Commit 246a37c1 authored by Jérémy Destin's avatar Jérémy Destin Committed by Célia Michotey
Browse files

fix: Fix germplasm card's bug about test before display. Rebase on the last...

fix: Fix germplasm card's bug about test before display. Rebase on the last version of master. Minor fixes GNP-5490
parent b88a3503
......@@ -5,854 +5,863 @@
Germplasm: {{ germplasmGnpis.germplasmName }}
</h3>
<div class="container-fluid">
<div class="row align-items-center">
<!--Section for the image representing the germplasm and the details about this image-->
<div class="col-auto field" *ngIf="germplasmGnpis.photo && germplasmGnpis.photo.thumbnailFileName">
<figure class="figure">
<img
[src]="IMAGES_SIREGAL_URL +'/' + germplasmGnpis.holdingGenbank.instituteCode + '/' + germplasmGnpis.photo.thumbnailFileName"
class="img-fluid">
<figcaption class="figure-caption">
<a class="btn popovers" data-boundary="window" placement="right" [ngbPopover]="imageTemplate"
[popoverTitle]="germplasmGnpis.photo.thumbnailFileName" container="body">
Click to see more details.
</a>
</figcaption>
</figure>
<ng-template #imageTemplate>
<div class="card ngb-popover-window ">
<img class="card-img-top"
[src]="IMAGES_SIREGAL_URL + '/' + germplasmGnpis.holdingGenbank.instituteCode + '/' + germplasmGnpis.photo.fileName"
alt="" width="250px">
<div class="card-body">
<gpds-card-row
label="Name"
[value]="germplasmGnpis.photo.photoName">
</gpds-card-row>
<gpds-card-row
label="Description"
[value]="germplasmGnpis.photo.description">
</gpds-card-row>
<gpds-card-row
label="Copyright"
[value]="germplasmGnpis.photo.copyright">
</gpds-card-row>
</div>
</div>
</ng-template>
</div>
<!--Section for the information about the identification of the germplasm-->
<gpds-card-section
class="col-12 col-lg"
header="Identification">
<ng-template>
<div class="card-body card-section-body">
<div class="row align-items-center">
<!--Section for the image representing the germplasm and the details about this image-->
<div class="col-auto field" *ngIf="germplasmGnpis.photo && germplasmGnpis.photo.thumbnailFileName">
<figure class="figure">
<img
[src]="IMAGES_SIREGAL_URL +'/' + germplasmGnpis.holdingGenbank.instituteCode + '/' + germplasmGnpis.photo.thumbnailFileName"
class="img-fluid">
<figcaption class="figure-caption">
<a class="btn popovers" data-boundary="window" placement="right" [ngbPopover]="imageTemplate"
[popoverTitle]="germplasmGnpis.photo.thumbnailFileName" container="body">
Click to see more details.
</a>
</figcaption>
</figure>
<ng-template #imageTemplate>
<div class="card ngb-popover-window ">
<img class="card-img-top"
[src]="IMAGES_SIREGAL_URL + '/' + germplasmGnpis.holdingGenbank.instituteCode + '/' + germplasmGnpis.photo.fileName"
alt="" width="250px">
<div class="card-body">
<gpds-card-row
label="Germplasm name"
[value]="germplasmGnpis.germplasmName">
label="Name"
[value]="germplasmGnpis.photo.photoName">
</gpds-card-row>
<gpds-card-row
label="Permanent Unique Identifier"
[value]="germplasmGnpis.germplasmPUI">
label="Description"
[value]="germplasmGnpis.photo.description">
</gpds-card-row>
<gpds-card-row
label="Accession number"
[value]="germplasmGnpis.accessionNumber">
label="Copyright"
[value]="germplasmGnpis.photo.copyright">
</gpds-card-row>
</div>
</div>
</ng-template>
</div>
<gpds-card-row
label="Acquisition date"
[test]="germplasmGnpis.acquisitionDate">
<ng-template>
{{ germplasmGnpis.acquisitionDate | amParse:'YYYYMMDD' | amDateFormat:'YYYY-MM-DD' }}
</ng-template>
</gpds-card-row>
<!--Section for the information about the identification of the germplasm-->
<gpds-card-section
class="col-12 col-lg"
header="Identification">
<ng-template>
<div class="card-body card-section-body">
<gpds-card-row
label="Seed source"
[value]="germplasmGnpis.seedSource">
</gpds-card-row>
<gpds-card-row
label="Germplasm name"
[value]="germplasmGnpis.germplasmName">
</gpds-card-row>
<gpds-card-row
label="Genetic nature"
[value]="germplasmGnpis.geneticNature">
</gpds-card-row>
<gpds-card-row
label="Permanent Unique Identifier"
[value]="germplasmGnpis.germplasmPUI">
</gpds-card-row>
<gpds-card-row
label="Accession synonyms"
[test]="germplasmGnpis.synonyms && germplasmGnpis.synonyms.length > 0">
<ng-template>
{{ germplasmGnpis.synonyms.join(', ') }}
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Accession number"
[value]="germplasmGnpis.accessionNumber">
</gpds-card-row>
<gpds-card-row
label="Taxon"
[test]="germplasmGnpis.genus || germplasmGnpis.species || germplasmGnpis.subtaxa">
<ng-template>
<i>{{ germplasmGnpis.genus }} {{ germplasmGnpis.species }} {{ germplasmGnpis.subtaxa }}</i>
{{ germplasmGnpis.speciesAuthority ? '(' + germplasmGnpis.speciesAuthority + ')' : '' }}
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Acquisition date"
[test]="germplasmGnpis.acquisitionDate">
<ng-template>
{{ germplasmGnpis.acquisitionDate | amParse:'YYYYMMDD' | amDateFormat:'YYYY-MM-DD' }}
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Seed source"
[value]="germplasmGnpis.seedSource">
</gpds-card-row>
<gpds-card-row
label="Taxon common names"
[test]="germplasmGnpis.taxonCommonNames && germplasmGnpis.taxonCommonNames.length > 0">
<ng-template>
{{ germplasmGnpis.taxonCommonNames.join(', ') }}
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Genetic nature"
[value]="germplasmGnpis.geneticNature">
</gpds-card-row>
<gpds-card-row
label="Accession synonyms"
[test]="germplasmGnpis.synonyms && germplasmGnpis.synonyms.length > 0">
<ng-template>
{{ germplasmGnpis.synonyms.join(', ') }}
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Taxon synonyms"
[test]="germplasmGnpis.taxonSynonyms && germplasmGnpis.taxonSynonyms.length > 0">
<ng-template>
<i>{{ germplasmGnpis.taxonSynonyms.join(', ') }}</i>
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Taxon"
[test]="germplasmGnpis.genus || germplasmGnpis.species || germplasmGnpis.subtaxa">
<ng-template>
<i>{{ germplasmGnpis.genus }} {{ germplasmGnpis.species }} {{ germplasmGnpis.subtaxa }}</i>
{{ germplasmGnpis.speciesAuthority ? '(' + germplasmGnpis.speciesAuthority + ')' : '' }}
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Pedigree"
[value]="germplasmGnpis.pedigree">
</gpds-card-row>
<gpds-card-row
label="Biological status"
[value]="germplasmGnpis.biologicalStatusOfAccessionCode">
</gpds-card-row>
<gpds-card-row
label="Taxon common names"
[test]="germplasmGnpis.taxonCommonNames && germplasmGnpis.taxonCommonNames.length > 0">
<ng-template>
{{ germplasmGnpis.taxonCommonNames.join(', ') }}
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Comments"
[value]="germplasmGnpis.comment">
</gpds-card-row>
</div>
</ng-template>
</gpds-card-section>
</div>
<gpds-card-row
label="Taxon synonyms"
[test]="germplasmGnpis.taxonSynonyms && germplasmGnpis.taxonSynonyms.length > 0">
<ng-template>
<i>{{ germplasmGnpis.taxonSynonyms.join(', ') }}</i>
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Pedigree"
[value]="germplasmGnpis.pedigree">
</gpds-card-row>
<!--Templates for gerplasm card-->
<ng-template #holdingInstituteTemplate>
<gpds-card-row
label="Biological status"
[value]="germplasmGnpis.biologicalStatusOfAccessionCode">
</gpds-card-row>
<gpds-card-row
label="Institute name"
[value]="germplasmGnpis.holdingInstitute.instituteName">
</gpds-card-row>
<gpds-card-row
label="Comments"
[value]="germplasmGnpis.comment">
</gpds-card-row>
<gpds-card-row
label="FAO code"
[value]="germplasmGnpis.holdingInstitute.instituteCode">
</gpds-card-row>
</div>
</ng-template>
</gpds-card-section>
</div>
<gpds-card-row
label="Acronym"
[value]="germplasmGnpis.holdingInstitute.acronym">
</gpds-card-row>
<gpds-card-row
label="Organisation"
[value]="germplasmGnpis.holdingInstitute.organisation">
</gpds-card-row>
<!--Templates for gerplasm card-->
<ng-template #holdingInstituteTemplate>
<gpds-card-row
label="Institute type"
[value]="germplasmGnpis.holdingInstitute.instituteType">
</gpds-card-row>
<gpds-card-row
label="Institute name"
[value]="germplasmGnpis.holdingInstitute.instituteName">
</gpds-card-row>
<gpds-card-row
label="Website"
[value]="germplasmGnpis.holdingInstitute.webSite">
</gpds-card-row>
<gpds-card-row
label="FAO code"
[value]="germplasmGnpis.holdingInstitute.instituteCode">
</gpds-card-row>
<gpds-card-row
label="Acronym"
[value]="germplasmGnpis.holdingInstitute.acronym">
</gpds-card-row>
<gpds-card-row
label="Address"
[value]="germplasmGnpis.holdingInstitute.address">
</gpds-card-row>
<gpds-card-row
label="Organisation"
[value]="germplasmGnpis.holdingInstitute.organisation">
</gpds-card-row>
</ng-template>
<gpds-card-row
label="Institute type"
[value]="germplasmGnpis.holdingInstitute.instituteType">
</gpds-card-row>
<gpds-card-row
label="Website"
[value]="germplasmGnpis.holdingInstitute.webSite">
</gpds-card-row>
<ng-template #BreederInstituteTemplate>
<gpds-card-row
label="Organisation"
[value]="germplasmGnpis.breeder.institute.organisation">
</gpds-card-row>
<gpds-card-row
label="Address"
[value]="germplasmGnpis.holdingInstitute.address">
</gpds-card-row>
<gpds-card-row
label="Acronym"
[value]="germplasmGnpis.breeder.institute.acronym">
</gpds-card-row>
</ng-template>
<gpds-card-row
label="Code"
[value]="germplasmGnpis.breeder.institute.instituteCode">
</gpds-card-row>
<gpds-card-row
label="Type"
[value]="germplasmGnpis.breeder.institute.instituteType">
</gpds-card-row>
<ng-template #BreederInstituteTemplate>
<gpds-card-row
label="Link"
[test]="germplasmGnpis.breeder.institute.webSite">
<ng-template>
<a [href]="germplasmGnpis.breeder.institute.webSite">
{{ germplasmGnpis.breeder.institute.webSite }}
</a>
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Organisation"
[value]="germplasmGnpis.breeder.institute.organisation">
</gpds-card-row>
<gpds-card-row
label="Address"
[value]="germplasmGnpis.breeder.institute.address">
</gpds-card-row>
<gpds-card-row
label="Acronym"
[value]="germplasmGnpis.breeder.institute.acronym">
</gpds-card-row>
</ng-template>
<gpds-card-row
label="Code"
[value]="germplasmGnpis.breeder.institute.instituteCode">
</gpds-card-row>
<gpds-card-row
label="Type"
[value]="germplasmGnpis.breeder.institute.instituteType">
</gpds-card-row>
<ng-template #CollectorInstituteTemplate>
<gpds-card-row
label="Link"
[test]="germplasmGnpis.breeder.institute.webSite">
<ng-template>
<a [href]="germplasmGnpis.breeder.institute.webSite">
{{ germplasmGnpis.breeder.institute.webSite }}
</a>
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Institute name"
[value]="germplasmGnpis.collector.instituteName">
</gpds-card-row>
<gpds-card-row
label="Address"
[value]="germplasmGnpis.breeder.institute.address">
</gpds-card-row>
<gpds-card-row
label="Acronym"
[value]="germplasmGnpis.collector.acronym">
</gpds-card-row>
</ng-template>
<gpds-card-row
label="FAO code"
[value]="germplasmGnpis.collector.instituteCode">
</gpds-card-row>
<gpds-card-row
label="Organisation"
[value]="germplasmGnpis.collector.organisation">
</gpds-card-row>
<ng-template #CollectorInstituteTemplate>
<gpds-card-row
label="Link"
[test]="germplasmGnpis.collector.institute.webSite">
<ng-template>
<a [href]="germplasmGnpis.collector.institute.webSite">
{{ germplasmGnpis.collector.institute.webSite }}
</a>
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Institute name"
[value]="germplasmGnpis.collector.instituteName">
</gpds-card-row>
<gpds-card-row
label="Address"
[value]="germplasmGnpis.collector.institute.address">
</gpds-card-row>
<gpds-card-row
label="Acronym"
[value]="germplasmGnpis.collector.acronym">
</gpds-card-row>
</ng-template>
<gpds-card-row
label="FAO code"
[value]="germplasmGnpis.collector.instituteCode">
</gpds-card-row>
<gpds-card-row
label="Organisation"
[value]="germplasmGnpis.collector.organisation">
</gpds-card-row>
<!--Section for the information about the holding of the germplasm-->
<gpds-card-section
header="Holding"
[test]="germplasmGnpis.holdingInstitute">
<gpds-card-row
label="Link"
[test]="germplasmGnpis.collector.institute.webSite">
<ng-template>
<div class="card-body card-section-body">
<gpds-card-row
label="Institution">
<ng-template>
<a class="popovers" data-boundary="window" placement="top"
[ngbPopover]="holdingInstituteTemplate"
[popoverTitle]="germplasmGnpis.holdingInstitute.instituteName"
container="body">
{{ germplasmGnpis.holdingInstitute.instituteName }}</a>
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Stock center name"
[test]="germplasmGnpis.holdingGenbank.instituteName">
<ng-template>
<ng-container *ngIf="germplasmGnpis.holdingGenbank.webSite">
<a [href]="germplasmGnpis.holdingGenbank.webSite">
{{ germplasmGnpis.holdingGenbank.instituteName }}
</a>
</ng-container>
<ng-container *ngIf="!germplasmGnpis.holdingGenbank.webSite">
{{ germplasmGnpis.holdingGenbank.instituteName }}
</ng-container>
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Presence status"
[value]="germplasmGnpis.presenceStatus">
</gpds-card-row>
</div>
<a [href]="germplasmGnpis.collector.institute.webSite">
{{ germplasmGnpis.collector.institute.webSite }}
</a>
</ng-template>
</gpds-card-section>
<gpds-card-section
header="Origin"
[test]="testOrigin()">
<ng-template>
<div class="card-body card-section-body">
<gpds-card-row
label="Geographical origin"
[test]="germplasmGnpis.originSite && germplasmGnpis.originSite.siteName">
<ng-template>
<a [routerLink]="['/sites/', germplasmGnpis.originSite.siteId]">
{{ germplasmGnpis.originSite.siteName }}
</gpds-card-row>
<gpds-card-row
label="Address"
[value]="germplasmGnpis.collector.institute.address">
</gpds-card-row>
</ng-template>
<!--Section for the information about the holding of the germplasm-->
<gpds-card-section
header="Holding"
[test]="germplasmGnpis.holdingInstitute">
<ng-template>
<div class="card-body card-section-body">
<gpds-card-row
label="Institution">
<ng-template>
<a class="popovers" data-boundary="window" placement="top"
[ngbPopover]="holdingInstituteTemplate"
[popoverTitle]="germplasmGnpis.holdingInstitute.instituteName"
container="body">
{{ germplasmGnpis.holdingInstitute.instituteName }}</a>
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Stock center name"
[test]="germplasmGnpis.holdingGenbank.instituteName">
<ng-template>
<ng-container *ngIf="germplasmGnpis.holdingGenbank.webSite">
<a [href]="germplasmGnpis.holdingGenbank.webSite">
{{ germplasmGnpis.holdingGenbank.instituteName }}
</a>
</ng-template>
</gpds-card-row>
</ng-container>
<ng-container *ngIf="!germplasmGnpis.holdingGenbank.webSite">
{{ germplasmGnpis.holdingGenbank.instituteName }}
</ng-container>
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Collecting"
[test]="testCollectorInstituteObject() || testCollectorInstituteFields() || (germplasmGnpis.collectingSite && germplasmGnpis.collectingSite.siteName)">
<ng-template>
<gpds-card-row
label="Presence status"
[value]="germplasmGnpis.presenceStatus">
</gpds-card-row>
<gpds-card-row
label="Institution"
[test]="germplasmGnpis.collector.institute && germplasmGnpis.collector.institute.instituteName">
<ng-template>
<a class="popovers" placement="top"
[ngbPopover]="CollectorInstituteTemplate"
[popoverTitle]="germplasmGnpis.collector.institute.instituteName">
{{ germplasmGnpis.collector.institute.instituteName }}
</a>
</ng-template>
</gpds-card-row>
</div>
</ng-template>
</gpds-card-section>
<gpds-card-row
label="Accession Creation date"
[test]="germplasmGnpis.collector.accessionCreationDate">
<ng-template>
{{ germplasmGnpis.collector.accessionCreationDate | amParse:'YYYYMMDD' | amDateFormat:'YYYY-MM-DD' }}
</ng-template>
</gpds-card-row>
<gpds-card-row
label="Accession number"
[value]="germplasmGnpis.collector.accessionNumber">
</gpds-card-row>
<gpds-card-section
header="Origin"
[test]="testOrigin()">
<ng-template>
<div class="card-body card-section-body">
<gpds-card-row
label="Collectors"
[value]="germplasmGnpis.collector.collectors">
</gpds-card-row>
<gpds-card-row