mirror of
https://github.com/we-promise/sure.git
synced 2026-04-16 18:44:13 +00:00
Introduces a basic CSV import module for bulk-importing account transactions. Changes include: - User can load a CSV - User can configure the column mappings for a CSV - Imported CSV shows invalid cells - User can clean up their data directly in the UI - User can see a preview of the import rows and confirm import - Layout refactor + Import nav stepper - System test stability improvements
40 lines
1.5 KiB
Plaintext
40 lines
1.5 KiB
Plaintext
<%= content_for :return_to_path, return_to_path(params, imports_path) %>
|
|
|
|
<div class="mx-auto max-w-[450px] w-full py-24 space-y-4">
|
|
<h1 class="sr-only"><%= t(".load_title") %></h1>
|
|
|
|
<div class="text-center space-y-2">
|
|
<h2 class="text-3xl text-gray-900 font-medium"><%= t(".subtitle") %></h2>
|
|
<p class="text-gray-500 text-sm"><%= t(".description") %></p>
|
|
</div>
|
|
|
|
<%= form_with model: @import, url: load_import_path(@import) do |form| %>
|
|
<div>
|
|
<%= form.text_area :raw_csv_str,
|
|
rows: 10,
|
|
required: true,
|
|
placeholder: "Paste your CSV file contents here",
|
|
class: "rounded-md w-full border text-sm border-alpha-black-100 bg-white placeholder:text-gray-400 p-4" %>
|
|
</div>
|
|
|
|
<%= form.submit t(".next"), class: "px-4 py-2 block w-full rounded-lg bg-gray-900 text-white text-sm font-medium", data: { turbo_confirm: (@import.raw_csv_str? ? { title: t(".confirm_title"), body: t(".confirm_body"), accept: t(".confirm_accept") } : nil) } %>
|
|
<% end %>
|
|
|
|
<div class="bg-alpha-black-25 rounded-xl p-1">
|
|
<div class="text-gray-500 p-2 mb-2">
|
|
<div class="flex gap-2 mb-2">
|
|
<%= lucide_icon("info", class: "w-5 h-5 shrink-0") %>
|
|
<p class="text-sm"><%= t(".instructions") %></p>
|
|
</div>
|
|
|
|
<ul class="list-disc text-sm pl-10">
|
|
<li><%= t(".requirement1") %></li>
|
|
<li><%= t(".requirement2") %></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<%= render partial: "imports/sample_table" %>
|
|
|
|
</div>
|
|
</div>
|