Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sidebar when no highlighted resource is present #7826

Merged
merged 1 commit into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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