From a5445100050e49e83f73424198d73cd72d672a4d Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Sun, 4 Mar 2018 14:53:33 +0200 Subject: Sync Integ to Master Change-Id: I71e3acc26fa612127756ac04073a522b9cc6cd74 Issue-ID: SDC-977 Signed-off-by: Gitelman, Tal (tg851x) --- catalog-ui/src/app/filters/entity-filter.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'catalog-ui/src/app/filters/entity-filter.ts') diff --git a/catalog-ui/src/app/filters/entity-filter.ts b/catalog-ui/src/app/filters/entity-filter.ts index 6d04bc3c41..ccac10f802 100644 --- a/catalog-ui/src/app/filters/entity-filter.ts +++ b/catalog-ui/src/app/filters/entity-filter.ts @@ -19,6 +19,8 @@ */ import {Component, Resource} from "../models"; +import {ComponentType} from "../utils/constants"; + export class EntityFilter { constructor() { @@ -56,11 +58,14 @@ export class EntityFilter { if (filter.selectedCategoriesModel && filter.selectedCategoriesModel.length > 0) { let filteredCategories = []; angular.forEach(filteredComponents, (component:Component):void => { - if (component.categories && filter.selectedCategoriesModel.indexOf(component.categories[0].uniqueId) !== -1) { - filteredCategories.push(component); - } else if (component.categories && component.categories[0].subcategories && filter.selectedCategoriesModel.indexOf(component.categories[0].subcategories[0].uniqueId) !== -1) { - filteredCategories.push(component); - } else if (component.categories && component.categories[0].subcategories && component.categories[0].subcategories[0].groupings && filter.selectedCategoriesModel.indexOf(component.categories[0].subcategories[0].groupings[0].uniqueId) !== -1) { + let componentCategory = component.categoryNormalizedName + + ((component.subCategoryNormalizedName) ? '.' + component.subCategoryNormalizedName : ''); + if (component.componentType === ComponentType.RESOURCE) { + componentCategory = 'resourceNewCategory.' + componentCategory; + } else if (component.componentType === ComponentType.SERVICE) { + componentCategory = 'serviceNewCategory.' + componentCategory; + } + if (filter.selectedCategoriesModel.indexOf(componentCategory) !== -1) { filteredCategories.push(component); } }); -- cgit 1.2.3-korg