Commit 614317f5 authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FIX #17058 TIME 0:10 hide error message when loading action list in indexation

parent 9e9e3166
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</div> </div>
<div class="actions-indexing-form"> <div class="actions-indexing-form">
<ng-container <ng-container
*ngIf="actionsList.length > 0 && indexingForm !== undefined && selectedAction !== undefined"> *ngIf="actionsListLoaded && actionsList.length > 0 && indexingForm !== undefined && selectedAction !== undefined">
<button mat-button class="button-form-primary" [disabled]="selectedAction.id === 0" <button mat-button class="button-form-primary" [disabled]="selectedAction.id === 0"
[matMenuTriggerFor]="menu" style="width:350px;margin-right:20px;" [matMenuTriggerFor]="menu" style="width:350px;margin-right:20px;"
[title]="selectedAction.label"> [title]="selectedAction.label">
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<mat-icon class="fa fa-check"></mat-icon> <mat-icon class="fa fa-check"></mat-icon>
</button> </button>
</ng-container> </ng-container>
<div class="emptyAction" *ngIf="actionsList.length === 0" <div class="emptyAction" *ngIf="actionsListLoaded && actionsList.length === 0"
[innerHTML]="'lang.noAvailableAction' | translate"></div> [innerHTML]="'lang.noAvailableAction' | translate"></div>
</div> </div>
</ng-container> </ng-container>
...@@ -95,4 +95,4 @@ ...@@ -95,4 +95,4 @@
autoFocus="false"> autoFocus="false">
<app-indexation-attachments-list #appIndexationAttachmentsList></app-indexation-attachments-list> <app-indexation-attachments-list #appIndexationAttachmentsList></app-indexation-attachments-list>
</mat-sidenav> </mat-sidenav>
</mat-sidenav-container> </mat-sidenav-container>
\ No newline at end of file
...@@ -13,9 +13,9 @@ import { AppService } from '@service/app.service'; ...@@ -13,9 +13,9 @@ import { AppService } from '@service/app.service';
import { IndexingFormComponent } from './indexing-form/indexing-form.component'; import { IndexingFormComponent } from './indexing-form/indexing-form.component';
import { tap, finalize, catchError, map, filter, take } from 'rxjs/operators'; import { tap, finalize, catchError, map, filter, take } from 'rxjs/operators';
import { DocumentViewerComponent } from '../viewer/document-viewer.component'; import { DocumentViewerComponent } from '../viewer/document-viewer.component';
import { ConfirmComponent } from '../../plugins/modal/confirm.component'; import { ConfirmComponent } from '@plugins/modal/confirm.component';
import { ActionsService } from '../actions/actions.service'; import { ActionsService } from '../actions/actions.service';
import { SortPipe } from '../../plugins/sorting.pipe'; import { SortPipe } from '@plugins/sorting.pipe';
import { FunctionsService } from '@service/functions.service'; import { FunctionsService } from '@service/functions.service';
import { of, Subscription } from 'rxjs'; import { of, Subscription } from 'rxjs';
import { SelectIndexingModelComponent } from './select-indexing-model/select-indexing-model.component'; import { SelectIndexingModelComponent } from './select-indexing-model/select-indexing-model.component';
...@@ -46,6 +46,7 @@ export class IndexationComponent implements OnInit, OnDestroy { ...@@ -46,6 +46,7 @@ export class IndexationComponent implements OnInit, OnDestroy {
currentGroupId: number; currentGroupId: number;
actionsList: any[] = []; actionsList: any[] = [];
actionsListLoaded: boolean = false;
selectedAction: any = { selectedAction: any = {
id: 0, id: 0,
label: '', label: '',
...@@ -136,6 +137,7 @@ export class IndexationComponent implements OnInit, OnDestroy { ...@@ -136,6 +137,7 @@ export class IndexationComponent implements OnInit, OnDestroy {
tap((data: any) => { tap((data: any) => {
this.selectedAction = data.actions[0]; this.selectedAction = data.actions[0];
this.actionsList = data.actions; this.actionsList = data.actions;
this.actionsListLoaded = true;
}), }),
finalize(() => this.loading = false), finalize(() => this.loading = false),
catchError((err: any) => { catchError((err: any) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment