diff --git a/changelog/unreleased/bugfix-renaming-space-in-projects-view-files-table-doesn-not-work b/changelog/unreleased/bugfix-renaming-space-in-projects-view-files-table-doesn-not-work new file mode 100644 index 00000000000..57e07f7455d --- /dev/null +++ b/changelog/unreleased/bugfix-renaming-space-in-projects-view-files-table-doesn-not-work @@ -0,0 +1,6 @@ +Bugfix: Renaming space in projects view files table does not work + +We've fixed a bug where renaming a space in the projects view files table did not work. + +https://github.com/owncloud/web/pull/11643/ +https://github.com/owncloud/web/issues/11638 diff --git a/packages/web-pkg/src/components/FilesList/ResourceTable.vue b/packages/web-pkg/src/components/FilesList/ResourceTable.vue index 89a1bef0e6f..4df84ad1eab 100644 --- a/packages/web-pkg/src/components/FilesList/ResourceTable.vue +++ b/packages/web-pkg/src/components/FilesList/ResourceTable.vue @@ -278,7 +278,8 @@ import { useFileActions, useIsTopBarSticky, embedModeFilePickMessageData, - routeToContextQuery + routeToContextQuery, + useSpaceActionsRename } from '../../composables' import ResourceListItem from './ResourceListItem.vue' import ResourceGhostElement from './ResourceGhostElement.vue' @@ -564,7 +565,9 @@ export default defineComponent({ ) const { actions: renameActions } = useFileActionsRename() + const { actions: renameActionsSpace } = useSpaceActionsRename() const renameHandler = computed(() => unref(renameActions)[0].handler) + const renameHandlerSpace = computed(() => unref(renameActionsSpace)[0].handler) const getTagToolTip = (text: string) => (text.length > 7 ? text : '') @@ -646,7 +649,9 @@ export default defineComponent({ contextMenuButton, getTagToolTip, renameActions, + renameActionsSpace, renameHandler, + renameHandlerSpace, FolderViewModeConstants, hasTags, disabledResources, @@ -947,11 +952,22 @@ export default defineComponent({ return item.id === this.latestSelectedId }, hasRenameAction(item: Resource) { + if (isProjectSpaceResource(item)) { + return this.renameActionsSpace.filter((menuItem) => + menuItem.isVisible({ resources: [item] }) + ).length + } + return this.renameActions.filter((menuItem) => menuItem.isVisible({ space: this.space, resources: [item] }) ).length }, openRenameDialog(item: Resource) { + if (isProjectSpaceResource(item)) { + return this.renameHandlerSpace({ + resources: [item] + }) + } this.renameHandler({ space: this.getMatchingSpace(item), resources: [item]