From c29f6892b3f5f4ccd7ecc48a45936986aeae9552 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 2 Jan 2023 12:03:13 +0530 Subject: [PATCH] fix: repositioned action buttons --- .../js/form_builder/form_builder.bundle.js | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/frappe/public/js/form_builder/form_builder.bundle.js b/frappe/public/js/form_builder/form_builder.bundle.js index 0b4a1a7cc2..ae19edbfc6 100644 --- a/frappe/public/js/form_builder/form_builder.bundle.js +++ b/frappe/public/js/form_builder/form_builder.bundle.js @@ -45,18 +45,26 @@ class FormBuilder { this.store.read_only = this.store.preview; this.read_only = true; }); - this.customize_form_btn = this.page.add_button(__("For Customize Form"), () => { - frappe.set_route("form-builder", this.doctype, "customize"); - }); - this.doctype_form_btn = this.page.add_button(__("For DocType Form"), () => { - frappe.set_route("form-builder", this.doctype); - }); this.reset_changes_btn = this.page.add_button(__("Reset Changes"), () => { this.store.reset_changes(); }); - this.go_to_doctype_btn = this.page.add_menu_item(__("Go to Doctype"), () => + this.go_to_doctype_list_btn = this.page.add_button( + __("Go to {0} List", [__(this.doctype)]), + () => { + window.open(`/app/${frappe.router.slug(this.doctype)}`); + } + ); + + this.customize_form_btn = this.page.add_menu_item(__("Switch to Customize Form"), () => { + frappe.set_route("form-builder", this.doctype, "customize"); + }); + this.doctype_form_btn = this.page.add_menu_item(__("Switch to DocType Form"), () => { + frappe.set_route("form-builder", this.doctype); + }); + + this.go_to_doctype_btn = this.page.add_menu_item(__("Go to DocType"), () => frappe.set_route("Form", "DocType", this.doctype) ); this.go_to_customize_form_btn = this.page.add_menu_item(__("Go to Customize Form"), () => @@ -121,9 +129,7 @@ class FormBuilder { ? __("Go to {0}", [__(this.doctype)]) : __("Go to {0} List", [__(this.doctype)]); - this.page.add_menu_item(label, () => { - window.open(`/app/${frappe.router.slug(this.doctype)}`); - }); + this.go_to_doctype_list_btn.text(label); } // toggle preview btn text