Uploader and import flow
CSV / JSON / ZIP into the import flow: upload → map → preview (added / updated / unchanged / linked / errors, with the failing rows) → confirm → progress (polled) → result. Limits are stated up front; a failed run says exactly what was written.
Covers: file-uploader primitive, uploader designer, review-step designer. Exports: FileUploader, ImportFlow, ReviewStep.
Anatomy
The component as it sits in the product: English, compact, real data shapes.
States
10 states, left to right, top to bottom. A mock poll never finishes, so each state is drawn on purpose.
4 rows need fixing
| Row | Column | Problem |
|---|---|---|
| 212 | supplier | “VBX” is not a supplier |
| 1,388 | code | duplicate of row 1,301 (228155) |
Density
Compact (2b ultra, the default) and comfortable, side by side. Same markup, only the density tokens change.
English · 中文
Staff pick en or cn (T001 Q25). Labels arrive localised; CJK falls back to PingFang SC / Noto Sans SC.
Long string · permission denied
The long-string case (PL-063) and what a role without the permission sees (the server decides; T003).
Not available to your role
Your role is missing import fabric codes. Nothing here is hidden by mistake: the server sends only what you can do.
Both apps
One @rj/admin-kit component, two themes: the Laravel admin (navy pinned) and the DTC admin (kit v4 Midnight green), by token swap only.
Contract
The @rj/admin-kit API for this family. Mirrored in CONTRACT.md.
- Export
FileUploader·@rj/admin-kit- Props
accept·maxBytes·multiple·onUpload- States
- idle · drag-over · invalid · uploading % · uploaded · error
- shadcn / Radix
- none (drop zone) + Progress
- Package underneath
- react-dropzone
- Accessibility
- the drop zone is a button; errors are announced
- Export
ImportFlow·@rj/admin-kit- Props
steps·preview(counts + row errors) ·onConfirm·onCancel·job- States
- upload · map · preview · confirming · progress · done · failed · cancelled
- Package underneath
- react-query polling
- API operations
- admin.fabric-codes.import → .import.preview.status → .confirm / .cancel · admin.pt-colors.import.preview · admin.colourway-families.import.preview / .confirm · admin.fitq.import · admin.media-library.archives.extract
- Phone variant
- not on phone (fallback page); the job shows in the phone tray
- Export
ReviewStep·@rj/admin-kit- Props
counts{added, updated, unchanged, linked, errors} ·errors[]{row, column, message}- States
- clean · with errors · skip-and-continue