feat(csv-import): Update CSV import functionality and enhance analysis features
Deploy Development / deploy (push) Successful in 50s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 17s

- Bumped version of csv_import to 0.3.0, reflecting new analysis capabilities.
- Modified analyze_csv endpoint to allow optional module filtering, improving flexibility in template selection.
- Enhanced the import process to support both system and user-defined templates, ensuring backward compatibility.
- Updated frontend to streamline mapping choices and improve user experience during CSV analysis and import.
- Added detailed error handling and user feedback for import operations.
This commit is contained in:
Lars committed 2026-04-10 06:15:21 +02:00
1 parent 7e9da46fe5
commit 5e5f3b4e5a
4 files changed
+216 -178

No files matched your search

+5 -5
View File
@@ -489,11 +489,10 @@ export const api = {
req(module ? `/csv/mappings?module=${encodeURIComponent(module)}` : '/csv/mappings'),
copyCsvMapping: (mappingId, body = null) =>
req(`/csv/mappings/${mappingId}/copy`, body ? json(body) : { method: 'POST' }),
/** Universal-CSV (Issue #21): file + module + mapping_id aus /csv/mappings */
importUniversalCsv: async (file, module, mappingId) => {
/** Universal-CSV (Issue #21): Zielmodul steckt in der Vorlage; nur file + mapping_id */
importUniversalCsv: async (file, mappingId) => {
const fd = new FormData()
fd.append('file', file)
fd.append('module', module)
fd.append('mapping_id', String(mappingId))
const res = await fetch(BASE + '/csv/import', { method: 'POST', headers: hdrs(), body: fd })
if (!res.ok) {
@@ -506,10 +505,11 @@ export const api = {
}
return res.json()
},
analyzeCsv: async (file, module, delimiter = null) => {
/** optional module = nur diese Vorlagen-Gruppe (Abwärtskompatibilität); ohne = globale Erkennung */
analyzeCsv: async (file, module = null, delimiter = null) => {
const fd = new FormData()
fd.append('file', file)
fd.append('module', module)
if (module) fd.append('module', module)
if (delimiter) fd.append('delimiter', delimiter)
const res = await fetch(BASE + '/csv/analyze', { method: 'POST', headers: hdrs(), body: fd })
if (!res.ok) {