Skip to content

Commit

Permalink
Fix: remove all references to old status and red lists
Browse files Browse the repository at this point in the history
Also, remove dead code.
Use TaxHub dependency for "taxonomie" schema models.

Resolve #1492.
  • Loading branch information
jpm-cbna authored and bouttier committed Dec 2, 2022
1 parent 0b91c8c commit 7c6d20d
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 95 deletions.
3 changes: 1 addition & 2 deletions backend/geonature/core/gn_profiles/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
VmValidProfiles,
VConsistancyData,
)
from geonature.core.taxonomie.models import Taxref, VMTaxrefListForautocomplete
from geonature.utils.env import DB

routes = Blueprint("gn_profiles", __name__, cli_group="profiles")
Expand Down Expand Up @@ -249,7 +248,7 @@ def get_observation_score():
{
"type": "life_stage",
"value": f"""
Le taxon n'a jamais été observé à cette periode et à cette altitude ({altitude_min}-{altitude_max}m)
Le taxon n'a jamais été observé à cette periode et à cette altitude ({altitude_min}-{altitude_max}m)
pour le stade de vie {life_stage_value.label_default}""",
}
)
Expand Down
9 changes: 0 additions & 9 deletions backend/geonature/core/gn_synthese/utils/query_select_sqla.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from geoalchemy2.shape import from_shape

from geonature.utils.env import DB
from geonature.core.taxonomie.models import TaxrefLR
from geonature.core.gn_synthese.models import (
CorObserverSynthese,
CorAreaSynthese,
Expand Down Expand Up @@ -194,14 +193,6 @@ def filter_taxonomy(self):
Taxref.id_habitat.in_(self.filters.pop("taxonomy_id_hab"))
)

if "taxonomy_lr" in self.filters:
sub_query_lr = select([TaxrefLR.cd_nom]).where(
TaxrefLR.id_categorie_france.in_(self.filters.pop("taxonomy_lr"))
)
# TODO est-ce qu'il faut pas filtrer sur le cd_ ref ?
# quid des protection définit à rang superieur de la saisie ?
self.query = self.query.where(self.model.cd_nom.in_(sub_query_lr))

aliased_cor_taxon_attr = {}
for colname, value in self.filters.items():
if colname.startswith("taxhub_attribut"):
Expand Down
53 changes: 0 additions & 53 deletions backend/geonature/core/taxonomie/models.py

This file was deleted.

2 changes: 1 addition & 1 deletion backend/geonature/tests/test_gn_profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
VSyntheseForProfiles,
)
from geonature.core.gn_synthese.models import Synthese
from geonature.core.taxonomie.models import Taxref
from apptax.taxonomie.models import Taxref


from .fixtures import *
Expand Down
4 changes: 0 additions & 4 deletions frontend/src/app/GN2CommonModule/form/data-form.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,6 @@ export class DataFormService {
return this._http.get<any>(`${AppConfig.API_TAXHUB}/bibattributs/`);
}

getTaxonomyLR() {
return this._http.get<any>(`${AppConfig.API_TAXHUB}/taxref/bib_lr`);
}

getTaxonomyHabitat() {
return this._http.get<any>(`${AppConfig.API_TAXHUB}/taxref/bib_habitats`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export class TaxonAdvancedStoreService {
public taxonTreeState: any;
public taxhubAttributes: any;
public formBuilded: boolean;
public taxonomyLR: Array<any>;
public taxonomyHab: Array<any>;
public taxonomyGroup2Inpn: Array<any>;
public redListsValues: any = {};
Expand Down Expand Up @@ -73,11 +72,7 @@ export class TaxonAdvancedStoreService {
});
this.formBuilded = true;
});
// Load LR, habitat and group2inpn
this._dataService.getTaxonomyLR().subscribe((data) => {
this.taxonomyLR = data;
});

// Load habitat and group2inpn
this._dataService.getTaxonomyHabitat().subscribe((data) => {
this.taxonomyHab = data;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,6 @@ <h5>Listes rouges</h5>

<div *ngIf="storeService.formBuilded">
<h5>Attributs TaxRef</h5>
<div class="form-group">
<pnx-multiselect
[values]="storeService.taxonomyLR"
[parentFormControl]="formService.searchForm.controls.taxonomy_lr"
keyLabel="nom_categorie_lr"
keyValue="id_categorie_france"
label="Liste rouge UICN"
(onChange)="onTaxRefAttributsSelected($event)"
(onDelete)="onTaxRefAttributsDeleted($event.id_categorie_france)"
>
</pnx-multiselect>
</div>

<div class="form-group">
<pnx-multiselect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</button>
</div>

<mat-card
<mat-card>
class="modal-body"
*ngIf="idSynthese && alertOpen"
>
Expand Down
7 changes: 0 additions & 7 deletions frontend/src/app/syntheseModule/services/store.service.ts

This file was deleted.

0 comments on commit 7c6d20d

Please sign in to comment.