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