From 41771f40e0eac9f1094675bdc0034182287ef94e Mon Sep 17 00:00:00 2001 From: Corban-Lee Jones Date: Thu, 3 Oct 2024 15:48:52 +0100 Subject: [PATCH] improve non-editable style message --- apps/home/static/home/js/tabs/styles.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/home/static/home/js/tabs/styles.js b/apps/home/static/home/js/tabs/styles.js index 483f4bd..68b3be5 100644 --- a/apps/home/static/home/js/tabs/styles.js +++ b/apps/home/static/home/js/tabs/styles.js @@ -138,12 +138,16 @@ getTableFiltersComponent(styleTableId).find(".table-del-btn").on("click", async const rows = getSelectedTableRows(styleTableId); const isMany = rows.length > 1; - if (rows.some(row => row.auto_created)) { + for (const row of rows) { + if (!row.auto_created) { + continue; + } + await okModal( - `Cannot Delete Style${isMany ? "s" : ""}`, - "One or more styles were created by the system, and cannot be altered.", + "Cannot Delete Style", + `${row.name} can't be deleted, as it was created by the system, and thus is immutable.`, "warning", - "bi-cpu", + "bi-arrow-return-right", null, ); return