Skip to content

Commit cb352b9

Browse files
committed
Bug fixes
1 parent 228cffd commit cb352b9

File tree

16 files changed

+66412
-41
lines changed

16 files changed

+66412
-41
lines changed

src/Server/Coderr.Server.App/Core/Applications/QueryHandlers/GetMyApplications.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public async Task<ApplicationListItem[]> HandleAsync(IMessageContext context, Ge
4646
var isSysAdmin = false;
4747
if (query.AccountId > 0)
4848
{
49-
var account = await _accountRepository.GetByIdAsync((int) query.AccountId);
49+
var account = await _accountRepository.GetByIdAsync((int)query.AccountId);
5050
if (account.IsSysAdmin)
5151
{
5252
query.AccountId = 0;

src/Server/Coderr.Server.App/Core/Incidents/Jobs/DeleteEmptyIncidents.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public async Task ExecuteAsync()
4343
using (var cmd = _unitOfWork.CreateDbCommand())
4444
{
4545
cmd.CommandText =
46-
$@"DELETE TOP(1000) Incidents
46+
$@"DELETE TOP(500) Incidents
4747
WHERE LastReportAtUtc < @retentionDays";
4848

4949
// Wait until no reports have been received for the specified report save time

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@
2828
<None Remove="Schema\Update.v11.sql" />
2929
<None Remove="Schema\Update.v12.sql" />
3030
<None Remove="Schema\Update.v13.sql" />
31+
<None Remove="Schema\Update.v14.sql" />
3132
</ItemGroup>
3233
</Project>

src/Server/Coderr.Server.SqlServer/Core/Applications/ApplicationRepository.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public async Task<UserApplication[]> GetForUserAsync(int accountId)
3434
cmd.CommandText = @"SELECT a.Id ApplicationId, a.Name ApplicationName, ApplicationMembers.Roles
3535
FROM Applications a
3636
JOIN ApplicationMembers ON (ApplicationMembers.ApplicationId = a.Id)
37-
WHERE ApplicationMembers.AccountId = @userId";
37+
WHERE ApplicationMembers.AccountId = @userId
38+
ORDER BY Name";
3839
cmd.AddParameter("userId", accountId);
3940
using (var reader = await cmd.ExecuteReaderAsync())
4041
{
@@ -167,7 +168,7 @@ public async Task<Application[]> GetAllAsync()
167168
{
168169
using (var cmd = (DbCommand) _uow.CreateCommand())
169170
{
170-
cmd.CommandText = "SELECT * FROM Applications";
171+
cmd.CommandText = "SELECT * FROM Applications ORDER BY Name";
171172

172173
//cmd.AddParameter("ids", string.Join(", ", appIds.Select(x => "'" + x + "'")));
173174
var result = await cmd.ToListAsync<Application>();

src/Server/Coderr.Server.SqlServer/Core/Incidents/Queries/FindIncidentsHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ SELECT Distinct IncidentId
122122
FROM ErrorReports
123123
WHERE StackTrace LIKE @FreeText
124124
OR ErrorReports.Title LIKE @FreeText
125+
OR ErrorReports.ErrorId LIKE @FreeText
125126
OR Incidents.Description LIKE @FreeText)
126127
)";
127128
cmd.AddParameter("FreeText", $"%{query.FreeText}%");
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
--alter table ApplicationVersions alter column Version varchar(20) not null;
2+
3+
--UPDATE DatabaseSchema SET Version = 14;

src/Server/Coderr.Server.Web/Areas/Installation/Controllers/SqlController.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Coderr.Server.Web.Areas.Installation.Controllers
99
{
1010
[Area("Installation")]
11-
11+
1212
public class SqlController : Controller
1313
{
1414
private static int _counter;
@@ -79,9 +79,10 @@ public ActionResult Tables(string go)
7979

8080
public ActionResult Validate()
8181
{
82+
string constr = "Not set";
8283
try
8384
{
84-
var constr = _config.GetConnectionString("Db");
85+
constr = _config.GetConnectionString("Db");
8586
constr = ChangeConnectionTimeout(constr);
8687
SetupTools.DbTools.TestConnection(constr);
8788
return Content(@"{ ""result"": ""ok"" }", "application/json");
@@ -95,7 +96,7 @@ public ActionResult Validate()
9596
return Json(new
9697
{
9798
result = "fail",
98-
reason = errMsg,
99+
reason = errMsg + "<br>Connection string: " + constr,
99100
attempt = ++_counter
100101
});
101102
}

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,14 @@ export default class IncidentSearchComponent extends Vue {
182182
query.FreeText = this.freeText;
183183

184184
switch (this.incidentState) {
185+
case -1:
186+
break;
185187
case 0:
186188
query.IsNew = true;
187189
break;
188190
case 1:
189191
query.IsAssigned = true;
192+
break;
190193
case 3:
191194
query.IsClosed = true;
192195
break;
@@ -204,7 +207,7 @@ export default class IncidentSearchComponent extends Vue {
204207
query.ApplicationIds = this.activeApplications;
205208
}
206209

207-
if (byCode !== true) {
210+
if (!byCode) {
208211
AppRoot.Instance.storeState({
209212
name: 'incident-search',
210213
component: this,
@@ -287,7 +290,7 @@ export default class IncidentSearchComponent extends Vue {
287290
this.activeApplications = [body.applicationId];
288291
this.showApplicationColumn = false;
289292
}
290-
293+
291294
this.search();
292295
}
293296
private drawSearchUi() {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ <h4>Tags</h4>
3030
<div class="state">
3131
<h4>Incident state</h4>
3232
<div class="row text-nowrap">
33+
<div class="col">
34+
<button class="btn btn-dark" v-model="incidentState" value="-1" v-on:click.prevent="toggleState(-1, $event)">
35+
All
36+
</button>
37+
</div>
3338
<div class="col">
3439
<button class="btn btn-dark" v-model="incidentState" value="0" v-on:click.prevent="toggleState(0, $event)">
3540
New

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</ItemGroup>-->
2020

2121
<ItemGroup>
22-
<PackageReference Include="Coderr.Client.AspNetCore.Mvc" Version="1.1.2" />
22+
<PackageReference Include="Coderr.Client.AspNetCore.Mvc" Version="1.1.3" />
2323
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.6" />
2424
<PackageReference Include="Griffin.Framework" Version="2.0.0-alpha01" />
2525
<PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="2.0.3" />

0 commit comments

Comments
 (0)