From e38233ca11186fe3a578a7cb25416bd766d5a0d9 Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Tue, 23 Apr 2024 23:42:27 +0200 Subject: [PATCH 1/2] Allow deletion of referential objects whose urn does not start with "urn:intuitem" This is a quick and dirty way to allow deleting referential objects that are supplied by the user. TODO: Come up with a better way to differentiate external referential objects from those packaged by intuitem. --- frontend/src/lib/components/ModelTable/ModelTable.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/lib/components/ModelTable/ModelTable.svelte b/frontend/src/lib/components/ModelTable/ModelTable.svelte index b3f988d43..3a7d0c122 100644 --- a/frontend/src/lib/components/ModelTable/ModelTable.svelte +++ b/frontend/src/lib/components/ModelTable/ModelTable.svelte @@ -273,7 +273,7 @@ {row} hasBody={$$slots.actionsBody} {identifierField} - preventDelete={(row.meta.builtin || (row.meta.urn ?? false)) && !(row.meta.allowDeleteLibrary ?? false)} + preventDelete={(row.meta.builtin || (row.meta.urn.startsWith("urn:intuitem") ?? false)) && !(row.meta.allowDeleteLibrary ?? false)} > {#if $$slots.actionsHead} From 5b0d71b0fa9a1447bea88f286c173016fc10c9d1 Mon Sep 17 00:00:00 2001 From: Nassim Tabchiche Date: Wed, 24 Apr 2024 12:47:38 +0200 Subject: [PATCH 2/2] Fix preventDelete in ModelTable --- frontend/src/lib/components/ModelTable/ModelTable.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/lib/components/ModelTable/ModelTable.svelte b/frontend/src/lib/components/ModelTable/ModelTable.svelte index 3a7d0c122..59943c3df 100644 --- a/frontend/src/lib/components/ModelTable/ModelTable.svelte +++ b/frontend/src/lib/components/ModelTable/ModelTable.svelte @@ -273,7 +273,7 @@ {row} hasBody={$$slots.actionsBody} {identifierField} - preventDelete={(row.meta.builtin || (row.meta.urn.startsWith("urn:intuitem") ?? false)) && !(row.meta.allowDeleteLibrary ?? false)} + preventDelete={(row.meta.builtin || ((row.meta.urn && row.meta.urn.startsWith("urn:intuitem")) ?? false)) && !(row.meta.allowDeleteLibrary ?? false)} > {#if $$slots.actionsHead}