Skip to content
Snippets Groups Projects
Commit feccb070 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #12091 TIME 0:30 disable button immediatly after click on validate

parent a32192e5
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment