wrolpi/app/src/components/inventory
Roland 6a46cfd17d
Add manual import + backup Restore/Merge/Overwrite for inventory configs
Inventories are a config-only MultiFileConfig (config/inventory/<slug>.yaml) and
were not reachable by the admin config Restore UI, so there was no way to re-import
a hand-edited/copied-in file or restore an inventory from its daily backup.

Backend:
- MultiFileConfig gains generic helpers: get_backup_dates(slug)/_get_backup_file
  (surface the daily config/backup/<subdir>/<slug>-DATE.yaml files) and reimport()
  (rebuild the in-memory store from disk; picks up hand-edits and copied-in files,
  drops files deleted on disk).  backup_date is constrained to YYYYMMDD so it cannot
  traverse out of the backup directory.
- InventoriesConfig.preview_restore/apply_restore: overwrite replaces the whole
  inventory; merge unions items by id (keeps current fields and existing items).
  The pre-restore state is backed up automatically, so a restore is undoable.
- API: POST /inventory/reimport, GET /inventory/<slug>/backups,
  POST /inventory/<slug>/restore/preview, POST /inventory/<slug>/restore.

Frontend:
- New InventoryImportModal (opened from a Restore button in the Inventory toolbar):
  Re-import from disk, plus a dated-backup table with per-row Merge/Overwrite that
  previews the change before applying.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 16:28:11 -06:00
..
CatalogEditor.js Applying theme style to paragraphs in inventory. 2026-06-19 12:52:27 -06:00
computeFields.js Add "Count by Weight" to estimate item counts from weighing 2026-06-19 14:36:56 -06:00
computeFields.test.js Add "Count by Weight" to estimate item counts from weighing 2026-06-19 14:36:56 -06:00
FieldCell.js Allow arithmetic expressions in inventory number fields 2026-06-19 15:14:10 -06:00
FieldSchemaEditor.js Add "Count by Weight" to estimate item counts from weighing 2026-06-19 14:36:56 -06:00
FieldSchemaEditor.test.js Add "Count by Weight" to estimate item counts from weighing 2026-06-19 14:36:56 -06:00
Inventory.cy.js Rebuild Inventory as a config-only system with food catalog and calculators 2026-06-14 17:14:54 -06:00
inventoryExport.js Add a recommended Food Storage example, a Ration tab, and a supply planner 2026-06-19 12:40:30 -06:00
inventoryExport.test.js Add a recommended Food Storage example, a Ration tab, and a supply planner 2026-06-19 12:40:30 -06:00
InventoryExportPanel.js Applying theme style to paragraphs in inventory. 2026-06-19 12:52:27 -06:00
InventoryImportModal.js Add manual import + backup Restore/Merge/Overwrite for inventory configs 2026-06-19 16:28:11 -06:00
InventoryImportModal.test.js Add manual import + backup Restore/Merge/Overwrite for inventory configs 2026-06-19 16:28:11 -06:00
InventoryItemsMobile.js Applying theme style to paragraphs in inventory. 2026-06-19 12:52:27 -06:00
InventoryItemsMobile.test.js Add responsive mobile view for Inventory with configurable columns 2026-06-18 14:08:34 -06:00
InventoryPrint.js Add CSV/PDF export and a search filter to Inventory 2026-06-19 11:06:38 -06:00
InventoryPrint.test.js Add CSV/PDF export and a search filter to Inventory 2026-06-19 11:06:38 -06:00
InventoryRoute.js Add manual import + backup Restore/Merge/Overwrite for inventory configs 2026-06-19 16:28:11 -06:00
InventorySummary.js Add a recommended Food Storage example, a Ration tab, and a supply planner 2026-06-19 12:40:30 -06:00
InventorySummary.test.js Rebuild Inventory as a config-only system with food catalog and calculators 2026-06-14 17:14:54 -06:00
InventoryTable.js Allow arithmetic expressions in inventory number fields 2026-06-19 15:14:10 -06:00
InventoryTable.test.js Allow arithmetic expressions in inventory number fields 2026-06-19 15:14:10 -06:00
summarize.js Add a recommended Food Storage example, a Ration tab, and a supply planner 2026-06-19 12:40:30 -06:00
summarize.test.js Add a recommended Food Storage example, a Ration tab, and a supply planner 2026-06-19 12:40:30 -06:00
units.js Allow arithmetic expressions in inventory number fields 2026-06-19 15:14:10 -06:00
units.test.js Allow arithmetic expressions in inventory number fields 2026-06-19 15:14:10 -06:00