From 9b0f6cc82d9e3fbdcbb596b03cdceb62aa9907e1 Mon Sep 17 00:00:00 2001 From: Jannik Stehle Date: Fri, 21 Jan 2022 11:09:14 +0100 Subject: [PATCH] Add breadbrumb, align images --- .../src/components/AppBar/AppBar.vue | 35 ++++++++--- packages/web-app-files/src/router/spaces.ts | 3 +- .../src/views/spaces/Project.vue | 59 ++++++++++++------- .../src/views/spaces/Projects.vue | 50 +++++++++++----- 4 files changed, 103 insertions(+), 44 deletions(-) diff --git a/packages/web-app-files/src/components/AppBar/AppBar.vue b/packages/web-app-files/src/components/AppBar/AppBar.vue index 1e145988b87..9c8c3f5012d 100644 --- a/packages/web-app-files/src/components/AppBar/AppBar.vue +++ b/packages/web-app-files/src/components/AppBar/AppBar.vue @@ -125,7 +125,7 @@ - + @@ -244,18 +244,32 @@ export default { hasBulkActions() { return this.$route.meta.hasBulkActions === true }, + hideViewOptions() { + return this.$route.meta.hideViewOptions === true + }, pageTitle() { const title = this.$route.meta.title return this.$gettext(title) }, breadcrumbs() { - if (!(this.isPublicLocation || this.isPersonalLocation)) { + const isProjectSpaces = + isLocationSpacesActive(this.$router, 'files-spaces-projects') || + isLocationSpacesActive(this.$router, 'files-spaces-project') + + if (!(this.isPublicLocation || this.isPersonalLocation || isProjectSpaces)) { return [] } const { params: routeParams, path: routePath } = this.$route - const { item: requestedItemPath = '' } = routeParams + + let requestedItemPath = '' + if (isProjectSpaces) { + requestedItemPath = routeParams.spaceId || '' + } else { + requestedItemPath = routeParams.item || '' + } + const basePaths = '/' + decodeURIComponent(routePath) @@ -275,10 +289,17 @@ export default { if (i === rawItems.length - 1) { this.isPublicLocation && acc.shift() - acc.length && - (acc[0].text = this.isPersonalLocation - ? this.$gettext('All files') - : this.$gettext('Public link')) + + if (acc.length) { + if (this.isPersonalLocation) { + acc[0].text = this.$gettext('All files') + } else if (isProjectSpaces) { + acc[0].text = this.$gettext('Spaces') + } else { + acc[0].text = this.$gettext('Public link') + } + } + acc.length && delete acc[acc.length - 1].to } else { delete acc[i].onClick diff --git a/packages/web-app-files/src/router/spaces.ts b/packages/web-app-files/src/router/spaces.ts index ba7cc24d99e..980a1936f62 100644 --- a/packages/web-app-files/src/router/spaces.ts +++ b/packages/web-app-files/src/router/spaces.ts @@ -39,7 +39,7 @@ export const buildRoutes = (components: RouteComponents): RouteConfig[] => [ meta: { hideFilelistActions: true, hasBulkActions: true, - hideAppBar: true, + hideViewOptions: true, title: $gettext('Spaces') } }, @@ -50,7 +50,6 @@ export const buildRoutes = (components: RouteComponents): RouteConfig[] => [ meta: { hideFilelistActions: true, hasBulkActions: true, - hideAppBar: true, title: $gettext('Space') } }, diff --git a/packages/web-app-files/src/views/spaces/Project.vue b/packages/web-app-files/src/views/spaces/Project.vue index b9bee270d10..07af32a703f 100644 --- a/packages/web-app-files/src/views/spaces/Project.vue +++ b/packages/web-app-files/src/views/spaces/Project.vue @@ -4,7 +4,7 @@