From c10448c837c5c2a3c43adc575a35e678ba518d4f Mon Sep 17 00:00:00 2001 From: Konstantinos Triantafyllou Date: Wed, 16 Oct 2019 08:46:16 +0000 Subject: [PATCH] [Monitor]: Fix active and public for caterories and sub-categories. git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor@57381 d315682c-612b-4755-9ff5-7f18f6832af3 --- src/app/monitor/monitor.component.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/monitor/monitor.component.ts b/src/app/monitor/monitor.component.ts index 14b3569..ecadc9d 100644 --- a/src/app/monitor/monitor.component.ts +++ b/src/app/monitor/monitor.component.ts @@ -105,7 +105,7 @@ export class MonitorComponent { if (this.activeTopic) { if (params['category']) { this.activeCategory = this.activeTopic.categories.filter(category => - category.alias === decodeURIComponent(params['category']))[0]; + (category.alias === params['category']) && category.isPublic && category.isActive)[0]; } else { let category: Category = this.activeTopic.categories[0]; this.navigateTo(this.stakeholder.alias, this.activeTopic.alias, category.alias); @@ -114,9 +114,10 @@ export class MonitorComponent { if (this.activeCategory) { if (params['subCategory']) { this.activeSubCategory = this.activeCategory.subCategories.filter(subCategory => - subCategory.alias = decodeURIComponent(params['subCategory']))[0]; + (subCategory.alias === params['subCategory'] && subCategory.isPublic && subCategory.isActive))[0]; } else { - this.activeSubCategory = this.activeCategory.subCategories.filter(subCategory => !subCategory.alias)[0]; + this.activeSubCategory = this.activeCategory.subCategories.filter(subCategory => + subCategory.isPublic && subCategory.isActive)[0]; } if (this.activeSubCategory) { this.setSideBar();