Skip to content

Commit 9545460

Browse files
committed
Bug fixes
1 parent 66667df commit 9545460

File tree

23 files changed

+271
-171
lines changed

23 files changed

+271
-171
lines changed

src/Server/Coderr.Server.Domain/Core/Account/Account.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ public void RequestPasswordReset()
204204
public void SetVerifiedEmail(string email)
205205
{
206206
Email = email ?? throw new ArgumentNullException(nameof(email));
207+
208+
// To enable UI testing without email integration
209+
if (email.EndsWith("test@localhost.com"))
210+
{
211+
ActivationKey = "abc123";
212+
}
207213
}
208214

209215
/// <summary>

src/Server/Coderr.Server.Web/ClientApp/boot.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,18 @@ const routes = [
248248
}
249249
];
250250

251+
var hooks = {
252+
mounted: function(instance:Vue) {},
253+
created: function(instance:Vue) {},
254+
afterRoute: function (to: string, from: string) {}
255+
};
256+
257+
// Hack for tests
258+
var v = <any>window;
259+
if (v["Cypress"]) {
260+
v['MyVueHooks'] = hooks;
261+
}
262+
251263
var ourVue: Vue;
252264
AppRoot.Instance.loadCurrentUser()
253265
.then(user => {
@@ -257,10 +269,20 @@ AppRoot.Instance.loadCurrentUser()
257269
router: new VueRouter({ mode: "history", routes: routes }),
258270
render: h => h(require("./components/home/app.vue.html")),
259271
created: () => {
272+
hooks.created(ourVue);
260273
},
261274
mounted: () => {
275+
hooks.mounted(ourVue);
276+
262277
}
263278
});
279+
ourVue.$router.afterEach((to, from) => {
280+
hooks.afterRoute(to.path, from.path);
281+
})
264282
ourVue.user$ = user;
283+
284+
if (v["Cypress"]) {
285+
v["MyVue"] = ourVue;
286+
}
265287
});
266288

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ export default class AnalyzeMenuComponent extends Vue {
2222
MyIncidents.Instance.subscribeOnSelectedIncident(this.onIncidentSelected);
2323
MyIncidents.Instance.subscribeOnListChanges(x => {
2424
this.incidents = MyIncidents.Instance.myIncidents;
25+
if (!this.incidentId && this.incidents.length > 0) {
26+
this.incidentId = this.incidents[0].incidentId;
27+
MyIncidents.Instance.switchIncident(this.incidentId);
28+
this.$router.push({ name: 'analyzeIncident', params: { incidentId: this.incidentId.toString() } });
29+
}
2530
});
2631
MyIncidents.Instance.ready()
2732
.then(x => {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export class MyIncidents {
127127
if (this.allMyIncidents$.findIndex(menuItem => menuItem.incidentId === assignedIncident.Id) === -1) {
128128
var item = this.createItem(assignedIncident.Id, assignedIncident.ApplicationId, assignedIncident.Description);
129129
this.allMyIncidents$.push(item);
130+
this.filterMyIncidents();
130131
this.triggerIncidentListCallbacks(item.incidentId, true);
131132
}
132133
});

src/Server/Coderr.Server.Web/ClientApp/components/discover/application/configure.ts

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ interface ILibrarySummary {
1616
export default class ConfigureClientComponent extends Vue {
1717
libraries: ILibrarySummary[] = [];
1818
instruction: string | null = null;
19-
weAreInTrouble = false;
2019

2120
applicationId = 0;
2221
appKey = "";
2322
sharedSecret = "";
2423
reportUrl = "";
2524

2625
noConnection = false;
27-
gotNoIncidents = false;
26+
weAreInTrouble = false;
2827

2928
created() {
3029
this.applicationId = parseInt(this.$route.params.applicationId, 10);
@@ -59,21 +58,7 @@ export default class ConfigureClientComponent extends Vue {
5958
params: { type: "configuration" }
6059
});
6160
}
62-
63-
onExitGuide() {
64-
AppRoot.Instance.incidentService.find(this.applicationId)
65-
.then(x => {
66-
if (x.Items.length === 0) {
67-
this.gotNoIncidents = true;
68-
} else {
69-
this.$router.push({
70-
name: "discover",
71-
params: { applicationId: this.applicationId.toString() }
72-
});
73-
}
74-
});
75-
}
76-
61+
7762
select(libName: string) {
7863
var appInfo = AppRoot.Instance.currentUser.applications[0];
7964
AppRoot.Instance.applicationService.get(appInfo.id)
@@ -110,7 +95,10 @@ export default class ConfigureClientComponent extends Vue {
11095
return;
11196
}
11297

113-
this.$router.push({ name: "root" });
98+
this.$router.push({
99+
name: "discover",
100+
params: { applicationId: this.applicationId.toString() }
101+
});
114102
});
115103

116104
}

src/Server/Coderr.Server.Web/ClientApp/components/discover/application/configure.vue.html

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,20 @@ <h1>Configure your application</h1>
2525
</div>
2626
<div class="col-md-8">
2727
<div class="alert alert-warning" v-if="weAreInTrouble">
28-
<h3 class="alert-heading">No reported errors</h3>
29-
<div>
30-
<p>We couldn't find any reported errors. Do you need help?</p>
31-
<router-link class="btn btn-outline-danger btn-sm" :to="{name: 'support', params: { type: 'configdemo' }}">Schedule a (free) demo with one of our developers</router-link>
32-
<a href="https://coderr.io/documentation/" target="_blank" class="btn btn-outline-danger btn-sm">Read the reporting errors guide</a>
33-
<a href="#" v-on:click.prevent="onExitGuide" class="btn btn-outline-danger btn-sm">Back</a>
34-
</div>
35-
</div>
36-
<div class="alert alert-warning" v-if="gotNoIncidents">
3728
<h3 class="alert-heading">No errors have been reported.</h3>
3829
<div>
3930
<p>We could not find any reported errors in our database. </p>
4031
<p>Do you want our help to troubleshoot the issue?</p>
41-
<button class="btn btn-outline-danger" v-on:click="goToSupport">Get help from our developers</button> <button class="btn btn-outline-danger">Exit onboarding</button>
32+
<button id="configureHelpButton" class="btn btn-outline-danger" v-on:click="goToSupport">Get help from our developers</button>
33+
<a class="btn btn-outline-danger" href="https://coderr.io/guides-and-support/">Guides and support</a>
34+
<router-link class="btn btn-outline-danger" :to="{ name: 'root' }">Exit onboarding</router-link>
4235
</div>
4336
</div>
4437
<div class="alert alert-warning" v-if="noConnection">
4538
<h3 class="alert-heading">No internet connection</h3>
4639
<div>
4740
<p>An internet connection is required to load the configuration guides.</p>
48-
<p>As we could not download them, you need to visit <a target="_blank" href="https://coderr.io/documentation">our documentation</a> by yourself.</p>
41+
<p>As we could not download them, you need to visit <a target="_blank" href="https://coderr.io/guides-and-support/">our documentation</a> by yourself.</p>
4942
<hr />
5043
<h5>
5144
Your credentials (copy/paste into your application)

src/Server/Coderr.Server.Web/ClientApp/components/discover/discover.vue.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div>
33
<discover-menu />
4-
<div class="mt-2 mr-2 ml-2">
4+
<div class="mt-2 mr-2 ml-2" id="DiscoverView">
55
<router-view></router-view>
66
</div>
77
</div>

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export default class DiscoverComponent extends Vue {
2222
private static activeBtnTheme: string = 'btn-dark';
2323

2424
applicationId: number = 0;
25+
destroyed$ = false;
2526

2627
// summary, changes when time window changes
2728
reportCount: number = 0;
@@ -41,13 +42,12 @@ export default class DiscoverComponent extends Vue {
4142
this.loadGenericOverview();
4243
return;
4344
}
45+
this.applicationId = parseInt(value);
4446

4547
if (this.$route.fullPath.indexOf('/discover/') === -1) {
4648
return;
4749
}
48-
49-
var applicationId = parseInt(value);
50-
this.loadApplication(applicationId);
50+
this.loadApplication(this.applicationId);
5151
}
5252

5353
created() {
@@ -62,6 +62,9 @@ export default class DiscoverComponent extends Vue {
6262
mounted() {
6363
}
6464

65+
beforeDestroy() {
66+
this.destroyed$ = true;
67+
}
6568
assignBestToMe() {
6669

6770
}
@@ -72,6 +75,10 @@ export default class DiscoverComponent extends Vue {
7275
q.NumberOfDays = 30;
7376
AppRoot.Instance.apiClient.query<GetApplicationOverviewResult>(q)
7477
.then(result => {
78+
if (this.destroyed$) {
79+
return;
80+
}
81+
7582
this.incidentCount = result.StatSummary.Incidents;
7683
this.reportCount = result.StatSummary.Reports;
7784
this.feedbackCount = result.StatSummary.UserFeedback;
@@ -90,6 +97,10 @@ export default class DiscoverComponent extends Vue {
9097
q.NumberOfDays = 30;
9198
AppRoot.Instance.apiClient.query<GetOverviewResult>(q)
9299
.then(result => {
100+
if (this.destroyed$) {
101+
return;
102+
}
103+
93104
this.incidentCount = result.StatSummary.Incidents;
94105
this.reportCount = result.StatSummary.Reports;
95106
this.feedbackCount = result.StatSummary.UserFeedback;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
</div>
6666
<div class="col-lg-9">
6767
<div class="card">
68-
<div class="card-body">
68+
<div class="card-body trend">
6969
<div class="position-relative coderr-chart" style="padding-left: 16px;">
7070
<h3>
7171
<span v-if="applicationId == 0">Incident trend per application</span>

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export default class IncidentSearchComponent extends Vue {
3333
private apiClient$: ApiClient = AppRoot.Instance.apiClient;
3434
private incidentService$: IncidentService = AppRoot.Instance.incidentService;
3535
private readyPromises$: Promise<any>[] = [];
36+
private destroyed$ = false;
3637

3738
//controls
3839
showFilters: boolean = false;
@@ -104,14 +105,20 @@ export default class IncidentSearchComponent extends Vue {
104105

105106
destroyed() {
106107
PubSubService.Instance.unsubscribe(MenuApi.MessagingTopics.ApplicationChanged, this.onApplicationChangedInNavMenu);
108+
this.destroyed$ = true;
107109
}
108110

109111
mounted() {
112+
this.destroyed$ = false;
110113

111114
var readyPromise = AppRoot.Instance.loadState('incident-search', this);
112115
this.readyPromises$.push(readyPromise);
113116
Promise.all(this.readyPromises$)
114117
.then(resolve => {
118+
if (this.destroyed$) {
119+
return;
120+
}
121+
115122
if (this.$route.params.applicationId) {
116123
var id = parseInt(this.$route.params.applicationId, 10);
117124
if (id > 0) {
@@ -132,7 +139,6 @@ export default class IncidentSearchComponent extends Vue {
132139
checkAll(e: Event) {
133140
const target = <HTMLInputElement>e.target;
134141
const elems = document.querySelectorAll('#searchTable tbody input[type="checkbox"]');
135-
console.log(elems);
136142
for (let i = 0; i < elems.length; i++) {
137143
const elem = <HTMLInputElement>elems[i];
138144
elem.checked = target.checked;
@@ -238,6 +244,10 @@ export default class IncidentSearchComponent extends Vue {
238244

239245
AppRoot.Instance.apiClient.query<FindIncidentsResult>(query)
240246
.then(result => {
247+
if (this.destroyed$) {
248+
return;
249+
}
250+
241251
this.incidents.splice(0);
242252
result.Items.forEach(item => {
243253
var entity: Incident = {
@@ -263,12 +273,11 @@ export default class IncidentSearchComponent extends Vue {
263273
}
264274

265275
assignAllToMe() {
266-
if (this.checkedIncidents.length === 0) {
267-
return;
276+
const elems = document.querySelectorAll('#searchTable tbody input[type="checkbox"]:checked');
277+
for (let i = 0; i < elems.length; i++) {
278+
const elem = <HTMLInputElement>elems[i];
279+
this.incidentService$.assignToMe(parseInt(elem.value));
268280
}
269-
this.checkedIncidents.forEach(id => {
270-
this.incidentService$.assignToMe(id);
271-
});
272281
AppRoot.notify('All incidents have been assigned to you. Click on the "Analyze" menu to start working with them.');
273282
setTimeout(() => { this.search() }, 1000);
274283
}

0 commit comments

Comments
 (0)