aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-11-21 12:45:57 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-11-23 13:32:14 +0100
commit077381c7b3aa220253a18ce3bbb946e4a46d8213 (patch)
tree8a4ca1104135a465b63f5a50738f9e225fa3fbfa /core
parent9d95391ff14a1c753e8fda4ecaacc007572552f4 (diff)
downloadnextcloud-server-077381c7b3aa220253a18ce3bbb946e4a46d8213.tar.gz
nextcloud-server-077381c7b3aa220253a18ce3bbb946e4a46d8213.zip
rip out obsolete recipientsDisplayName
also needs tests adjustements, and this also brings in natural sorting Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'core')
-rw-r--r--core/js/share.js5
-rw-r--r--core/js/tests/specs/shareSpec.js16
2 files changed, 11 insertions, 10 deletions
diff --git a/core/js/share.js b/core/js/share.js
index 381c42c5de2..a2a3635e145 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -245,7 +245,10 @@ OC.Share = _.extend(OC.Share || {}, {
*/
_formatShareList: function(recipients) {
var _parent = this;
- recipients = _.sortBy(_.toArray(recipients), 'shareWithDisplayName');
+ recipients = _.toArray(recipients);
+ recipients.sort(function(a, b) {
+ return a.shareWithDisplayName.localeCompare(b.shareWithDisplayName);
+ });
return $.map(recipients, function(recipient) {
return _parent._formatRemoteShare(recipient.shareWith, recipient.shareWithDisplayName, t('core', 'Shared with'));
});
diff --git a/core/js/tests/specs/shareSpec.js b/core/js/tests/specs/shareSpec.js
index 8688705b8e8..399911c3d54 100644
--- a/core/js/tests/specs/shareSpec.js
+++ b/core/js/tests/specs/shareSpec.js
@@ -157,8 +157,6 @@ describe('OC.Share tests', function() {
function checkRecipients(input, output, title) {
var $action;
- var concatenated = _.values(input).join(', ');
- $file.attr('data-share-recipients', concatenated);
$file.attr('data-share-recipient-data', JSON.stringify(input));
OC.Share.markFileAsShared($file, true);
@@ -270,8 +268,8 @@ describe('OC.Share tests', function() {
shareWithDisplayName: 'One@someserver.com'
},
1: {
- shareWith: 'two@someserver.com',
- shareWithDisplayName: 'two@someserver.com'
+ shareWith: 'two@otherserver.com',
+ shareWithDisplayName: 'two@otherserver.com'
}
};
checkRecipients(
@@ -320,8 +318,8 @@ describe('OC.Share tests', function() {
shareWithDisplayName: 'One'
},
1: {
- shareWith: 'two@someserver.com',
- shareWithDisplayName: 'two@someserver.com'
+ shareWith: 'two@otherserver.com',
+ shareWithDisplayName: 'two@otherserver.com'
}
},
'Shared with One two@…',
@@ -336,15 +334,15 @@ describe('OC.Share tests', function() {
shareWithDisplayName: 'Yoko Ono'
},
1: {
- shareWith: 'two@someserver.com',
- shareWithDisplayName: 'two@someserver.com'
+ shareWith: 'two@otherserver.com',
+ shareWithDisplayName: 'two@othererver.com'
},
2: {
shareWith: 'Three',
shareWithDisplayName: 'Green, Mina'
}
},
- 'Shared with Yoko Ono two@… Shared with Green, Mina',
+ 'Shared with Green, Mina two@… Shared with Yoko Ono',
['Shared with two@otherserver.com']
);
});