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

FEAT #13827 TIME 0:20 fix selected indexing model

parent c7d47917
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@ export class SelectIndexingModelComponent implements OnInit {
lang: any = LANG;
loading: boolean = true;
@Input() defaultIndexingModelId: number = null;
@Input() indexingModels: any = [];
@Input() indexingForm: IndexingFormComponent;
@Input() adminMode: boolean = false;
......@@ -49,7 +50,8 @@ export class SelectIndexingModelComponent implements OnInit {
tap((data: any) => {
this.indexingModels = data.indexingModels;
if (this.indexingModels.length > 0) {
this.currentIndexingModel = this.indexingModels.filter((model: any) => model.default === true)[0];
this.currentIndexingModel = this.defaultIndexingModelId === null ? this.indexingModels.filter((model: any) => model.default === true)[0] : this.indexingModels.filter((model: any) => model.id === this.defaultIndexingModelId)[0];
if (this.currentIndexingModel === undefined) {
this.currentIndexingModel = this.indexingModels[0];
this.notify.error(this.lang.noDefaultIndexingModel);
......
......@@ -101,7 +101,7 @@
[resId]="currentResourceInformations.resId" [autoOpenCreation]="isMailing" [target]="'process'"
(reloadBadgeAttachments)="refreshBadge($event,'attachments')">
</app-attachments-list>
<app-select-indexing-model *ngIf="currentTool === 'info' && !loading" #appSelectIndexingModel [adminMode]="canChangeModel" [indexingForm]="indexingForm" (afterSelectedListModel)="this.currentIndexingModel = $event;indexingForm.loadForm($event.id, false)"></app-select-indexing-model>
<app-select-indexing-model *ngIf="currentTool === 'info' && !loading" #appSelectIndexingModel [defaultIndexingModelId]="currentResourceInformations.modelId" [adminMode]="canChangeModel" [indexingForm]="indexingForm" (afterSelectedListModel)="this.currentIndexingModel = $event;indexingForm.loadForm($event.id, false)"></app-select-indexing-model>
<app-indexing-form *ngIf="currentTool === 'info' && !loading" #indexingForm [groupId]="currentGroupId"
[resId]="currentResourceInformations.resId" [indexingFormId]="currentResourceInformations.modelId"
[mode]="'process'" [canEdit]="canEditData" [hideDiffusionList]="true"
......@@ -287,7 +287,7 @@
<app-attachments-list *ngIf="modal.id === 'attachments' && !loading" #appAttachmentsList
[resId]="currentResourceInformations.resId" [autoOpenCreation]="isMailing" (reloadBadgeAttachments)="refreshBadge($event,'attachments')">
</app-attachments-list>
<app-select-indexing-model *ngIf="modal.id === 'info' && !loading" #appSelectIndexingModel [adminMode]="canChangeModel" [indexingForm]="indexingForm" (afterSelectedListModel)="this.currentIndexingModel = $event;indexingForm.loadForm($event.id, false)"></app-select-indexing-model>
<app-select-indexing-model *ngIf="modal.id === 'info' && !loading" #appSelectIndexingModel [adminMode]="canChangeModel" [indexingForm]="indexingForm" [defaultIndexingModelId]="currentResourceInformations.modelId" (afterSelectedListModel)="this.currentIndexingModel = $event;indexingForm.loadForm($event.id, false)"></app-select-indexing-model>
<app-indexing-form *ngIf="modal.id === 'info' && !loading" #indexingForm [groupId]="currentGroupId"
[indexingFormId]="currentResourceInformations.modelId" [resId]="currentResourceInformations.resId"
[mode]="'process'" [canEdit]="canEditData" [hideDiffusionList]="true"
......
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