fix(UX): Disable number card filters on standard (#26676)

This commit is contained in:
Ankush Menat 2024-06-04 18:42:03 +05:30 committed by GitHub
parent 5a8e00af38
commit f3100d05cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -273,6 +273,9 @@ frappe.ui.form.on("Number Card", {
}
table.on("click", () => {
if (!frappe.boot.developer_mode && frm.doc.is_standard) {
frappe.throw(__("Cannot edit filters for standard number cards"));
}
let dialog = new frappe.ui.Dialog({
title: __("Set Filters"),
fields: fields.filter((f) => !is_dynamic_filter(f)),
@ -357,6 +360,9 @@ frappe.ui.form.on("Number Card", {
);
frm.dynamic_filter_table.on("click", () => {
if (!frappe.boot.developer_mode && frm.doc.is_standard) {
frappe.throw(__("Cannot edit filters for standard number cards"));
}
let dialog = new frappe.ui.Dialog({
title: __("Set Dynamic Filters"),
fields: fields,