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

FEAT #13827 TIME 0:20 disable destination if change model

parent 34123827
No related branches found
No related tags found
No related merge requests found
...@@ -498,7 +498,7 @@ export class IndexingFormComponent implements OnInit { ...@@ -498,7 +498,7 @@ export class IndexingFormComponent implements OnInit {
return { return {
id: entity.id, id: entity.id,
label: entity.entity_label label: entity.entity_label
} };
}); });
} }
...@@ -639,15 +639,14 @@ export class IndexingFormComponent implements OnInit { ...@@ -639,15 +639,14 @@ export class IndexingFormComponent implements OnInit {
tap(async (data: any) => { tap(async (data: any) => {
await Promise.all(this.fieldCategories.map(async (element: any) => { await Promise.all(this.fieldCategories.map(async (element: any) => {
//this.fieldCategories.forEach(async element => { // this.fieldCategories.forEach(async element => {
await Promise.all(this['indexingModels_' + element].map(async (elem: any) => { await Promise.all(this['indexingModels_' + element].map(async (elem: any) => {
console.log(elem);
//this['indexingModels_' + element].forEach((elem: any) => { // this['indexingModels_' + element].forEach((elem: any) => {
const customId: any = Object.keys(data.customFields).filter(index => index === elem.identifier.split('indexingCustomField_')[1])[0]; const customId: any = Object.keys(data.customFields).filter(index => index === elem.identifier.split('indexingCustomField_')[1])[0];
if (Object.keys(data).indexOf(elem.identifier) > -1 || customId !== undefined) { if (Object.keys(data).indexOf(elem.identifier) > -1 || customId !== undefined) {
let fieldValue: any = ''; let fieldValue: any = '';
if (customId !== undefined) { if (customId !== undefined) {
fieldValue = data.customFields[customId]; fieldValue = data.customFields[customId];
} else { } else {
...@@ -671,7 +670,12 @@ export class IndexingFormComponent implements OnInit { ...@@ -671,7 +670,12 @@ export class IndexingFormComponent implements OnInit {
fieldValue = new Date(fieldValue); fieldValue = new Date(fieldValue);
} }
this.arrFormControl[elem.identifier].setValue(fieldValue); this.arrFormControl[elem.identifier].setValue(fieldValue);
} else if (!saveResourceState && elem.identifier === 'destination') {
this.arrFormControl[elem.identifier].disable();
this.arrFormControl[elem.identifier].setValidators([]);
this.arrFormControl['diffusionList'].disable();
} }
if (!this.canEdit) { if (!this.canEdit) {
this.arrFormControl[elem.identifier].disable(); this.arrFormControl[elem.identifier].disable();
} }
...@@ -861,9 +865,9 @@ export class IndexingFormComponent implements OnInit { ...@@ -861,9 +865,9 @@ export class IndexingFormComponent implements OnInit {
const controlErrors: ValidationErrors = this.indexingFormGroup.get(key).errors; const controlErrors: ValidationErrors = this.indexingFormGroup.get(key).errors;
if (controlErrors != null) { if (controlErrors != null) {
this.indexingFormGroup.controls[key].markAsTouched(); this.indexingFormGroup.controls[key].markAsTouched();
/*Object.keys(controlErrors).forEach(keyError => { Object.keys(controlErrors).forEach(keyError => {
console.log('Key control: ' + key + ', keyError: ' + keyError + ', err value: ', controlErrors[keyError]); console.log('Key control: ' + key + ', keyError: ' + keyError + ', err value: ', controlErrors[keyError]);
});*/ });
} }
}); });
} }
......
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