Skip to content

Commit bb1e5ba

Browse files
committed
Merge branch 'dev-refsearch'
2 parents 02ef5e3 + c7fef9b commit bb1e5ba

21 files changed

+757
-8
lines changed

app/frontend/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vdjdb-frontend",
3-
"version": "2.4.20",
3+
"version": "2.5.0",
44
"description": "Frontend application for VDJdb-server",
55
"license": "Apache 2.0",
66
"private": true,

app/frontend/src/app/application.routing.ts

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const routes: Routes = [
3131
{ path: 'self-antigen', component: SelfAntigenActionComponent },
3232
{ path: 'annotations', loadChildren: 'pages/annotations/annotations.module#AnnotationsPageModule' },
3333
{ path: 'motif', loadChildren: 'pages/motif/motif.module#MotifPageModule' },
34+
{ path: 'refsearch', loadChildren: 'pages/refsearch/refsearch.module#RefSearchPageModule' },
3435
{ path: 'about', loadChildren: 'pages/about/about.module#AboutPageModule' },
3536
{ path: 'links', loadChildren: 'pages/links/links.module#LinksPageModule' },
3637
{ path: 'credits', loadChildren: 'pages/credits/credits.module#CreditsPageModule' }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!--
2+
~ Copyright 2017-2019 Bagaev Dmitry
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<div class="ui main content container text fade slow element" style="max-width: 1050px !important; padding-bottom: 75px;">
18+
<div class="ui raised segments">
19+
<h3 class="ui top attached header centered">Reference search </h3>
20+
<ng-container [ngSwitch]="isAlive | async">
21+
<ng-container *ngSwitchCase="1"> <!-- UNDEFINED -->
22+
<div class="ui teal segment raised">
23+
<div class="ui active centered inline loader"></div>
24+
</div>
25+
</ng-container>
26+
<ng-container *ngSwitchCase="2"> <!-- ALIVE -->
27+
<div class="ui teal segment raised" [ngClass]="{ 'loading': isLoading | async }">
28+
<refsearch-filters></refsearch-filters>
29+
</div>
30+
<div class="ui segment raised">
31+
<div class="ui grid middle aligned">
32+
33+
<div class="three wide column">
34+
<button class="ui teal fluid button" (click)="search()" [ngClass]="{ 'loading': isLoading | async }">Search</button>
35+
</div>
36+
37+
<div class="ten wide column"></div>
38+
39+
<div class="three wide column">
40+
<button class="ui blue fluid button" (click)="reset()" [ngClass]="{ 'disabled': isLoading | async }">Reset filters</button>
41+
</div>
42+
43+
</div>
44+
</div>
45+
<div class="ui segment raised" *ngIf="(error | async) as errmsg">
46+
<div class="ui negative message">
47+
<div class="header">
48+
Error has occured during the search request
49+
</div>
50+
<p>{{ errmsg }}</p>
51+
</div>
52+
53+
</div>
54+
<div class="ui segment raised" [ngClass]="{ 'loading': isLoading | async }" *ngIf="!(error | async)">
55+
<refsearch-table [rows]="rows | async"></refsearch-table>
56+
</div>
57+
</ng-container>
58+
<ng-container *ngSwitchCase="3"> <!-- UNREACHABLE -->
59+
<div class="ui teal segment raised">
60+
<h2 class="ui center aligned icon header">
61+
<i class="exclamation triangle icon"></i>
62+
The server is unreachable
63+
<div class="sub header">
64+
The reference search backend is not available at the moment. Please, try again later.
65+
</div>
66+
</h2>
67+
</div>
68+
</ng-container>
69+
</ng-container>
70+
</div>
71+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright 2017-2019 Bagaev Dmitry
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { ChangeDetectionStrategy, Component } from '@angular/core';
18+
import { Observable } from 'rxjs';
19+
import { RefSearchTableRow } from './refsearch';
20+
import { RefSearchBackendState, RefSearchService } from './refsearch.service';
21+
22+
@Component({
23+
selector: 'refsearch',
24+
templateUrl: './refsearch.component.html',
25+
changeDetection: ChangeDetectionStrategy.OnPush
26+
})
27+
export class RefSearchPageComponent {
28+
29+
get isAlive(): Observable<RefSearchBackendState> {
30+
return this.refsearch.isAlive();
31+
}
32+
33+
get isLoading(): Observable<boolean> {
34+
return this.refsearch.isLoading();
35+
}
36+
37+
get error(): Observable<string | undefined> {
38+
return this.refsearch.getError();
39+
}
40+
41+
get rows(): Observable<RefSearchTableRow[] | undefined> {
42+
return this.refsearch.getRows();
43+
}
44+
45+
constructor(private refsearch: RefSearchService) {}
46+
47+
public search(): void {
48+
this.refsearch.search()
49+
}
50+
51+
public reset(): void {
52+
this.refsearch.reset()
53+
}
54+
55+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright 2017-2019 Bagaev Dmitry
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { CommonModule } from '@angular/common';
18+
import { NgModule } from '@angular/core';
19+
import { FormsModule } from '@angular/forms';
20+
import { RefSearchPageRouting } from 'pages/refsearch/refsearch.routing';
21+
import { FiltersModule } from 'shared/filters/filters.module';
22+
import { RefSearchPageComponent } from './refsearch.component';
23+
import { RefSearchService } from './refsearch.service';
24+
import { FiltersCommonModule } from 'shared/filters/common/filters-common.module';
25+
import { RefSearchPageFiltersComponent } from './refsearch_filters/refsearch-filters.component';
26+
import { RefSearchPageTableComponent } from './refsearch_table/refsearch-table.component';
27+
import { RefSearchPageTableRowComponent } from './refsearch_table_row/refsearch-table-row.component';
28+
29+
@NgModule({
30+
imports: [ CommonModule, FormsModule, FiltersModule, RefSearchPageRouting, FiltersCommonModule ],
31+
declarations: [ RefSearchPageComponent, RefSearchPageFiltersComponent, RefSearchPageTableComponent, RefSearchPageTableRowComponent ],
32+
providers: [ RefSearchService ]
33+
})
34+
export class RefSearchPageModule {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright 2017-2019 Bagaev Dmitry
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
import { RouterModule, Routes } from '@angular/router';
18+
import { RefSearchPageComponent } from 'pages/refsearch/refsearch.component';
19+
20+
const routes: Routes = [
21+
{ path: '', component: RefSearchPageComponent }
22+
];
23+
24+
export const RefSearchPageRouting = RouterModule.forChild(routes); // tslint:disable-line:variable-name

0 commit comments

Comments
 (0)