Skip to content

Commit

Permalink
Disable tags for locked files (#9873)
Browse files Browse the repository at this point in the history
* disabled tags input for locked files in sidebar

* changelog entry

* removed explicit type
  • Loading branch information
grimmoc authored and AlexAndBear committed Dec 13, 2023
1 parent 0c8a45a commit 705866f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions changelog/unreleased/bugfix-tags-not-editable-locked-files
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Tags are no longer editable for a locked file

Tags are no longer editable for files that are currently locked.

https://github.com/owncloud/web/pull/9873
https://github.com/owncloud/web/issues/9789
5 changes: 4 additions & 1 deletion packages/web-app-files/src/components/SideBar/TagsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
v-model="selectedTags"
class="oc-mb-s"
:multiple="true"
:disabled="readonly"
:options="availableTags"
:contextual-helper="contextualHelper"
taggable
Expand Down Expand Up @@ -85,6 +86,7 @@ export default defineComponent({
const injectedResource = inject<Resource>('resource')
const resource = computed<Resource>(() => unref(injectedResource))
const readonly = computed(() => unref(resource).locked === true)
const selectedTags = ref<TagOption[]>([])
const availableTags = ref<TagOption[]>([])
let allTags: string[] = []
Expand Down Expand Up @@ -230,7 +232,8 @@ export default defineComponent({
save,
keycode,
keydownMethods,
contextualHelper
contextualHelper,
readonly
}
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export const useFileActionsShowEditTags = ({ store }: { store?: Store<any> } = {
return false
}

if (resources[0].locked === true) {
return false
}

if (
isLocationTrashActive(router, 'files-trash-generic') ||
isLocationPublicActive(router, 'files-public-link')
Expand Down

0 comments on commit 705866f

Please sign in to comment.