Commit 1e628da
feat: csv import page (#22)
* feat: add CSV preview with validation before import
- Add StagesPreviewTable to show parsed stages data
- Add SetsPreviewTable with time format validation
- Parse CSV immediately on file selection to show preview
- Validate time_start and time_end formats using existing timeUtils
- Show validation errors inline in preview table
- Display valid/invalid count badges in preview header
- Highlight invalid rows with background color
- Clear preview when import completes or dialog closes
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* feat: import view
* feat: simplify CSV import - remove conflict resolution
- Remove complex conflict detection and resolution system
- Delete CSVImportDialog, ImportConflictResolver, conflictDetector, artistResolver, useMergeSets
- Auto-detect user's timezone as default
- Simplify CSVImportPage to single view without dialogs
- Clean up all imports and unused code
- Prepare for inline artist selection in preview table
Next step: Add artist dropdowns and set matching to preview table
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* feat: add artist matching and set detection to CSV import
- Created setMatcher service for detecting matching sets by artists/edition
- Fixed query to use left joins instead of inner joins for better results
- Added useMatchingSetsQuery hook for react-query data loading
- Refactored SetsPreviewTable into modular components:
- SetPreviewRow: handles individual row rendering
- ArtistSelectionCell: manages multiple artist selections
- ArtistSelect: reusable select component for artist matching
- StageCellWithValidation: displays stage with error messages
- TimeCellWithValidation: displays time with error messages
- MatchingSetCell: displays matching set information
- Artist selector shows all artists with exact match highlighting (✓)
- Users can select existing artists or create new ones from CSV
- Updated setImporter to accept artist mappings and create artists as needed
- Fixed artist creation to use added_by field instead of created_by
- Wired up artist selections in CSVImportPage with proper state management
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* refactor: optimize loading
* feat: add inline set selection with match/duplicate/create options
* feat: allow selecting any set from edition in CSV import
- Auto-select first matching set by default
- Add dropdown to select from all sets in edition (matching + other sets)
- Display sets grouped by matching/other with vote counts and stage info
- Fetch stage names in set queries for better UX
* show detailed errors
* feat: improve CSV import - set selection, error display, and stage handling
- Auto-select first matching set by default in CSV import
- Allow selecting from all sets in edition (matching + other sets grouped)
- Display sets with vote counts and stage info for better selection
- Add ImportResults component to show detailed error messages in UI
- Update stage_id when matching or duplicating sets during import
- Extend duplicateSetWithVotes to accept stage_id and description parameters
* duplicate sets with hours and stage
* fix: remove group_id from duplicate_set_with_votes and add optional params
- Remove group_id column reference (doesn't exist in votes table)
- Add optional new_stage_id and new_description parameters
- Use COALESCE to fall back to source set values if not provided
- Add grants for both old and new function signatures
* match sets
* fix function
* remove lovable
---------
Co-authored-by: Claude <[email protected]>1 parent c843f7e commit 1e628da
File tree
46 files changed
+5671
-7824
lines changed- public
- src
- components/router
- hooks
- queries/sets
- integrations/supabase
- lib
- pages/admin/festivals
- CSVImportDialog
- ImportConflictResolver
- ImportConflictItem
- SetsManagement
- services/csv
- supabase/migrations
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
46 files changed
+5671
-7824
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 17 | + | |
21 | 18 | | |
22 | 19 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
| 20 | + | |
28 | 21 | | |
29 | 22 | | |
30 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
0 commit comments