Skip to content
Snippets Groups Projects
Commit ec08b1f0 authored by Julian Späth's avatar Julian Späth
Browse files

Merge branch 'add-feedback-after-launch' into 'master'

Add feedback after launching quick find drugs

See merge request covid-19/frontend!79
parents d0739249 477a3f22
No related branches found
No related tags found
No related merge requests found
...@@ -45,6 +45,8 @@ export class AnalysisService { ...@@ -45,6 +45,8 @@ export class AnalysisService {
private intervalId: any; private intervalId: any;
private canLaunchNewTask = false; private canLaunchNewTask = false;
private launchingQuick = false;
constructor(private http: HttpClient) { constructor(private http: HttpClient) {
const tokens = localStorage.getItem('tokens'); const tokens = localStorage.getItem('tokens');
const finishedTokens = localStorage.getItem('finishedTokens'); const finishedTokens = localStorage.getItem('finishedTokens');
...@@ -153,6 +155,8 @@ export class AnalysisService { ...@@ -153,6 +155,8 @@ export class AnalysisService {
return; return;
} }
this.launchingQuick = true;
const resp = await this.http.post<any>(`${environment.backend}task/`, { const resp = await this.http.post<any>(`${environment.backend}task/`, {
algorithm: 'quick', algorithm: 'quick',
target: 'drug', target: 'drug',
...@@ -200,6 +204,10 @@ export class AnalysisService { ...@@ -200,6 +204,10 @@ export class AnalysisService {
this.startWatching(); this.startWatching();
} }
public isLaunchingQuick(): boolean {
return this.launchingQuick;
}
showToast(task: Task, status: 'DONE' | 'FAILED') { showToast(task: Task, status: 'DONE' | 'FAILED') {
let toastMessage; let toastMessage;
let toastType; let toastType;
...@@ -252,6 +260,7 @@ export class AnalysisService { ...@@ -252,6 +260,7 @@ export class AnalysisService {
} else { } else {
this.canLaunchNewTask = true; this.canLaunchNewTask = true;
} }
this.launchingQuick = false;
}; };
watch(); watch();
if (this.intervalId) { if (this.intervalId) {
......
...@@ -251,10 +251,11 @@ ...@@ -251,10 +251,11 @@
<div class="tile notification is-info"> <div class="tile notification is-info">
<div class="align-vmiddle"> <div class="align-vmiddle">
<div class="digit">2</div> <div class="digit">2</div>
<button (click)="analysis.startQuickAnalysis()" [disabled]="analysis.getCount() === 0" <button (click)="analysis.startQuickAnalysis()" [disabled]="analysis.getCount() === 0 || analysis.isLaunchingQuick()"
class="button is-white is-rounded"> class="button is-white is-rounded">
<span class="icon"> <span class="icon">
<i class="fa fa-capsules"></i> <i class="fa fa-capsules" *ngIf="!analysis.isLaunchingQuick()"></i>
<i class="fa fa-spin fa-spinner" *ngIf="analysis.isLaunchingQuick()"></i>
</span> </span>
<span> <span>
Find Drugs Find Drugs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment