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

Bugfix: Renaming space in projects view files table does not work #11643

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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,7 @@
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

AlexAndBear marked this conversation as resolved.
Show resolved Hide resolved
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