diff --git a/jey_wizard/__init__.py b/jey_wizard/__init__.py index 970659c..86205cb 100644 --- a/jey_wizard/__init__.py +++ b/jey_wizard/__init__.py @@ -1 +1 @@ -__version__ = "0.1.16" +__version__ = "0.1.17" diff --git a/jey_wizard/public/js/jey_setup.js b/jey_wizard/public/js/jey_setup.js index 627e7b3..842f0c6 100644 --- a/jey_wizard/public/js/jey_setup.js +++ b/jey_wizard/public/js/jey_setup.js @@ -10,7 +10,7 @@ frappe.provide("jey_wizard"); // Bump this string in every commit that changes wizard code. Displayed in the badge so // we can tell at a glance which version is actually running on a given machine. Kept in // sync with __version__ in jey_wizard/__init__.py. -const JEY_WIZARD_VERSION = "0.1.16"; +const JEY_WIZARD_VERSION = "0.1.17"; // Wipe Frappe + ERPNext default slides so their `before_load`/`after_load` listeners // don't try to mutate a wizard that isn't slide-based anymore. @@ -444,23 +444,28 @@ frappe.setup.SetupWizard = class JeySetupWizard { `); $body.find(".jey-company-name").val(this.data.company_name); - // Mount native Frappe Date controls (Flatpickr-styled) into the - // jey-fy-start / jey-fy-end placeholders. Plain - // looks dated and inconsistent with the rest of Frappe's UI. The - // controls expose set_value / get_value; we wire those into the - // usual data dict. - this.fy_start_ctrl = frappe.ui.form.make_control({ - df: { fieldtype: "Date", fieldname: "fy_start_date", placeholder: "" }, - parent: $body.find(".jey-fy-start")[0], - render_input: true, - }); - this.fy_start_ctrl.set_value(this.data.fy_start_date || ""); - this.fy_end_ctrl = frappe.ui.form.make_control({ - df: { fieldtype: "Date", fieldname: "fy_end_date", placeholder: "" }, - parent: $body.find(".jey-fy-end")[0], - render_input: true, - }); - this.fy_end_ctrl.set_value(this.data.fy_end_date || ""); + // Mount native Frappe Date controls (Flatpickr) into the placeholders. + // `only_input: true` matches what frappe.ui.Page.add_field does — it + // drops the built-in label/help wrapper (we already render our own + // labels above) and gives us just the input + datepicker. Without + // this flag the wrapper double-labels and the picker's UI looks + // like a plain native . + const mountDate = (selector, value) => { + const parent = $body.find(selector)[0]; + if (!parent) return null; + parent.innerHTML = ""; + const ctrl = frappe.ui.form.make_control({ + df: { fieldtype: "Date", fieldname: selector.slice(1) }, + parent: parent, + only_input: true, + render_input: true, + }); + ctrl.refresh(); + if (value) ctrl.set_value(value); + return ctrl; + }; + this.fy_start_ctrl = mountDate(".jey-fy-start", this.data.fy_start_date); + this.fy_end_ctrl = mountDate(".jey-fy-end", this.data.fy_end_date); $body.find(".jey-valuation-method").val(this.data.valuation_method || "FIFO"); $body.find(".jey-accounting-method").val(this.data.accounting_method || "Hesablama metodu"); @@ -1347,15 +1352,17 @@ frappe.setup.SetupWizard = class JeySetupWizard { // events with {progress: [idx, total], stage_status: "..."}; we // subscribe and translate those into bar width + status text. this.$wrap.find(".jey-body").html(` -

${__("Setting up your system")}

-
${__("Starting...")}
-
-
+

${__("Setting up your system")}

+
${__("Starting...")}
+
+
-
5%
+
5%
`); this.$wrap.find(".jey-nav").empty(); this.$wrap.find(".jey-status").empty(); + // Override progress label since show_current_step no longer runs here. + this.$wrap.find(".jey-progress").text(__("Finalizing")); const setProgress = (pct, status) => { pct = Math.max(0, Math.min(100, Math.round(pct)));