Skip to content

Conversation

@VincentCauchois
Copy link
Member

@VincentCauchois VincentCauchois commented Oct 1, 2025

Dans la continuité des travaux de #1363 qui avaient notamment permis la gestion des champs additionnels en BDD et l'implémentation pour le module OCCTAX.

@VincentCauchois VincentCauchois self-assigned this Oct 1, 2025
@VincentCauchois VincentCauchois added enhancement généricité database SQL frontend backend javascript Pull requests that update Javascript code python Pull requests that update Python code labels Oct 1, 2025
@VincentCauchois VincentCauchois changed the title [METADATA][ADDITIONAL_FIELDS] Implémentation du système de champs additionels pour les cadres d'acquisition [METADATA][ADDITIONAL_FIELDS] Implémentation du système de champs additionnels pour les cadres d'acquisition Oct 1, 2025
@codecov
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.59%. Comparing base (a8f3906) to head (a04326e).
⚠️ Report is 11 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3744      +/-   ##
===========================================
+ Coverage    84.48%   84.59%   +0.10%     
===========================================
  Files          133      133              
  Lines        10361    10374      +13     
===========================================
+ Hits          8754     8776      +22     
+ Misses        1607     1598       -9     
Flag Coverage Δ
pytest 84.59% <100.00%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@VincentCauchois VincentCauchois force-pushed the feat/add-additional-data-fields-for-metadata branch 2 times, most recently from 598330d to 31278cb Compare October 1, 2025 16:38
Copy link
Contributor

@jacquesfize jacquesfize left a comment

Choose a reason for hiding this comment

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

Ca me semble bien dans le fonctionnement ! En plus, ça montre que le système de champs additionnels s'intègre facilement côté backend mais aussi frontend !

Toutefois, la création d'une nouvelle colonne est à mon sens inutile car une colonne existante a été créée à ce dessin #3422. Il faudra aussi ajouter des tests côtés backend pour tester les champs additionnels.

Enfin, quelques broutilles sur les choix de nommages.

@jacquesfize jacquesfize added this to the 2.17.0 milestone Oct 2, 2025
@jacquesfize jacquesfize mentioned this pull request Oct 2, 2025
13 tasks
@VincentCauchois VincentCauchois force-pushed the feat/add-additional-data-fields-for-metadata branch 3 times, most recently from 53aff95 to 5f9ac34 Compare October 2, 2025 13:40
@VincentCauchois VincentCauchois force-pushed the feat/add-additional-data-fields-for-metadata branch from 5f9ac34 to 53add31 Compare October 3, 2025 08:20
@camillemonchicourt
Copy link
Member

En effet, le champs additional_data qui a été ajouté récemment dans les tables de métadonnées a exactement cette vocation.
L'appellation additional_fields qui a été utilisée dans Occtax est un peu divergente et nous a échappé à l'époque, mais me semble moins pertinente.
Donc si il y avait un truc à faire, cela serait, il me semble, de renommer les champs additional_fields des tables Occtax en additional_data.
Car on y stocke des données additionnelles, pas des champs additionnels, et donc ça apporte de la confusion avec la table gn_commons.t_additional_fields qui elle contient bien la définition des champs additionnels.

@VincentCauchois VincentCauchois force-pushed the feat/add-additional-data-fields-for-metadata branch from 53add31 to ec22f56 Compare October 3, 2025 08:33
@VincentCauchois
Copy link
Member Author

En effet, le champs additional_data qui a été ajouté récemment dans les tables de métadonnées a exactement cette vocation. L'appellation additional_fields qui a été utilisée dans Occtax est un peu divergente et nous a échappé à l'époque, mais me semble moins pertinente. Donc si il y avait un truc à faire, cela serait, il me semble, de renommer les champs additional_fields des tables Occtax en additional_data. Car on y stocke des données additionnelles, pas des champs additionnels, et donc ça apporte de la confusion avec la table gn_commons.t_additional_fields qui elle contient bien la définition des champs additionnels.

