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

refactor: Change style for links and navbar. Check if sources exist before display. GNP-5490

parent e37ced3d
......@@ -1189,6 +1189,11 @@
"integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=",
"dev": true
},
"angular-coordinates": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/angular-coordinates/-/angular-coordinates-1.0.0.tgz",
"integrity": "sha1-IcuYpv+PTV6LWLjOjvzBP7elnug="
},
"angular-mocks": {
"version": "1.7.8",
"resolved": "https://registry.npmjs.org/angular-mocks/-/angular-mocks-1.7.8.tgz",
......
......@@ -24,6 +24,7 @@
"@ng-bootstrap/ng-bootstrap": "4.0.0",
"@types/leaflet": "1.2.14",
"@types/leaflet.markercluster": "1.0.3",
"angular-coordinates": "1.0.0",
"angular-mocks": "1.7.8",
"bootstrap": "4.1.3",
"core-js": "2.5.7",
......
......@@ -24,6 +24,7 @@ import { LoadingSpinnerComponent } from './loading-spinner/loading-spinner.compo
import { CardTableComponent } from './card-table/card-table.component';
import { MomentModule } from 'ngx-moment';
import { XrefsComponent } from './xrefs/xrefs.component';
import { CoordinatesModule } from 'angular-coordinates';
@NgModule({
......@@ -58,7 +59,8 @@ import { XrefsComponent } from './xrefs/xrefs.component';
NgbPopoverModule,
FormsModule,
ReactiveFormsModule,
MomentModule
MomentModule,
CoordinatesModule
],
providers: [
{ provide: HTTP_INTERCEPTORS, useExisting: ErrorInterceptorService, multi: true }
......
......@@ -4,3 +4,4 @@
font-weight: bold;
overflow-wrap: normal;
}
......@@ -233,10 +233,10 @@
<gpds-card-row
label="Data source"
[test]="germplasmGnpis.documentationURL">
[test]="germplasmSource['schema:identifier'] && germplasmGnpis.documentationURL">
<ng-template>
<a target="_blank" [href]="germplasmGnpis.documentationURL">
Link to this study on source
Link to this study on {{ germplasmSource['schema:identifier'] }}
</a>
</ng-template>
</gpds-card-row>
......
@import "theme";
@import '../../styles.scss';
a {
color: #0f6fa1;
text-decoration: underline;
}
a:not([href]):not([tabindex]) {
color: #0f6fa1;
cursor: pointer;
}
a:not([href]):not([tabindex]):hover {
text-decoration: underline;
}
......@@ -92,25 +92,17 @@ export class GermplasmCardComponent implements OnInit {
let germplasm$: Promise<Germplasm>;
if (id) {
germplasm$ = this.gnpisService.germplasm(id).toPromise();
germplasm$
.then(germplasmGnpis => {
this.germplasmGnpis = germplasmGnpis;
// Get germplasm source
const sourceURI = germplasmGnpis['schema:includedInDataCatalog'];
this.getGermplasmSource(sourceURI);
this.reformatData(germplasmGnpis);
});
} else {
germplasm$ = this.gnpisService.germplasmByPuid(pui).toPromise();
germplasm$
.then(germplasmGnpis => {
this.germplasmGnpis = germplasmGnpis;
// Get germplasm source
const sourceURI = germplasmGnpis['schema:includedInDataCatalog'];
this.getGermplasmSource(sourceURI);
this.reformatData(germplasmGnpis);
});
}
germplasm$
.then(germplasmGnpis => {
this.germplasmGnpis = germplasmGnpis;
// Get germplasm source
const sourceURI = germplasmGnpis['schema:includedInDataCatalog'];
this.getGermplasmSource(sourceURI);
this.reformatData(germplasmGnpis);
});
return germplasm$;
}
......
@import "theme";
.navbar {
background-image: $theme-navbar-bg-color;
background-color: $theme-navbar-bg-color;
}
.navbar-toggler {
......
......@@ -29,10 +29,10 @@
<gpds-card-row
label="Data source"
[test]="location && location.documentationURL">
[test]="location && location['schema:identifier'] && location.documentationURL">
<ng-template>
<a target="_blank" [href]="location.documentationURL">
Link to this study on {{ location["schema:identifier"] }}
Link to this study on {{ location['schema:identifier'] }}
</a>
</ng-template>
</gpds-card-row>
......
@import "theme";
@import '../../styles.scss';
h3 {
font-weight: bold;
color: #0f6191;
a:not([href]):not([tabindex]) {
color: #0f6fa1;
cursor: pointer;
}
a {
a:not([href]):not([tabindex]):hover {
text-decoration: underline;
}
......@@ -43,7 +43,7 @@
<gpds-card-row
label="Data source"
[test]="studySource && study.documentationURL">
[test]="studySource && studySource['schema:identifier'] && study.documentationURL">
<ng-template>
<a target="_blank" [href]="study.documentationURL">
Link to this study on {{ studySource["schema:identifier"] }}
......
@import "theme";
@import '../../styles.scss';
a {
color: #0f6fa1;
text-decoration: underline;
}
a:not([href]):not([tabindex]) {
color: #0f6fa1;
cursor: pointer;
}
a:not([href]):not([tabindex]):hover {
text-decoration: underline;
}
......@@ -73,7 +73,7 @@ $theme-btn-hover-border-color: $_theme-blue;
// custom navbar
$theme-navbar-height: 4rem;
$theme-navbar-color: $black;
$theme-navbar-bg-color: repeating-linear-gradient(#9b9b9b, #eaeaea, #eaeaea);
$theme-navbar-bg-color: $_theme-light-gray;
$theme-navbar-hover-color: $white;
$theme-navbar-hover-bg-color: $_theme-gray;
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