Skip to content

Commit 3cdfb77

Browse files
authored
Merge pull request #103 from EBISPOT/develop
release v1.1.0
2 parents 85ba299 + 3d0ad2d commit 3cdfb77

26 files changed

+771
-8
lines changed

src/app/app-routing.module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ const routes: Routes = [
1414
path: 'efo-traits',
1515
loadChildren: () => import('./feature/efo-trait/efo-trait.module').then(m => m.EfoTraitModule)
1616
},
17+
{
18+
path: 'studies',
19+
loadChildren: () => import('./feature/study/study.module').then(m => m.StudyModule)
20+
},
1721
{
1822
path: 'login',
1923
loadChildren: () => import('./feature/authentication/authentication.module').then(m => m.AuthenticationModule)

src/app/core/components/header/header.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<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>
1919
<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>
2020
<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>
21+
<a routerLink="studies" mat-button class="text-gray-300 hover:bg-gray-700 hover:text-white px-2 py-2 rounded-md text-sm font-medium">Studies</a>
2122
</div>
2223
</div>
2324
</div>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { ApiResponse } from './apiResponse';
2+
import { StudySolr } from '../../studySolr';
3+
4+
export interface StudySearchApiResponse extends ApiResponse {
5+
6+
_embedded: {
7+
studySolrDToes: StudySolr[];
8+
};
9+
}

src/app/core/models/studySolr.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export interface StudySolr {
2+
reportedTrait: string;
3+
efoTraits: string[];
4+
pmid: string;
5+
submissionId: string;
6+
publicationDate: string;
7+
firstAuthor: string;
8+
title: string;
9+
accessionId: string;
10+
notes: string[];
11+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { TestBed } from '@angular/core/testing';
2+
3+
import { StudyService } from './study.service';
4+
5+
describe('StudyService', () => {
6+
let service: StudyService;
7+
8+
beforeEach(() => {
9+
TestBed.configureTestingModule({});
10+
service = TestBed.inject(StudyService);
11+
});
12+
13+
it('should be created', () => {
14+
expect(service).toBeTruthy();
15+
});
16+
});
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { Injectable } from '@angular/core';
2+
import { CurationHttpService } from './curation-http.service';
3+
import { HttpParams } from '@angular/common/http';
4+
5+
@Injectable({
6+
providedIn: 'root'
7+
})
8+
export class StudyService {
9+
10+
constructor(private http: CurationHttpService) {}
11+
12+
search(size: number, page: number, sort: string, order: string, efoTrait: string, reportedTrait: string, note: string,
13+
sumstatsFlag: string, pooledFlag: string, gxeFlag: string) {
14+
let params: HttpParams = new HttpParams();
15+
if (size) {
16+
params = params.set('size', String(size));
17+
}
18+
if (page) {
19+
params = params.set('page', String(page));
20+
}
21+
if (sort) {
22+
params = params.set('sort', sort + ',' + order);
23+
}
24+
if (efoTrait){
25+
params = params.set('efoTrait', efoTrait);
26+
}
27+
if (reportedTrait) {
28+
params = params.set('reportedTrait', reportedTrait);
29+
}
30+
if (note) {
31+
params = params.set('note', note);
32+
}
33+
if (sumstatsFlag !== 'any' && sumstatsFlag != null) {
34+
params = params.set('sumstatsFlag', String(sumstatsFlag));
35+
}
36+
if (gxeFlag !== 'any' && gxeFlag != null) {
37+
params = params.set('gxeFlag', String(gxeFlag));
38+
}
39+
if (pooledFlag !== 'any' && pooledFlag != null) {
40+
params = params.set('pooledFlag', String(pooledFlag));
41+
}
42+
43+
return this.http.get('/studies', params);
44+
}
45+
}

src/app/core/services/submission.service.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,20 @@ export class SubmissionService {
173173
.set('sort', sort + ',' + order);
174174
return this.curationHttp.get('/submissions/' + submissionId + '/studies/sampledescription', params);
175175
}
176+
177+
getSnpStatus(submissionId: string) {
178+
return this.curationHttp.get('/submissions/' + submissionId + '/associations/snp-status');
179+
}
180+
181+
approveSnps(submissionId: string) {
182+
return this.curationHttp.put('/submissions/' + submissionId + '/associations/approve-snps');
183+
}
184+
185+
downloadSnpValidationReport(submissionId: string) {
186+
return this.curationHttp.download('/submissions/' + submissionId + '/associations/snp-validation-report');
187+
}
188+
189+
retriggerSnpValidation(submissionId: string) {
190+
return this.http.get('/submissions/' + submissionId + '/validate-snps');
191+
}
176192
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
.mat-cell {
2+
padding: 0 4px;
3+
}
4+
5+
th {
6+
color: black;
7+
font-weight: bold;
8+
}
9+
.table-container {
10+
position: relative;
11+
overflow: auto;
12+
width: 100%;
13+
}
14+
15+
table {
16+
width: 100%;
17+
min-height: 300px;
18+
}
19+
20+
th, td {
21+
white-space: pre-wrap;
22+
text-overflow:ellipsis;
23+
overflow: hidden;
24+
}
25+
26+
.loading-shade {
27+
position: absolute;
28+
top: 0;
29+
left: 0;
30+
bottom: 0;
31+
right: 0;
32+
background: rgba(0, 0, 0, 0.15);
33+
z-index: 4;
34+
display: flex;
35+
align-items: center;
36+
justify-content: center;
37+
}
38+
39+
.filters-button {
40+
width: 120px;
41+
}
42+
43+
44+
tr.example-detail-row {
45+
height: 0;
46+
}
47+
48+
tr.example-element-row:not(.example-expanded-row):active {
49+
background: #efefef;
50+
}
51+
52+
.example-element-row td {
53+
border-bottom-width: 0;
54+
}
55+
56+
.element-detail {
57+
overflow: hidden;
58+
display: flex;
59+
}
60+
61+
.element-description {
62+
padding: 16px;
63+
}
64+
65+
.mat-row {
66+
background-color: white;
67+
}
68+
69+
.mat-row:nth-child(4n-1), .mat-row:nth-child(4n) {
70+
background-color: #eee;
71+
}
72+
73+
.ellipsis-col {
74+
overflow: hidden;
75+
max-width: 200px;
76+
text-overflow: ellipsis;
77+
white-space: nowrap;
78+
}
79+
80+
::ng-deep .cdk-overlay-pane {
81+
width: auto !important;
82+
}

0 commit comments

Comments
 (0)