Skip to content

Commit

Permalink
Merge pull request #7826 from owncloud/fix-sidebar-without-highlighte…
Browse files Browse the repository at this point in the history
…d-resource

Fix sidebar when no highlighted resource is present
  • Loading branch information
JammingBen authored Oct 19, 2022
2 parents 4c239f2 + 68ac81a commit fc32048
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Sidebar without highlighted resource

Sidebar panels that require a resource now won't be loaded without such. This fixes a bug where navigating with an open sidebar would break it.

https://github.com/owncloud/web/issues/7781
https://github.com/owncloud/web/pull/7826
2 changes: 1 addition & 1 deletion packages/web-app-files/src/components/SideBar/SideBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
>
<template #header>
<file-info
v-if="isSingleResource && !highlightedFileIsSpace"
v-if="highlightedFile && isSingleResource && !highlightedFileIsSpace"
class="sidebar-panel__file_info"
:is-sub-panel-active="!!activePanel"
/>
Expand Down
17 changes: 10 additions & 7 deletions packages/web-app-files/src/fileSideBars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,21 @@ const panelGenerators: (({
component: NoSelection,
default: () => true,
get enabled() {
return rootFolder && highlightedFile?.type !== 'space'
return !highlightedFile || (rootFolder && highlightedFile?.type !== 'space')
}
}),
({ router, multipleSelection, rootFolder }) => ({
({ router, multipleSelection, rootFolder, highlightedFile }) => ({
app: 'details-item',
icon: 'questionnaire-line',
title: $gettext('Details'),
component: FileDetails,
default: !isLocationTrashActive(router, 'files-trash-generic'),
get enabled() {
return (
!isLocationTrashActive(router, 'files-trash-generic') && !multipleSelection && !rootFolder
!isLocationTrashActive(router, 'files-trash-generic') &&
!multipleSelection &&
!rootFolder &&
highlightedFile
)
}
}),
Expand Down Expand Up @@ -91,14 +94,14 @@ const panelGenerators: (({
return highlightedFile?.type === 'space' && !multipleSelection
}
}),
({ router, multipleSelection, rootFolder }) => ({
({ router, multipleSelection, rootFolder, highlightedFile }) => ({
app: 'actions-item',
icon: 'slideshow-3',
title: $gettext('Actions'),
component: FileActions,
default: isLocationTrashActive(router, 'files-trash-generic'),
get enabled() {
return !multipleSelection && !rootFolder
return !multipleSelection && !rootFolder && highlightedFile
}
}),
({ multipleSelection, highlightedFile, user }) => ({
Expand All @@ -119,7 +122,7 @@ const panelGenerators: (({
].includes(user.uuid)
}
}),
({ capabilities, router, multipleSelection, rootFolder }) => ({
({ capabilities, router, multipleSelection, rootFolder, highlightedFile }) => ({
app: 'sharing-item',
icon: 'user-add',
iconFillType: 'line',
Expand All @@ -135,7 +138,7 @@ const panelGenerators: (({
}
},
get enabled() {
if (multipleSelection || rootFolder) {
if (multipleSelection || rootFolder || !highlightedFile) {
return false
}
if (
Expand Down

0 comments on commit fc32048

Please sign in to comment.