Ok, je comprends mieux, merci pour l'explication !

Features:
- AF additional fields: able define additional fields, for acquisition frameworks, from GN backoffice admin: add an object 'METADATA_CADRE_ACQUISITION' in `gn_permissions.t_objects` that can be used, through GN config
  - Set by default in GN config this new object and the module 'METADATA' as implemented for additional fields // `config_schema.py`
- AF form: able provide additional data, based on configured additional fields, in create-or-update acquisition framework form
- AF card: display additional data, based on configured additional fields, in acquisition framework card
- Default config example:
  - Complete `default_config.toml.example` with missing section `[ADDITIONAL_FIELDS]`

Informations:
- Use existing field `gn_meta.t_acquisition_frameworks.additional_data`

Ref #2745
@VincentCauchois VincentCauchois force-pushed the feat/add-additional-data-fields-for-metadata branch from ec22f56 to d2c6c74 Compare October 3, 2025 12:45
Add additional_data to the acquisition framework "af_1" so as to cover additional_data section in endpoint "gn_meta.get_export_pdf_acquisition_frameworks", through existing test function `test_get_export_pdf_acquisition_frameworks`
@VincentCauchois VincentCauchois force-pushed the feat/add-additional-data-fields-for-metadata branch from 48110b7 to f52121a Compare October 7, 2025 14:56
Add tests and modify an existing one to add coverage for "gn_commons._get_additional_fields" function:
- Filter-by-`id_dataset`-parameter code
- Filter-by-`object_code`-parameter code, for when it the parameter a strictly-longer-than-1-list
@VincentCauchois VincentCauchois force-pushed the feat/add-additional-data-fields-for-metadata branch from f52121a to d45eff1 Compare October 7, 2025 15:57
Copy link
Contributor

@jacquesfize jacquesfize left a comment

Choose a reason for hiding this comment

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

Encore quelques trucs mais on est bien :)

@VincentCauchois VincentCauchois force-pushed the feat/add-additional-data-fields-for-metadata branch from 531b47f to aa8d430 Compare October 13, 2025 15:48
@VincentCauchois VincentCauchois marked this pull request as draft October 13, 2025 17:16
@VincentCauchois VincentCauchois force-pushed the feat/add-additional-data-fields-for-metadata branch 3 times, most recently from d814159 to c2e6e46 Compare October 14, 2025 16:56
@VincentCauchois VincentCauchois force-pushed the feat/add-additional-data-fields-for-metadata branch from 56b0974 to 7bea1a8 Compare October 30, 2025 14:47
@VincentCauchois VincentCauchois force-pushed the feat/add-additional-data-fields-for-metadata branch from 7bea1a8 to 81757f0 Compare October 30, 2025 14:58
@VincentCauchois VincentCauchois force-pushed the feat/add-additional-data-fields-for-metadata branch from a54915d to b2be7a7 Compare October 31, 2025 14:08
Copy link
Contributor

@jacquesfize jacquesfize left a comment

Choose a reason for hiding this comment

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

Les tests frontends échouent. Pas sur de la nouvelle branche pour les champs additionnels... il y a peut-être une stratégie plus importante sur la ou les branches dédiées aux tests E2E. A discuter.

Sinon, fonctionnellement ça marche bien de mon côté.

geonature install-gn-module contrib/gn_module_occhab OCCHAB --build=false --upgrade-db=false
geonature install-gn-module contrib/gn_module_validation VALIDATION --build=false --upgrade-db=false
geonature db upgrade occtax-samples-test@head
geonature db upgrade cypress-samples-test@head
Copy link
Contributor

Choose a reason for hiding this comment

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

ça pose question... pourquoi ne pas ajouter aussi occhab-samples@head, import-samples@head dans le depends on ? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend database enhancement frontend généricité javascript Pull requests that update Javascript code python Pull requests that update Python code SQL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants