Skip to content

Commit 58b3eea

Browse files
committed
Better getting started documentation
1 parent 891162c commit 58b3eea

File tree

14 files changed

+1552
-1272
lines changed

14 files changed

+1552
-1272
lines changed

src/Server/Coderr.Server.App/Core/Accounts/AccountService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using Coderr.Server.App.Core.Invitations;
1212
using Coderr.Server.Domain.Core.Account;
1313
using Coderr.Server.Domain.Core.Applications;
14+
using Coderr.Server.Domain.Core.User;
1415
using Coderr.Server.Infrastructure.Security;
1516

1617
using DotNetCqs;

src/Server/Coderr.Server.App/Core/Users/EventHandlers/CreateOnNewAccount.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ public CreateOnNewAccount(IUserRepository userRepository)
2020

2121
public async Task HandleAsync(IMessageContext context, AccountActivated e)
2222
{
23+
var user = await _userRepository.FindByEmailAsync(e.EmailAddress);
24+
if (user != null)
25+
return;
26+
2327
await _userRepository.CreateAsync(new User(e.AccountId, e.UserName)
2428
{
2529
EmailAddress = e.EmailAddress

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<a class="nav-link"><i class="fa fa-question-circle"></i> Suggestions</a>
1010
</router-link>-->
1111
<router-link tag="li" class="nav-item" :to="{name: 'findIncidents', params: {applicationId: currentApplicationId }}">
12-
<a class="nav-link"><i class="fa fa-table"></i> Search</a>
12+
<a class="nav-link"><i class="fa fa-table"></i> Incidents</a>
1313
</router-link>
1414
<router-link tag="li" class="nav-item" :to="{name: 'configureApplication', params: {applicationId: currentApplicationId }}" v-if="currentApplicationId">
1515
<a class="nav-link"><i class="fa fa-cog"></i> Configure your application</a>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.end {
2+
position: absolute;
3+
bottom: 0
4+
}
5+
6+
7+
.onboarding .card .card-footer, .onboarding .card .card-header {
8+
background: transparent;
9+
border: none;
10+
}
11+
12+
/*.onboarding .card-group {
13+
padding: 5px;
14+
}*/
15+
.onboarding .card {
16+
margin-right: 10px;
17+
}
18+
19+
.onboarding .card:last-child {
20+
margin-right: 0;
21+
}

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import { Component } from "vue-property-decorator";
77
export default class HomeHomeComponent extends Vue {
88
muteOnboarding = false;
99
noApps = false;
10+
appId = '1';
11+
showOnboarding = false;
12+
1013
created() {
1114
AppRoot.Instance.loadState("MainHome", this)
1215
.then(x => {
@@ -20,25 +23,25 @@ export default class HomeHomeComponent extends Vue {
2023
q.ItemsPerPage = 1;
2124
AppRoot.Instance.apiClient.query<FindIncidentsResult>(q)
2225
.then(result => {
26+
this.showOnboarding = true;
2327
if (result.TotalCount > 0) {
2428
this.mute();
2529
}
2630
});
27-
}
2831

29-
start() {
30-
// since we can be users who do not have access to application with id 1
3132
AppRoot.Instance.applicationService.list()
3233
.then(apps => {
33-
if (apps.length === 0) {
34-
this.noApps = true;
35-
return;
34+
this.noApps = apps.length === 0;
35+
if (apps.length > 0) {
36+
this.appId = apps[0].id.toString();
3637
}
37-
38-
this.$router.push({ name: 'onboardApp', params: { applicationId: apps[0].id.toString() } });
3938
});
4039
}
4140

41+
start() {
42+
this.$router.push({ name: 'onboardApp', params: { applicationId: this.appId } });
43+
}
44+
4245
mute() {
4346
this.muteOnboarding = true;
4447
AppRoot.Instance.storeState({
Lines changed: 100 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,111 @@
11
<template>
2-
<div class="">
3-
<div class="row" v-if="!noApps">
4-
<div class="col mb-2">
2+
<div class="onboarding">
3+
<div v-if="showOnboarding" v-hide>
4+
<div class="row">
5+
<div class="col mb-2 mt-5">
6+
<div class="m-4">
7+
<h2>Welcome to Coderr!</h2>
8+
<p class="lead">
9+
Coderr finds errors in production and makes it trivial to reproduce and correct them. The best way to get started is to read our <a href="https://coderr.io/documentation/getting-started/">getting started guide</a>.
10+
</p>
11+
</div>
12+
13+
</div>
14+
</div>
15+
<div class="m-4">
16+
<div class="row card-group">
17+
<div class="card">
18+
<div class="card-header">
19+
<h3>Report errors</h3>
20+
</div>
21+
<div class="card-body">
22+
<p>
23+
Our nuget packages are used detect and report errors in your application. To get started you need to install and configure our of our packages.
24+
</p>
25+
<p>
26+
Follow
27+
our configuration wizard below to get started. You can also read our <a href="https://coderr.io/documentation/">reporting guide</a> or visit our <a href="https://coderr.io/guides-and-support">Guides and support</a> section at our homepage.
28+
</p>
29+
<div>
30+
31+
</div>
32+
33+
</div>
34+
<div class="card-footer">
35+
<button class="btn btn-primary" @click.prevent="start">Configuration wizard</button>
36+
</div>
37+
</div>
38+
<div class="card">
39+
<div class="card-header">
40+
<h3>Application configuration (admin only)</h3>
41+
</div>
42+
<div class="card-body">
43+
<p>
44+
You can monitor multiple applications in Coderr. To make it easier for you, we created an application named "DemoApp".
45+
</p>
46+
<p>
47+
You can change its name and create more applications by clicking on the Cog wheel (<i class="fa fa-cog text-primary"></i>) at top right.
48+
</p>
49+
</div>
50+
<div class="card-footer">
51+
<a class="btn btn-primary" :href="`/manage/application/${appId}`">
52+
Application settings
53+
</a>
54+
</div>
55+
</div>
56+
57+
<div class="card">
58+
<div class="card-header">
59+
<h3>Invite co-workers (admin only)</h3>
60+
</div>
61+
<div class="card-body">
62+
<p>To invite co-workers, use the Cog wheel (<i class="fa fa-cog text-primary"></i>) found in top right menu, select one of your applications and then use the "Security" tab.</p>
63+
</div>
64+
<div class="card-footer">
65+
<a class="btn btn-primary" :href="`/manage/application/${appId}/security`">
66+
Invite co-workers
67+
</a>
68+
</div>
69+
70+
</div>
71+
</div>
72+
<div class="row card-group mt-2">
73+
<div class="card">
74+
<div class="card-header">
75+
<h3>Before going to production</h3>
76+
</div>
77+
<div class="card-body">
78+
<pre><code>Err.Configuration.ThrowExceptions = false;</code></pre>
79+
<p>Turn of Coderrs internal exceptions before going to production.</p>
80+
</div>
81+
</div>
82+
<div class="card">
83+
<div class="card-header">
84+
<h3>Disable Coderr in Development environments</h3>
85+
</div>
86+
<div class="card-body">
87+
<p>You typically have full control over errors happening in development environments. Learn how to conditionally enable Coderr to reduce noise.</p>
88+
89+
</div>
90+
<div class="card-footer">
91+
<a class="btn btn-primary" href="https://coderr.io/documentation/getting-started/#before-going-to-production">Learn more</a>
92+
</div>
93+
</div>
94+
</div>
95+
</div>
96+
</div>
97+
<div v-if="noApps" v-hide>
98+
<div class="row">
599
<div class="jumbotron">
6100
<h1 class="display-4">Welcome to Coderr! </h1>
7101
<p class="lead">
8-
We suggest that you begin by configuring your application.
102+
You are not a member of any applications in Coderr yet. Ask your administrator to get invited.
9103
</p>
10-
<button class="btn btn-primary" @click.prevent="start">Configuration guide</button>
11-
<button class="btn btn-secondary" @click.prevent="mute">Mute this message</button>
12104
</div>
13105
</div>
14106
</div>
15-
<div class="row" v-if="noApps">
16-
<div class="jumbotron">
17-
<h1 class="display-4">Welcome to Coderr! </h1>
18-
<p class="lead">
19-
You are not a member of any applications in Coderr yet. Ask your administrator to get invited.
20-
</p>
21-
</div>
22-
</div>
23107
</div>
24108
</template>
25109

26-
<script src="./home.ts"></script>
110+
<script src="./home.ts"></script>
111+
<style src="./home.css"></style>

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

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ type NavigationCallback = (context: IRouteNavigation) => void;
1717
@Component
1818
export default class NavMenuComponent extends Vue {
1919
private callbacks: NavigationCallback[] = [];
20-
20+
private loaded = false;
2121
childMenu: MenuApi.MenuItem[] = [];
2222

23+
myApplicationsPromise: Promise<null>;
2324
myApplications: MenuApi.MenuItem[] = [];
2425
currentApplicationName: string = 'All applications';
2526
currentApplicationId: number | null = null;
@@ -42,16 +43,24 @@ export default class NavMenuComponent extends Vue {
4243
this.updateCurrent(0);
4344
return;
4445
}
45-
46+
console.log()
4647
var applicationId = parseInt(value);
4748
this.updateCurrent(applicationId);
4849
}
4950

5051
created() {
51-
AppRoot.Instance.currentUser.applications.forEach(app => {
52-
var mnuItem = this.createAppMenuItem(app.id, app.name);
53-
this.myApplications.push(mnuItem);
52+
this.myApplicationsPromise = new Promise((accept, reject) => {
53+
AppRoot.Instance.loadCurrentUser().then(x => {
54+
x.applications.forEach(app => {
55+
var mnuItem = this.createAppMenuItem(app.id, app.name);
56+
this.myApplications.push(mnuItem);
57+
});
58+
accept();
59+
});
5460
});
61+
this.myApplicationsPromise.then(x => {
62+
console.log('pushed', this.myApplications);
63+
})
5564

5665
this.$router.beforeEach((to, from, next) => {
5766
if (to.fullPath.indexOf('/onboarding/') === -1 && this.onboarding) {
@@ -156,15 +165,17 @@ export default class NavMenuComponent extends Vue {
156165
return;
157166
}
158167

159-
var app = this.getApplication(applicationId);
160-
this.currentApplicationId = applicationId;
168+
this.myApplicationsPromise.then(x => {
169+
var app = this.getApplication(applicationId);
170+
this.currentApplicationId = applicationId;
161171

162-
var title = app.title;
163-
if (title.length > 20) {
164-
title = title.substr(0, 15) + '[...]';
165-
}
166-
this.currentApplicationName = title;
167-
this.discoverLink = '/discover/' + applicationId;
172+
var title = app.title;
173+
if (title.length > 20) {
174+
title = title.substr(0, 15) + '[...]';
175+
}
176+
this.currentApplicationName = title;
177+
this.discoverLink = '/discover/' + applicationId;
178+
});
168179
}
169180

170181

@@ -189,7 +200,7 @@ export default class NavMenuComponent extends Vue {
189200
}
190201
}
191202

192-
throw new Error('Failed to find application ' + applicationId);
203+
throw new Error('Failed to find application ' + applicationId + ".\r\n" + JSON.stringify(this.myApplications));
193204
}
194205

195206
}

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
<div class="mt-4">
33
<div class="row">
44
<div class="col">
5-
<h1>Welcome to Coderr!</h1>
6-
<p class="lead">You have taken the first step towards painless error handling.</p>
5+
<h1>Application configuration</h1>
6+
<p class="lead">First step is to configure your own application so that errors are reported to Coderr. To do that you need to install one of our nuget packages.</p>
77
</div>
88
</div>
99
<div class="row">
1010
<div class="col">
1111
<p>
12-
To get started, you need to configure your application.
13-
Select the .NET library that you are going to use.
12+
Select the .NET library that you are using in your application.
1413
</p>
1514
</div>
1615
</div>

src/Server/Coderr.Server.Web/ClientApp/css/site.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@
1111

1212
.card {
1313
margin-bottom: 10px;
14+
}
15+
16+
[v-cloak] {
17+
display: none;
1418
}

src/Server/Coderr.Server.Web/ClientApp/services/AppRoot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class AppRoot {
6767
}
6868

6969
var usr = await this.apiClient.auth();
70-
70+
console.log(usr);
7171
var apps: IMyApplication[] = [];
7272
usr.Applications.forEach((app: any) => {
7373
apps.push({

0 commit comments

Comments
 (0)