Skip to content
Snippets Groups Projects
Commit 50a60c20 authored by Florian Azizian's avatar Florian Azizian
Browse files

FIX #14100 TIME 0:15 replace empty value with default value if change indexing model

parent 44e5da9a
No related branches found
No related tags found
No related merge requests found
......@@ -694,7 +694,9 @@ export class IndexingFormComponent implements OnInit {
if (elem.type === 'date' && !this.functions.empty(fieldValue)) {
fieldValue = new Date(fieldValue);
}
this.arrFormControl[elem.identifier].setValue(fieldValue);
if (!this.functions.empty(fieldValue)) {
this.arrFormControl[elem.identifier].setValue(fieldValue);
}
} else if (!saveResourceState && elem.identifier === 'destination') {
this.arrFormControl[elem.identifier].disable();
this.arrFormControl[elem.identifier].setValidators([]);
......@@ -785,6 +787,7 @@ export class IndexingFormComponent implements OnInit {
if (indexFound > -1) {
field.label = this.availableFields[indexFound].label;
field.default_value = !this.functions.empty(field.default_value) ? field.default_value : this.availableFields[indexFound].default_value;
field.values = this.availableFields[indexFound].values;
field.type = this.availableFields[indexFound].type;
this.availableFields.splice(indexFound, 1);
......@@ -807,6 +810,7 @@ export class IndexingFormComponent implements OnInit {
if (indexFound > -1) {
field.label = this.indexingModelsCore[indexFound].label;
field.default_value = !this.functions.empty(field.default_value) ? field.default_value : this.indexingModelsCore[indexFound].default_value;
field.values = this.indexingModelsCore[indexFound].values;
field.type = this.indexingModelsCore[indexFound].type;
fieldExist = 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