mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-23 15:19:38 +02: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
19 lines
1,012 B
Ruby
19 lines
1,012 B
Ruby
module ImportsHelper
|
|
def table_corner_class(row_idx, col_idx, rows, cols)
|
|
return "rounded-tl-xl" if row_idx == 0 && col_idx == 0
|
|
return "rounded-tr-xl" if row_idx == 0 && col_idx == cols.size - 1
|
|
return "rounded-bl-xl" if row_idx == rows.size - 1 && col_idx == 0
|
|
return "rounded-br-xl" if row_idx == rows.size - 1 && col_idx == cols.size - 1
|
|
""
|
|
end
|
|
|
|
def nav_steps(import = Import.new)
|
|
[
|
|
{ name: "Select", complete: import.persisted?, path: import.persisted? ? edit_import_path(import) : new_import_path },
|
|
{ name: "Import", complete: import.loaded?, path: import.persisted? ? load_import_path(import) : nil },
|
|
{ name: "Setup", complete: import.configured?, path: import.persisted? ? configure_import_path(import) : nil },
|
|
{ name: "Clean", complete: import.cleaned?, path: import.persisted? ? clean_import_path(import) : nil },
|
|
{ name: "Confirm", complete: import.complete?, path: import.persisted? ? confirm_import_path(import) : nil }
|
|
]
|
|
end
|
|
end
|