From e1e2b21f7e9a02dbe4bd04f318ef2004001871c7 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 19 Aug 2024 14:52:24 -0300 Subject: [PATCH] Bug 37513: Only display delete button if usage_count == 0 Signed-off-by: David Nind Signed-off-by: Matt Blenkinsop Signed-off-by: Katrin Fischer --- .../js/vue/components/Admin/RecordSources/List.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/RecordSources/List.vue b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/RecordSources/List.vue index 80186e01e0..60a7b3234d 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/RecordSources/List.vue +++ b/koha-tmpl/intranet-tmpl/prog/js/vue/components/Admin/RecordSources/List.vue @@ -35,6 +35,7 @@ export default { return { title: this.$__("Record sources"), tableOptions: { + options: { embed: "usage_count" }, columns: [ { title: this.$__("ID"), @@ -59,7 +60,16 @@ export default { }, ], actions: { - "-1": ["edit", "delete"], + "-1": [ + "edit", + { + delete: { + text: this.$__("Delete"), + icon: "fa fa-trash", + should_display: row => row.usage_count == 0, + }, + }, + ], }, url: "/api/v1/record_sources", }, -- 2.39.5