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

FIX #11271 TIME 0:15 add empty model msg warn in indexation

parent 8952b06a
No related branches found
No related tags found
No related merge requests found
...@@ -3,36 +3,48 @@ ...@@ -3,36 +3,48 @@
[fixedInViewport]="appService.getViewMode()" [opened]="appService.getViewMode() ? false : true" [fixedInViewport]="appService.getViewMode()" [opened]="appService.getViewMode() ? false : true"
autoFocus="false" style="overflow-x:hidden;" [ngStyle]="{'width': appService.getViewMode() ? '95%' : '600px'}"> autoFocus="false" style="overflow-x:hidden;" [ngStyle]="{'width': appService.getViewMode() ? '95%' : '600px'}">
<header-panel [snavLeft]="snav"></header-panel> <header-panel [snavLeft]="snav"></header-panel>
<div style="background: #F9F9F9;display: flex;padding: 10px;padding-left: 40px;padding-right: 40px;"> <ng-container *ngIf="indexingModels.length > 0">
<button mat-button class="button-form-primary" [matMenuTriggerFor]="IndexingModelsMenu" style="flex:1;margin-right:20px;"> <div style="background: #F9F9F9;display: flex;padding: 10px;padding-left: 40px;padding-right: 40px;">
<span class="menu-label"> <button mat-button class="button-form-primary" [matMenuTriggerFor]="IndexingModelsMenu"
{{currentIndexingModel.label}} {{currentIndexingModel.default ? '(par défaut)': ''}} style="flex:1;margin-right:20px;">
</span> <span class="menu-label">
<i class="fa fa-chevron-down menu-icon"></i></button> {{currentIndexingModel.label}} {{currentIndexingModel.default ? '(par défaut)': ''}}
<mat-menu #IndexingModelsMenu="matMenu" [class]="'menuForm'"> </span>
<ng-container *ngFor="let indexingModel of indexingModels"> <i class="fa fa-chevron-down menu-icon"></i></button>
<button *ngIf="indexingModel.id !== currentIndexingModel.id" mat-menu-item (click)="loadIndexingModel(indexingModel)">{{indexingModel.label}} {{indexingModel.default ? '(par défaut)': ''}}</button> <mat-menu #IndexingModelsMenu="matMenu" [class]="'menuForm'">
</ng-container> <ng-container *ngFor="let indexingModel of indexingModels">
</mat-menu> <button *ngIf="indexingModel.id !== currentIndexingModel.id" mat-menu-item
<button mat-button class="button-form-primary" (click)="loadIndexingModel(indexingModel)">{{indexingModel.label}}
style="flex:1;align-items: center;justify-content: center;text-align: center;display: flex;">Enregistrer {{indexingModel.default ? '(par défaut)': ''}}</button>
comme modèle</button> </ng-container>
</div> </mat-menu>
<div class="indexing-form-container"> <button mat-button class="button-form-primary"
<app-indexing-form *ngIf="currentIndexingModel.id !== undefined" #indexingForm [groupId]="currentGroupId" [indexingFormId]="currentIndexingModel.id"></app-indexing-form> style="flex:1;align-items: center;justify-content: center;text-align: center;display: flex;">Enregistrer
</div> comme modèle</button>
<div class="actions-indexing-form"> </div>
<button mat-button class="button-form-primary" [matMenuTriggerFor]="menu" style="flex:1;margin-right:20px;"> <div class="indexing-form-container">
<span class="menu-label"> <app-indexing-form *ngIf="currentIndexingModel.id !== undefined" #indexingForm
Enregistrer (par défaut) [groupId]="currentGroupId" [indexingFormId]="currentIndexingModel.id"></app-indexing-form>
</span> </div>
<i class="fa fa-chevron-down menu-icon"></i></button> <div class="actions-indexing-form">
<mat-menu #menu="matMenu" [class]="'menuForm'"> <button mat-button class="button-form-primary" [matMenuTriggerFor]="menu"
<button mat-menu-item>Item 1</button> style="flex:1;margin-right:20px;">
<button mat-menu-item>Item 2</button> <span class="menu-label">
</mat-menu> Enregistrer (par défaut)
<button mat-button class="button-form-primary" </span>
style="width: 150px;align-items: center;justify-content: center;text-align: center;display: flex;" (click)="onSubmit()">Valider</button> <i class="fa fa-chevron-down menu-icon"></i></button>
<mat-menu #menu="matMenu" [class]="'menuForm'">
<button mat-menu-item>Item 1</button>
<button mat-menu-item>Item 2</button>
</mat-menu>
<button mat-button class="button-form-primary"
style="width: 150px;align-items: center;justify-content: center;text-align: center;display: flex;"
(click)="onSubmit()">Valider</button>
</div>
</ng-container>
<div *ngIf="indexingModels.length === 0" class="emptyModel">
Aucun modèle d'enregistrement disponible<br/><br/>
<small>Veuillez créer un modèle depuis Administation > Modèle d'enregistrement</small>
</div> </div>
</mat-sidenav> </mat-sidenav>
<mat-sidenav-content> <mat-sidenav-content>
...@@ -62,7 +74,9 @@ ...@@ -62,7 +74,9 @@
<button mat-menu-item>Item 1</button> <button mat-menu-item>Item 1</button>
<button mat-menu-item>Item 2</button> <button mat-menu-item>Item 2</button>
</mat-menu> </mat-menu>
<button mat-button class="button-form-primary" style="align-items: center;justify-content: center;text-align: center;display: flex;">Choisissez votre fichier</button> <button mat-button class="button-form-primary"
style="align-items: center;justify-content: center;text-align: center;display: flex;">Choisissez
votre fichier</button>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -58,4 +58,18 @@ ...@@ -58,4 +58,18 @@
box-shadow: 0 -5px 10px 0 rgba(0, 0, 0, 0.07); box-shadow: 0 -5px 10px 0 rgba(0, 0, 0, 0.07);
padding-left: 40px; padding-left: 40px;
padding-right: 40px; padding-right: 40px;
}
.emptyModel {
display: flex;
flex-direction: column;
height: 100%;
align-items: center;
justify-content: center;
text-align: center;
padding-left: 20px;
padding-right: 20px;
font-size: 25px;
opacity: 0.3;
font-weight: bold;
} }
\ No newline at end of file
...@@ -62,6 +62,7 @@ export class IndexationComponent implements OnInit { ...@@ -62,6 +62,7 @@ export class IndexationComponent implements OnInit {
tap((data: any) => { tap((data: any) => {
// //
this.indexingModels = data.indexingModels; this.indexingModels = data.indexingModels;
console.log(this.indexingModels.length);
this.currentIndexingModel = this.indexingModels.filter(model => model.default === true)[0]; this.currentIndexingModel = this.indexingModels.filter(model => model.default === true)[0];
}), }),
finalize(() => this.loading = false), finalize(() => this.loading = false),
......
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