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

FIX #14598 TIME 1:15 improve doctype tree in indexing form

parent 4859f5d6
No related branches found
No related tags found
No related merge requests found
...@@ -642,7 +642,6 @@ export class IndexingFormComponent implements OnInit { ...@@ -642,7 +642,6 @@ export class IndexingFormComponent implements OnInit {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.http.get(`../rest/doctypes`).pipe( this.http.get(`../rest/doctypes`).pipe(
tap((data: any) => { tap((data: any) => {
let title = '';
let arrValues: any[] = []; let arrValues: any[] = [];
data.structure.forEach((doctype: any) => { data.structure.forEach((doctype: any) => {
if (doctype['doctypes_second_level_id'] === undefined) { if (doctype['doctypes_second_level_id'] === undefined) {
...@@ -654,25 +653,25 @@ export class IndexingFormComponent implements OnInit { ...@@ -654,25 +653,25 @@ export class IndexingFormComponent implements OnInit {
isTitle: true, isTitle: true,
color: doctype.css_style color: doctype.css_style
}); });
} else if (doctype['description'] === undefined) { data.structure.filter((info: any) => info.doctypes_first_level_id === doctype.doctypes_first_level_id && info.doctypes_second_level_id !== undefined && info.description === undefined).forEach((secondDoctype: any) => {
arrValues.push({ arrValues.push({
id: doctype.doctypes_second_level_id, id: secondDoctype.doctypes_second_level_id,
label: '    ' + doctype.doctypes_second_level_label, label: '    ' + secondDoctype.doctypes_second_level_label,
title: doctype.doctypes_second_level_label, title: secondDoctype.doctypes_second_level_label,
disabled: true, disabled: true,
isTitle: true, isTitle: true,
color: doctype.css_style color: secondDoctype.css_style
});
arrValues = arrValues.concat(data.structure.filter((infoDoctype: any) => infoDoctype.doctypes_second_level_id === secondDoctype.doctypes_second_level_id && infoDoctype.description !== undefined).map((infoType: any) => {
return {
id: infoType.type_id,
label: '        ' + infoType.description,
title: infoType.description,
disabled: false,
isTitle: false,
};
}));
}); });
arrValues = arrValues.concat(data.structure.filter((info: any) => info.doctypes_second_level_id === doctype.doctypes_second_level_id && info.description !== undefined).map((info: any) => {
return {
id: info.type_id,
label: '        ' + info.description,
title: info.description,
disabled: false,
isTitle: false,
}
}));
} }
}); });
elem.values = arrValues; elem.values = arrValues;
......
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