Skip to content

Commit

Permalink
Merge pull request #76 from EBISPOT/29-03-22-release
Browse files Browse the repository at this point in the history
29 03 22 release
  • Loading branch information
ala-ebi authored Mar 29, 2022
2 parents 32eb8a6 + 69fc317 commit dc84c33
Show file tree
Hide file tree
Showing 70 changed files with 4,037 additions and 491 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,7 @@ testem.log
# System Files
.DS_Store
Thumbs.db
!/src/environments/environment.ts

tailwind.config.js
src/environments/environment.ts
40 changes: 23 additions & 17 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
image: docker:latest
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:latest
services:
- docker:dind

stages:
- sandbox-build
- sandbox-build-migration
- prod-build
- docker-build
- docker-build-release
- deploy-sandbox
- deploy-sandbox-migration
- deploy-production
- deploy-fallback

Expand All @@ -17,23 +17,27 @@ variables:
CI_REGISTRY_IMAGE: ebispot/gwas-curation-ui
CURATION_UI_SERVICE_NAME: gwas-curation-ui

sandbox-build:
image: node:14.15.5
stage: sandbox-build



sandbox-build-migration:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/node:14.15.5
stage: sandbox-build-migration
script:
- npm -v
- node -v
- rm -rf node_modules
- npm install
- CI=false npm run build -- --base-href=/gwas/depo-curation/ --configuration sandbox
- CI=false npm run build -- --base-href=/gwas/depo-curation/ --configuration sandbox-migration
artifacts:
paths:
- dist/gwas-curation-ui/*
only:
- develop


prod-build:
image: node:14.15.5
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/node:14.15.5
stage: prod-build
script:
- npm -v
Expand All @@ -47,6 +51,7 @@ prod-build:
except:
- tags
- develop
- curation-477-sandbox-migration

docker-build:
stage: docker-build
Expand Down Expand Up @@ -74,23 +79,24 @@ docker-build-release:
only:
- tags

deploy-sandbox:
image: dtzar/helm-kubectl:2.13.1
stage: deploy-sandbox

deploy-sandbox-migration:
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/dtzar/helm-kubectl:2.13.1
stage: deploy-sandbox-migration
script:
- echo "Deploy to sandbox server"
- mkdir -p /root/.kube
- echo ${SANBOX_KUBECONF} | base64 -d > /root/.kube/config
- echo ${PLIVE_KUBECONFIG} | base64 -d > /root/.kube/config
- helm init --stable-repo-url https://charts.helm.sh/stable
- helm delete --purge gwas-curation-ui || true
- helm install --name gwas-curation-ui --set k8Namespace=gwas,image.repository=$CI_REGISTRY_IMAGE,image.tag=$CI_COMMIT_SHA ./k8chart/ --wait
- helm delete --purge gwas-curation-ui-dev || true
- helm install --name gwas-curation-ui-dev --set k8Namespace=gwas-dev,service.name=gwas-curation-ui-dev,ingress.name=curation-ui-ingress-dev,image.repository=$CI_REGISTRY_IMAGE,image.tag=$CI_COMMIT_SHA ./k8chart/ --wait
environment:
name: sandbox
name: sandbox-migration
only:
- develop

deploy-fallback:
image: dtzar/helm-kubectl:2.13.1
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/dtzar/helm-kubectl:2.13.1
stage: deploy-fallback
script:
- echo "Deploy to Production fallback server"
Expand All @@ -105,7 +111,7 @@ deploy-fallback:
- tags

deploy-production:
image: dtzar/helm-kubectl:2.13.1
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/dtzar/helm-kubectl:2.13.1
stage: deploy-production
script:
- echo "Deploy to Production server"
Expand Down
26 changes: 26 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,32 @@
"maximumError": "10kb"
}
]
},"sandbox-migration": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.sandbox-migration.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
},
"local-sandbox": {
"fileReplacements": [
Expand Down
4 changes: 2 additions & 2 deletions k8chart/templates/gwas-curation-ui-ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: curation-ui-ingress
namespace: gwas
name: {{.Values.ingress.name}}
namespace: {{.Values.k8Namespace}}
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /gwas/depo-curation/$2
nginx.ingress.kubernetes.io/ssl-redirect: "false"
Expand Down
1 change: 1 addition & 0 deletions k8chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ service:
port: 80

ingress:
name: curation-ui-ingress
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
Expand Down
8 changes: 8 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ const routes: Routes = [
path: 'submissions',
loadChildren: () => import('./feature/submission/submission.module').then(m => m.SubmissionModule)
},
{
path: 'reported-traits',
loadChildren: () => import('./feature/reported-trait/reported-trait.module').then(m => m.ReportedTraitModule)
},
{
path: 'efo-traits',
loadChildren: () => import('./feature/efo-trait/efo-trait.module').then(m => m.EfoTraitModule)
},
{
path: 'login',
loadChildren: () => import('./feature/authentication/authentication.module').then(m => m.AuthenticationModule)
Expand Down
4 changes: 2 additions & 2 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div style="min-height: 70vh">
<app-header></app-header>
<app-header *ngIf="routePath !== 'login'"></app-header>
<div>
<router-outlet></router-outlet>
</div>
</div>
<app-footer></app-footer>
<!--<app-footer></app-footer>-->
10 changes: 10 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import { Component } from '@angular/core';
import {ActivationEnd, Router} from "@angular/router";

@Component({
selector: 'app-root',
templateUrl: 'app.component.html',
styleUrls: ['app.component.css']
})
export class AppComponent {

routePath: string;
constructor(private router: Router) {
router.events.subscribe((val) => {
if (val instanceof ActivationEnd) {
this.routePath = val.snapshot.routeConfig.path;
}
});
}
}
13 changes: 9 additions & 4 deletions src/app/core/components/header/header.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<nav class="bg-gray-800 mat-elevation-z9 sticky w-full" style="z-index: 200; top: -1px">
<div class="max-w-7xl mx-auto px-2 sm:px-4 lg:px-6">
<div class="relative flex items-center justify-between h-16">
<div class="relative flex items-center justify-between" style="height: 3.3rem;">
<div class="absolute inset-y-0 left-0 flex items-center sm:hidden">
<!-- Mobile menu button-->
<button (click)="showMenu()" mat-icon-button type="button" class="rounded-md text-gray-400 hover:text-white hover:bg-gray-700">
Expand All @@ -16,6 +16,8 @@
<div class="hidden sm:block sm:ml-6">
<div class="flex flex-wrap space-x-4">
<a routerLink="submissions" mat-button class="text-gray-300 hover:bg-gray-700 hover:text-white px-2 py-2 rounded-md text-sm font-medium">Submissions</a>
<a routerLink="reported-traits" mat-button class="text-gray-300 hover:bg-gray-700 hover:text-white px-2 py-2 rounded-md text-sm font-medium">Reported traits</a>
<a routerLink="efo-traits" mat-button class="text-gray-300 hover:bg-gray-700 hover:text-white px-2 py-2 rounded-md text-sm font-medium">EFO traits</a>
</div>
</div>
</div>
Expand All @@ -40,9 +42,12 @@
<div class="sm:hidden" id="mobile-menu" *ngIf="menuOpen">
<div class="px-2 pt-2 pb-3 space-y-1">
<a routerLink="submissions" mat-button class="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium">Submissions</a>
<a routerLink="reported-traits" mat-button class="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium">Reported traits</a>
<a routerLink="efo-traits" mat-button class="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium">EFO traits</a>
</div>
</div>
</nav>
<mat-toolbar color="accent" class="mb-3">
{{pathName}}
</mat-toolbar>

<!--<mat-toolbar color="primary" class="mb-3">-->
<!-- {{pathName}}-->
<!--</mat-toolbar>-->
10 changes: 10 additions & 0 deletions src/app/core/models/efoTrait.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Provenance } from './provenance';

export interface EfoTrait {
efoTraitId: string;
trait: string;
shortForm: string;
uri: string;
created: Provenance;
edited: Provenance;
}
7 changes: 7 additions & 0 deletions src/app/core/models/reportedTrait.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Provenance } from './provenance';

export interface ReportedTrait {
diseaseTraitId: string;
trait: string;
created: Provenance;
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { EfoTrait } from '../../efoTrait';
import { ApiResponse } from './apiResponse';

export interface EfoTraitsListApiResponse extends ApiResponse {

_embedded: {
efoTraits: EfoTrait[];
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { ApiResponse } from './apiResponse';
import { ReportedTrait } from '../../reportedTrait';

export interface ReportedTraitsListApiResponse extends ApiResponse {
_embedded: {
diseaseTraits: ReportedTrait[];
};
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ApiResponse } from '../models/apiResponse';
import { Submission } from '../models/submission';
import { ApiResponse } from './apiResponse';
import { Submission } from '../../submission';

export interface SubmissionListApiResponse extends ApiResponse {
_embedded: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// TODO delete
export interface TraitUploadApiResponse {
trait: string;
uploadComment: string;
links: string[];
}
33 changes: 33 additions & 0 deletions src/app/core/models/study.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { ReportedTrait } from './reportedTrait';
import { EfoTrait } from './efoTrait';

export interface Study {
studyId: string;
study_tag: string;
study_accession: string;
genotyping_technology: string;
array_manufacturer: string;
array_information: string;
imputation: boolean;
variant_count: number;
sample_description: string;
statistical_model: string;
study_description: string;
trait: string;
efo_trait: string;
background_trait: string;
background_efo_trait: string;
checksum: string;
summary_statistics_file: string;
raw_sumstats_file: string;
summary_statistics_assembly: string;
readme_file: string;
cohort: string;
cohort_id: string;
// associations: Association[];
// samples: Sample[];
// notes: Note[];
agreedToCc0: boolean;
diseaseTrait: ReportedTrait;
efoTraits: EfoTrait[];
}
6 changes: 3 additions & 3 deletions src/app/core/services/curation-http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class CurationHttpService {
}

private static formatErrors(error: any) {
return throwError(error.error);
return throwError(error);
}

get(path: string, params: HttpParams = new HttpParams()): Observable<any> {
Expand All @@ -24,15 +24,15 @@ export class CurationHttpService {
put(path: string, body: any = {}, params: HttpParams = new HttpParams()): Observable<any> {
return this.http.put(
`${environment.CURATION_API_URL}${path}`,
JSON.stringify(body),
body,
{params}
).pipe(catchError(CurationHttpService.formatErrors));
}

post(path: string, body: any = {}): Observable<any> {
return this.http.post(
`${environment.CURATION_API_URL}${path}`,
JSON.stringify(body)
body
).pipe(catchError(CurationHttpService.formatErrors));
}

Expand Down
16 changes: 16 additions & 0 deletions src/app/core/services/efo-trait.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';

import { EfoTraitService } from './efo-trait.service';

describe('EfoTraitService', () => {
let service: EfoTraitService;

beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(EfoTraitService);
});

it('should be created', () => {
expect(service).toBeTruthy();
});
});
Loading

0 comments on commit dc84c33

Please sign in to comment.