summaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@protonmail.com>2023-03-24 09:41:40 +0100
committerJohn Molakvoæ <skjnldsv@protonmail.com>2023-04-06 14:49:31 +0200
commit3c3050c76f86c7a8cc2f217f9305cb1051e0eca0 (patch)
treed9656a549b1db4c7f3d37549713a6c96da616464 /apps/files_trashbin
parent0b4da6117fff4d999cb492503a8b6fc04eb75f9d (diff)
downloadnextcloud-server-3c3050c76f86c7a8cc2f217f9305cb1051e0eca0.tar.gz
nextcloud-server-3c3050c76f86c7a8cc2f217f9305cb1051e0eca0.zip
feat(files): implement sorting per view
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r--apps/files_trashbin/src/main.ts7
-rw-r--r--apps/files_trashbin/tests/Controller/PreviewControllerTest.php2
2 files changed, 6 insertions, 3 deletions
diff --git a/apps/files_trashbin/src/main.ts b/apps/files_trashbin/src/main.ts
index 7cd6cf850f8..13b37836774 100644
--- a/apps/files_trashbin/src/main.ts
+++ b/apps/files_trashbin/src/main.ts
@@ -20,6 +20,7 @@
*
*/
import type NavigationService from '../../files/src/services/Navigation'
+import type { Navigation } from '../../files/src/services/Navigation'
import { translate as t, translate } from '@nextcloud/l10n'
import DeleteSvg from '@mdi/svg/svg/delete.svg?raw'
@@ -39,6 +40,8 @@ Navigation.register({
order: 50,
sticky: true,
+ defaultSortKey: 'deleted',
+
columns: [
{
id: 'deleted',
@@ -57,10 +60,10 @@ Navigation.register({
sort(nodeA, nodeB) {
const deletionTimeA = nodeA.attributes?.['trashbin-deletion-time'] || nodeA?.mtime || 0
const deletionTimeB = nodeB.attributes?.['trashbin-deletion-time'] || nodeB?.mtime || 0
- return deletionTimeA - deletionTimeB
+ return deletionTimeB - deletionTimeA
},
},
],
getContents,
-})
+} as Navigation)
diff --git a/apps/files_trashbin/tests/Controller/PreviewControllerTest.php b/apps/files_trashbin/tests/Controller/PreviewControllerTest.php
index 441222bea19..4db3d4f613c 100644
--- a/apps/files_trashbin/tests/Controller/PreviewControllerTest.php
+++ b/apps/files_trashbin/tests/Controller/PreviewControllerTest.php
@@ -157,7 +157,7 @@ class PreviewControllerTest extends TestCase {
$this->overwriteService(ITimeFactory::class, $this->time);
- $res = $this->controller->getPreview(42, 10, 10);
+ $res = $this->controller->getPreview(42, 10, 10, true);
$expected = new FileDisplayResponse($preview, Http::STATUS_OK, ['Content-Type' => 'previewMime']);
$expected->cacheFor(3600 * 24);