diff --git a/src/app/app.component.ts b/src/app/app.component.ts index c71c6a3..6bc753f 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -141,18 +141,9 @@ export class AppComponent implements OnInit, OnDestroy { this.stakeholder = stakeholder; LinksResolver.setProperties(this.stakeholder.alias); this.setProperties(this.stakeholder.alias, this.stakeholder.type); - if (params && params['topic'] && !this.activeTopic) { - this.activeTopic = this.stakeholder.topics.find(topic => topic.alias === decodeURIComponent(params['topic']) && this.isPublicOrIsMember(topic.visibility)); - } else { - this.activeTopic = this.stakeholder.topics.find(topic => this.isPublicOrIsMember(topic.visibility)); - } - if (params && params['category']) { - this.activeCategory = this.activeTopic.categories.find(category => category.alias === decodeURIComponent(params['category']) && this.isPublicOrIsMember(category.visibility)); - } else { - this.activeCategory = this.activeTopic.categories.find(category => this.isPublicOrIsMember(category.visibility)); - } - this.setSideBar(); this.buildMenu(); + this.setActives(params); + this.setSideBar(); this.loading = false; } else { this.stakeholder = null; @@ -164,16 +155,7 @@ export class AppComponent implements OnInit, OnDestroy { })); } else { this.buildMenu(); - if (params && params['topic']) { - this.activeTopic = this.stakeholder.topics.find(topic => topic.alias === decodeURIComponent(params['topic']) && this.isPublicOrIsMember(topic.visibility)); - } else { - this.activeTopic = this.stakeholder.topics.find(topic => this.isPublicOrIsMember(topic.visibility)); - } - if (params && params['category']) { - this.activeCategory = this.activeTopic.categories.find(category => category.alias === decodeURIComponent(params['category']) && this.isPublicOrIsMember(category.visibility)); - } else { - this.activeCategory = this.activeTopic.categories.find(category => this.isPublicOrIsMember(category.visibility)); - } + this.setActives(params); this.loading = false; } } else { @@ -207,6 +189,26 @@ export class AppComponent implements OnInit, OnDestroy { })); } + setActives(params: Params) { + if (params && params['topic']) { + this.activeTopic = this.stakeholder.topics.find(topic => topic.alias === decodeURIComponent(params['topic']) && this.isPublicOrIsMember(topic.visibility)); + } else { + this.activeTopic = this.stakeholder.topics.find(topic => this.isPublicOrIsMember(topic.visibility)); + } + if(this.activeTopic) { + if (params && params['category']) { + this.activeCategory = this.activeTopic.categories.find(category => category.alias === decodeURIComponent(params['category']) && this.isPublicOrIsMember(category.visibility)); + } else { + this.activeCategory = this.activeTopic.categories.find(category => this.isPublicOrIsMember(category.visibility)); + } + if(!this.activeCategory) { + this.navigateToError(); + } + } else { + this.navigateToError(); + } + } + public setNotificationGroups() { this.entities = this.stakeholderUtils.types.map(option => option.value); this.notificationGroups = []; diff --git a/src/app/monitor/monitor.component.html b/src/app/monitor/monitor.component.html index fb746cf..3c37e1b 100644 --- a/src/app/monitor/monitor.component.html +++ b/src/app/monitor/monitor.component.html @@ -39,10 +39,10 @@
-
+
-
Dashboard
+
Monitor Dashboard

{{stakeholder.name}}

diff --git a/src/app/topic/topic.component.html b/src/app/topic/topic.component.html index f76c0bb..84e1731 100644 --- a/src/app/topic/topic.component.html +++ b/src/app/topic/topic.component.html @@ -199,17 +199,18 @@
- +
+
+ +
+ +
+
+
diff --git a/src/app/topic/topic.component.ts b/src/app/topic/topic.component.ts index 4b7a5fc..93b1f44 100644 --- a/src/app/topic/topic.component.ts +++ b/src/app/topic/topic.component.ts @@ -351,7 +351,7 @@ export class TopicComponent implements OnInit, OnDestroy, AfterViewInit, IDeacti this.topicChanged(() => { this.stakeholder.topics.splice(this.index, 1); if(this.topicIndex === this.index) { - this.chooseTopic(Math.max(0, this.index)); + this.chooseTopic(Math.max(0, this.index - 1)); } }, true); }; @@ -492,7 +492,7 @@ export class TopicComponent implements OnInit, OnDestroy, AfterViewInit, IDeacti this.categoryChanged(() => { this.stakeholder.topics[this.topicIndex].categories.splice(this.index, 1); if(this.categoryIndex === this.index) { - this.chooseCategory(Math.max(0, this.index)); + this.chooseCategory(Math.max(0, this.index - 1)); } }, true); }; @@ -632,7 +632,7 @@ export class TopicComponent implements OnInit, OnDestroy, AfterViewInit, IDeacti this.subCategoryChanged(() => { this.stakeholder.topics[this.topicIndex].categories[this.categoryIndex].subCategories.splice(this.index, 1); if(this.subCategoryIndex === this.index) { - this.chooseSubcategory(Math.max(0, this.index)); + this.chooseSubcategory(Math.max(0, this.index - 1)); } }, true); }; diff --git a/src/assets/common-assets b/src/assets/common-assets index 06e1889..75433ae 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit 06e1889730e456e86f728a31410bf550d16ac7d6 +Subproject commit 75433ae50ab42a5ad1aea2a26ec26c57e78e4a25