Skip to content

Commit

Permalink
fet: update status badge + tooltip content
Browse files Browse the repository at this point in the history
  • Loading branch information
edelclaux committed Sep 25, 2024
1 parent 5e43880 commit e82421e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
class="badge badge-secondary"
*ngFor="let status of status; let isLast = last"
[style]="status.symbologyAsCSS"
matTooltip="{{ status.long }}"
matTooltip="{{ status.tooltip }}"
>
{{ status.short }}
{{ status.badge }}
</span>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { GN2CommonModule } from '@geonature_common/GN2Common.module';
import { TaxonSheetService } from '../../taxon-sheet.service';

interface Status {
short: string;
long: string;
badge: string;
tooltip: string;
symbologyAsCSS: string;
}

Expand Down Expand Up @@ -97,24 +97,12 @@ export class StatusComponent implements OnInit {
}

for (const status of Object.values(this._taxon.status)) {
const status_short = status.cd_type_statut;
const status_long = status.display;
const type_code = status.cd_type_statut;

for (const text of Object.values<any>(status.text)) {
const text_short = text.cd_sig;
const text_long = text.full_citation;
for (const value of Object.values<any>(text.values)) {
const value_short = value.code_statut;
const value_long = value.display;
const value_code = value.code_statut;
this.status.push({
short:
value.code_statut === 'true' || value.code_statut === 'false'
? `${status_short} ${text_short}`
: `${status_short} ${text_short}: ${value_short}`,
long: `${status_long} ${text_short} ${text_long}: ${value_long}`,
symbologyAsCSS: this._getSymbologyAsCSSStyle(type_code, value_code),
badge: `${status.cd_type_statut}: ${value.code_statut}`,
tooltip: `${status.cd_type_statut} : ${value.display} - ${text.full_citation}`,
symbologyAsCSS: this._getSymbologyAsCSSStyle(status.cd_type_statut, value.code_statut),
});
}
}
Expand Down

0 comments on commit e82421e

Please sign in to comment.