From 4de0a81ecb010f998986be73d53932e3051c47f2 Mon Sep 17 00:00:00 2001 From: Alex ORLUC <alex.orluc@maarch.org> Date: Thu, 24 Oct 2019 11:05:05 +0200 Subject: [PATCH] FEAT #12091 TIME 0:20 fix difflist not required if destination not required --- .../app/actions/actions-list.component.ts | 12 +----------- .../app/indexation/indexation.component.ts | 4 +--- .../indexing-form/indexing-form.component.ts | 19 ++++++++++--------- 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/src/frontend/app/actions/actions-list.component.ts b/src/frontend/app/actions/actions-list.component.ts index 2a9510d8834..1226d86ede1 100644 --- a/src/frontend/app/actions/actions-list.component.ts +++ b/src/frontend/app/actions/actions-list.component.ts @@ -112,17 +112,7 @@ export class ActionsListComponent implements OnInit { this.http.get('../../rest/resourcesList/users/' + this.currentBasketInfo.ownerId + '/groups/' + this.currentBasketInfo.groupId + '/baskets/' + this.currentBasketInfo.basketId + '/actions') .subscribe((data: any) => { if (data.actions.length > 0) { - this.actionsList = data.actions; - - // TO DO TO REMOVE AFTER BACK CHANGE : label_action => label - this.actionsList = data.actions.map((action: any) => { - return { - id: action.id, - label: action.label_action, - component: action.component - } - }); - + this.actionsList = data.actions; } else { this.actionsList = [{ id: 0, diff --git a/src/frontend/app/indexation/indexation.component.ts b/src/frontend/app/indexation/indexation.component.ts index 79960770110..98358738f48 100644 --- a/src/frontend/app/indexation/indexation.component.ts +++ b/src/frontend/app/indexation/indexation.component.ts @@ -117,7 +117,7 @@ export class IndexationComponent implements OnInit { data.actions = data.actions.map((action: any, index: number) => { return { id: action.id, - label: action.label_action, + label: action.label, component: action.component, enabled: action.enabled, default: index === 0 ? true : false, @@ -150,8 +150,6 @@ export class IndexationComponent implements OnInit { formatdatas['encodedFile'] = this.appDocumentViewer.getFile().content; formatdatas['format'] = this.appDocumentViewer.getFile().format; - console.log(formatdatas['encodedFile']); - this.actionService.launchIndexingAction(this.selectedAction, this.headerService.user.id, this.currentGroupId, formatdatas); } else { diff --git a/src/frontend/app/indexation/indexing-form/indexing-form.component.ts b/src/frontend/app/indexation/indexing-form/indexing-form.component.ts index 6de4b858ceb..dcac74c50c0 100644 --- a/src/frontend/app/indexation/indexing-form/indexing-form.component.ts +++ b/src/frontend/app/indexation/indexing-form/indexing-form.component.ts @@ -89,7 +89,7 @@ export class IndexingFormComponent implements OnInit { label: this.lang.confidential, type: 'radio', default_value: '', - values: [{'id': 'true', 'label': 'Oui'}, {'id': 'false', 'label': 'Non'}] + values: [{ 'id': 'true', 'label': 'Oui' }, { 'id': 'false', 'label': 'Non' }] }, { identifier: 'initiator', @@ -277,8 +277,8 @@ export class IndexingFormComponent implements OnInit { if (!this.adminMode) { arrIndexingModels.push({ - identifier : 'modelId', - default_value : this.indexingFormId + identifier: 'modelId', + default_value: this.indexingFormId }); } return arrIndexingModels; @@ -537,7 +537,7 @@ export class IndexingFormComponent implements OnInit { let arrayRoutes: any = []; let mergedRoutesDatas: any = {}; - + if (this.availableCustomFieldsClone === null) { arrayRoutes.push(this.http.get("../../rest/customFields")); } else { @@ -635,7 +635,7 @@ export class IndexingFormComponent implements OnInit { this.initElemForm(); this.createForm(); - + }), catchError((err: any) => { this.notify.handleErrors(err); @@ -661,9 +661,10 @@ export class IndexingFormComponent implements OnInit { if (field.identifier === 'destination') { let valArr: ValidatorFn[] = []; - - valArr.push(Validators.required); - + if (field.mandatory) { + valArr.push(Validators.required); + } + this.arrFormControl['diffusionList'] = new FormControl({ value: null, disabled: false }); this.arrFormControl['diffusionList'].setValidators(valArr); @@ -794,7 +795,7 @@ export class IndexingFormComponent implements OnInit { calcLimitDateByPriority(field: any, value: any) { let limitDate: Date = null; - + if (this.arrFormControl['processLimitDate'] !== undefined) { this.http.get("../../rest/indexing/processLimitDate", { params: { "priority": value } }).pipe( tap((data: any) => { -- GitLab