From 5088bc171eba1a6a6ddbd34ddc9c1e36e0994bbd Mon Sep 17 00:00:00 2001
From: Alex ORLUC <alex.orluc@maarch.org>
Date: Wed, 25 Sep 2019 18:22:35 +0200
Subject: [PATCH] FIX #11269 TIME 0:25 add ids when load custom values

---
 .../indexing-form/indexing-form.component.ts     | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/frontend/app/indexation/indexing-form/indexing-form.component.ts b/src/frontend/app/indexation/indexing-form/indexing-form.component.ts
index b6547d8fd21..5b62cc55dd7 100644
--- a/src/frontend/app/indexation/indexing-form/indexing-form.component.ts
+++ b/src/frontend/app/indexation/indexing-form/indexing-form.component.ts
@@ -190,6 +190,12 @@ export class IndexingFormComponent implements OnInit {
                     this.availableCustomFields = data.customFields.map((info: any) => {
                         info.identifier = 'indexingCustomField_' + info.id;
                         info.system = false;
+                        info.values = info.values.length > 0 ? info.values.map((custVal: any) => {
+                            return {
+                                id: custVal,
+                                label: custVal
+                            }
+                        }) : info.values;
                         return info;
                     });
                     this.fieldCategories.forEach(element => {
@@ -302,12 +308,8 @@ export class IndexingFormComponent implements OnInit {
         const myObservable = of(42);
 
         myObservable.pipe(
-            tap(() => {
-                console.log('fuu');
-            }),
             exhaustMap(() => this.initializeRoutes()),
             tap((data) => {
-                console.log(data.structure);
                 this.fieldCategories.forEach(element => {
                     this['indexingModels_' + element].forEach((elem: any) => {
                         if (elem.identifier === 'docDate') {
@@ -473,6 +475,12 @@ export class IndexingFormComponent implements OnInit {
                 this.availableCustomFields = data.customFields.map((info: any) => {
                     info.identifier = 'indexingCustomField_' + info.id;
                     info.system = false;
+                    info.values = info.values.length > 0 ? info.values.map((custVal: any) => {
+                        return {
+                            id: custVal,
+                            label: custVal
+                        }
+                    }) : info.values;
                     return info;
                 });
             }),
-- 
GitLab