mirror of
https://github.com/we-promise/sure.git
synced 2026-08-06 00:52:16 +00:00
* fix(ds): route remaining literal yellow warning surfaces onto --color-warning Completes the #2198 warning consolidation for view-level surfaces: - rules/index recent-runs status badges → DS::Pill (warning / success / error). - accounts/_account_sidebar_tabs missing-data notice: bg-yellow-tint-10 / text-yellow-600 → bg-warning/10 / text-warning. - import/confirms/_mappings unassigned-account notice → bg-warning/10 / border-warning/20 (also fixes a missing dark variant — it was light-yellow in dark mode). - simplefin/_replacement_prompt card → bg-warning/10 / border-warning/20, dropping the now-redundant theme-dark: companions (the token is theme-aware). rules' blue/purple execution-type badges and the red failed-row highlight are left as-is (not warning surfaces). Part of #2198. * fix(ds): neutral text in sidebar missing-data notice (match DS::Alert recipe) Warning surfaces follow the DS::Alert recipe — warning tint + warning-colored icon, but neutral body text (text-primary / text-secondary). The sidebar missing-data notice was the lone holdout still painting its text (and link) with text-warning. Switch to neutral text; keep the bg-warning/10 tint and the warning-colored triangle/chevron as the accent. More readable (color-on-tint text is low-contrast) and consistent with the DS::Alert migrations. * fix(ds): missing-data sidebar notice → static DS::Alert (drop disclosure) The notice was a raw collapsible <details> styled as a warning — a hybrid that hid its own primary action (the "Configure providers" link) and its explanation behind a chevron click. A warning's job is to surface a problem and its fix; a disclosure's job is to hide secondary detail. The two fought each other (triangle-alert "act on this" vs chevron "optional, expand"). Replace with a static DS::Alert(:warning): icon + title + body + the Configure link, always visible. Fixes the affordance, surfaces the action, canonicalizes the last warning-styled raw <details>, and matches the other DS::Alert notices. * fix(ds): grey body text in missing-data alert for title/body hierarchy DS::Alert renders its body in text-primary (same dark as the title). For this notice, drop the description to text-secondary so the title (primary, semibold) reads above the supporting body (grey) — clearer hierarchy. Still neutral (no colored text); the Configure link stays primary + underline so the action remains the prominent element. * fix(ds): bump account_sidebar_tabs cache version v1→v2 Flush stale <details>-markup fragments on deploy. The sidebar missing-data notice migrated from <details> to a static DS::Alert, but the fragment is cached with a 12h TTL — without a key change, old markup renders until expiry (and inconsistently across staggered multi-server cache warmups). Bumping the version string changes the cache-key namespace so every cached fragment is bypassed immediately.
73 lines
2.9 KiB
Plaintext
73 lines
2.9 KiB
Plaintext
<%# locals: (import:, mapping_class:, step_idx:) %>
|
|
|
|
<% mappings = mapping_class.for_import(import) %>
|
|
<% is_last_step = step_idx == import.mapping_steps.count - 1 %>
|
|
|
|
<div class="w-full max-w-full">
|
|
<% if mapping_class == Import::AccountMapping && import.account.nil? %>
|
|
<% if import.requires_account? %>
|
|
<div class="w-full max-w-full overflow-hidden mb-4">
|
|
<div class="overflow-x-auto">
|
|
<div class="flex items-center justify-between p-4 gap-4 text-secondary bg-red-100 border border-red-200 rounded-lg w-[650px] min-w-0 mx-auto">
|
|
<%= tag.p t(".no_accounts"), class: "text-sm" %>
|
|
|
|
<%= render DS::Link.new(
|
|
text: t(".create_account"),
|
|
variant: "primary",
|
|
href: new_account_path(return_to: import_confirm_path(import)),
|
|
frame: :modal
|
|
) %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% elsif import.has_unassigned_account? %>
|
|
<div class="w-full max-w-full overflow-hidden mb-4">
|
|
<div class="overflow-x-auto">
|
|
<div class="flex items-center justify-between p-4 gap-4 text-secondary bg-warning/10 border border-warning/20 rounded-lg w-[650px] min-w-0 mx-auto">
|
|
<%= tag.p t(".unassigned_account"), class: "text-sm" %>
|
|
<%= render DS::Link.new(
|
|
text: t(".create_account"),
|
|
variant: "primary",
|
|
href: new_account_path(return_to: import_confirm_path(import)),
|
|
frame: :modal
|
|
) %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<div class="space-y-4 w-full max-w-full">
|
|
<div class="w-full max-w-full overflow-hidden">
|
|
<div class="overflow-x-auto">
|
|
<div class="bg-container-inset rounded-xl p-1 space-y-1 w-[650px] min-w-0 mx-auto">
|
|
<div class="grid grid-cols-3 gap-2 text-xs font-medium text-secondary uppercase px-5 py-3">
|
|
<p><%= t(".csv_mapping_label", mapping: mapping_label(mapping_class)) %></p>
|
|
<p><%= t(".sure_mapping_label", mapping: mapping_label(mapping_class), product_name: product_name) %></p>
|
|
<p class="justify-self-end"><%= t(".rows_label") %></p>
|
|
</div>
|
|
|
|
<div class="shadow-border-xs rounded-md divide-y divide-alpha-black-100 text-sm">
|
|
<% mappings.sort_by(&:key).each do |mapping| %>
|
|
<div class="px-5 py-3 bg-container first:rounded-tl-xl first:rounded-tr-xl last:rounded-bl-xl last:rounded-br-xl">
|
|
<%= render partial: "import/mappings/form", locals: { mapping: mapping } %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex justify-center w-full">
|
|
<%= render DS::Link.new(
|
|
text: t(".next"),
|
|
variant: "primary",
|
|
href: is_last_step ? import_path(import) : url_for(step: step_idx + 2),
|
|
icon: "arrow-right",
|
|
icon_position: "right",
|
|
class: "w-full md:w-auto"
|
|
) %>
|
|
</div>
|
|
</div>
|
|
</div>
|