[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
This commit is contained in:
Konstantinos Triantafyllou 2019-10-16 08:46:16 +00:00
parent 3e688f7c4d
commit c10448c837
1 changed files with 4 additions and 3 deletions

View File

@ -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();