Skip to content

Commit 42e550e

Browse files
authored
Improved the design (a lot of small tweaks) (#67)
UI corrections
1 parent 99ad85c commit 42e550e

File tree

28 files changed

+263
-250
lines changed

28 files changed

+263
-250
lines changed

src/Server/Coderr.Server.Api/Core/Incidents/Events/IncidentAssigned.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected IncidentAssigned()
4545
/// <summary>
4646
/// When the incident was assigned (client side)
4747
/// </summary>
48-
public DateTime AssignedAtUtc { get; private set; }
48+
public DateTime AssignedAtUtc { get; private set; }
4949

5050
/// <summary>
5151
/// Incident being assigned

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@ public async Task<ClaimsIdentity> ActivateAccount(ClaimsPrincipal user, string a
8686
throw new ArgumentOutOfRangeException("ActivationKey", activationKey,
8787
"Key was not found.");
8888

89+
8990
account.Activate();
9091
await _repository.UpdateAsync(account);
91-
92+
9293

9394
if (!user.IsCurrentAccount(account.Id))
9495
{

src/Server/Coderr.Server.ReportAnalyzer/Incidents/IncidentBeingAnalyzed.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ public string Description
9292
set => _description = value;
9393
}
9494

95+
/// <summary>
96+
/// List of all environment names that the developer specified when reporting the errors.
97+
/// </summary>
98+
public string[] EnvironmentNames { get; set; }
99+
95100
/// <summary>
96101
/// Full name of the exception message.
97102
/// </summary>

src/Server/Coderr.Server.SqlServer/Core/Accounts/AccountRepository.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace Coderr.Server.SqlServer.Core.Accounts
1616
public class AccountRepository : IAccountRepository
1717
{
1818
private readonly IAdoNetUnitOfWork _uow;
19+
private ILog _logger = LogManager.GetLogger(typeof(AccountRepository));
1920

2021
public AccountRepository(IAdoNetUnitOfWork uow)
2122
{
@@ -43,7 +44,12 @@ public async Task<Account> FindByActivationKeyAsync(string activationKey)
4344
{
4445
cmd.CommandText = "SELECT * FROM Accounts WHERE ActivationKey=@key";
4546
cmd.AddParameter("key", activationKey);
46-
return await cmd.FirstOrDefaultAsync(new AccountMapper());
47+
var accounts= await cmd.ToListAsync(new AccountMapper());
48+
if (accounts.Count == 0)
49+
return null;
50+
51+
_logger.Error($"Found {accounts.Count} accounts, expected one.");
52+
return accounts.First();
4753
}
4854
}
4955

src/Server/Coderr.Server.SqlServer/ReportAnalyzer/AnalyticsRepository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ from Environments
113113
begin
114114
INSERT INTO IncidentEnvironments (IncidentId, EnvironmentId)
115115
SELECT @incidentId, @environmentId
116-
WHERE NOT EXISTS (SELECT IncidentId, EnvironmentId FROM IncidentEnvironment
116+
WHERE NOT EXISTS (SELECT IncidentId, EnvironmentId FROM IncidentEnvironments
117117
WHERE IncidentId=@incidentId AND EnvironmentId=@environmentId)
118118
end;";
119119
cmd.AddParameter("incidentId", incidentId);

src/Server/Coderr.Server.SqlServer/ReportAnalyzer/ErrorReportEntityMapper.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ public ErrorReportEntityMapper() : base("ErrorReports")
2020
.ToPropertyValue(x => null)
2121
.ToColumnValue(x => "");
2222

23+
Property(x => x.EnvironmentName)
24+
.Ignore();
25+
2326
Property(x => x.ClientReportId)
2427
.ColumnName("ErrorId");
2528

src/Server/Coderr.Server.Web/ClientApp/components/analyze/analyze.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
<analyze-menu />
4-
<div class="col">
4+
<div class="cold">
55
<router-view></router-view>
66
</div>
77
</div>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,8 @@ export default class AnalyzeHomeComponent extends Vue {
2929

3030
private onReady() {
3131
this.showWelcome = MyIncidents.Instance.myIncidents.length === 0;
32+
if (MyIncidents.Instance.myIncidents.length > 0) {
33+
MyIncidents.Instance.switchIncident(MyIncidents.Instance.myIncidents[0].incidentId);
34+
}
3235
}
3336
}

src/Server/Coderr.Server.Web/ClientApp/components/analyze/incidents/incident.vue.html

Lines changed: 81 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,109 @@
11
<template>
22
<div class="IncidentView">
3-
<div>
4-
<div class="row">
5-
<div class="col">
6-
<div class="float-right">
7-
<div class="dropdown">
8-
<button type="button" class="btn btn-outline-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
9-
Actions
10-
</button>
11-
<div class="dropdown-menu">
3+
<div class="row">
4+
<div class="col pl-4">
5+
<div class="float-right">
6+
<div class="btn-group" role="group">
7+
<button class="btn btn-primary text-light" v-on:click="closeIncident">Close incident</button>
8+
<div class="dropdown" style="display: inline-block">
9+
<button type="button" class="btn btn-outline-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></button>
10+
<div class="dropdown-menu dropdown-menu-right">
1211
<span class="dropdown-item" v-on:click="reAssign"><i class="fa-redo fa text-muted"></i> Re-assign</span>
1312
<!--<span class="dropdown-item" v-on:click="addToTfs"><i class="fa-code-branch fa text-muted"></i> Add to TFS/VSTS</span>-->
14-
<span class="dropdown-item" v-on:click="closeIncident"><i class="fa-lock fa text-muted"></i> Close incident</span>
13+
1514
</div>
1615
</div>
1716
</div>
17+
</div>
1818

19-
<h3>{{incident.Description}} <span class="lead text-muted">[{{incident.FullName}}]</span></h3>
19+
<h3>{{incident.Description}} <span class="lead text-muted">[{{incident.FullName}}]</span></h3>
2020

2121

22-
<div class="tags">
23-
<span v-for="tag in incident.Tags" class="badge badge-dark">{{tag}}</span>
24-
</div>
25-
<hr />
22+
<div class="tags">
23+
<span v-for="tag in incident.Tags" class="badge badge-dark">{{tag}}</span>
2624
</div>
2725
</div>
28-
<div class="row" v-if="incident.Solution">
29-
<div class="col">
30-
<div class="card">
31-
<div class="card-header">
32-
Previous solution ({{incident.SolvedAtUtc|ago}})
33-
</div>
34-
<div class="card-body">
35-
<div v-html="incident.Solution"></div>
36-
</div>
26+
</div>
27+
<div class="row" v-if="incident.Solution">
28+
<div class="col">
29+
<div class="card">
30+
<div class="card-header">
31+
Previous solution ({{incident.SolvedAtUtc|ago}})
32+
</div>
33+
<div class="card-body">
34+
<div v-html="incident.Solution"></div>
3735
</div>
3836
</div>
39-
4037
</div>
41-
<div class="row">
42-
<div class="col-xl-8 col-lg-6">
43-
<div class="card">
44-
<div class="card-body">
45-
<h3>Stack trace</h3>
46-
<pre style="min-height: 200px"><code>{{incident.StackTrace}}</code></pre>
47-
</div>
38+
39+
</div>
40+
<div class="row minimal-gutters">
41+
<div class="col-xl-8 col-lg-6">
42+
<div class="card">
43+
<div class="card-body">
44+
<h3>Stack trace</h3>
45+
<pre style="min-height: 200px"><code>{{incident.StackTrace}}</code></pre>
4846
</div>
4947
</div>
50-
<div class="col-xl-4 col-lg-6">
51-
<div class="card" v-if="incident.Facts && incident.Facts.length > 0">
52-
<div class="card-body">
53-
<h3>Quick facts</h3>
54-
<div>
55-
<table class="table table-borderless">
56-
<tbody>
57-
<tr v-for="prop in incident.Facts" v-if="prop.Value != '0'">
58-
<td>{{prop.Title}}</td>
59-
<td>{{prop.Value}}</td>
60-
</tr>
61-
</tbody>
62-
</table>
63-
</div>
48+
</div>
49+
<div class="col-xl-4 col-lg-6">
50+
<div class="card" v-if="incident.Facts && incident.Facts.length > 0">
51+
<div class="card-body">
52+
<h3>Quick facts</h3>
53+
<div>
54+
<table class="table table-borderless">
55+
<tbody>
56+
<tr v-for="prop in incident.Facts" v-if="prop.Value != '0'">
57+
<td>{{prop.Title}}</td>
58+
<td>{{prop.Value}}</td>
59+
</tr>
60+
</tbody>
61+
</table>
6462
</div>
6563
</div>
64+
</div>
6665

67-
<div class="card">
68-
<div class="card-body">
69-
<h3>Context collections</h3>
70-
<div>
71-
<div class="dropdown" style="display: inline">
72-
<button type="button" class="btn btn-light dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
73-
{{currentReportName}}
74-
</button>
75-
<div class="dropdown-menu">
76-
<h6 class="dropdown-header">Select report</h6>
77-
<div v-for="report in reports">
78-
<a class="dropdown-item" href="#" v-on:click.prevent="loadReport(report.Id)"><i class="fa-desktop fa text-muted"></i> {{report.CreatedAtUtc|ago}}</a>
79-
</div>
66+
<div class="card">
67+
<div class="card-body">
68+
<h3>Context collections</h3>
69+
<div>
70+
<div class="dropdown" style="display: inline">
71+
<button type="button" class="btn btn-light dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
72+
{{currentReportName}}
73+
</button>
74+
<div class="dropdown-menu">
75+
<h6 class="dropdown-header">Select report</h6>
76+
<div v-for="report in reports">
77+
<a class="dropdown-item" href="#" v-on:click.prevent="loadReport(report.Id)"><i class="fa-desktop fa text-muted"></i> {{report.CreatedAtUtc|ago}}</a>
8078
</div>
8179
</div>
82-
<div class="dropdown" style="display: inline">
83-
<button type="button" class="btn btn-light dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="reportChooser">
84-
{{currentCollectionName}}
85-
</button>
86-
<div class="dropdown-menu">
87-
<h6 class="dropdown-header">Select context collection</h6>
88-
<div v-for="collection in currentReport.ContextCollections">
89-
<span class="dropdown-item" v-on:click="loadCollection(collection.Name)"><i class="fa-table fa text-muted"></i> {{collection.Name}}</span>
90-
</div>
80+
</div>
81+
<div class="dropdown" style="display: inline">
82+
<button type="button" class="btn btn-light dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="reportChooser">
83+
{{currentCollectionName}}
84+
</button>
85+
<div class="dropdown-menu">
86+
<h6 class="dropdown-header">Select context collection</h6>
87+
<div v-for="collection in currentReport.ContextCollections">
88+
<span class="dropdown-item" v-on:click="loadCollection(collection.Name)"><i class="fa-table fa text-muted"></i> {{collection.Name}}</span>
9189
</div>
9290
</div>
9391
</div>
94-
<div v-if="currentReport.Id > 0" style="overflow: auto">
95-
<table class="table mt-3 mb-3">
96-
<tbody>
97-
<tr v-for="prop in currentCollection.Properties">
98-
<td>{{prop.Key}}</td>
99-
<td v-html="prop.Value"></td>
100-
</tr>
101-
</tbody>
102-
</table>
103-
</div>
104-
<hr />
105-
<em>
106-
<router-link class="btn btn-primary btn-block" :to="{ name: 'analyzeReport', params: { reportId: currentReport.Id, incidentId: incident.Id}}">View entire report</router-link>
107-
</em>
108-
</div>
92+
</div>
93+
<div v-if="currentReport.Id > 0" style="overflow: auto">
94+
<table class="table mt-3 mb-3">
95+
<tbody>
96+
<tr v-for="prop in currentCollection.Properties">
97+
<td>{{prop.Key}}</td>
98+
<td v-html="prop.Value"></td>
99+
</tr>
100+
</tbody>
101+
</table>
102+
</div>
103+
<em v-if="currentReport.Id > 0" >
104+
<router-link class="btn btn-primary btn-block" :to="{ name: 'analyzeReport', params: { reportId: currentReport.Id, incidentId: incident.Id}}">Report browser</router-link>
105+
</em>
106+
109107
</div>
110108
</div>
111109
</div>

src/Server/Coderr.Server.Web/ClientApp/components/analyze/incidents/report.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,16 @@
99
display: none;
1010
}
1111

12-
.ReportsView .contextCollections th, .ReportsView .contextCollections td {
12+
.collection a {
13+
padding: 5px;
14+
margin: 5px;
15+
display: block;
16+
}
17+
.ReportsView .contextCollections th, .ReportsView .contextCollections td, .ReportsView h4 {
1318
padding: 0.15rem;
1419
}
1520

21+
1622
.contextCollections .card {
1723
overflow-x: scroll;
1824
overflow-y: auto

0 commit comments

Comments
 (0)