Skip to content

Commit

Permalink
Merge pull request #37878 from 2lar/sortingfixbranch
Browse files Browse the repository at this point in the history
  • Loading branch information
skjnldsv authored Aug 7, 2024
2 parents 6cc0827 + 6cf1aed commit 3da69fc
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 10 deletions.
11 changes: 8 additions & 3 deletions apps/files_sharing/src/views/SharingTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,16 @@ export default {
*/
processShares({ data }) {
if (data.ocs && data.ocs.data && data.ocs.data.length > 0) {
// create Share objects and sort by newest
// create Share objects and sort by title in alphabetical order and then by creation time
const shares = data.ocs.data
.map(share => new Share(share))
.sort((a, b) => b.createdTime - a.createdTime)
.sort((a, b) => {
const localCompare = a.title.localeCompare(b.title)
if (localCompare !== 0) {
return localCompare
}
return b.createdTime - a.createdTime
})
this.linkShares = shares.filter(share => share.type === this.SHARE_TYPES.SHARE_TYPE_LINK || share.type === this.SHARE_TYPES.SHARE_TYPE_EMAIL)
this.shares = shares.filter(share => share.type !== this.SHARE_TYPES.SHARE_TYPE_LINK && share.type !== this.SHARE_TYPES.SHARE_TYPE_EMAIL)
Expand Down
4 changes: 2 additions & 2 deletions dist/9549-9549.js → dist/6880-6880.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/6880-6880.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/6880-6880.js.map.license
1 change: 0 additions & 1 deletion dist/9549-9549.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/9549-9549.js.map.license

This file was deleted.

4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

0 comments on commit 3da69fc

Please sign in to comment.