From fca45ea6e5cb6872897ada404d9217d499790517 Mon Sep 17 00:00:00 2001
From: "hamza.hramchi" <hamza.hramchi@xelians.fr>
Date: Thu, 15 Oct 2020 11:56:17 +0200
Subject: [PATCH] FEAT #13271 TIME 0:15 set the concatenation and remove the
 item from the list of availableData when adding

---
 .../search/search-administration.component.ts               | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/frontend/app/administration/search/search-administration.component.ts b/src/frontend/app/administration/search/search-administration.component.ts
index 232aa498a49..300dcebd946 100644
--- a/src/frontend/app/administration/search/search-administration.component.ts
+++ b/src/frontend/app/administration/search/search-administration.component.ts
@@ -8,6 +8,7 @@ import { startWith, map, tap, catchError } from 'rxjs/operators';
 import { Observable, of } from 'rxjs';
 import { AppService } from '@service/app.service';
 import { HeaderService } from '@service/header.service';
+import { each } from 'jquery';
 
 declare var $: any;
 
@@ -347,7 +348,6 @@ export class SearchAdministrationComponent implements OnInit {
         }
         this.displayedSecondaryData[this.displayedSecondaryData.length - 1].push(event.option.value);
         this.availableData.splice(i, 1);
-        console.log(this.availableData.indexOf(this.availableData[i]));
         $('#availableData').blur();
         this.dataControl.setValue('');
     }
@@ -359,7 +359,9 @@ export class SearchAdministrationComponent implements OnInit {
     }
 
     removeAllData() {
-        this.availableData = this.availableData.concat(this.displayedSecondaryData);
+        this.displayedSecondaryData.forEach(element => {
+            this.availableData = this.availableData.concat(element);
+        });
         this.dataControl.setValue('');
         this.displayedSecondaryData = [];
     }
-- 
GitLab