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

fix: Rename tab Variable into Trait. Manage the double links for URGI's study....

fix: Rename tab Variable into Trait. Manage the double links for URGI's study. Minor fixes. GNP-5490
parent 4fa272eb
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<a tabindex="1" <a tabindex="1"
class="nav-link {{ activeTab == 'Variable' ? 'active' : ''}}" class="nav-link {{ activeTab == 'Variable' ? 'active' : ''}}"
(click)="activeTab='Variable'"> (click)="activeTab='Variable'">
Variable Trait
</a> </a>
</li> </li>
</ul> </ul>
......
...@@ -404,7 +404,7 @@ ...@@ -404,7 +404,7 @@
<gpds-card-row <gpds-card-row
label="Breeder" label="Breeder"
[test]="germplasmGnpis.breeder"> [test]="testBreeder()">
<ng-template> <ng-template>
<gpds-card-row <gpds-card-row
......
...@@ -106,6 +106,19 @@ export class GermplasmCardComponent implements OnInit { ...@@ -106,6 +106,19 @@ export class GermplasmCardComponent implements OnInit {
&& this.germplasmProgeny.length > 0); && this.germplasmProgeny.length > 0);
} }
testBreeder() {
return (this.germplasmGnpis.breeder)
&& (this.germplasmGnpis.breeder.institute.instituteName
|| this.germplasmGnpis.breeder.germplasmPUI
|| this.germplasmGnpis.breeder.accessionNumber
|| this.germplasmGnpis.breeder.accessionCreationDate
|| this.germplasmGnpis.breeder.materialType
|| this.germplasmGnpis.breeder.collectors
|| this.germplasmGnpis.breeder.registrationYear
|| this.germplasmGnpis.breeder.deregistrationYear
|| this.germplasmGnpis.breeder.distributionStatus);
}
testPedigree() { testPedigree() {
return (this.germplasmPedigree return (this.germplasmPedigree
&& (this.germplasmPedigree.parent1Name && (this.germplasmPedigree.parent1Name
...@@ -127,14 +140,14 @@ export class GermplasmCardComponent implements OnInit { ...@@ -127,14 +140,14 @@ export class GermplasmCardComponent implements OnInit {
testCollectorInstituteFields() { testCollectorInstituteFields() {
return (this.germplasmGnpis.collector) && return (this.germplasmGnpis.collector) &&
(this.germplasmGnpis.collector.germplasmPUI (this.germplasmGnpis.collector.germplasmPUI
|| this.germplasmGnpis.collector.accessionNumber || this.germplasmGnpis.collector.accessionNumber
|| this.germplasmGnpis.collector.accessionCreationDate || this.germplasmGnpis.collector.accessionCreationDate
|| this.germplasmGnpis.collector.materialType || this.germplasmGnpis.collector.materialType
|| this.germplasmGnpis.collector.collectors || this.germplasmGnpis.collector.collectors
|| this.germplasmGnpis.collector.registrationYear || this.germplasmGnpis.collector.registrationYear
|| this.germplasmGnpis.collector.deregistrationYear || this.germplasmGnpis.collector.deregistrationYear
|| this.germplasmGnpis.collector.distributionStatus || this.germplasmGnpis.collector.distributionStatus
); );
} }
testOrigin() { testOrigin() {
......
...@@ -12,7 +12,10 @@ ...@@ -12,7 +12,10 @@
</a> </a>
</h5> </h5>
<h5> <h5>
<a class="title" *ngIf="getRouterLink()" [routerLink]="getRouterLink()" [queryParams]="getQueryParam()"> <a class="title" *ngIf="getRouterLink() && document['@type'] == 'Phenotyping Study'" [routerLink]="getRouterLink()">
(go to this {{ document["@type"] }} card)
</a>
<a class="title" *ngIf="getRouterLink() && document['@type'] != 'Phenotyping Study'" [routerLink]="getRouterLink()" [queryParams]="getQueryParam()">
(go to this {{ document["@type"] }} card) (go to this {{ document["@type"] }} card)
</a> </a>
</h5> </h5>
......
...@@ -28,9 +28,14 @@ export class DocumentComponent implements OnInit { ...@@ -28,9 +28,14 @@ export class DocumentComponent implements OnInit {
} }
getRouterLink() { getRouterLink() {
const urgiStudy = this.document['schema:includedInDataCatalog']['schema:url'] === 'https://urgi.versailles.inra.fr';
for (const type of this.document['@type']) { for (const type of this.document['@type']) {
const cardUrl = DocumentComponent.CARD_TYPE[type]; const cardUrl = DocumentComponent.CARD_TYPE[type];
if (cardUrl === 'studies') { if (cardUrl === 'studies') {
if (urgiStudy) {
const studyId = this.document['@id'].replace(/urn:URGI\/study\//, '');
return `/${cardUrl}/${studyId}`;
}
return `/${cardUrl}/${this.document['schema:identifier']}`; return `/${cardUrl}/${this.document['schema:identifier']}`;
} }
if (cardUrl === 'germplasm') { if (cardUrl === 'germplasm') {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment