From 7b5d77249a2798e58693e2e6096f68b63fea7750 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 --- .../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 a1595b9e64f..b5d7846d55a 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.46.0