diff --git a/src/frontend/app/administration/basket/list/list-administration.component.ts b/src/frontend/app/administration/basket/list/list-administration.component.ts index 9a1ba69f0f78b7efa3b8db85d5f75a56f13c0886..79e6c19b0493dd359dad96ba3a21fbd71ad34a11 100644 --- a/src/frontend/app/administration/basket/list/list-administration.component.ts +++ b/src/frontend/app/administration/basket/list/list-administration.component.ts @@ -369,7 +369,7 @@ export class ListAdministrationComponent implements OnInit { addData(event: any) { const i = this.availableData.map((e: any) => e.value).indexOf(event.option.value.value); - if (this.displayedSecondaryData[this.displayedSecondaryData.length - 1].length >= this.selectedTemplateDisplayedSecondaryData) { + if ((this.displayedSecondaryData.length === 0) || (this.displayedSecondaryData[this.displayedSecondaryData.length - 1].length >= this.selectedTemplateDisplayedSecondaryData)) { this.displayedSecondaryData.push([]); } this.displayedSecondaryData[this.displayedSecondaryData.length - 1].push(event.option.value); @@ -385,7 +385,9 @@ export class ListAdministrationComponent implements OnInit { } removeAllData() { - this.availableData = this.availableData.concat(this.displayedSecondaryData); + this.displayedSecondaryData.forEach(element => { + this.availableData = this.availableData.concat(element); + }); this.displayedSecondaryData = []; this.dataControl.setValue(''); } diff --git a/src/frontend/app/administration/search/search-administration.component.ts b/src/frontend/app/administration/search/search-administration.component.ts index 300dcebd946993f395e6e88bfaf8a55d92e6375a..98af549180c9511c54d84ca774c64a8200acc08f 100644 --- a/src/frontend/app/administration/search/search-administration.component.ts +++ b/src/frontend/app/administration/search/search-administration.component.ts @@ -8,7 +8,6 @@ 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;