From 7f65351b6085fccacd428d4b5ff7a6c2fea633a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Odini?= Date: Thu, 9 Jan 2025 09:49:04 +0100 Subject: [PATCH] =?UTF-8?q?refactor(Import=20de=20masse):=20basculer=20la?= =?UTF-8?q?=20logique=20de=20documentation=20(schema=20->=20table)=20dans?= =?UTF-8?q?=20un=20composant=20d=C3=A9di=C3=A9=20(#4854)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/schemas/imports/achats.json | 1 + frontend/src/components/SchemaTable.vue | 87 ++++++++++++++++++++++++ frontend/src/constants.js | 8 --- frontend/src/views/PurchasesImporter.vue | 68 ++---------------- 4 files changed, 93 insertions(+), 71 deletions(-) create mode 100644 frontend/src/components/SchemaTable.vue diff --git a/data/schemas/imports/achats.json b/data/schemas/imports/achats.json index 036f290cf..24eb59390 100644 --- a/data/schemas/imports/achats.json +++ b/data/schemas/imports/achats.json @@ -98,6 +98,7 @@ "LOCAL" ], "enum_multiple": true, + "enum_multiple_seperator": ",", "pattern": "(?:(?:^|;)(BIO|LABEL_ROUGE|AOCAOP|IGP|STG|HVE|PECHE_DURABLE|RUP|COMMERCE_EQUITABLE|FERMIER|EXTERNALITES|PERFORMANCE|FRANCE|SHORT_DISTRIBUTION|LOCAL))+$", "required": false }, diff --git a/frontend/src/components/SchemaTable.vue b/frontend/src/components/SchemaTable.vue new file mode 100644 index 000000000..e798b0a57 --- /dev/null +++ b/frontend/src/components/SchemaTable.vue @@ -0,0 +1,87 @@ + + + diff --git a/frontend/src/constants.js b/frontend/src/constants.js index 43584c2ff..2266866ea 100644 --- a/frontend/src/constants.js +++ b/frontend/src/constants.js @@ -5,14 +5,6 @@ export default Object.freeze({ ERROR: 3, IDLE: 4, }, - SchemaTypes: { - siret: "14 chiffres, avec ou sans espaces", - string: "Texte", - string_enum: "Texte (choix unique)", - string_enum_multiple: "Texte (choix multiples)", - number: "Chiffre", - date: "Date (au format AAAA-MM-JJ)", - }, DefaultDiagnostics: { id: null, year: null, diff --git a/frontend/src/views/PurchasesImporter.vue b/frontend/src/views/PurchasesImporter.vue index 3e45d6a77..fd2a08431 100644 --- a/frontend/src/views/PurchasesImporter.vue +++ b/frontend/src/views/PurchasesImporter.vue @@ -97,44 +97,7 @@

Les données doivent être présentées dans l'ordre indiqué ci-dessous.

Colonnes

- - - +

Fichier exemple

@@ -165,12 +128,12 @@