-
Notifications
You must be signed in to change notification settings - Fork 23
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
Dev suivi eolien rebased on develop #238
Dev suivi eolien rebased on develop #238
Conversation
5be029d
to
ae84016
Compare
0a4bf79
to
672d184
Compare
2850df2
to
1738b78
Compare
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.
Première relecture des révisions
) | ||
op.execute(statement) | ||
|
||
# Drop column id_module |
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.
Si il y a des modules installées avec des vues d'export qui utilisent id_module
sqlalchemy.exc.InternalError: (psycopg2.errors.DependentObjectsStillExist) cannot drop column id_module of table gn_monitoring.t_site_complements because other objects depend on it
A voir faire une note de version où gérer automatiquement la suppression des vues
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 ça marche je me le note dans un fichier de doc (en mettant note de version)
"bib_type_site", | ||
"Table de définition des champs associés aux types de sites", | ||
schema=monitorings_schema, | ||
) |
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.
Peupler la table avec les valeurs déjà présentes dans t_base_sites
INSERT INTO gn_monitoring.bib_type_site AS bts (id_nomenclature_type_site)
SELECT DISTINCT id_nomenclature_type_site
FROM gn_monitoring.t_base_sites AS tbs ;
"cor_type_site", | ||
"Table d'association entre les sites et les types de sites", | ||
schema=monitorings_schema, | ||
) |
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.
Peupler les données
INSERT INTO gn_monitoring.cor_type_site
SELECT id_nomenclature_type_site , id_base_site d
FROM gn_monitoring.t_base_sites ;
nullable=False, | ||
), | ||
sa.PrimaryKeyConstraint("id_type_site", "id_module", name="pk_cor_module_type"), | ||
schema=monitorings_schema, |
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.
upgrade data
INSERT INTO gn_monitoring.cor_module_type (id_module, id_type_site )
SELECT DISTINCT csm.id_module, cts.id_type_site
FROM gn_monitoring.cor_site_module AS csm
JOIN gn_monitoring.cor_type_site AS cts
ON Cts.id_base_site = csm.id_base_site ;
backend/gn_module_monitoring/migrations/e78003460441_correction_t_observation_detail.py
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,36 @@ | |||
"""add_observers_txt_column_t_base_visit | |||
|
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.
Doit être réalisé dans GN2 concomitamment avec le model
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.
Concernant cette revision observers_txt" , tu dis que c'est coté GN ? Ca serait donc une revision avec un "depends_on" sur la premièe révision de la branche alembic monitorings ?
412f459
to
9906bf8
Compare
name=f"fk_{table}_{column}", | ||
onupdate="CASCADE", | ||
), | ||
nullable=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.
la colonne ne peut avoir la contrainte NOT NULL car il y a des données saisies et il n'est pas possible à 100% de retrouver l'id_digitizer
name=f"fk_{table}_{column}", | ||
onupdate="CASCADE", | ||
), | ||
nullable=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.
avant de rendre la colonne NOT NULL il faut peupler les données existantes à partir des visites
6c544bc
to
462d408
Compare
Welcome to Codecov 🎉Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment. Thanks for integrating Codecov - We've got you covered ☂️ |
return query | ||
|
||
|
||
def geojson_query(subquery) -> bytes: |
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.
Cette fonction ne peut pas fonctionner avec postgis < 3.0.0. Hors actuellement debian 10 est toujours supporté avec postgresql 11 et postgis 2.5
commit 70b0139 Author: Maxime Vergez <[email protected]> Date: Tue Dec 6 15:22:56 2022 +0100 style: apply black commit 2badedf Author: Maxime Vergez <[email protected]> Date: Tue Dec 6 15:11:41 2022 +0100 chore(db): removed unused import commit 57d9b52 Author: Maxime Vergez <[email protected]> Date: Tue Dec 6 14:47:48 2022 +0100 feat(db): improved & finished downgrade func commit 211780f Author: Maxime Vergez <[email protected]> Date: Tue Dec 6 09:32:12 2022 +0100 feat(db): wip: add upgrade and began downgrade Downgrade migration need a little bit more work due to the use of sql alchemy and not plain text sql commit 0b5a3b8 Author: Maxime Vergez <[email protected]> Date: Mon Dec 5 11:40:32 2022 +0100 feat: packaged module
Squashed commit of the following: commit 2bdc22a Author: Maxime Vergez <[email protected]> Date: Fri Dec 9 14:59:31 2022 +0100 chore: changed json_schema into config commit 4279389 Author: Maxime Vergez <[email protected]> Date: Tue Dec 6 18:37:41 2022 +0100 feat(db): add foreign key from site to cat From t_base_sites to bib_categorie_site commit 5cb5dfa Author: Maxime Vergez <[email protected]> Date: Tue Dec 6 16:47:27 2022 +0100 feat(api): add admin interface commit 559a0ec Author: Maxime Vergez <[email protected]> Date: Tue Dec 6 16:46:27 2022 +0100 feat(db): add bib_categorie_site table Add migration and model
* feat(api): wip began add site routes + tests With site categories Also add tests * feat(api): add more routes * test(api): add tests and fixtures * style(api): applied black * feat(db): add migration to remove id_module Column in t_sites_groups * refactor(api): move utils for routes from sites * feat(api): wip: add sites groups route * test(api): wip: begin adding fixture site_groups * fix: remove id_module in all models * chore: rename route for better consistency * tests: moved site_groups in tests and add tests * chore(api): applied black * refactor(api): add filter params function And refact routes to use it
* feat(api): add association table with alembic Add model in backend and alembic migration Reviewed-by: andriac [Refs ticket]: #3 * test: WIP add test to see new relationship Adding test to see if categories are showing up when we call module Reviewed-by: andriacap [Refs ticket]: #3 * feat: add type site - categorie relation WIP - add selectfield to get type site in admin module Reviewed-by: andriac [Refs ticket]: #3 * feat(api): Flask admin and routes categories Clean code for change label list and form selectfield for the BibCategorieView in Flask Admin Add utils routes to get all subtable relationship in order to get back the label type site Review-by: andriac [Refs ticket]: #3 * refactor: remove paginate_nested For depth in as_dict() * test: fix tests due to as_dict depth * style: applied black and isort * chore: remove unused import Co-authored-by: Andria Capai <[email protected]>
* tests: make tests and fixtures work for modules By changing the way a monitoring module is created in the fixture Add two tests to check the relationship * feat(api): add categories in edit module * style: applied black
Need to set the current working directory of pytest the directory where the gn_monitoring_module repo is (so with the frontend etc.)
clean: Merge la PR move test_route Co-authored-by: Andria Capai <[email protected]>
* feat(api): remove id_module from sites_complements Co-authored-by: andriacap <[email protected]> * feat(api): create schema for sites_groups * test: add sites_group to site fixture * test: wip add test for sites_groups schemas * chore(api): remove depth parameter from paginate * test: updated to work with sites_group schema * feat: categorie site with marshmallow Test and marshmallow create/refactor to adapt for bibcategorie site paginate WIP : Adapt load_only site_type in test to "assert" same object when initiate BibCategorieSite [Refs ticket]: #3 * feat(api): route /sites/categories/id with schema Changing the route to return a dump Marshmallow schema BibCategorieSitesSchema Reviewed-by: andriac [Refs ticket]: #3 * test(api): routes get categoires label Change the "as_dict" by schema.dump in order to use the Marshmallow schema created Reviewed-by: andriac [Refs ticket]: #3 * feat(api): Sites: cols to geoserializable + schema * style(api): applied black * test(api): add test for Site Schema * style(api): applied black to test_site * refactor(api): instantiate schema once Instead of for each all() iteration * chore(api): remove useless comments * chore(api): remove useless comments and imports Co-authored-by: andriacap <[email protected]> Co-authored-by: Andria Capai <[email protected]>
To replace it with a bib nomenclature type: TYPE_SITE
* fix(api): add int conversion for limit/offset * test(api): add test for get_limit_offset * fix(api): max_per_page => per_page & test * test(api): update test with changes on schema Since marshmallow schemas, the json returned by pagination has changed for items and not sites
* feat(api): add Query Class to sites, grps & cats * feat(api): add sort and fix _get_model Via _get_entity * test(api): test sort query * feat(api): add api sort/sort_dir params To be able to sort through REST Api * fix(api): check if integer to avoid using ilike In filter_by_params * test(api): add test to check filter integer
* Merged feat/package-module-alembic commit 70b0139 Author: Maxime Vergez <[email protected]> Date: Tue Dec 6 15:22:56 2022 +0100 style: apply black commit 2badedf Author: Maxime Vergez <[email protected]> Date: Tue Dec 6 15:11:41 2022 +0100 chore(db): removed unused import commit 57d9b52 Author: Maxime Vergez <[email protected]> Date: Tue Dec 6 14:47:48 2022 +0100 feat(db): improved & finished downgrade func commit 211780f Author: Maxime Vergez <[email protected]> Date: Tue Dec 6 09:32:12 2022 +0100 feat(db): wip: add upgrade and began downgrade Downgrade migration need a little bit more work due to the use of sql alchemy and not plain text sql commit 0b5a3b8 Author: Maxime Vergez <[email protected]> Date: Mon Dec 5 11:40:32 2022 +0100 feat: packaged module * Feat/edit categories module (#19) * tests: make tests and fixtures work for modules By changing the way a monitoring module is created in the fixture Add two tests to check the relationship * feat(api): add categories in edit module * style: applied black * fix(config): changed categories into items Following the change with marshmallow schemas
e2f21c9
to
d3a81d2
Compare
Basé sur les retours de Camille, Amandine et MNHN Reviewed-by: andriac
Reviewed-by: andriacap
Reset specific field when quit form component (entrance through site) Reviewed-by: andriac
Load permission on 'ALL' for modules error . Change to precise object visit permission Reviewed-by: andriac
Reviewed-by: andriacap
Reviewed-by: andriac
Manage geometry site group (load, reload, on cancel, manage layer etc) (entrance through site) Reviewed-by: andriac
Allow user to create and edit geometry for site group Case : - site group with child --> if no geom created, geometry is calculated --> if geom created you can edit this geom - site group without child --> geom can be null (otherwise it's possible to create geom) - Remove console.log Reviewed-by: andriacap
Add message about geometry site group to infomr user that the current geometry is calculated based on site group's child Reviewed-by: andriacap
Error on check id_organism compare to organism actor Reviewed-by: andriacap
Creation d'un nouveau fichier pour expliquer l'entrée par groupe de site et site Modification de la présentation du module monitoring Modification du paragraphe de Permissions Ajout d'images descriptives Reviewed-by: andriacap
Add part to explain link between type site field in edit and creation site form Reviewed-by: andriacap
- Fix bug changeActiveTab - Add displaying conditional site group geometry through protocol Reviewed-by: andriacap
Reviewed-by: andriacap
Error when using docker build Reviewed-by: andriacap
Reviewed-by: andriacap
606d08c
to
9e9878e
Compare
Cette branche a été rebase par rapport à la branche
branche
develop de https://github.com/PnX-SI/gn_module_monitoring . Et a été installé sur le GN 2.13.0-beta1 (branche develop dernier commit : PnX-SI/GeoNature@652a7fd7b )L'état de la PR est pour le moment en draft , car plusieurs soucis doivent être résolus :
Material Angular :
nav-tab
,nav-link
ne sont plus utilisés et doivent être remplacé parmat-tab
(voor composantmonitoring-properties
Détails des propriété des sites (composant
monitoring-datatable
, exemple l'ensemble des stations d'un circuit pour le module cheveches groupe de site):site.json
du protcole qui est chargé , tandis que lors de l'entrée par site c'est le fichiersite.Json
du dossier generci qui est chargé . Les différences entre ces deux fichiers entraine des problèmes d'affichage notamment sur les filtres.- Checker les différences entre les champs "specific" / additionnels des deux fichiers de configs pour ne pas avertr / corriger ces différences ?
- Ignorer les champs additionnels du fichier
site.json
du protocole et laisser la responsabilité d'affichage des champs additionnels liés aux types de site (associés au protocole en question)Affichage des géométries:
site.json
(voir explication ci dessus): Affichage des visites liées à un site (erreur sur les droits): voir issue [fix] Erreur de chargement de droits lors du chargement des visites lié à un site (entrée protocole) naturalsolutions/gn_module_monitoring#76 (Normalement OK dans les derniers commit de la branche develop de monitoring)
Retours sur le point réalisé avec @amandine-sahl et @joelclems :
Entrée par protocole: pouvoir à l'édition et création de site renseigner les types de site associés au protocole (voir l'utilisation de
data_utils
pour récupérer les types de site associés au module et insérer à la volé les champs specific + ajouter des attributs "hidden" en fonction du type sélectionnéEntrée par site : Rendre la possibilité d'ajouter un nouveau site sans groupe de site (mais laissé la possibilité d'ajouter le groupe de site une fois dans le formulaire)
Entrée par site : La géométrie n'est pas affichée à l'édition et à la visualisation d'un site
Rendre possible le filtre/sort du tableau sur le champ "type de site"
La liste des observers est renseigné dans le fichier de config du module moitoring et c'est celle ci qui est chargé par défault
L'enchainement des saisies avec des champs "keep" reste fonctionnel
fc90d31c677f
pour laquelle il a été ajouté des droits 'CUD' pour le module monitoring afin de pouvoir ajouter des types de site via le module Admin