Skip to content

Commit

Permalink
feat: change "species_sheet" to "taxon_sheet"
Browse files Browse the repository at this point in the history
  • Loading branch information
edelclaux committed Oct 4, 2024
1 parent 176870e commit 86813cc
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions backend/geonature/core/gn_synthese/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,11 +957,11 @@ def general_stats(permissions):
return data


@routes.route("/species_stats/<int:cd_ref>", methods=["GET"])
@routes.route("/taxon_stats/<int:cd_ref>", 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")

Expand Down
8 changes: 4 additions & 4 deletions backend/geonature/utils/config_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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):
Expand Down
8 changes: 4 additions & 4 deletions config/default_config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export class SyntheseDataService {
return this._api.get<any>(`${this.config.API_ENDPOINT}/synthese/general_stats`);
}

getSyntheseSpeciesSheetStat(cd_ref: number, areaType: string = 'COM') {
return this._api.get<any>(`${this.config.API_ENDPOINT}/synthese/species_stats/${cd_ref}`, {
getSyntheseTaxonSheetStat(cd_ref: number, areaType: string = 'COM') {
return this._api.get<any>(`${this.config.API_ENDPOINT}/synthese/taxon_stats/${cd_ref}`, {
params: new HttpParams().append('area_type', areaType),
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
);
Expand Down

0 comments on commit 86813cc

Please sign in to comment.