Skip to content
Snippets Groups Projects

Fix: Disabled Delete in Metadataheader

Merged Sirieam Marie Hunke requested to merge Issue/2073-RCVandResourceEditAdaptions into main
Files
3
@@ -26,6 +26,9 @@
>
<b-dropdown-item
v-if="showDetail"
:disabled="
resourceTypeInformation && !resourceTypeInformation.canDelete
"
@click="$emit('showModalDeleteFolderContents')"
>{{ $t("buttons.delete") }}</b-dropdown-item
>
@@ -44,9 +47,13 @@
<script lang="ts">
import { defineComponent, PropType } from "vue-demi";
// import the store for current module
import useResourceStore from "../../../store";
import type { ResourceObject } from "@coscine/api-client/dist/types/Coscine.Api.Resources";
import type { FolderContent } from "../../../utils/EntryDefinition";
import type { ResourceTypeInformation } from "@coscine/api-client/dist/types/Coscine.Api.Resources";
export default defineComponent({
props: {
editableDataUrl: {
@@ -74,6 +81,21 @@ export default defineComponent({
type: Array as PropType<FolderContent[]>,
},
},
setup() {
const resourceStore = useResourceStore();
return { resourceStore };
},
computed: {
resourceTypeInformation(): null | undefined | ResourceTypeInformation {
if (this.resourceStore.resourceTypes && this.resource) {
return this.resourceStore.resourceTypes.find(
(resourceType) => resourceType.id === this.resource?.type?.id
);
}
return null;
},
},
});
</script>
Loading