From 24f49977786c9e49d5482fbccf2d6a24be960574 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 25 Jan 2024 12:25:14 +0100 Subject: [PATCH 1/6] fix(files): Add declaration for `$navigation` Signed-off-by: Ferdinand Thiessen --- apps/files/src/vue.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 apps/files/src/vue.d.ts diff --git a/apps/files/src/vue.d.ts b/apps/files/src/vue.d.ts new file mode 100644 index 0000000000000..af81b34de56b7 --- /dev/null +++ b/apps/files/src/vue.d.ts @@ -0,0 +1,7 @@ +import type { Navigation } from '@nextcloud/files' + +declare module 'vue/types/vue' { + interface Vue { + $navigation: Navigation + } +} From d1fc93ede1f5ba74742c4c7d73f489faf7bd1236 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Sun, 21 Jan 2024 00:05:20 +0100 Subject: [PATCH 2/6] fix(files): Set default view and match also child routes Signed-off-by: Ferdinand Thiessen --- apps/files/src/router/router.ts | 8 +++++--- apps/files/src/views/Navigation.vue | 26 ++++++++++++++++++-------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/apps/files/src/router/router.ts b/apps/files/src/router/router.ts index 5bb8f90770b01..4fec332cddffb 100644 --- a/apps/files/src/router/router.ts +++ b/apps/files/src/router/router.ts @@ -19,9 +19,11 @@ * along with this program. If not, see . * */ +import type { RawLocation, Route } from 'vue-router' + import { generateUrl } from '@nextcloud/router' import queryString from 'query-string' -import Router, { RawLocation, Route } from 'vue-router' +import Router from 'vue-router' import Vue from 'vue' import { ErrorHandler } from 'vue-router/types/router' @@ -46,10 +48,10 @@ const router = new Router({ { path: '/', // Pretending we're using the default view - redirect: { name: 'filelist' }, + redirect: { name: 'filelist', params: { view: 'files' } }, }, { - path: '/:view/:fileid?', + path: '/:view/:fileid(\\d+)?', name: 'filelist', props: true, }, diff --git a/apps/files/src/views/Navigation.vue b/apps/files/src/views/Navigation.vue index 9e7a630128e94..0ed8d7d7a44b9 100644 --- a/apps/files/src/views/Navigation.vue +++ b/apps/files/src/views/Navigation.vue @@ -25,9 +25,9 @@