Skip to content

Commit 2e81928

Browse files
committed
Bug fixes
1 parent ed962e8 commit 2e81928

File tree

19 files changed

+266
-238
lines changed

19 files changed

+266
-238
lines changed

src/Server/Coderr.Server.Api/Core/Incidents/Queries/FindIncidentsResultItem.cs

+17-6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ namespace Coderr.Server.Api.Core.Incidents.Queries
77
/// </summary>
88
public class FindIncidentsResultItem
99
{
10+
private string _name;
11+
1012
/// <summary>
1113
/// Creates new instance of <see cref="FindIncidentsResultItem" />.
1214
/// </summary>
@@ -53,6 +55,11 @@ protected FindIncidentsResultItem()
5355
/// </summary>
5456
public bool IsReOpened { get; set; }
5557

58+
/// <summary>
59+
/// When we recieved the last report.
60+
/// </summary>
61+
public DateTime LastReportReceivedAtUtc { get; set; }
62+
5663
/// <summary>
5764
/// When someone updated this incident (assigned/closed etc).
5865
/// </summary>
@@ -61,16 +68,20 @@ protected FindIncidentsResultItem()
6168
/// <summary>
6269
/// Incident name
6370
/// </summary>
64-
public string Name { get; private set; }
71+
public string Name
72+
{
73+
set
74+
{
75+
if (value.Length > 40)
76+
value = value.Substring(0, 35) + "[...]";
77+
_name = value;
78+
}
79+
get => _name;
80+
}
6581

6682
/// <summary>
6783
/// Total number of received reports (increased even if the number of stored reports are at the limit)
6884
/// </summary>
6985
public int ReportCount { get; set; }
70-
71-
/// <summary>
72-
/// When we recieved the last report.
73-
/// </summary>
74-
public DateTime LastReportReceivedAtUtc { get; set; }
7586
}
7687
}

src/Server/Coderr.Server.App/Coderr.Server.App.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<NoWarn>NU1701</NoWarn>
2323
</PackageReference>
2424
<PackageReference Include="DotNetCqs" Version="2.0.9" />
25-
<PackageReference Include="Griffin.Framework" Version="2.0.0-alpha01" />
25+
<PackageReference Include="Griffin.Framework" Version="2.0.1" />
2626
<PackageReference Include="log4net" Version="2.0.8" />
2727
<PackageReference Include="Markdig" Version="0.14.9" />
2828
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />

src/Server/Coderr.Server.App/Modules/MonthlyStats/CollectStatsJob.cs

+12-9
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ public async Task ExecuteAsync()
3636
return;
3737

3838
var lastMonth = new DateTime(lastMonthDate.Year, lastMonthDate.Month, 1);
39-
if (_config.Value.LatestUploadedMonth == null)
40-
{
41-
await ReportAllFoundMonths(lastMonth);
42-
return;
43-
}
39+
//if (_config.Value.LatestUploadedMonth == null)
40+
//{
41+
// await ReportAllFoundMonths(lastMonth);
42+
// return;
43+
//}
4444

45-
if (_config.Value?.LatestUploadedMonth == lastMonth)
46-
return;
45+
//if (_config.Value?.LatestUploadedMonth == lastMonth)
46+
// return;
4747

4848

