Commit fafc103b authored by Jérémy Destin's avatar Jérémy Destin
Browse files

fix: Do not display tab trait when germplasm-result page is active and clear...

fix: Do not display tab trait when germplasm-result page is active and clear Germplasm-list field to have more generic suggestions. GNP-4309
parent 9e30c1db
This diff is collapsed.
......@@ -44,15 +44,18 @@ export class SwitchButtonComponent implements OnInit {
}
switchGermplasmResult() {
if (!this.germplasmDisplayCurrentState) {
this.localCriteria = {
...this.localCriteria,
facetFields: ['types']
facetFields: ['types'],
germplasmLists: null,
types: this.localCriteria.types ? this.localCriteria.types : ['Germplasm']
};
} else {
this.localCriteria = {
...this.localCriteria,
facetFields: ['types', 'sources']
facetFields: ['types', 'sources'],
};
this.germplasmSearchCriteria$.next(DataDiscoveryCriteriaUtils.emptyGermplasmSearchCriteria());
}
......
......@@ -6,7 +6,8 @@
{{ tabs.GERMPLASM }}
</a>
</li>
<li class="nav-item">
<li class="nav-item"
*ngIf="!displayGermplasmResult">
<a tabindex="1"
class="nav-link trait {{ getNavClass(tabs.TRAIT) }}"
(click)="activeTab=tabs.TRAIT">
......
......@@ -32,6 +32,11 @@ export class FormComponent implements OnInit {
return this.activeTab === tab ? 'visible' : 'd-none';
}
ngOnInit(): void {
this.displayGermplasmResult$.subscribe(displayStatus => this.displayGermplasmResult = displayStatus);
this.displayGermplasmResult$.subscribe(displayStatus => {
this.displayGermplasmResult = displayStatus;
if (this.displayGermplasmResult) {
this.activeTab = Tabs.GERMPLASM;
}
});
}
}
Markdown is supported
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