Skip to content

Commit 6cf1aed

Browse files
2larskjnldsv
authored andcommitted
fix(files_sharing): tab shares title and creation sort
Signed-off-by: Benjamin Gaussorgues <[email protected]>
1 parent cb341fc commit 6cf1aed

9 files changed

+15
-10
lines changed

apps/files_sharing/src/views/SharingTab.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,16 @@ export default {
260260
*/
261261
processShares({ data }) {
262262
if (data.ocs && data.ocs.data && data.ocs.data.length > 0) {
263-
// create Share objects and sort by newest
263+
// create Share objects and sort by title in alphabetical order and then by creation time
264264
const shares = data.ocs.data
265265
.map(share => new Share(share))
266-
.sort((a, b) => b.createdTime - a.createdTime)
267-
266+
.sort((a, b) => {
267+
const localCompare = a.title.localeCompare(b.title)
268+
if (localCompare !== 0) {
269+
return localCompare
270+
}
271+
return b.createdTime - a.createdTime
272+
})
268273
this.linkShares = shares.filter(share => share.type === this.SHARE_TYPES.SHARE_TYPE_LINK || share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL)
269274
this.shares = shares.filter(share => share.type !== this.SHARE_TYPES.SHARE_TYPE_LINK && share.type !== this.SHARE_TYPES.SHARE_TYPE_EMAIL)
270275

dist/9549-9549.js renamed to dist/6880-6880.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

dist/6880-6880.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/6880-6880.js.map.license

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6880-6880.js.license

dist/9549-9549.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/9549-9549.js.map.license

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/files_sharing-files_sharing_tab.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/files_sharing-files_sharing_tab.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)