From 432378c06f2b45dfebbfb9ef9baab0f0edea5132 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 7 Sep 2021 10:46:52 +0530 Subject: [PATCH] fix: misc - show "Not Saved" when dirty - Toggle Preview only when format is saved - save a new format on first load --- .../doctype/print_format/print_format.js | 6 +- .../js/print_format_builder/Preview.vue | 19 ++++- .../js/print_format_builder/PrintFormat.vue | 1 + .../PrintFormatBuilder.vue | 11 ++- .../print_format_builder.bundle.js | 13 +++- .../public/js/print_format_builder/store.js | 74 +++++++++++++------ 6 files changed, 93 insertions(+), 31 deletions(-) diff --git a/frappe/printing/doctype/print_format/print_format.js b/frappe/printing/doctype/print_format/print_format.js index 786f8f97ab..39eb164e3f 100644 --- a/frappe/printing/doctype/print_format/print_format.js +++ b/frappe/printing/doctype/print_format/print_format.js @@ -30,7 +30,11 @@ frappe.ui.form.on("Print Format", { frappe.msgprint(__("Please select DocType first")); return; } - frappe.set_route("print-format-builder", frm.doc.name); + if (frm.doc.print_format_builder_beta) { + frappe.set_route("print-format-builder-beta", frm.doc.name); + } else { + frappe.set_route("print-format-builder", frm.doc.name); + } }); } else if (frm.doc.custom_format && !frm.doc.raw_printing) { diff --git a/frappe/public/js/print_format_builder/Preview.vue b/frappe/public/js/print_format_builder/Preview.vue index 2525d23694..1ce89a87aa 100644 --- a/frappe/public/js/print_format_builder/Preview.vue +++ b/frappe/public/js/print_format_builder/Preview.vue @@ -8,13 +8,26 @@
- + {{ __("Open in a new tab") }} +
Generating preview...