Commit 77acdd38 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #18721 TIME 1:20 indexing model: set values even if the default values are...

FIX #18721 TIME 1:20 indexing model: set values even if the default values are defined from the administration
parent 43959a67
......@@ -261,6 +261,8 @@ export class IndexingFormComponent implements OnInit {
mustFixErrors: boolean = false;
isPrivate: boolean = false;
constructor(
public translate: TranslateService,
public http: HttpClient,
......@@ -815,12 +817,11 @@ export class IndexingFormComponent implements OnInit {
}
if (elem.type === 'date') {
if (!this.functions.empty(fieldValue) || elem.default_value !== null) {
fieldValue = elem.default_value !== null ? elem.default_value : fieldValue;
fieldValue = new Date(fieldValue);
} else {
if (!this.isPrivate && this.functions.empty(fieldValue)) {
elem.default_value = null;
this.arrFormControl[elem.identifier].value = null;
} else if (!this.functions.empty(fieldValue)) {
fieldValue = new Date(fieldValue);
}
}
......@@ -903,6 +904,7 @@ export class IndexingFormComponent implements OnInit {
this.http.get(`../rest/indexingModels/${indexModelId}`).pipe(
tap(async (data: any) => {
this.isPrivate = data.indexingModel.private || data.indexingModel.master !== null;
this.indexingFormId = data.indexingModel.master !== null ? data.indexingModel.master : data.indexingModel.id;
this.currentCategory = data.indexingModel.category;
this.mandatoryFile = data.indexingModel.mandatoryFile;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment