Skip to content

Commit

Permalink
fix(UX): Disable number card filters on standard (#26676)
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Jun 4, 2024
1 parent 5a8e00a commit f3100d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frappe/desk/doctype/number_card/number_card.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit f3100d0

Please sign in to comment.