-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update status and taxonomy in species-page
- Loading branch information
Showing
21 changed files
with
264 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
...nd/src/app/shared/syntheseSharedModule/synthese-info-obs/taxonomy/taxonomy.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<div class="Taxonomy"> | ||
<table class="font-xs table table-striped table-sm"> | ||
<tr> | ||
<td> | ||
<b>Groupe taxonomique</b> | ||
</td> | ||
<td>{{ taxon?.classe }}</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<b>Ordre</b> | ||
</td> | ||
<td>{{ taxon?.ordre }}</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
<b>Famille</b> | ||
</td> | ||
<td data-qa="synthese-obs-detail-taxo-familly">{{ taxon?.famille }}</td> | ||
</tr> | ||
</table> | ||
|
||
<!-- <h5 class="underlined underlined-sm main-color">Attribut(s) Taxonomique(s) locaux</h5> | ||
<table class="font-xs table table-striped table-sm"> | ||
<tr | ||
class="font-xs" | ||
*ngFor="let attr of taxon?.attributs" | ||
> | ||
<td> | ||
<b>{{ attr.label_attribut }}</b> | ||
</td> | ||
<td>{{ attr.valeur_attribut }}</td> | ||
</tr> | ||
</table> --> | ||
|
||
<h5 class="underlined underlined-sm main-color">Statuts</h5> | ||
<table | ||
class="font-xs table table-sm" | ||
*ngIf="taxon?.status; else noStatus" | ||
> | ||
<ng-container *ngFor="let status of taxon?.status | keyvalue"> | ||
<tr class="table-primary"> | ||
<th>{{ status.value.display }}</th> | ||
</tr> | ||
<tr *ngFor="let text of status.value.text | keyvalue"> | ||
<td> | ||
<ul class="list-unstyled mt-2"> | ||
<li | ||
*ngIf="text.value.full_citation" | ||
class="d-flex w-100 justify-content-between" | ||
> | ||
<span class="flex-shrink-1 w-75"> | ||
<strong [innerHtml]="text.value.full_citation | safeHTML"></strong> | ||
<br /> | ||
({{ text.value.lb_adm_tr }} - {{ text.value.cd_sig }}) | ||
</span> | ||
<a | ||
*ngIf="text.value.doc_url" | ||
class="btn align-self-start" | ||
href="{{ text.value.doc_url }}" | ||
mat-stroked-button | ||
color="primary" | ||
target="_blank" | ||
> | ||
Voir / Télécharger | ||
<mat-icon aria-hidden="true">launch</mat-icon> | ||
</a> | ||
</li> | ||
<li> | ||
<span *ngFor="let value of text.value.values | keyvalue"> | ||
<strong *ngIf="value.value.code != 'true'"> | ||
{{ value.value.code_statut }} | ||
</strong> | ||
{{ value.value.label_statut }} | ||
{{ value.value.rq_statut }} | ||
</span> | ||
</li> | ||
</ul> | ||
</td> | ||
</tr> | ||
</ng-container> | ||
</table> | ||
<ng-template #noStatus><p>Aucun</p></ng-template> | ||
</div> |
2 changes: 2 additions & 0 deletions
2
...nd/src/app/shared/syntheseSharedModule/synthese-info-obs/taxonomy/taxonomy.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.Taxonomy { | ||
} |
15 changes: 15 additions & 0 deletions
15
...tend/src/app/shared/syntheseSharedModule/synthese-info-obs/taxonomy/taxonomy.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 2 additions & 14 deletions
16
frontend/src/app/syntheseModule/taxon-sheet/infos/infos.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 1 addition & 15 deletions
16
frontend/src/app/syntheseModule/taxon-sheet/infos/infos.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,5 @@ | ||
.Infos { | ||
display: flex; | ||
flex-flow: row nowrap; | ||
flex-flow: column; | ||
justify-content: flex-start; | ||
column-gap: 1rem; | ||
|
||
&__infos { | ||
display: flex; | ||
flex-flow: column; | ||
&CompleteName { | ||
font-weight: lighter; | ||
font-style: italic; | ||
} | ||
&VernacularName { | ||
font-size: 1.5rem; | ||
font-weight: bold; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
frontend/src/app/syntheseModule/taxon-sheet/infos/status/status.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="Status"> | ||
<div class="Status__header">Statuts</div> | ||
<span | ||
class="badge badge-secondary" | ||
*ngFor="let status of status; let isLast = last" | ||
matTooltip="{{ status.longName }}" | ||
> | ||
{{ status.shortName }} | ||
</span> | ||
</div> |
15 changes: 15 additions & 0 deletions
15
frontend/src/app/syntheseModule/taxon-sheet/infos/status/status.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.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; | ||
} | ||
.badge { | ||
line-height: inherit; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
frontend/src/app/syntheseModule/taxon-sheet/infos/status/status.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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'; | ||
|
||
interface Status { | ||
shortName: string; | ||
longName: string; | ||
} | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'status', | ||
templateUrl: 'status.component.html', | ||
styleUrls: ['status.component.scss'], | ||
imports: [CommonModule, GN2CommonModule], | ||
}) | ||
export class StatusComponent { | ||
status: Array<Status> = []; | ||
@Input() | ||
set taxon(taxon: Taxon | null) { | ||
if (!taxon) { | ||
this.status = []; | ||
return; | ||
} | ||
this.status = Object.values(taxon.status).map((status) => { | ||
return { | ||
shortName: status.cd_type_statut, | ||
longName: status.lb_type_statut, | ||
}; | ||
}); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
frontend/src/app/syntheseModule/taxon-sheet/infos/taxonomy/taxonomy.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="Taxonomy"> | ||
<div class="Taxonomy__completeName"> | ||
{{ taxon?.nom_complet }} | ||
</div> | ||
<div class="Taxonomy__vernacularName"> | ||
{{ taxon?.nom_vern }} | ||
</div> | ||
</div> |
Oops, something went wrong.