Skip to content

Commit 6b6108f

Browse files
committed
Meny corrections
1 parent 2e704bf commit 6b6108f

File tree

9 files changed

+66069
-48
lines changed

9 files changed

+66069
-48
lines changed

src/Server/Coderr.Server.Web/ClientApp/components/analyze/myincidents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ export class MyIncidents {
238238

239239

240240

241-
if (incidentId === this.selectedIncident.incidentId) {
241+
if (this.selectedIncident == null || incidentId === this.selectedIncident.incidentId) {
242242
this.getNextIncident();
243243
}
244244
}

src/Server/Coderr.Server.Web/ClientApp/components/discover/incidents/search.ts

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PubSubService } from "../../../services/PubSub";
1+
import { PubSubService, MessageContext } from "../../../services/PubSub";
22
import * as MenuApi from "../../../services/menu/MenuApi";
33
import { FindIncidents, FindIncidentsResult, IncidentOrder } from "../../../dto/Core/Incidents";
44
import { GetTags, TagDTO } from "../../../dto/Modules/Tagging";
@@ -62,18 +62,7 @@ export default class IncidentSearchComponent extends Vue {
6262
currentIncidentId = 0;
6363

6464
created() {
65-
PubSubService.Instance.subscribe(MenuApi.MessagingTopics.ApplicationChanged, ctx => {
66-
var body = <MenuApi.ApplicationChanged>ctx.message.body;
67-
if (body.applicationId == null) {
68-
this.activeApplications = [];
69-
this.showApplicationColumn = true;
70-
} else {
71-
this.activeApplications = [body.applicationId];
72-
this.showApplicationColumn = false;
73-
}
74-
75-
this.search();
76-
});
65+
PubSubService.Instance.subscribe(MenuApi.MessagingTopics.ApplicationChanged, this.onApplicationChangedInNavMenu);
7766

7867
//fetch in created since we do not need the DOM
7968
var promise = new Promise<any>(resolve => {
@@ -113,6 +102,10 @@ export default class IncidentSearchComponent extends Vue {
113102
}
114103
}
115104

105+
destroyed() {
106+
PubSubService.Instance.unsubscribe(MenuApi.MessagingTopics.ApplicationChanged, this.onApplicationChangedInNavMenu);
107+
}
108+
116109
mounted() {
117110

118111
var readyPromise = AppRoot.Instance.loadState('incident-search', this);
@@ -276,6 +269,21 @@ export default class IncidentSearchComponent extends Vue {
276269

277270
}
278271

272+
private onApplicationChangedInNavMenu(ctx: MessageContext) {
273+
if (this.$route.name !== 'findIncidents') {
274+
return;
275+
}
276+
var body = <MenuApi.ApplicationChanged>ctx.message.body;
277+
if (body.applicationId == null) {
278+
this.activeApplications = [];
279+
this.showApplicationColumn = true;
280+
} else {
281+
this.activeApplications = [body.applicationId];
282+
this.showApplicationColumn = false;
283+
}
284+
285+
this.search();
286+
}
279287
private drawSearchUi() {
280288
var els = document.querySelectorAll('.search-head th i');
281289
for (var i = 0; i < els.length; i++) {

src/Server/Coderr.Server.Web/ClientApp/components/home/navmenu/navmenu.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ export default class NavMenuComponent extends Vue {
3030

3131
onboarding: boolean = false;
3232

33+
discoverLink: string = '/discover/';
34+
3335
@Watch('$route.params.applicationId')
3436
onApplicationChanged(value: string, oldValue: string) {
3537
if (!value) {
@@ -80,6 +82,7 @@ export default class NavMenuComponent extends Vue {
8082
}
8183

8284
changeApplication(applicationId: number) {
85+
console.log('changing app: ' + applicationId);
8386
if (applicationId == null) {
8487
this.updateCurrent(0);
8588
} else {
@@ -144,6 +147,7 @@ export default class NavMenuComponent extends Vue {
144147
if (applicationId === 0) {
145148
this.currentApplicationName = "All applications";
146149
this.currentApplicationId = null;
150+
this.discoverLink = '/discover/';
147151
return;
148152
}
149153

@@ -155,6 +159,7 @@ export default class NavMenuComponent extends Vue {
155159
title = title.substr(0, 15) + '[...]';
156160
}
157161
this.currentApplicationName = title;
162+
this.discoverLink = '/discover/' + applicationId;
158163
}
159164

160165

src/Server/Coderr.Server.Web/ClientApp/components/home/navmenu/navmenu.vue.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
</div>
3131
</li>
3232
<li class="nav-item">
33-
<router-link class="nav-link" :to="'/discover/' + currentApplicationId">
33+
<router-link class="nav-link" :to="discoverLink">
3434
<span class="fa fa-binoculars"></span> Discover
3535
</router-link>
3636
</li>
@@ -53,7 +53,7 @@
5353
</router-link>
5454
</li>
5555
<li class="nav-item">
56-
<router-link :to="{ name:'manageHome' }" class="nav-link" title="System administration">
56+
<router-link :to="{ name:'manageHome', params: {applicationId: currentApplicationId }}" class="nav-link" title="System administration">
5757
<i class="fa fa-cog"></i>
5858
</router-link>
5959
</li>
Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import { PubSubService, MessageContext } from "../../../services/PubSub";
2+
import * as MenuApi from "../../../services/menu/MenuApi";
13
import Vue from 'vue';
2-
import { Component } from 'vue-property-decorator';
4+
import { Component, Watch } from 'vue-property-decorator';
35

46
@Component({
57
components: {
@@ -8,6 +10,20 @@ import { Component } from 'vue-property-decorator';
810
})
911
export default class ManageComponent extends Vue {
1012
created() {
13+
PubSubService.Instance.subscribe(MenuApi.MessagingTopics.ApplicationChanged, this.onApplicationChangedInNavMenu);
1114
}
1215

16+
destroyed() {
17+
PubSubService.Instance.unsubscribe(MenuApi.MessagingTopics.ApplicationChanged, this.onApplicationChangedInNavMenu);
18+
}
19+
20+
private onApplicationChangedInNavMenu(ctx: MessageContext) {
21+
if (this.$route.path.indexOf('/manage/') === -1) {
22+
return;
23+
}
24+
var body = <MenuApi.ApplicationChanged>ctx.message.body;
25+
if (body.applicationId == null) {
26+
this.$router.push({ name: 'manageHome' });
27+
}
28+
}
1329
}

src/Server/Coderr.Server.Web/ClientApp/components/manage/application/settings/settings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default class ManageAppSettingsComponent extends Vue {
2222

2323
@Watch('$route.params.applicationId')
2424
onApplicationChanged(value: string, oldValue: string) {
25+
console.log(value);
2526
this.load();
2627
}
2728

src/Server/Coderr.Server.Web/ClientApp/components/manage/system/home/home.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ export default class ManageHomeComponent extends Vue {
88

99

1010
created() {
11+
if (this.$route.params.applicationId) {
12+
this.$router.push({
13+
name: 'manageAppSettings',
14+
params: { applicationId: this.$route.params.applicationId }
15+
});
16+
}
1117
}
1218

1319

src/Server/Coderr.Server.Web/wwwroot/dist/main.js

Lines changed: 66015 additions & 30 deletions
Large diffs are not rendered by default.

src/Server/Coderr.Server.Web/wwwroot/dist/main.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)