From 73886d1573398d0b6360ec55409210f93d019f03 Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Mon, 19 Oct 2020 16:46:07 +0200
Subject: [PATCH] FEAT #14383 TIME 0:15 fix technical info custom

---
 .../technical-information.component.ts        | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/frontend/app/indexation/technical-information/technical-information.component.ts b/src/frontend/app/indexation/technical-information/technical-information.component.ts
index 660d9d1f402..e90cf209172 100644
--- a/src/frontend/app/indexation/technical-information/technical-information.component.ts
+++ b/src/frontend/app/indexation/technical-information/technical-information.component.ts
@@ -90,26 +90,21 @@ export class TechnicalInformationComponent implements OnInit {
             }),
             exhaustMap(() => this.http.get('../rest/customFields')),
             tap((data: any) => {
-                data.customFields.map((info: any) => {
+                data.customFields.filter((item: { mode: any; }) => item.mode === 'technical').map((info: any) => {
                     this.customs[info.id] = {
                         label : info.label,
                         type : info.type
                     };
                 });
-                this.customsData = data.customFields.filter((item: { mode: any; }) => item.mode === 'technical');
             }),
             exhaustMap(() => this.http.get(`../rest/resources/${this.data.resId}`)),
             tap((data: any) => {
-                Object.keys(this.customsData).forEach(key => {
-                    const values = [];
-                    this.customsData[key].values.forEach(element => {
-                        values.push(element.label);
-                    });
-                        this.customsData[key] = {
-                            label: this.customsData[key].label,
-                            value: values,
-                            icon: 'fas fa-hashtag'
-                        };
+                Object.keys(data.customFields).forEach(key => {
+                    this.customsData[key] = {
+                        label: this.customs[key].label,
+                        value: data.customFields[key],
+                        icon: 'fas fa-hashtag'
+                    };
                 });
             }),
             catchError((err: any) => {
-- 
GitLab