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:
parent
40f65ffd90
commit
0e7ce08d7e
|
|
@ -1 +1 @@
|
|||
__version__ = "0.1.16"
|
||||
__version__ = "0.1.17"
|
||||
|
|
|
|||
|
|
@ -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 <input type="date">
|
||||
// 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],
|
||||
// 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 <input type="date">.
|
||||
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,
|
||||
});
|
||||
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 || "");
|
||||
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(`
|
||||
<h3 style="margin-bottom:12px">${__("Setting up your system")}</h3>
|
||||
<div class="jey-finalize-status" style="color:#666;margin-bottom:12px;min-height:1.4em">${__("Starting...")}</div>
|
||||
<div style="background:#eee;border-radius:6px;height:12px;overflow:hidden">
|
||||
<div class="jey-finalize-bar" style="background:#3b82f6;height:100%;width:5%;transition:width 0.4s ease"></div>
|
||||
<h3 style="margin-bottom:12px !important">${__("Setting up your system")}</h3>
|
||||
<div class="jey-finalize-status" style="color:#666 !important;margin-bottom:12px !important;min-height:1.4em">${__("Starting...")}</div>
|
||||
<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:#2563eb !important;height:100% !important;width:5% !important;transition:width 0.4s ease !important;display:block !important"></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-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)));
|
||||
|
|
|
|||
Loading…
Reference in New Issue