From 86813cc6196ceca17959f2fa7f643ef293115257 Mon Sep 17 00:00:00 2001 From: Etienne Delclaux Date: Fri, 4 Oct 2024 12:39:12 +0200 Subject: [PATCH] feat: change "species_sheet" to "taxon_sheet" --- backend/geonature/core/gn_synthese/routes.py | 6 +++--- backend/geonature/utils/config_schema.py | 8 ++++---- config/default_config.toml.example | 8 ++++---- .../form/synthese-form/synthese-data.service.ts | 4 ++-- .../syntheseModule/taxon-sheet/taxon-sheet.component.ts | 2 +- .../taxon-sheet/taxon-sheet.route.service.ts | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/backend/geonature/core/gn_synthese/routes.py b/backend/geonature/core/gn_synthese/routes.py index c42c65711f..8e8d86a3d9 100644 --- a/backend/geonature/core/gn_synthese/routes.py +++ b/backend/geonature/core/gn_synthese/routes.py @@ -957,11 +957,11 @@ def general_stats(permissions): return data -@routes.route("/species_stats/", methods=["GET"]) +@routes.route("/taxon_stats/", methods=["GET"]) @permissions.check_cruved_scope("R", get_scope=True, module_code="SYNTHESE") @json_resp -def species_stats(scope, cd_ref): - """Return stats about distinct species.""" +def taxon_stats(scope, cd_ref): + """Return stats about distinct taxon""" area_type = request.args.get("area_type") diff --git a/backend/geonature/utils/config_schema.py b/backend/geonature/utils/config_schema.py index 021f98da7b..ad5e00ad48 100644 --- a/backend/geonature/utils/config_schema.py +++ b/backend/geonature/utils/config_schema.py @@ -271,9 +271,9 @@ class ExportObservationSchema(Schema): geojson_local_field = fields.String(load_default="geojson_local") -class SpeciesSheet(Schema): +class TaxonSheet(Schema): # -------------------------------------------------------------------- - # SYNTHESE - SPECIES_SHEET + # SYNTHESE - TAXON_SHEET ENABLE_PROFILE = fields.Boolean(load_default=True) ENABLE_TAXONOMY = fields.Boolean(load_default=True) @@ -433,8 +433,8 @@ class Synthese(Schema): BLUR_SENSITIVE_OBSERVATIONS = fields.Boolean(load_default=True) # -------------------------------------------------------------------- - # SYNTHESE - SPECIES_SHEET - SPECIES_SHEET = fields.Nested(SpeciesSheet, load_default=SpeciesSheet().load({})) + # SYNTHESE - TAXON_SHEET + TAXON_SHEET = fields.Nested(TaxonSheet, load_default=TaxonSheet().load({})) @pre_load def warn_deprecated(self, data, **kwargs): diff --git a/config/default_config.toml.example b/config/default_config.toml.example index 36f75ac331..ac51cb9973 100644 --- a/config/default_config.toml.example +++ b/config/default_config.toml.example @@ -441,11 +441,11 @@ MEDIA_CLEAN_CRONTAB = "0 1 * * *" # Seulement les données de présence cd_nomenclature_observation_status = ['Pr'] - [SYNTHESE.SPECIES_SHEET] - # Options dédiées à la fiche espèce - #Permet d'activer ou non la section "Profile" de la fiche espèce + [SYNTHESE.TAXON_SHEET] + # Options dédiées à la fiche taxon + # Permet d'activer ou non la section "Profile" ENABLE_PROFILE = True - # Permet d'activer ou non la section "Taxonomy" de la fiche espèce + # Permet d'activer ou non la section "Taxonomy" ENABLE_TAXONOMY = True # Gestion des demandes d'inscription diff --git a/frontend/src/app/GN2CommonModule/form/synthese-form/synthese-data.service.ts b/frontend/src/app/GN2CommonModule/form/synthese-form/synthese-data.service.ts index 85ec1862c1..0b1d451403 100644 --- a/frontend/src/app/GN2CommonModule/form/synthese-form/synthese-data.service.ts +++ b/frontend/src/app/GN2CommonModule/form/synthese-form/synthese-data.service.ts @@ -55,8 +55,8 @@ export class SyntheseDataService { return this._api.get(`${this.config.API_ENDPOINT}/synthese/general_stats`); } - getSyntheseSpeciesSheetStat(cd_ref: number, areaType: string = 'COM') { - return this._api.get(`${this.config.API_ENDPOINT}/synthese/species_stats/${cd_ref}`, { + getSyntheseTaxonSheetStat(cd_ref: number, areaType: string = 'COM') { + return this._api.get(`${this.config.API_ENDPOINT}/synthese/taxon_stats/${cd_ref}`, { params: new HttpParams().append('area_type', areaType), }); } diff --git a/frontend/src/app/syntheseModule/taxon-sheet/taxon-sheet.component.ts b/frontend/src/app/syntheseModule/taxon-sheet/taxon-sheet.component.ts index a17055c723..e665ee7aef 100644 --- a/frontend/src/app/syntheseModule/taxon-sheet/taxon-sheet.component.ts +++ b/frontend/src/app/syntheseModule/taxon-sheet/taxon-sheet.component.ts @@ -91,7 +91,7 @@ export class TaxonSheetComponent implements OnInit { const cd_ref = params['cd_ref']; if (cd_ref) { this._tss.updateTaxonByCdRef(cd_ref); - this._syntheseDataService.getSyntheseSpeciesSheetStat(cd_ref).subscribe((stats) => { + this._syntheseDataService.getSyntheseTaxonSheetStat(cd_ref).subscribe((stats) => { this.setIndicators(stats); }); } diff --git a/frontend/src/app/syntheseModule/taxon-sheet/taxon-sheet.route.service.ts b/frontend/src/app/syntheseModule/taxon-sheet/taxon-sheet.route.service.ts index 054cf2c944..b045a9e1c2 100644 --- a/frontend/src/app/syntheseModule/taxon-sheet/taxon-sheet.route.service.ts +++ b/frontend/src/app/syntheseModule/taxon-sheet/taxon-sheet.route.service.ts @@ -48,8 +48,8 @@ export class RouteService implements CanActivateChild { private _config: ConfigService, private _router: Router ) { - if (this._config['SYNTHESE']?.['SPECIES_SHEET']) { - const config = this._config['SYNTHESE']['SPECIES_SHEET']; + if (this._config['SYNTHESE']?.['TAXON_SHEET']) { + const config = this._config['SYNTHESE']['TAXON_SHEET']; this.TAB_LINKS = ALL_TAXON_SHEET_ADVANCED_INFOS_ROUTES.filter( (tab) => !tab.configEnabledField || config[tab.configEnabledField] );