From e1cb4562d01a8d62e25146a4951ce3f9b22d017d Mon Sep 17 00:00:00 2001 From: Garvit Singhal <82756460+GarvitSinghal47@users.noreply.github.com> Date: Tue, 17 Jun 2025 08:00:05 +0530 Subject: [PATCH 1/2] fix: trash page sorting and show more (#4967) --- .../channelEdit/views/trash/TrashModal.vue | 20 +++---- .../channelEdit/vuex/contentNode/actions.js | 7 ++- .../frontend/shared/data/resources.js | 11 +++- .../contentcuration/viewsets/contentnode.py | 54 +++++++++++-------- 4 files changed, 59 insertions(+), 33 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelEdit/views/trash/TrashModal.vue b/contentcuration/contentcuration/frontend/channelEdit/views/trash/TrashModal.vue index e1ba3e3625..9aa7b2c605 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/views/trash/TrashModal.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/views/trash/TrashModal.vue @@ -201,7 +201,7 @@ ]; }, items() { - return sortBy(this.getContentNodeChildren(this.trashId), 'modified'); + return sortBy(this.getContentNodeChildren(this.trashId), 'modified').reverse(); }, backLink() { return { @@ -225,9 +225,9 @@ }, }, created() { - this.loadContentNodes({ parent__in: [this.rootId] }), - this.loadAncestors({ id: this.nodeId }), - this.loadNodes(); + this.loadContentNodes({ parent__in: [this.rootId] }); + this.loadAncestors({ id: this.nodeId }); + this.loadNodes(); }, mounted() { this.updateTabTitle(this.$store.getters.appendChannelName(this.$tr('trashModalTitle'))); @@ -246,10 +246,12 @@ this.loading = false; return; } - this.loadChildren({ parent: this.trashId }).then(childrenResponse => { - this.loading = false; - this.more = childrenResponse.more || null; - }); + this.loadChildren({ parent: this.trashId, ordering: '-modified' }).then( + childrenResponse => { + this.loading = false; + this.more = childrenResponse.more || null; + } + ); }, moveNodes(target) { return this.moveContentNodes({ @@ -311,7 +313,7 @@ }; -