Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
1 merge request!14GPDS code refactor for uniformization
......@@ -10,7 +10,7 @@
<a tabindex="1"
class="nav-link {{ activeTab == 'Variable' ? 'active' : ''}}"
(click)="activeTab='Variable'">
Variable
Trait
</a>
</li>
</ul>
......
......@@ -404,7 +404,7 @@
<gpds-card-row
label="Breeder"
[test]="germplasmGnpis.breeder">
[test]="testBreeder()">
<ng-template>
<gpds-card-row
......
......@@ -106,6 +106,19 @@ export class GermplasmCardComponent implements OnInit {
&& 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() {
return (this.germplasmPedigree
&& (this.germplasmPedigree.parent1Name
......@@ -127,14 +140,14 @@ export class GermplasmCardComponent implements OnInit {
testCollectorInstituteFields() {
return (this.germplasmGnpis.collector) &&
(this.germplasmGnpis.collector.germplasmPUI
|| this.germplasmGnpis.collector.accessionNumber
|| this.germplasmGnpis.collector.accessionCreationDate
|| this.germplasmGnpis.collector.materialType
|| this.germplasmGnpis.collector.collectors
|| this.germplasmGnpis.collector.registrationYear
|| this.germplasmGnpis.collector.deregistrationYear
|| this.germplasmGnpis.collector.distributionStatus
);
|| this.germplasmGnpis.collector.accessionNumber
|| this.germplasmGnpis.collector.accessionCreationDate
|| this.germplasmGnpis.collector.materialType
|| this.germplasmGnpis.collector.collectors
|| this.germplasmGnpis.collector.registrationYear
|| this.germplasmGnpis.collector.deregistrationYear
|| this.germplasmGnpis.collector.distributionStatus
);
}
testOrigin() {
......
......@@ -12,7 +12,10 @@
</a>
</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)
</a>
</h5>
......
......@@ -28,9 +28,14 @@ export class DocumentComponent implements OnInit {
}
getRouterLink() {
const urgiStudy = this.document['schema:includedInDataCatalog']['schema:url'] === 'https://urgi.versailles.inra.fr';
for (const type of this.document['@type']) {
const cardUrl = DocumentComponent.CARD_TYPE[type];
if (cardUrl === 'studies') {
if (urgiStudy) {
const studyId = this.document['@id'].replace(/urn:URGI\/study\//, '');
return `/${cardUrl}/${studyId}`;
}
return `/${cardUrl}/${this.document['schema:identifier']}`;
}
if (cardUrl === 'germplasm') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment