diff --git a/src/frontend/app/indexation/indexation.component.html b/src/frontend/app/indexation/indexation.component.html index 8ab476c27dde47314a46cc0bcdef8520155d3cec..170f7aecd582fa5bd24a7dba118733fd8bfeccc6 100644 --- a/src/frontend/app/indexation/indexation.component.html +++ b/src/frontend/app/indexation/indexation.component.html @@ -3,36 +3,48 @@ [fixedInViewport]="appService.getViewMode()" [opened]="appService.getViewMode() ? false : true" autoFocus="false" style="overflow-x:hidden;" [ngStyle]="{'width': appService.getViewMode() ? '95%' : '600px'}"> <header-panel [snavLeft]="snav"></header-panel> - <div style="background: #F9F9F9;display: flex;padding: 10px;padding-left: 40px;padding-right: 40px;"> - <button mat-button class="button-form-primary" [matMenuTriggerFor]="IndexingModelsMenu" style="flex:1;margin-right:20px;"> - <span class="menu-label"> - {{currentIndexingModel.label}} {{currentIndexingModel.default ? '(par défaut)': ''}} - </span> - <i class="fa fa-chevron-down menu-icon"></i></button> - <mat-menu #IndexingModelsMenu="matMenu" [class]="'menuForm'"> - <ng-container *ngFor="let indexingModel of indexingModels"> - <button *ngIf="indexingModel.id !== currentIndexingModel.id" mat-menu-item (click)="loadIndexingModel(indexingModel)">{{indexingModel.label}} {{indexingModel.default ? '(par défaut)': ''}}</button> - </ng-container> - </mat-menu> - <button mat-button class="button-form-primary" - style="flex:1;align-items: center;justify-content: center;text-align: center;display: flex;">Enregistrer - comme modèle</button> - </div> - <div class="indexing-form-container"> - <app-indexing-form *ngIf="currentIndexingModel.id !== undefined" #indexingForm [groupId]="currentGroupId" [indexingFormId]="currentIndexingModel.id"></app-indexing-form> - </div> - <div class="actions-indexing-form"> - <button mat-button class="button-form-primary" [matMenuTriggerFor]="menu" style="flex:1;margin-right:20px;"> - <span class="menu-label"> - Enregistrer (par défaut) - </span> - <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> + <ng-container *ngIf="indexingModels.length > 0"> + <div style="background: #F9F9F9;display: flex;padding: 10px;padding-left: 40px;padding-right: 40px;"> + <button mat-button class="button-form-primary" [matMenuTriggerFor]="IndexingModelsMenu" + style="flex:1;margin-right:20px;"> + <span class="menu-label"> + {{currentIndexingModel.label}} {{currentIndexingModel.default ? '(par défaut)': ''}} + </span> + <i class="fa fa-chevron-down menu-icon"></i></button> + <mat-menu #IndexingModelsMenu="matMenu" [class]="'menuForm'"> + <ng-container *ngFor="let indexingModel of indexingModels"> + <button *ngIf="indexingModel.id !== currentIndexingModel.id" mat-menu-item + (click)="loadIndexingModel(indexingModel)">{{indexingModel.label}} + {{indexingModel.default ? '(par défaut)': ''}}</button> + </ng-container> + </mat-menu> + <button mat-button class="button-form-primary" + style="flex:1;align-items: center;justify-content: center;text-align: center;display: flex;">Enregistrer + comme modèle</button> + </div> + <div class="indexing-form-container"> + <app-indexing-form *ngIf="currentIndexingModel.id !== undefined" #indexingForm + [groupId]="currentGroupId" [indexingFormId]="currentIndexingModel.id"></app-indexing-form> + </div> + <div class="actions-indexing-form"> + <button mat-button class="button-form-primary" [matMenuTriggerFor]="menu" + style="flex:1;margin-right:20px;"> + <span class="menu-label"> + Enregistrer (par défaut) + </span> + <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> </mat-sidenav> <mat-sidenav-content> @@ -62,7 +74,9 @@ <button mat-menu-item>Item 1</button> <button mat-menu-item>Item 2</button> </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> diff --git a/src/frontend/app/indexation/indexation.component.scss b/src/frontend/app/indexation/indexation.component.scss index 13c8adc0c3b832a9a4a251ea6cfad12aecc7026e..cef66867725a5ca77316a7269e37a358d674936e 100644 --- a/src/frontend/app/indexation/indexation.component.scss +++ b/src/frontend/app/indexation/indexation.component.scss @@ -58,4 +58,18 @@ box-shadow: 0 -5px 10px 0 rgba(0, 0, 0, 0.07); padding-left: 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 diff --git a/src/frontend/app/indexation/indexation.component.ts b/src/frontend/app/indexation/indexation.component.ts index 27fbc5bbf56b81076a0b5af9adc9f72d200eb596..e4c8f70ec08c892dd527226d361c810bfe433c35 100644 --- a/src/frontend/app/indexation/indexation.component.ts +++ b/src/frontend/app/indexation/indexation.component.ts @@ -62,6 +62,7 @@ export class IndexationComponent implements OnInit { tap((data: any) => { // this.indexingModels = data.indexingModels; + console.log(this.indexingModels.length); this.currentIndexingModel = this.indexingModels.filter(model => model.default === true)[0]; }), finalize(() => this.loading = false),