Skip to content

Commit

Permalink
Fix: renaming space in projects view doesn't work (#11643)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAndBear authored Sep 24, 2024
1 parent 6e0d8e8 commit d21a906
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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
18 changes: 17 additions & 1 deletion packages/web-pkg/src/components/FilesList/ResourceTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@ import {
useFileActions,
useIsTopBarSticky,
embedModeFilePickMessageData,
routeToContextQuery
routeToContextQuery,
useSpaceActionsRename
} from '../../composables'
import ResourceListItem from './ResourceListItem.vue'
import ResourceGhostElement from './ResourceGhostElement.vue'
Expand Down Expand Up @@ -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 : '')
Expand Down Expand Up @@ -646,7 +649,9 @@ export default defineComponent({
contextMenuButton,
getTagToolTip,
renameActions,
renameActionsSpace,
renameHandler,
renameHandlerSpace,
FolderViewModeConstants,
hasTags,
disabledResources,
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit d21a906

Please sign in to comment.