diff --git a/src/frontend/app/indexation/indexation.component.ts b/src/frontend/app/indexation/indexation.component.ts index c2130b84f467fbf793557d49f9191e42cc6282ba..1db9f30fa073424a6b5390e29872d82deb1994d3 100644 --- a/src/frontend/app/indexation/indexation.component.ts +++ b/src/frontend/app/indexation/indexation.component.ts @@ -94,7 +94,7 @@ export class IndexationComponent implements OnInit { this._activatedRoute.queryParamMap.subscribe((paramMap: ParamMap) => { const refresh = paramMap.get('refresh'); this.headerService.injectInSideBarLeft(this.adminMenuTemplate, this.viewContainerRef, 'adminMenu', 'form'); - this.headerService.sideBarButton = {icon: 'fa fa-home', label: this.lang.backHome, route : '/home'}; + this.headerService.sideBarButton = { icon: 'fa fa-home', label: this.lang.backHome, route: '/home' }; if (refresh) { this.appDocumentViewer.templateListForm.reset(); this.appDocumentViewer.file = { @@ -187,6 +187,7 @@ export class IndexationComponent implements OnInit { onSubmit() { if (this.indexingForm.isValidForm()) { + this.actionService.loading = true; const formatdatas = this.formatDatas(this.indexingForm.getDatas()); formatdatas['modelId'] = this.currentIndexingModel.master !== null ? this.currentIndexingModel.master : this.currentIndexingModel.id; @@ -204,6 +205,11 @@ export class IndexationComponent implements OnInit { this.dialogRef = this.dialog.open(ConfirmComponent, { panelClass: 'maarch-modal', autoFocus: false, disableClose: true, data: { title: this.lang.noFile, msg: this.lang.noFileMsg } }); this.dialogRef.afterClosed().pipe( + tap((data: string) => { + if (data !== 'ok') { + this.actionService.loading = false; + } + }), filter((data: string) => data === 'ok'), tap(() => { this.actionService.launchIndexingAction(this.selectedAction, this.headerService.user.id, this.currentGroupId, formatdatas); diff --git a/src/frontend/app/process/process.component.ts b/src/frontend/app/process/process.component.ts index 8a518e400eec529d9d992ad112cbc651955b4104..f9f0a3d403427f84bb975fc59fb048432dfa5bea 100755 --- a/src/frontend/app/process/process.component.ts +++ b/src/frontend/app/process/process.component.ts @@ -571,12 +571,14 @@ export class ProcessComponent implements OnInit { async processAction() { if (this.indexingForm.isValidForm()) { + this.actionService.loading = true; if (this.isToolModified()) { const dialogRef = this.openConfirmModification(); dialogRef.afterClosed().pipe( tap((data: string) => { if (data !== 'ok') { this.refreshTool(); + this.actionService.loading = false; } }), filter((data: string) => data === 'ok'), @@ -590,6 +592,7 @@ export class ProcessComponent implements OnInit { }), catchError((err: any) => { this.notify.handleSoftErrors(err); + this.actionService.loading = false; return of(false); }) ).subscribe();