summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-06-02 18:52:31 +0200
committerVincent Petry <pvince81@owncloud.com>2014-06-02 18:52:31 +0200
commit640fbc016dd81f6ffffb4eb404717a9dd2c2465a (patch)
tree53da824385b9dee87ad83ee78449d4325326e32b
parent0944565f6033766abfe0ab8987d7116062748c21 (diff)
downloadnextcloud-server-640fbc016dd81f6ffffb4eb404717a9dd2c2465a.tar.gz
nextcloud-server-640fbc016dd81f6ffffb4eb404717a9dd2c2465a.zip
Now using shareOwner for the share owner
Makes it consistent with the regular file list fileData
-rw-r--r--apps/files_sharing/js/sharedfilelist.js4
-rw-r--r--apps/files_sharing/tests/js/appSpec.js4
-rw-r--r--apps/files_sharing/tests/js/sharedfilelistSpec.js10
3 files changed, 12 insertions, 6 deletions
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js
index 8a6c3169f9e..ecac5b33667 100644
--- a/apps/files_sharing/js/sharedfilelist.js
+++ b/apps/files_sharing/js/sharedfilelist.js
@@ -46,7 +46,7 @@
$tr.find('td.filename input:checkbox').remove();
$tr.attr('data-share-id', _.pluck(fileData.shares, 'id').join(','));
if (this._sharedWithUser) {
- $tr.attr('data-share-owner', fileData.shares[0].ownerDisplayName);
+ $tr.attr('data-share-owner', fileData.shareOwner);
}
return $tr;
},
@@ -159,7 +159,7 @@
stime: share.stime * 1000,
};
if (self._sharedWithUser) {
- file.share.ownerDisplayName = share.displayname_owner;
+ file.shareOwner = share.displayname_owner;
file.name = OC.basename(share.file_target);
file.path = OC.dirname(share.file_target);
file.permissions = share.permissions;
diff --git a/apps/files_sharing/tests/js/appSpec.js b/apps/files_sharing/tests/js/appSpec.js
index ad95ee53942..6a30f18ea40 100644
--- a/apps/files_sharing/tests/js/appSpec.js
+++ b/apps/files_sharing/tests/js/appSpec.js
@@ -122,9 +122,7 @@ describe('OCA.Sharing.App tests', function() {
type: 'dir',
path: '/somewhere/inside/subdir',
counterParts: ['user2'],
- shares: [{
- ownerDisplayName: 'user2'
- }]
+ shareOwner: 'user2'
}]);
fileListIn.findFileEl('testdir').find('td a.name').click();
diff --git a/apps/files_sharing/tests/js/sharedfilelistSpec.js b/apps/files_sharing/tests/js/sharedfilelistSpec.js
index 7aec8322a44..f53e79e277f 100644
--- a/apps/files_sharing/tests/js/sharedfilelistSpec.js
+++ b/apps/files_sharing/tests/js/sharedfilelistSpec.js
@@ -9,7 +9,8 @@
*/
describe('OCA.Sharing.FileList tests', function() {
- var testFiles, alertStub, notificationStub, fileList;
+ var testFiles, alertStub, notificationStub, fileList, fileActions;
+ var oldFileListPrototype;
beforeEach(function() {
alertStub = sinon.stub(OC.dialogs, 'alert');
@@ -45,10 +46,17 @@ describe('OCA.Sharing.FileList tests', function() {
'<div id="emptycontent">Empty content message</div>' +
'</div>'
);
+ // back up prototype, as it will be extended by
+ // the sharing code
+ oldFileListPrototype = _.extend({}, OCA.Files.FileList.prototype);
+ fileActions = new OCA.Files.FileActions();
+ OCA.Sharing.Util.initialize(fileActions);
});
afterEach(function() {
+ OCA.Files.FileList.prototype = oldFileListPrototype;
testFiles = undefined;
fileList = undefined;
+ fileActions = undefined;
notificationStub.restore();
alertStub.restore();