From 0e7ce08d7e9eb565cd73fc9ef8967a628d8d5ec3 Mon Sep 17 00:00:00 2001 From: Ali <010109ali@gmail.com> Date: Thu, 30 Apr 2026 12:43:29 +0000 Subject: [PATCH] Date controls: only_input mode; finalize bar: !important + label MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two corrections to v0.1.16 — your screenshot showed v0.1.8 in the badge, so the JS bundle there is older than the Python side. Once you rebuild and bust the browser cache, both fixes take effect: 1. Frappe Date controls now mount with only_input:true v0.1.16 used render_input:true without only_input, which kept the built-in form-group wrapper (label slot, help-box, etc.). With our own label rendered above, that produced a double-label layout that degraded the visual to look like a plain native date input. The only_input flag mirrors what frappe.ui.Page.add_field does — strips the wrapper and gives just the input + datepicker. Mount path is now mountDate(selector, value): clears the placeholder first (idempotent re-renders), constructs the control, then set_value with the data dict. Same get_value contract on read. 2. Finalize progress UI hardened with !important The reported "still a dimmed screen" was the cached older JS, but the new bar styles now also carry !important so any leftover wizard CSS or app theme rule can't collapse the bar div. Also overrides .jey-progress to "Finalizing" in finalize() so the step counter doesn't show "Adım 6 / 6" mid-progress. --- jey_wizard/__init__.py | 2 +- jey_wizard/public/js/jey_setup.js | 53 +++++++++++++++++-------------- 2 files changed, 31 insertions(+), 24 deletions(-) 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(` -