4949
await ReportMonth(lastMonth);
@@ -261,11 +261,14 @@ private async Task GetApps(Dictionary<int, ApplicationUsageStatisticsDto> apps)
261261
{
262262
while (await reader.ReadAsync())
263263
{
264+
var estimatedNumberOfErrors = reader[1];
265+
var numberOfDevelopers = reader[2];
264266
var item = new ApplicationUsageStatisticsDto()
265267
{
266268
ApplicationId = reader.GetInt32(0),
267-
EstimatedNumberOfErrors= reader.GetFieldValue<int?>(1),
268-
NumberOfDevelopers = reader.GetFieldValue<decimal?>(2)
269+
EstimatedNumberOfErrors =
270+
estimatedNumberOfErrors is DBNull ? 0 : (int) estimatedNumberOfErrors,
271+
NumberOfDevelopers = numberOfDevelopers is DBNull ? 0 : (decimal) numberOfDevelopers
269272
};
270273
apps[item.ApplicationId] = item;
271274
}

src/Server/Coderr.Server.Infrastructure/Coderr.Server.Infrastructure.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77
<ItemGroup>
88
<PackageReference Include="DotNetCqs" Version="2.0.9" />
9-
<PackageReference Include="Griffin.Framework" Version="2.0.0-alpha01" />
9+
<PackageReference Include="Griffin.Framework" Version="2.0.1" />
1010
<PackageReference Include="log4net" Version="2.0.8" />
1111
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
1212
</ItemGroup>

src/Server/Coderr.Server.ReportAnalyzer/Coderr.Server.ReportAnalyzer.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PackageReference Include="DotNetCqs" Version="2.0.9" />
1111
<PackageReference Include="DotNetCqs.DependencyInjection.Microsoft" Version="1.0.0" />
1212
<PackageReference Include="DotNetCqs.Queues.AdoNet" Version="1.0.6" />
13-
<PackageReference Include="Griffin.Framework" Version="2.0.0-alpha01" />
13+
<PackageReference Include="Griffin.Framework" Version="2.0.1" />
1414
<PackageReference Include="log4net" Version="2.0.8" />
1515
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.0.0" />
1616
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />

src/Server/Coderr.Server.SqlServer/Coderr.Server.SqlServer.csproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77
<ItemGroup>
88
<PackageReference Include="DotNetCqs" Version="2.0.9" />
9-
<PackageReference Include="Griffin.Framework" Version="2.0.0-alpha01" />
9+
<PackageReference Include="Griffin.Framework" Version="2.0.1" />
1010
<PackageReference Include="log4net" Version="2.0.8" />
1111
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
1212
<PackageReference Include="System.Data.SqlClient" Version="4.4.3" />
@@ -30,5 +30,6 @@
3030
<None Remove="Schema\Update.v13.sql" />
3131
<None Remove="Schema\Update.v14.sql" />
3232
<None Remove="Schema\Update.v15.sql" />
33+
<None Remove="Schema\Update.v16.sql" />
3334
</ItemGroup>
3435
</Project>

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ public void AddMissedReport(DateTime date)
120120
{
121121
cmd.CommandText =
122122
@"update IgnoredReports set NumberOfReports=NumberOfReports+1 WHERE date = @date;
123-
IF @@ROWCOUNT=0 insert into IgnoredReports(NumberOfReports) values(1);";
124-
cmd.AddParameter("date", date);
123+
IF @@ROWCOUNT=0 insert into IgnoredReports(NumberOfReports, Date) values(1, Convert(date, GetUtcDate()));";
124+
cmd.AddParameter("date", date.Date);
125125
cmd.ExecuteNonQuery();
126126
}
127127
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
alter table applications alter column NumberOfFtes decimal(4,1) null;
2+
3+
UPDATE DatabaseSchema SET Version = 16;

src/Server/Coderr.Server.Web/Boot/Modules/BackgroundJobs.cs

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public void Start(StartContext context)
1919
var adapter = new DependencyInjectionAdapter(context.ServiceProvider);
2020

2121
_backgroundJobManager = new BackgroundJobManager(adapter);
22+
_backgroundJobManager.ExecuteSequentially = true;
2223
_backgroundJobManager.JobFailed += OnBackgroundJobFailed;
2324
_backgroundJobManager.StartInterval = TimeSpan.FromSeconds(Debugger.IsAttached ? 0 : 10);
2425
_backgroundJobManager.ExecuteInterval = TimeSpan.FromMinutes(3);

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

+3
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ AppRoot.Instance.loadCurrentUser()
276276

277277
}
278278
});
279+
ourVue.$router.beforeEach((to, from, next) => {
280+
next();
281+
});
279282
ourVue.$router.afterEach((to, from) => {
280283
hooks.afterRoute(to.path, from.path);
281284
})

src/Server/Coderr.Server.Web/ClientApp/components/analyze/incidents/incident.ts

-8
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,6 @@ export default class AnalyzeIncidentComponent extends Vue {
6565
});
6666
return;
6767
}
68-
AppRoot.Instance.incidentService.getMine(null, this.incident.Id)
69-
.then(incidents => {
70-
if (incidents.length === 0) {
71-
this.$router.push({ name: "discover" });
72-
} else {
73-
this.$router.push({ name: "analyzeHome" });
74-
}
75-
});
7668
});
7769
}
7870

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

