feat: Show color for depends on fields for data import

This commit is contained in:
Nishka Gosalia 2026-02-06 17:31:47 +05:30
parent 9b24450337
commit cb278ff39d
2 changed files with 18 additions and 0 deletions

View file

@ -287,6 +287,19 @@ frappe.data_import.DataExporter = class DataExporter {
return false;
};
let is_field_depends_on = (df) => {
if (df.depends_on && this.exporting_for == "Insert New Records") {
return true;
}
if (autoname_field && df.fieldname == autoname_field.fieldname) {
return true;
}
if (df.fieldname === "name") {
return true;
}
return false;
};
return fields
.filter((df) => {
if (autoname_field && df.fieldname === "name") {
@ -299,6 +312,7 @@ frappe.data_import.DataExporter = class DataExporter {
label: __(df.label, null, df.parent),
value: df.fieldname,
danger: is_field_mandatory(df),
warning: is_field_depends_on(df),
checked: false,
description: `${df.fieldname} ${df.reqd ? __("(Mandatory)") : ""}`,
};

View file

@ -85,6 +85,10 @@ frappe.ui.form.ControlMultiCheck = class ControlMultiCheck extends frappe.ui.for
if (option.danger) {
checkbox.find(".label-area").addClass("text-danger");
}
if (option.warning) {
checkbox.find(".label-area").addClass("text-warning");
}
option.$checkbox = checkbox;
});
if (this.df.select_all) {