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

FEAT #14383 TIME 0:15 fix technical info custom

parent 8f7f2ef8
No related branches found
No related tags found
No related merge requests found
...@@ -90,26 +90,21 @@ export class TechnicalInformationComponent implements OnInit { ...@@ -90,26 +90,21 @@ export class TechnicalInformationComponent implements OnInit {
}), }),
exhaustMap(() => this.http.get('../rest/customFields')), exhaustMap(() => this.http.get('../rest/customFields')),
tap((data: any) => { tap((data: any) => {
data.customFields.map((info: any) => { data.customFields.filter((item: { mode: any; }) => item.mode === 'technical').map((info: any) => {
this.customs[info.id] = { this.customs[info.id] = {
label : info.label, label : info.label,
type : info.type type : info.type
}; };
}); });
this.customsData = data.customFields.filter((item: { mode: any; }) => item.mode === 'technical');
}), }),
exhaustMap(() => this.http.get(`../rest/resources/${this.data.resId}`)), exhaustMap(() => this.http.get(`../rest/resources/${this.data.resId}`)),
tap((data: any) => { tap((data: any) => {
Object.keys(this.customsData).forEach(key => { Object.keys(data.customFields).forEach(key => {
const values = []; this.customsData[key] = {
this.customsData[key].values.forEach(element => { label: this.customs[key].label,
values.push(element.label); value: data.customFields[key],
}); icon: 'fas fa-hashtag'
this.customsData[key] = { };
label: this.customsData[key].label,
value: values,
icon: 'fas fa-hashtag'
};
}); });
}), }),
catchError((err: any) => { catchError((err: any) => {
......
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