Skip to content

Commit

Permalink
Fix breadcrumbs on {Personal,PublicFiles}.vue, fix changelog typo
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalwengerter committed Mar 29, 2022
1 parent 8ee7494 commit 49688aa
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Bugfix: AppBar ViewOptions alignement
Bugfix: AppBar ViewOptions alignment

We have fixed a visual glitch that rendered the ViewOptions in the AppBar on the left side instead of right-aligned if no Breadcrumbs or SharesNavigation is present.

Expand Down
4 changes: 3 additions & 1 deletion packages/web-app-files/src/views/Personal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ import { useResourcesViewDefaults } from '../composables'
import { fetchResources } from '../services/folder/loaderPersonal'
import { defineComponent } from '@vue/composition-api'
import { Resource } from '../helpers/resource'
import { useCapabilitySpacesEnabled } from 'web-pkg/src/composables'
const visibilityObserver = new VisibilityObserver()
Expand Down Expand Up @@ -133,7 +134,8 @@ export default defineComponent({
setup() {
return {
...useResourcesViewDefaults<Resource, any, any[]>(),
resourceTargetLocation: createLocationSpaces('files-spaces-personal-home')
resourceTargetLocation: createLocationSpaces('files-spaces-personal-home'),
hasSpaces: useCapabilitySpacesEnabled()
}
},
Expand Down
17 changes: 13 additions & 4 deletions packages/web-app-files/src/views/PublicFiles.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<template>
<div>
<app-bar :has-bulk-actions="true" :breadcrumbs="breadcrumbs">
<app-bar
:has-bulk-actions="true"
:breadcrumbs="breadcrumbs"
:breadcrumbs-context-actions-items="[currentFolder]"
>
<template #actions>
<create-and-upload />
</template>
Expand Down Expand Up @@ -82,7 +86,7 @@ import ListInfo from '../components/FilesList/ListInfo.vue'
import Pagination from '../components/FilesList/Pagination.vue'
import ContextActions from '../components/FilesList/ContextActions.vue'
import { createLocationOperations } from '../router'
import { breadcrumbsFromPath } from '../helpers/breadcrumbs'
import { breadcrumbsFromPath, concatBreadcrumbs } from '../helpers/breadcrumbs'
const visibilityObserver = new VisibilityObserver()
Expand Down Expand Up @@ -126,8 +130,13 @@ export default {
},
breadcrumbs() {
const publicFilesBreadcrumb = breadcrumbsFromPath(this.$route.path, this.$route.params.item)
return [{ text: this.$gettext('Public link') }, publicFilesBreadcrumb.splice()]
const breadcrumbs = breadcrumbsFromPath(this.$route.path, this.$route.params.item)
const rootRoute = breadcrumbs.shift()
return concatBreadcrumbs(
{ text: this.$gettext('Public link'), to: rootRoute.to },
...breadcrumbs
)
},
isEmpty() {
Expand Down
3 changes: 2 additions & 1 deletion packages/web-app-files/tests/unit/views/views.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const forestJpg = {
}

// eslint-disable-next-line @typescript-eslint/no-empty-function
const noop = () => {}
const noop = () => { }

// eslint-disable-next-line jest/no-export
export const accentuatesTableRowTest = async <V extends Vue>(
Expand Down Expand Up @@ -73,6 +73,7 @@ export const accentuatesTableRowTest = async <V extends Vue>(
store,
stubs: stubs,
computed: {
breadcrumbs: () => [],
displayThumbnails: () => false,
folderNotFound: () => false,
isEmpty: () => false
Expand Down

0 comments on commit 49688aa

Please sign in to comment.