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