Revert clickable area: only digit + hint stay linked

Wrapping the whole row turned the bold label into a link too, which
read like a heading-as-button. Keep label plain, put the digit and
the "(click to preview)" hint inside one anchor so they share a
clickable target without hijacking the label.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ali 2026-05-15 16:16:27 +00:00
parent 55174552c0
commit 68ea3dce38
2 changed files with 9 additions and 11 deletions

View File

@ -1 +1 @@
__version__ = "0.1.27" __version__ = "0.1.28"

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.27"; const JEY_WIZARD_VERSION = "0.1.28";
// 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.
@ -286,10 +286,9 @@ frappe.setup.SetupWizard = class JeySetupWizard {
["bank_accounts_json", "bank_accounts", __("Bank accounts")], ["bank_accounts_json", "bank_accounts", __("Bank accounts")],
["presented_certs_json", "presented_certs", __("Presented certificates")], ["presented_certs_json", "presented_certs", __("Presented certificates")],
]; ];
// Whole row is the clickable target so users don't have to aim // Label (the bold heading) stays plain text; only the digit + the
// at the digit. Anchor strips default underline + color, gets a // "(click to preview)" hint sit inside the anchor so they share
// soft hover background. // one clickable target.
const linkStyle = "display:block;padding:4px 6px;border-radius:3px;text-decoration:none;color:inherit;cursor:pointer";
const rows = datasets.map(([field, kind, label]) => { const rows = datasets.map(([field, kind, label]) => {
if (errors[field]) { if (errors[field]) {
return `<li><b>${label}:</b> <span style="color:#c00">${__("failed")}</span> <span style="color:#888;font-size:12px">(${frappe.utils.escape_html(errors[field])})</span></li>`; return `<li><b>${label}:</b> <span style="color:#c00">${__("failed")}</span> <span style="color:#888;font-size:12px">(${frappe.utils.escape_html(errors[field])})</span></li>`;
@ -299,18 +298,17 @@ frappe.setup.SetupWizard = class JeySetupWizard {
return `<li><b>${label}:</b> <span style="color:#888">—</span></li>`; return `<li><b>${label}:</b> <span style="color:#888">—</span></li>`;
} }
if (n > 0) { if (n > 0) {
return `<li style="list-style:none;margin-left:-20px"><a href="#" class="jey-preview-link" data-kind="${kind}" data-title="${frappe.utils.escape_html(label)}" style="${linkStyle}"><b>${label}:</b> ${n} <span style="color:#888;font-size:12px">${__("(click to preview)")}</span></a></li>`; return `<li><b>${label}:</b> <a href="#" class="jey-preview-link" data-kind="${kind}" data-title="${frappe.utils.escape_html(label)}">${n} <span style="font-size:12px">${__("(click to preview)")}</span></a></li>`;
} }
return `<li><b>${label}:</b> ${n}</li>`; return `<li><b>${label}:</b> ${n}</li>`;
}).join(""); }).join("");
$body.html(` $body.html(`
<style>.jey-preview-link:hover{background:#eef3fb;color:inherit;text-decoration:none}</style>
<h3 style="margin-bottom:16px;color:#080"> ${__("Authenticated & data loaded")}</h3> <h3 style="margin-bottom:16px;color:#080"> ${__("Authenticated & data loaded")}</h3>
<p>${__("Pulled from the tax portal:")}</p> <p>${__("Pulled from the tax portal:")}</p>
<ul style="line-height:1.8;list-style:none;padding-left:0"> <ul style="line-height:1.8">
<li><a href="#" class="jey-preview-link" data-kind="profile" data-title="${frappe.utils.escape_html(__("Company profile"))}" style="${linkStyle}"><b>${__("Company")}:</b> ${frappe.utils.escape_html(this.data.company_name)} <span style="color:#888;font-size:12px">${__("(click to preview)")}</span></a></li> <li><b>${__("Company")}:</b> <a href="#" class="jey-preview-link" data-kind="profile" data-title="${frappe.utils.escape_html(__("Company profile"))}">${frappe.utils.escape_html(this.data.company_name)} <span style="font-size:12px">${__("(click to preview)")}</span></a></li>
<li style="padding:4px 6px"><b>${__("VÖEN")}:</b> ${frappe.utils.escape_html(this.data.asan_voen)}</li> <li><b>${__("VÖEN")}:</b> ${frappe.utils.escape_html(this.data.asan_voen)}</li>
</ul> </ul>
<div style="margin-top:16px;padding:12px;background:#f7f7f7;border-radius:6px"> <div style="margin-top:16px;padding:12px;background:#f7f7f7;border-radius:6px">
<div style="font-weight:600;margin-bottom:6px">${__("Loaded datasets")}</div> <div style="font-weight:600;margin-bottom:6px">${__("Loaded datasets")}</div>