Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Maintenance - Mise à jour mensuelle Lundi 6 Février entre 7h00 et 9h00
Open sidebar
urgi-is
FAIDARE
Commits
aed32453
Commit
aed32453
authored
Mar 04, 2019
by
Jérémy Destin
Committed by
Célia Michotey
Mar 19, 2019
Browse files
fix: Fix the bug for germplasm navigation page.
GNP-5490
parent
64ccbd2a
Changes
3
Hide whitespace changes
Inline
Side-by-side
frontend/src/app/app-routing.module.ts
View file @
aed32453
...
...
@@ -5,15 +5,19 @@ import { GermplasmCardComponent } from './germplasm-card/germplasm-card.componen
import
{
StudyCardComponent
}
from
'
./study-card/study-card.component
'
;
import
{
SiteCardComponent
}
from
'
./site-card/site-card.component
'
;
const
routes
:
Routes
=
[
{
path
:
'
germplasm
'
,
component
:
GermplasmCardComponent
},
export
const
routes
:
Routes
=
[
{
path
:
'
studies/:id
'
,
component
:
StudyCardComponent
},
{
path
:
'
sites/:id
'
,
component
:
SiteCardComponent
},
{
path
:
''
,
component
:
ResultPageComponent
},
{
path
:
'
germplasm
'
,
component
:
GermplasmCardComponent
,
runGuardsAndResolvers
:
'
paramsOrQueryParamsChange
'
}
];
@
NgModule
({
imports
:
[
RouterModule
.
forRoot
(
routes
)],
imports
:
[
RouterModule
.
forRoot
(
routes
,
{
onSameUrlNavigation
:
'
reload
'
}
)],
exports
:
[
RouterModule
]
})
export
class
AppRoutingModule
{
...
...
frontend/src/app/germplasm-card/germplasm-card.component.html
View file @
aed32453
...
...
@@ -640,7 +640,7 @@
label=
"Mother"
[test]=
"germplasmPedigree.parent1Type && germplasmPedigree.parent1Type == 'FEMALE'"
>
<ng-template>
<a
[routerLink]=
"'/germplasm'"
<a
[routerLink]=
"
[
'/germplasm'
]
"
[queryParams]=
"{id:germplasmPedigree.parent1DbId}"
>
{{ germplasmPedigree.parent1Name }}
</a>
...
...
@@ -651,7 +651,7 @@
label=
"Father"
[test]=
"germplasmPedigree.parent1Type && germplasmPedigree.parent1Type == 'MALE'"
>
<ng-template>
<a
[routerLink]=
"'/germplasm'"
<a
[routerLink]=
"
[
'/germplasm'
]
"
[queryParams]=
"{id:germplasmPedigree.parent1DbId}"
>
{{ germplasmPedigree.parent1Name }}
</a>
...
...
@@ -679,7 +679,7 @@
label=
"Mother"
[test]=
"germplasmPedigree.parent2Type && germplasmPedigree.parent2Type == 'FEMALE'"
>
<ng-template>
<a
[routerLink]=
"'/germplasm'"
<a
[routerLink]=
"
[
'/germplasm'
]
"
[queryParams]=
"{id:germplasmPedigree.parent2DbId}"
>
{{ germplasmPedigree.parent2Name }}
</a>
...
...
@@ -690,7 +690,7 @@
label=
"Father"
[test]=
"germplasmPedigree.parent2Type && germplasmPedigree.parent2Type == 'MALE'"
>
<ng-template>
<a
[routerLink]=
"'/germplasm'"
<a
[routerLink]=
"
[
'/germplasm'
]
"
[queryParams]=
"{id:germplasmPedigree.parent2DbId}"
>
{{ germplasmPedigree.parent2Name }}
</a>
...
...
@@ -723,7 +723,7 @@
<div
class=
"content-overflow"
>
<ng-container
*ngFor=
"let sibling of germplasmPedigree.siblings"
>
<a
[routerLink]=
"'/germplasm'"
[queryParams]=
"{id:sibling.germplasmDbId }"
>
<a
[routerLink]=
"
[
'/germplasm'
]
"
[queryParams]=
"{id:sibling.germplasmDbId }"
>
{{ sibling.defaultDisplayName }}
</a>
,
</ng-container>
...
...
@@ -746,7 +746,7 @@
<ng-template>
<ng-container
*ngFor=
"let sibling of child.sibblings"
>
<a
[routerLink]=
"'/germplasm'"
[queryParams]=
"{
pu
i:sibling.pui}"
>
<a
[routerLink]=
"
[
'/germplasm'
]
"
[queryParams]=
"{i
d
:sibling.pui}"
>
{{ sibling.name }}
</a>
,
</ng-container>
...
...
@@ -789,7 +789,7 @@
<gpds-card-row
[label]=
"collection.type ? collection.name + ' (' + collection.type + ')' : collection.name"
>
<ng-template>
<a
[routerLink]=
"'/'"
<a
[routerLink]=
"
[
'/'
]
"
[queryParams]=
"{germplasmLists: collection.name, types: 'Germplasm'}"
>
{{ collection.germplasmCount }} accessions
</a>
...
...
@@ -811,7 +811,7 @@
<ng-container
*ngFor=
"let panel of germplasmGnpis.panel"
>
<gpds-card-row
[label]=
"panel.type ? panel.name + ' (' + panel.type + ')' : panel.name"
>
<a
[routerLink]=
"'/'"
<a
[routerLink]=
"
[
'/'
]
"
[queryParams]=
"{germplasmLists: panel.name, types: 'Germplasm'}"
>
{{ panel.germplasmCount }} accessions
</a>
...
...
@@ -833,7 +833,7 @@
<gpds-card-row
[label]=
"population.type ? population.name + ' (' + population.type + ')' : population.name"
>
<ng-template>
<a
[routerLink]=
"'/'"
<a
[routerLink]=
"
[
'/'
]
"
[queryParams]=
"{germplasmLists: population.name, types: 'Germplasm'}"
>
{{ population.germplasmCount }} accessions
</a>
...
...
frontend/src/app/germplasm-card/germplasm-card.component.ts
View file @
aed32453
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
ActivatedRoute
,
NavigationEnd
,
Router
}
from
'
@angular/router
'
;
import
{
BrapiService
}
from
'
../brapi.service
'
;
import
{
GnpisService
}
from
'
../gnpis.service
'
;
import
{
Germplasm
,
GermplasmProgeny
}
from
'
../models/gnpis.germplasm.model
'
;
...
...
@@ -14,7 +14,17 @@ import { BrapiGermplasmAttributes, BrapiGermplasmPedigree } from '../models/brap
export
class
GermplasmCardComponent
implements
OnInit
{
constructor
(
private
brapiService
:
BrapiService
,
private
gnpisService
:
GnpisService
,
private
route
:
ActivatedRoute
)
{
constructor
(
private
brapiService
:
BrapiService
,
private
gnpisService
:
GnpisService
,
private
route
:
ActivatedRoute
,
private
router
:
Router
)
{
this
.
router
.
events
.
subscribe
((
event
:
any
)
=>
{
// If it is a NavigationEnd event re-initalise the component
if
(
event
instanceof
NavigationEnd
)
{
this
.
ngOnInit
();
}
});
}
germplasmGnpis
:
Germplasm
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment