Date controls: only_input mode; finalize bar: !important + label

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.
This commit is contained in:
Ali 2026-04-30 12:43:29 +00:00
parent 40f65ffd90
commit 0e7ce08d7e
2 changed files with 31 additions and 24 deletions

View File

@ -1 +1 @@
__version__ = "0.1.16" __version__ = "0.1.17"

View File

@ -10,7 +10,7 @@ frappe.provide("jey_wizard");
// Bump this string in every commit that changes wizard code. Displayed in the badge so // 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 // 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. // 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 // 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. // 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); $body.find(".jey-company-name").val(this.data.company_name);
// Mount native Frappe Date controls (Flatpickr-styled) into the // Mount native Frappe Date controls (Flatpickr) into the placeholders.
// jey-fy-start / jey-fy-end placeholders. Plain <input type="date"> // `only_input: true` matches what frappe.ui.Page.add_field does — it
// looks dated and inconsistent with the rest of Frappe's UI. The // drops the built-in label/help wrapper (we already render our own
// controls expose set_value / get_value; we wire those into the // labels above) and gives us just the input + datepicker. Without
// usual data dict. // this flag the wrapper double-labels and the picker's UI looks
this.fy_start_ctrl = frappe.ui.form.make_control({ // like a plain native <input type="date">.
df: { fieldtype: "Date", fieldname: "fy_start_date", placeholder: "" }, const mountDate = (selector, value) => {
parent: $body.find(".jey-fy-start")[0], 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, render_input: true,
}); });
this.fy_start_ctrl.set_value(this.data.fy_start_date || ""); ctrl.refresh();
this.fy_end_ctrl = frappe.ui.form.make_control({ if (value) ctrl.set_value(value);
df: { fieldtype: "Date", fieldname: "fy_end_date", placeholder: "" }, return ctrl;
parent: $body.find(".jey-fy-end")[0], };
render_input: true, 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);
this.fy_end_ctrl.set_value(this.data.fy_end_date || "");
$body.find(".jey-valuation-method").val(this.data.valuation_method || "FIFO"); $body.find(".jey-valuation-method").val(this.data.valuation_method || "FIFO");
$body.find(".jey-accounting-method").val(this.data.accounting_method || "Hesablama metodu"); $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 // events with {progress: [idx, total], stage_status: "..."}; we
// subscribe and translate those into bar width + status text. // subscribe and translate those into bar width + status text.
this.$wrap.find(".jey-body").html(` this.$wrap.find(".jey-body").html(`
<h3 style="margin-bottom:12px">${__("Setting up your system")}</h3> <h3 style="margin-bottom:12px !important">${__("Setting up your system")}</h3>
<div class="jey-finalize-status" style="color:#666;margin-bottom:12px;min-height:1.4em">${__("Starting...")}</div> <div class="jey-finalize-status" style="color:#666 !important;margin-bottom:12px !important;min-height:1.4em">${__("Starting...")}</div>
<div style="background:#eee;border-radius:6px;height:12px;overflow:hidden"> <div style="background:#e5e7eb !important;border-radius:6px !important;height:14px !important;overflow:hidden !important;width:100% !important">
<div class="jey-finalize-bar" style="background:#3b82f6;height:100%;width:5%;transition:width 0.4s ease"></div> <div class="jey-finalize-bar" style="background:#2563eb !important;height:100% !important;width:5% !important;transition:width 0.4s ease !important;display:block !important"></div>
</div> </div>
<div class="jey-finalize-pct" style="color:#888;font-size:12px;margin-top:6px;text-align:right">5%</div> <div class="jey-finalize-pct" style="color:#6b7280 !important;font-size:12px !important;margin-top:6px !important;text-align:right !important">5%</div>
`); `);
this.$wrap.find(".jey-nav").empty(); this.$wrap.find(".jey-nav").empty();
this.$wrap.find(".jey-status").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) => { const setProgress = (pct, status) => {
pct = Math.max(0, Math.min(100, Math.round(pct))); pct = Math.max(0, Math.min(100, Math.round(pct)));