From f0100abd146b8c97e4b1ff0ba74175a24bbc5e98 Mon Sep 17 00:00:00 2001 From: JvD_Ericsson Date: Mon, 12 Dec 2022 10:52:30 +0000 Subject: Improve Composition View Filtering Issue-ID: SDC-4330 Signed-off-by: JvD_Ericsson Change-Id: I0a161605b722ca6db46b6a8259acc17fd8af0c02 --- .../composition/palette/__snapshots__/palette.component.spec.ts.snap | 1 + .../src/app/ng2/pages/composition/palette/palette.component.html | 2 +- catalog-ui/src/app/ng2/pages/composition/palette/palette.component.ts | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'catalog-ui/src') diff --git a/catalog-ui/src/app/ng2/pages/composition/palette/__snapshots__/palette.component.spec.ts.snap b/catalog-ui/src/app/ng2/pages/composition/palette/__snapshots__/palette.component.spec.ts.snap index e5bd4a9079..054ba6c4b3 100644 --- a/catalog-ui/src/app/ng2/pages/composition/palette/__snapshots__/palette.component.spec.ts.snap +++ b/catalog-ui/src/app/ng2/pages/composition/palette/__snapshots__/palette.component.spec.ts.snap @@ -10,6 +10,7 @@ exports[`palette component should match current snapshot of palette component 1` onDraggableMoved={[Function Function]} onDrop={[Function Function]} onSearchChanged={[Function Function]} + openAccordion="false" position={[Function Point]} >
No Elements Found
- +
{{mapBySubCategory.key}}
diff --git a/catalog-ui/src/app/ng2/pages/composition/palette/palette.component.ts b/catalog-ui/src/app/ng2/pages/composition/palette/palette.component.ts index 673efa4172..020acffd5c 100644 --- a/catalog-ui/src/app/ng2/pages/composition/palette/palette.component.ts +++ b/catalog-ui/src/app/ng2/pages/composition/palette/palette.component.ts @@ -49,6 +49,7 @@ export class PaletteComponent { public isPaletteLoading: boolean; private paletteDraggedElement: LeftPaletteComponent; public position: Point = new Point(); + private openAccordion: boolean = false; ngOnInit() { this.isPaletteLoading = true; @@ -66,6 +67,7 @@ export class PaletteComponent { public buildPaletteByCategories = (searchText?: string) => { // create nested by category & subcategory, filtered by search parans // Flat the object and run on its leaves if (searchText) { + this.openAccordion = true; searchText = searchText.toLowerCase(); const paletteElementsAfterSearch = {}; this.paletteElements = this.compositionPaletteService.getLeftPaletteElements(); @@ -83,6 +85,7 @@ export class PaletteComponent { } this.paletteElements = paletteElementsAfterSearch; } else { + this.openAccordion = false; this.paletteElements = this.compositionPaletteService.getLeftPaletteElements(); } this.numberOfElements = this.countLeftPalleteElements(this.paletteElements); -- cgit 1.2.3-korg