diff options
author | Michael Lando <ml636r@att.com> | 2018-03-04 14:53:33 +0200 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2018-03-07 13:19:05 +0000 |
commit | a5445100050e49e83f73424198d73cd72d672a4d (patch) | |
tree | cacf4df817df31be23e4e790d1dda857bdae061e /catalog-ui/src/app/filters/entity-filter.ts | |
parent | 51157f92c21976cba4914c378aaa3cba49826931 (diff) |
Sync Integ to Master
Change-Id: I71e3acc26fa612127756ac04073a522b9cc6cd74
Issue-ID: SDC-977
Signed-off-by: Gitelman, Tal (tg851x) <tg851x@intl.att.com>
Diffstat (limited to 'catalog-ui/src/app/filters/entity-filter.ts')
-rw-r--r-- | catalog-ui/src/app/filters/entity-filter.ts | 15 |
1 files changed, 10 insertions, 5 deletions
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); } }); |