Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Permettre de taguer les imports nécessitant des compléments/correctifs #253

Merged
merged 23 commits into from
Dec 30, 2021

Conversation

mvergez
Copy link
Contributor

@mvergez mvergez commented Dec 20, 2021

Closes #230

Maxime Vergez added 20 commits December 20, 2021 15:54
Replaced all checks for gn_is_valid = True etc. to an empty/not
empty gn_invalid_reason. So that we can get rid of gn_is_valid
Remove everything that created and populated the gn_is_valid
column
Now there is no more gn_is_valid column and all the validation
is done with gn_invalid_reason
To load and set the fix attributes which are the need_fix bool and
fix_comment string.
Added a "rights" function to check that the user has the rights to
CRUD the import
Add get in getValidData
Add set in a new route called setFixData
Need to use update on the query.
Improved also the get functions
To say that the import needs to be fixed and to add a comment
The update button calls the API to update the fix status of the
import
Add responsive style
That, for now, checks if the user has rights to update this
import
So that it can reused in the import report!
So that it does not get buggy in the import report (see next
commits)
Do this in the step4 component and not in the need-fix
component since it is reused!
So that the user can change the state of the import directly in
the report
Set/Get enables when importId is set to get the permissions
automatically, otherwise with concurrency there can be misses
Add ng_container with ngIf on fix for kind of the same reasons
Instead of errors, now filter on "need_fix".
Replaced the Warning Sign on need_fix imports
Changed icon so that is does not interfere with the one in the
import list
Changed the title for it to be shorter et clearer
@mvergez
Copy link
Contributor Author

mvergez commented Dec 21, 2021

Ce qui a été fait

Backend/db :

  • Suppression de la colonne gn_is_valid dans les tables relatifs aux imports (créés automatiquement). Tout est maintenant basé sur la colonne gn_invalid_reason. La ligne sera donc valide s'il n'y a pas de gn_invalid_reason.
  • Ajout de 2 colonnes dans la table t_imports : need_fix et fix_comment, permet de décider si un import nécessite une correction. L'utilisateur est libre d'ajouter un commentaire
  • Ajout d'un script SQL de migration (qui ajoute ces 2 colonnes)
  • Récupération de ces valeurs dans la route getValidData, cette route a été choisie car déjà utilisée dans l'étape 4 et le rapport d'import.
  • Ajout d'une route PUT pour changer ces valeurs (need_fix et fix_comment) : setValidData. Seul l'utilisateur ayant un droit U peut appeler cette route.
  • Ajout d'une route permissions pour savoir si l'utilisateur peut Update l'import (je crois que cela n'existait pas). Cela permettra de gérer les droits sur la modification de ces champs à l'étape 4 et dans le rapport d'import

Frontend :

  • Ajout d'un service gérant les permissions.
  • Ajout de la nouvelle route setValidData dans le DataService.
  • Ajout d'un composant pour la gestion des valeurs need_fix et fix_comment composé d'un slider toggle, d'un champ texte et d'un bouton "Mettre à jour".
  • Ajout de ce composant dans le composant de l'étape 4 et dans celui du rapport d'import.
  • Modification de la liste des imports :
    • La checkbox pour filtrer sur les rapports en erreur filtre maintenant sur les rapports nécessitant des corrections.
    • L'icone "Danger" apparait uniquement si le rapport nécessite des corrections.

Quelques captures (mon thème GeoNature est bleu)

Etape 4 : image
Rapport d'import :
image
Liste d'imports :
import_list

@mvergez mvergez marked this pull request as ready for review December 21, 2021 16:43
@DonovanMaillard DonovanMaillard merged commit bd9a4b9 into PnX-SI:project-FLA_NS Dec 30, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants