Merge pull request #16095 from ankush/develop_warn
fix(ux): instructions/warning for doctype edits in developer mode
This commit is contained in:
commit
fe4a317861
2 changed files with 8 additions and 1 deletions
|
|
@ -33,9 +33,16 @@ frappe.ui.form.on('DocType', {
|
|||
}
|
||||
}
|
||||
|
||||
const customize_form_link = "<a href='/app/customize-form'>Customize Form</a>";
|
||||
if(!frappe.boot.developer_mode && !frm.doc.custom) {
|
||||
// make the document read-only
|
||||
frm.set_read_only();
|
||||
frm.dashboard.add_comment(__("DocTypes can not be modified, please use {0} instead", [customize_form_link]), "blue", true);
|
||||
} else if (frappe.boot.developer_mode) {
|
||||
let msg = __("This site is running in developer mode. Any change made here will be updated in code.");
|
||||
msg += "<br>";
|
||||
msg += __("If you just want to customize for your site, use {0} instead.", [customize_form_link]);
|
||||
frm.dashboard.add_comment(msg, "yellow");
|
||||
}
|
||||
|
||||
if(frm.is_new()) {
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ frappe.ui.form.Layout = class Layout {
|
|||
// remove previous color
|
||||
this.message.removeClass(this.message_color);
|
||||
}
|
||||
this.message_color = (color && ['yellow', 'blue'].includes(color)) ? color : 'blue';
|
||||
this.message_color = (color && ['yellow', 'blue', 'red'].includes(color)) ? color : 'blue';
|
||||
if (html) {
|
||||
if (html.substr(0, 1)!=='<') {
|
||||
// wrap in a block
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue