diff --git a/backend/geonature/utils/config_schema.py b/backend/geonature/utils/config_schema.py index 1e83119c8e..4d21312bba 100644 --- a/backend/geonature/utils/config_schema.py +++ b/backend/geonature/utils/config_schema.py @@ -280,6 +280,7 @@ class TaxonSheet(Schema): # -------------------------------------------------------------------- # SYNTHESE - TAXON_SHEET ENABLE_PROFILE = fields.Boolean(load_default=True) + ENABLE_TAXONOMY = fields.Boolean(load_default=True) class Synthese(Schema): diff --git a/config/default_config.toml.example b/config/default_config.toml.example index 3e3418b622..012c784109 100644 --- a/config/default_config.toml.example +++ b/config/default_config.toml.example @@ -445,6 +445,8 @@ MEDIA_CLEAN_CRONTAB = "0 1 * * *" # 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" + ENABLE_TAXONOMY = true # Gestion des demandes d'inscription [ACCOUNT_MANAGEMENT] diff --git a/frontend/src/app/GN2CommonModule/GN2Common.module.ts b/frontend/src/app/GN2CommonModule/GN2Common.module.ts index 6cd8392c2d..a3d13c0a1c 100644 --- a/frontend/src/app/GN2CommonModule/GN2Common.module.ts +++ b/frontend/src/app/GN2CommonModule/GN2Common.module.ts @@ -40,6 +40,7 @@ import { AreasIntersectedComponent } from './form/areas-intersected/areas-inters import { AutoCompleteComponent } from '@geonature_common/form/autocomplete/autocomplete.component'; import { ConfirmationDialog } from '@geonature_common/others/modal-confirmation/confirmation.dialog'; import { DatalistComponent } from '@geonature_common/form/datalist/datalist.component'; +import { BadgeComponent } from '@geonature_common/others/badge/badge.component'; import { BreadcrumbsComponent } from '@geonature_common/others/breadcrumbs/breadcrumbs.component'; import { DatasetsComponent } from './form/datasets/datasets.component'; import { DateComponent } from './form/date/date.component'; @@ -74,6 +75,7 @@ import { ObserversTextComponent } from '@geonature_common/form/observers-text/ob import { PeriodComponent } from '@geonature_common/form/date/period.component'; import { PlacesComponent } from './map/places/places.component'; import { PlacesListComponent } from './map/placesList/placesList.component'; +import { StatusBadgesComponent } from '@geonature_common/others/status-badges/status-badges.component'; import { SyntheseSearchComponent } from '@geonature_common/form/synthese-form/synthese-form.component'; import { TaxaComponent } from '@geonature_common/form/taxa/taxa.component'; import { TaxonAdvancedModalComponent } from '@geonature_common/form/synthese-form/advanced-form/synthese-advanced-form-component'; @@ -141,6 +143,7 @@ import { TaxonTreeComponent } from './form/taxon-tree/taxon-tree.component'; AreasComponent, NomenclatureComponent, ObserversComponent, + BadgeComponent, BreadcrumbsComponent, DateComponent, TaxonomyComponent, @@ -185,6 +188,7 @@ import { TaxonTreeComponent } from './form/taxon-tree/taxon-tree.component'; SafeHtmlPipe, SyntheseSearchComponent, SafeStripHtmlPipe, + StatusBadgesComponent, StripHtmlPipe, TaxaComponent, TaxonAdvancedModalComponent, @@ -208,6 +212,7 @@ import { TaxonTreeComponent } from './form/taxon-tree/taxon-tree.component'; AcquisitionFrameworksComponent, AreasComponent, MunicipalitiesComponent, + BadgeComponent, BreadcrumbsComponent, DynamicFormComponent, NomenclatureComponent, @@ -288,6 +293,7 @@ import { TaxonTreeComponent } from './form/taxon-tree/taxon-tree.component'; ReactiveFormsModule, ReadablePropertiePipe, SafeHtmlPipe, + StatusBadgesComponent, TaxaComponent, TaxonAdvancedModalComponent, TaxonomyComponent, diff --git a/frontend/src/app/GN2CommonModule/form/data-form.service.ts b/frontend/src/app/GN2CommonModule/form/data-form.service.ts index f144c9006b..dd05134246 100644 --- a/frontend/src/app/GN2CommonModule/form/data-form.service.ts +++ b/frontend/src/app/GN2CommonModule/form/data-form.service.ts @@ -159,6 +159,10 @@ export class DataFormService { }); } + fetchStatusSymbology() { + return this._http.get(`${this.getTaxhubAPI()}/bdc_statuts/status_symbologies`); + } + getTaxaBibList() { return this._http.get(`${this.getTaxhubAPI()}/biblistes/`).pipe(map((d) => d.data)); } diff --git a/frontend/src/app/GN2CommonModule/form/taxonomy/taxonomy.component.ts b/frontend/src/app/GN2CommonModule/form/taxonomy/taxonomy.component.ts index 40281d85f6..dc3ca24f40 100644 --- a/frontend/src/app/GN2CommonModule/form/taxonomy/taxonomy.component.ts +++ b/frontend/src/app/GN2CommonModule/form/taxonomy/taxonomy.component.ts @@ -35,7 +35,7 @@ export interface Taxon { nom_vern?: string; ordre?: string; phylum?: string; - statuts_protection?: any[]; + status?: any[]; synonymes?: any[]; } diff --git a/frontend/src/app/GN2CommonModule/others/badge/badge.component.html b/frontend/src/app/GN2CommonModule/others/badge/badge.component.html new file mode 100644 index 0000000000..7d5af3e2c3 --- /dev/null +++ b/frontend/src/app/GN2CommonModule/others/badge/badge.component.html @@ -0,0 +1,7 @@ + + {{ text }} + diff --git a/frontend/src/app/GN2CommonModule/others/badge/badge.component.scss b/frontend/src/app/GN2CommonModule/others/badge/badge.component.scss new file mode 100644 index 0000000000..2a48c04202 --- /dev/null +++ b/frontend/src/app/GN2CommonModule/others/badge/badge.component.scss @@ -0,0 +1,15 @@ +.badge { + --bgColor: #ffffff; // Default value + --textColor: #444; // Default value + + display: flex; + flex-flow: row nowrap; + white-space: nowrap; + gap: 0.25rem; + text-transform: uppercase; + font-weight: bold; + + background-color: var(--bgColor); + border: 2px solid color-mix(in srgb, var(--bgColor) 80%, black); + color: var(--textColor); +} diff --git a/frontend/src/app/GN2CommonModule/others/badge/badge.component.ts b/frontend/src/app/GN2CommonModule/others/badge/badge.component.ts new file mode 100644 index 0000000000..1138911743 --- /dev/null +++ b/frontend/src/app/GN2CommonModule/others/badge/badge.component.ts @@ -0,0 +1,66 @@ +import { Component, Input } from '@angular/core'; + +// //////////////////////////////////////////////////////////////////////////// +// helper method +// //////////////////////////////////////////////////////////////////////////// + +function isHexadecimalColor(color: string) { + return /^#[0-9A-F]{6}$/i.test(color); +} + +function computeContrastColor(backgroundColor: string) { + // Convertir la couleur en un format RGB + const r = parseInt(backgroundColor.slice(1, 3), 16); + const g = parseInt(backgroundColor.slice(3, 5), 16); + const b = parseInt(backgroundColor.slice(5, 7), 16); + + // Calculer la luminosité + const luminance = 0.299 * r + 0.587 * g + 0.114 * b; + + // Retourner une couleur claire ou foncée selon la luminosité + return luminance < 128 ? '#ffffff' : '#444'; +} + +function colorToCSS(color: string) { + return `--bgColor: ${color}; --textColor: ${computeContrastColor(color)};`; +} + +// //////////////////////////////////////////////////////////////////////////// +// Badge parameters +// //////////////////////////////////////////////////////////////////////////// + +export interface BadgeSymbology { + color?: string; +} + +// //////////////////////////////////////////////////////////////////////////// +// helper method +// //////////////////////////////////////////////////////////////////////////// + +@Component({ + selector: 'gn-badge', + templateUrl: 'badge.component.html', + styleUrls: ['badge.component.scss'], +}) +export class BadgeComponent { + @Input() + text: string; + + @Input() + tooltip: string; + + symbologyAsCSS: string; + + @Input() + set symbology(symbology: BadgeSymbology | null) { + this.symbologyAsCSS = ''; + if (!symbology) { + return; + } + if (!isHexadecimalColor(symbology.color)) { + console.warn(`[badge] ${symbology.color} is not a valid hexadecimal color`); + return; + } + this.symbologyAsCSS = colorToCSS(symbology.color); + } +} diff --git a/frontend/src/app/GN2CommonModule/others/status-badges/status-badges.component.html b/frontend/src/app/GN2CommonModule/others/status-badges/status-badges.component.html new file mode 100644 index 0000000000..4221d6f4a6 --- /dev/null +++ b/frontend/src/app/GN2CommonModule/others/status-badges/status-badges.component.html @@ -0,0 +1,8 @@ +
+ +
diff --git a/frontend/src/app/GN2CommonModule/others/status-badges/status-badges.component.scss b/frontend/src/app/GN2CommonModule/others/status-badges/status-badges.component.scss new file mode 100644 index 0000000000..9b42867b35 --- /dev/null +++ b/frontend/src/app/GN2CommonModule/others/status-badges/status-badges.component.scss @@ -0,0 +1,7 @@ +.StatusBadges { + display: flex; + flex-flow: row wrap; + width: 100%; + gap: 0.5rem; + line-height: inherit; +} diff --git a/frontend/src/app/GN2CommonModule/others/status-badges/status-badges.component.ts b/frontend/src/app/GN2CommonModule/others/status-badges/status-badges.component.ts new file mode 100644 index 0000000000..d9c6ec47c5 --- /dev/null +++ b/frontend/src/app/GN2CommonModule/others/status-badges/status-badges.component.ts @@ -0,0 +1,83 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { TaxonSheetService } from '@geonature/syntheseModule/taxon-sheet/taxon-sheet.service'; +import { DataFormService } from '@geonature_common/form/data-form.service'; +import { Taxon } from '@geonature_common/form/taxonomy/taxonomy.component'; +import { BadgeSymbology } from '@geonature_common/others/badge/badge.component'; + +interface Status { + badge: string; + tooltip: string; + symbology: BadgeSymbology | null; +} +@Component({ + selector: 'gn-status-badges', + templateUrl: 'status-badges.component.html', + styleUrls: ['status-badges.component.scss'], +}) +export class StatusBadgesComponent implements OnInit { + _taxon: Taxon | null; + _symbology: Array<{ + types: Array; + values: Record; + }>; + status: Array = []; + + constructor(private _ds: DataFormService) {} + + ngOnInit() { + this._ds.fetchStatusSymbology().subscribe((symbology) => { + this._symbology = []; + if (!symbology || !symbology.symbologies) { + return; + } + this._symbology = symbology.symbologies; + + this.computeStatus(); + }); + } + + _getSymbologyAsBadgeSymbology(type: string, value: string): BadgeSymbology | null { + if (!this._symbology) { + return null; + } + const symbologieItem = this._symbology.find((item) => item.types.includes(type)); + if (!symbologieItem) { + return null; + } + if (!('color' in symbologieItem.values[value])) { + return null; + } + return { + color: symbologieItem.values[value].color, + }; + } + + @Input() + set taxon(taxon: Taxon | null) { + this._taxon = taxon; + this.computeStatus(); + } + + computeStatus() { + this.status = []; + if (!this._taxon) { + return; + } + + for (const status of Object.values(this._taxon.status)) { + for (const text of Object.values(status.text)) { + for (const value of Object.values(text.values)) { + const badgeValue = ['true', 'false'].includes(value.code_statut) + ? `${status.cd_type_statut}` + : `${status.cd_type_statut}: ${value.code_statut}`; + + this.status.push({ + badge: badgeValue, + tooltip: `${status.cd_type_statut} : ${value.display} - ${text.full_citation}`, + symbology: this._getSymbologyAsBadgeSymbology(status.cd_type_statut, value.code_statut), + }); + } + } + } + } +} diff --git a/frontend/src/app/shared/syntheseSharedModule/synthese-info-obs/taxonomy/taxonomy.component.html b/frontend/src/app/shared/syntheseSharedModule/synthese-info-obs/taxonomy/taxonomy.component.html new file mode 100644 index 0000000000..d3350df06b --- /dev/null +++ b/frontend/src/app/shared/syntheseSharedModule/synthese-info-obs/taxonomy/taxonomy.component.html @@ -0,0 +1,86 @@ +
+
Classification
+ + + + + + + + + + + + + + + +
Groupe taxonomique{{ taxon?.classe }}
Ordre{{ taxon?.ordre }}
Famille + {{ taxon?.famille }} +
+ + + +
Statuts
+ + + + + + + + + +
{{ status.value.display }}
+
    +
  • + + +
    + ({{ text.value.lb_adm_tr }} - {{ text.value.cd_sig }}) +
    + + Voir / Télécharger + + +
  • +
  • + + + {{ value.value.code_statut }} + + {{ value.value.label_statut }} + {{ value.value.rq_statut }} + +
  • +
+
+

Aucun

+
diff --git a/frontend/src/app/shared/syntheseSharedModule/synthese-info-obs/taxonomy/taxonomy.component.scss b/frontend/src/app/shared/syntheseSharedModule/synthese-info-obs/taxonomy/taxonomy.component.scss new file mode 100644 index 0000000000..2ad0c2cd00 --- /dev/null +++ b/frontend/src/app/shared/syntheseSharedModule/synthese-info-obs/taxonomy/taxonomy.component.scss @@ -0,0 +1,23 @@ +.Taxonomy { + display: flex; + flex-flow: column; + justify-content: flex-start; + row-gap: 0.5rem; + + &__subtitle { + text-decoration: underline; + text-decoration-color: currentColor; + text-underline-offset: 0.4rem; + text-decoration-thickness: 2px; + } + .Classification { + &__name { + font-weight: bold; + white-space: nowrap; + } + &__value { + width: 100%; + padding-left: 1rem; + } + } +} diff --git a/frontend/src/app/shared/syntheseSharedModule/synthese-info-obs/taxonomy/taxonomy.component.ts b/frontend/src/app/shared/syntheseSharedModule/synthese-info-obs/taxonomy/taxonomy.component.ts new file mode 100644 index 0000000000..52a5bc2c12 --- /dev/null +++ b/frontend/src/app/shared/syntheseSharedModule/synthese-info-obs/taxonomy/taxonomy.component.ts @@ -0,0 +1,15 @@ +import { Component, Input, OnInit } from '@angular/core'; +import { GN2CommonModule } from '@geonature_common/GN2Common.module'; +import { CommonModule } from '@angular/common'; +import { Taxon } from '@geonature_common/form/taxonomy/taxonomy.component'; + +@Component({ + selector: 'pnx-synthese-taxonomy', + templateUrl: 'taxonomy.component.html', + styleUrls: ['taxonomy.component.scss'], +}) +export class TaxonomyComponent { + @Input() + taxon: Taxon | null = null; + constructor() {} +} diff --git a/frontend/src/app/shared/syntheseSharedModule/synthese-shared.module.ts b/frontend/src/app/shared/syntheseSharedModule/synthese-shared.module.ts index 4065730a24..3cfbc72764 100644 --- a/frontend/src/app/shared/syntheseSharedModule/synthese-shared.module.ts +++ b/frontend/src/app/shared/syntheseSharedModule/synthese-shared.module.ts @@ -8,11 +8,22 @@ import { ClipboardModule } from '@angular/cdk/clipboard'; import { SyntheseInfoObsComponent } from './synthese-info-obs/synthese-info-obs.component'; import { DiscussionCardComponent } from '../discussionCardModule/discussion-card.component'; import { AlertInfoComponent } from '../alertInfoModule/alert-Info.component'; +import { TaxonomyComponent } from './synthese-info-obs/taxonomy/taxonomy.component'; @NgModule({ imports: [CommonModule, GN2CommonModule, NgChartsModule, RouterModule, ClipboardModule], - exports: [SyntheseInfoObsComponent, DiscussionCardComponent, AlertInfoComponent], - declarations: [SyntheseInfoObsComponent, DiscussionCardComponent, AlertInfoComponent], + exports: [ + SyntheseInfoObsComponent, + DiscussionCardComponent, + AlertInfoComponent, + TaxonomyComponent, + ], + declarations: [ + SyntheseInfoObsComponent, + DiscussionCardComponent, + AlertInfoComponent, + TaxonomyComponent, + ], providers: [], }) export class SharedSyntheseModule {} diff --git a/frontend/src/app/syntheseModule/synthese-results/synthese-list/synthese-info-obs/modal-info-obs.component.html b/frontend/src/app/syntheseModule/synthese-results/synthese-list/synthese-info-obs/modal-info-obs.component.html deleted file mode 100644 index cf63290746..0000000000 --- a/frontend/src/app/syntheseModule/synthese-results/synthese-list/synthese-info-obs/modal-info-obs.component.html +++ /dev/null @@ -1,477 +0,0 @@ -
- - - diff --git a/frontend/src/app/syntheseModule/synthese-results/synthese-list/synthese-info-obs/modal-info-obs.component.ts b/frontend/src/app/syntheseModule/synthese-results/synthese-list/synthese-info-obs/modal-info-obs.component.ts deleted file mode 100644 index faec54615d..0000000000 --- a/frontend/src/app/syntheseModule/synthese-results/synthese-list/synthese-info-obs/modal-info-obs.component.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { Component, OnInit, Input } from '@angular/core'; -import { SyntheseDataService } from '@geonature_common/form/synthese-form/synthese-data.service'; -import { DataFormService } from '@geonature_common/form/data-form.service'; -import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import { MediaService } from '@geonature_common/service/media.service'; -import { finalize } from 'rxjs/operators'; -import { ConfigService } from '@geonature/services/config.service'; - -@Component({ - selector: 'pnx-synthese-modal-info-obs', - templateUrl: 'modal-info-obs.component.html', -}) -export class ModalInfoObsComponent implements OnInit { - @Input() syntheseObs: any; - public selectedObs; - public selectedObsTaxonDetail; - public formatedAreas = []; - public SYNTHESE_CONFIG = null; - public isLoading = false; - constructor( - private _gnDataService: DataFormService, - private _dataService: SyntheseDataService, - public activeModal: NgbActiveModal, - public mediaService: MediaService, - public config: ConfigService - ) { - this.SYNTHESE_CONFIG = this.config.SYNTHESE; - } - - ngOnInit() { - this.loadOneSyntheseReleve(this.syntheseObs); - } - - loadOneSyntheseReleve(syntheseObs) { - this.isLoading = true; - this._dataService - .getOneSyntheseObservation(syntheseObs.id) - .pipe( - finalize(() => { - this.isLoading = false; - }) - ) - .subscribe((data) => { - this.selectedObs = data; - this.selectedObs['municipalities'] = []; - this.selectedObs['other_areas'] = []; - this.selectedObs['actors'] = this.selectedObs['actors'].split('|'); - const areaDict = {}; - // for each area type we want all the areas: we build an dict of array - this.selectedObs.areas.forEach((area) => { - if (!areaDict[area.area_type.type_name]) { - areaDict[area.area_type.type_name] = [area]; - } else { - areaDict[area.area_type.type_name].push(area); - } - }); - // for angular tempate we need to convert it into a aray - for (let key in areaDict) { - this.formatedAreas.push({ area_type: key, areas: areaDict[key] }); - } - - // this.inpnMapUrl = `https://inpn.mnhn.fr/cartosvg/couchegeo/repartition/atlas/${ - // this.selectedObs['cd_nom'] - // }/fr_light_l93,fr_light_mer_l93,fr_lit_l93)`; - }); - - const taxhubFields = ['attributs', 'attributs.bib_attribut.label_attribut', 'status']; - this._gnDataService.getTaxonInfo(syntheseObs.cd_nom, taxhubFields).subscribe((taxInfo) => { - this.selectedObsTaxonDetail = taxInfo; - // filter attributs - this.selectedObsTaxonDetail.attributs = taxInfo['attributs'].filter((v) => - this.config.SYNTHESE.ID_ATTRIBUT_TAXHUB.includes(v.id_attribut) - ); - }); - } - - backToModule(url_source, id_pk_source) { - window.open(url_source + '/' + id_pk_source, '_blank'); - } -} diff --git a/frontend/src/app/syntheseModule/taxon-sheet/infos/infos.component.html b/frontend/src/app/syntheseModule/taxon-sheet/infos/infos.component.html index 9608bc40c2..b2d722d056 100644 --- a/frontend/src/app/syntheseModule/taxon-sheet/infos/infos.component.html +++ b/frontend/src/app/syntheseModule/taxon-sheet/infos/infos.component.html @@ -1,18 +1,6 @@
-
-
- {{ taxon?.nom_complet }} -
-
- {{ taxon?.nom_vern }} -
-
+ +
+
Statuts
+
+ +
+
diff --git a/frontend/src/app/syntheseModule/taxon-sheet/infos/status/status.component.scss b/frontend/src/app/syntheseModule/taxon-sheet/infos/status/status.component.scss new file mode 100644 index 0000000000..8d2326bd7c --- /dev/null +++ b/frontend/src/app/syntheseModule/taxon-sheet/infos/status/status.component.scss @@ -0,0 +1,16 @@ +// //////////////////////////////////////////////////////////////////////////// +// +// //////////////////////////////////////////////////////////////////////////// + +.Status { + display: flex; + flex-flow: row nowrap; + justify-content: flex-start; + align-items: center; + column-gap: 0.5rem; + line-height: 1; + + &__header { + vertical-align: middle; + } +} diff --git a/frontend/src/app/syntheseModule/taxon-sheet/infos/status/status.component.ts b/frontend/src/app/syntheseModule/taxon-sheet/infos/status/status.component.ts new file mode 100644 index 0000000000..0cc562647b --- /dev/null +++ b/frontend/src/app/syntheseModule/taxon-sheet/infos/status/status.component.ts @@ -0,0 +1,18 @@ +import { CommonModule } from '@angular/common'; +import { Component, Input } from '@angular/core'; +import { Taxon } from '@geonature_common/form/taxonomy/taxonomy.component'; +import { GN2CommonModule } from '@geonature_common/GN2Common.module'; + +@Component({ + standalone: true, + selector: 'status', + templateUrl: 'status.component.html', + styleUrls: ['status.component.scss'], + imports: [CommonModule, GN2CommonModule], +}) +export class StatusComponent { + constructor() {} + + @Input() + taxon: Taxon | null; +} diff --git a/frontend/src/app/syntheseModule/taxon-sheet/infos/taxonomy/taxonomy.component.html b/frontend/src/app/syntheseModule/taxon-sheet/infos/taxonomy/taxonomy.component.html new file mode 100644 index 0000000000..c74e9f299b --- /dev/null +++ b/frontend/src/app/syntheseModule/taxon-sheet/infos/taxonomy/taxonomy.component.html @@ -0,0 +1,8 @@ +
+
+ {{ taxon?.nom_complet }} +
+
+ {{ taxon?.nom_vern }} +
+
diff --git a/frontend/src/app/syntheseModule/taxon-sheet/infos/taxonomy/taxonomy.component.scss b/frontend/src/app/syntheseModule/taxon-sheet/infos/taxonomy/taxonomy.component.scss new file mode 100644 index 0000000000..4ac109a575 --- /dev/null +++ b/frontend/src/app/syntheseModule/taxon-sheet/infos/taxonomy/taxonomy.component.scss @@ -0,0 +1,12 @@ +.Taxonomy { + display: flex; + flex-flow: column; + &__completeName { + font-weight: lighter; + font-style: italic; + } + &__vernacularName { + font-size: 1.5rem; + font-weight: bold; + } +} diff --git a/frontend/src/app/syntheseModule/taxon-sheet/infos/taxonomy/taxonomy.component.ts b/frontend/src/app/syntheseModule/taxon-sheet/infos/taxonomy/taxonomy.component.ts new file mode 100644 index 0000000000..27e3cbb63c --- /dev/null +++ b/frontend/src/app/syntheseModule/taxon-sheet/infos/taxonomy/taxonomy.component.ts @@ -0,0 +1,14 @@ +import { CommonModule } from '@angular/common'; +import { Component, Input } from '@angular/core'; +import { Taxon } from '@geonature_common/form/taxonomy/taxonomy.component'; +@Component({ + standalone: true, + selector: 'taxonomy', + templateUrl: 'taxonomy.component.html', + styleUrls: ['taxonomy.component.scss'], + imports: [CommonModule], +}) +export class TaxonomyComponent { + @Input() + taxon: Taxon | null = null; +} diff --git a/frontend/src/app/syntheseModule/taxon-sheet/tab-taxonomy/tab-taxonomy.component.html b/frontend/src/app/syntheseModule/taxon-sheet/tab-taxonomy/tab-taxonomy.component.html new file mode 100644 index 0000000000..94da0dd149 --- /dev/null +++ b/frontend/src/app/syntheseModule/taxon-sheet/tab-taxonomy/tab-taxonomy.component.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/frontend/src/app/syntheseModule/taxon-sheet/tab-taxonomy/tab-taxonomy.component.scss b/frontend/src/app/syntheseModule/taxon-sheet/tab-taxonomy/tab-taxonomy.component.scss new file mode 100644 index 0000000000..e69de29bb2 diff --git a/frontend/src/app/syntheseModule/taxon-sheet/tab-taxonomy/tab-taxonomy.component.ts b/frontend/src/app/syntheseModule/taxon-sheet/tab-taxonomy/tab-taxonomy.component.ts new file mode 100644 index 0000000000..e5767049de --- /dev/null +++ b/frontend/src/app/syntheseModule/taxon-sheet/tab-taxonomy/tab-taxonomy.component.ts @@ -0,0 +1,24 @@ +import { Component, OnInit } from '@angular/core'; +import { GN2CommonModule } from '@geonature_common/GN2Common.module'; +import { CommonModule } from '@angular/common'; +import { TaxonSheetService } from '../taxon-sheet.service'; +import { Taxon } from '@geonature_common/form/taxonomy/taxonomy.component'; +import { SharedSyntheseModule } from '@geonature/shared/syntheseSharedModule/synthese-shared.module'; + +@Component({ + standalone: true, + selector: 'tab-taxonomy', + templateUrl: 'tab-taxonomy.component.html', + styleUrls: ['tab-taxonomy.component.scss'], + imports: [GN2CommonModule, CommonModule, SharedSyntheseModule], +}) +export class TabTaxonomyComponent implements OnInit { + taxon: Taxon | null = null; + constructor(private _tss: TaxonSheetService) {} + + ngOnInit() { + this._tss.taxon.subscribe((taxon: Taxon | null) => { + this.taxon = taxon; + }); + } +} 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 66b098d819..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 @@ -9,6 +9,7 @@ import { ConfigService } from '@geonature/services/config.service'; import { Observable } from 'rxjs'; import { TabGeographicOverviewComponent } from './tab-geographic-overview/tab-geographic-overview.component'; import { TabProfileComponent } from './tab-profile/tab-profile.component'; +import { TabTaxonomyComponent } from './tab-taxonomy/tab-taxonomy.component'; interface Tab { label: string; @@ -24,6 +25,12 @@ export const ALL_TAXON_SHEET_ADVANCED_INFOS_ROUTES: Array = [ component: TabGeographicOverviewComponent, configEnabledField: null, // make it always available ! }, + { + label: 'Taxonomie', + path: 'taxonomy', + configEnabledField: 'ENABLE_TAXONOMY', + component: TabTaxonomyComponent, + }, { label: 'Profil', path: 'profile',