[FEATURE]: Implement Admin Global Settings LiveView UI for import #335

Open
opened 2026-01-07 13:53:42 +01:00 by carla · 0 comments
Owner

Description

UI section with upload, progress, results, and template links.

Tasks:

  • Render import section only for admins
  • Add prominent UI notice about custom fields:
    • Display alert/info box: "Custom fields must be created in Mila before importing CSV files with custom field columns"
    • Explain: "Use the custom field name as the CSV column header (same normalization as member fields applies)"
    • Add link to custom fields management section
  • Configure allow_upload/3:
    • .csv only, max_entries: 1, max_file_size: 10MB, auto_upload: false
  • handle_event("start_import", ...):
    • Admin permission check
    • Consume upload -> read file content
    • Call MemberCSV.prepare/2
    • Store import_state in assigns (chunks + column_map + metadata)
    • Initialize progress assigns
    • send(self(), {:process_chunk, 0})
  • handle_info({:process_chunk, idx}, socket):
    • Fetch chunk from import_state
    • Call MemberCSV.process_chunk/3
    • Merge counts/errors into progress assigns (cap errors at 50 overall)
    • Schedule next chunk (or finish and show results)
  • Results UI:
    • Success count
    • Failure count
    • Error list (line number + message + field)
    • Warning messages for unknown custom field columns (non-existent names) shown in results
  • Fixtures:
    • valid EN/DE (core fields only)
    • valid with custom fields
    • invalid
    • unknown custom field name (non-existent, should show warning)
    • too many rows (1,001)
    • BOM + ; delimiter fixture
    • fixture with empty line(s) to validate correct line numbers
  • LiveView tests:
    • admin sees section, non-admin does not
    • upload + start import
    • success + error rendering
    • row limit + file size errors
    • custom field import success
    • custom field import warning (non-existent name, column ignored)

Template links:

  • Link /templates/member_import_en.csv and /templates/member_import_de.csv via Phoenix static path helpers.

External or internal Dependencies

#334

## Description UI section with upload, progress, results, and template links. **Tasks:** - [ ] Render import section only for admins - [ ] **Add prominent UI notice about custom fields:** - Display alert/info box: "Custom fields must be created in Mila before importing CSV files with custom field columns" - Explain: "Use the custom field name as the CSV column header (same normalization as member fields applies)" - Add link to custom fields management section - [ ] Configure `allow_upload/3`: - `.csv` only, `max_entries: 1`, `max_file_size: 10MB`, `auto_upload: false` - [ ] `handle_event("start_import", ...)`: - Admin permission check - Consume upload -> read file content - Call `MemberCSV.prepare/2` - Store `import_state` in assigns (chunks + column_map + metadata) - Initialize progress assigns - `send(self(), {:process_chunk, 0})` - [ ] `handle_info({:process_chunk, idx}, socket)`: - Fetch chunk from `import_state` - Call `MemberCSV.process_chunk/3` - Merge counts/errors into progress assigns (cap errors at 50 overall) - Schedule next chunk (or finish and show results) - [ ] Results UI: - Success count - Failure count - Error list (line number + message + field) - **Warning messages for unknown custom field columns** (non-existent names) shown in results - [ ] Fixtures: - valid EN/DE (core fields only) - valid with custom fields - invalid - unknown custom field name (non-existent, should show warning) - too many rows (1,001) - BOM + `;` delimiter fixture - fixture with empty line(s) to validate correct line numbers - [ ] LiveView tests: - admin sees section, non-admin does not - upload + start import - success + error rendering - row limit + file size errors - custom field import success - custom field import warning (non-existent name, column ignored) **Template links:** - Link `/templates/member_import_en.csv` and `/templates/member_import_de.csv` via Phoenix static path helpers. ## External or internal Dependencies #334
carla added this to the I can import members milestone 2026-01-07 13:53:42 +01:00
carla added the
M
label 2026-01-07 13:53:42 +01:00
carla added a new dependency 2026-01-07 13:53:56 +01:00
carla added this to the Sprint 11: 08.01-29.01 project 2026-01-08 12:54:03 +01:00
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: local-it/mitgliederverwaltung#335
No description provided.