+4-9
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ export default class AnalyzeMenuComponent extends Vue {
2020
incidentId: number | null = null;
2121

2222
created() {
23-
MyIncidents.Instance.subscribeOnSelectedIncident(this.onIncidentSelected);
24-
MyIncidents.Instance.subscribeOnListChanges(this.onListChanged);
23+
MyIncidents.Instance.subscribeOnSelectedIncident(x => this.onIncidentSelected(x));
24+
MyIncidents.Instance.subscribeOnListChanges(() => this.onListChanged());
2525
MyIncidents.Instance.ready()
2626
.then(x => {
2727
this.incidents = MyIncidents.Instance.myIncidents;
@@ -61,7 +61,6 @@ export default class AnalyzeMenuComponent extends Vue {
6161
if (!this.incidentId && this.incidents.length > 0) {
6262
this.incidentId = this.incidents[0].incidentId;
6363
MyIncidents.Instance.switchIncident(this.incidentId);
64-
this.$router.push({ name: 'analyzeIncident', params: { incidentId: this.incidentId.toString() } });
6564
}
6665
}
6766

@@ -70,12 +69,7 @@ export default class AnalyzeMenuComponent extends Vue {
7069
this.title = '(Select an incident)';
7170
this.incidentId = null;
7271
} else {
73-
74-
// update URL
75-
if (this.incidentId !== incident.incidentId) {
76-
this.$router.push({ name: 'analyzeIncident', params: { incidentId: incident.incidentId.toString() } });
77-
}
78-
72+
this.$router.push({ name: 'analyzeIncident', params: { incidentId: incident.incidentId.toString() } });
7973
this.title = incident.shortTitle;
8074
this.incidentId = incident.incidentId;
8175
}
@@ -92,6 +86,7 @@ export default class AnalyzeMenuComponent extends Vue {
9286
} else {
9387
var newIncidentId = parseInt(value, 10);
9488
if (this.incidentId === newIncidentId) {
89+
console.log('exiting')
9590
return;
9691
}
9792
this.incidentId = newIncidentId;

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class MyIncidents {
4040
selectedIncident: IMyIncident | null;
4141
menuTitle = '';
4242

43-
selectedApplicationId: number | null;
43+
selectedApplicationId: number | null = null;
4444

4545
constructor() {
4646
this.loadPromise$ = this.loadMyIncidentsFromBackend();
@@ -171,6 +171,8 @@ export class MyIncidents {
171171
this.allMyIncidents$.push(item);
172172
}
173173
});
174+
this.filterMyIncidents();
175+
this.triggerIncidentListCallbacks();
174176
}
175177

176178
private filterMyIncidents() {

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ export default class NavMenuComponent extends Vue {
7979
}
8080
});
8181
PubSubService.Instance.subscribe(MenuApi.MessagingTopics.SetApplication, ctx => {
82-
console.log('SET', ctx.message)
8382
var msg = <MenuApi.SetApplication>ctx.message.body;
8483
this.changeApplication(msg.applicationId);
8584
});
@@ -129,11 +128,11 @@ export default class NavMenuComponent extends Vue {
129128
}
130129
return;
131130
} else if (currentRoute.path.indexOf('/discover') === 0) {
132-
this.$router.push({ name: 'discover', params: { applicationId: applicationId.toString() } });
131+
this.$router.push({ name: 'discover', params: { applicationId: applicationId == null ? null : applicationId.toString() } });
133132
} else if (currentRoute.path.indexOf('/analyze') === 0) {
134-
this.$router.push({ name: 'analyzeHome', params: { applicationId: applicationId.toString() } });
133+
this.$router.push({ name: 'analyzeHome', params: { applicationId: applicationId == null ? null : applicationId.toString() } });
135134
} else {
136-
const route = { name: currentRoute.name, params: { applicationId: applicationId.toString() } };
135+
const route = { name: currentRoute.name, params: { applicationId: applicationId == null ? null : applicationId.toString() } };
137136
this.$router.push(route);
138137
}
139138

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class AppRoot {
124124
localForage.getItem(options.name);
125125
})
126126
.catch(reason => {
127-
console.log('ERRROR', reason);
127+
console.log('ERROR', reason);
128128
});
129129
}
130130

src/Server/Coderr.Server.Web/Coderr.Server.Web.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
77
<IsPackable>false</IsPackable>
88
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
9-
<Version>2.0.0-rc02</Version>
9+
<Version>2.0.1</Version>
1010
</PropertyGroup>
1111

1212
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
@@ -21,7 +21,7 @@
2121
<ItemGroup>
2222
<PackageReference Include="Coderr.Client.AspNetCore.Mvc" Version="1.1.3" />
2323
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
24-
<PackageReference Include="Griffin.Framework" Version="2.0.0-alpha01" />
24+
<PackageReference Include="Griffin.Framework" Version="2.0.1" />
2525
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.0.3" />
2626
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.3" />
2727
</ItemGroup>

0 commit comments

Comments
 (0)