Skip to content

Commit eaefa74

Browse files
committed
Updates for feedback
1 parent f468775 commit eaefa74

24 files changed

+196
-100
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
ALTER TABLE Incidents ADD State int not null default(0);
2+
ALTER TABLE Incidents ADD AssignedToId int;
3+
ALTER TABLE Incidents ADD AssignedAtUtc datetime;
4+
ALTER TABLE Incidents ADD LastReportAtUtc datetime;
5+
6+
DECLARE @ConstraintName nvarchar(200)
7+
SELECT @ConstraintName = Name FROM SYS.DEFAULT_CONSTRAINTS
8+
WHERE PARENT_OBJECT_ID = OBJECT_ID('incidents')
9+
AND PARENT_COLUMN_ID = (SELECT column_id FROM sys.columns
10+
WHERE NAME = N'IsSolved'
11+
AND object_id = OBJECT_ID(N'Incidents'))
12+
IF @ConstraintName IS NOT NULL
13+
EXEC('ALTER TABLE incidents DROP CONSTRAINT ' + @ConstraintName)
14+
alter table incidents drop column IsSolved;
15+
16+
SELECT @ConstraintName = Name FROM SYS.DEFAULT_CONSTRAINTS
17+
WHERE PARENT_OBJECT_ID = OBJECT_ID('incidents')
18+
AND PARENT_COLUMN_ID = (SELECT column_id FROM sys.columns
19+
WHERE NAME = N'IgnoreReports'
20+
AND object_id = OBJECT_ID(N'Incidents'))
21+
IF @ConstraintName IS NOT NULL
22+
EXEC('ALTER TABLE incidents DROP CONSTRAINT ' + @ConstraintName)
23+
alter table incidents drop column IgnoreReports;
24+
25+
UPDATE DatabaseSchema SET Version = 8;

src/Server/Coderr.Server.Web/Areas/Admin/Views/Application/Index.cshtml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
ViewBag.Title = "Admin - Applications";
44
}
55
<div class="container">
6-
<div class="col-lg-6">
6+
<div class="col-lg-12">
77
<h2>Applications</h2>
88
<p>
99
Here you can delete applications, which also will delete all data which have been associated with them.
@@ -18,9 +18,9 @@
1818
<tr>
1919
<td>@item.Name</td>
2020
<td>
21-
<a class="btn btn-default" href="@Url.Action("Edit", new {id=item.Id})" data-name="@item.Name">Rename</a>
22-
<a class="btn btn-default" href="@Url.Action("Versions", new {id=item.Id})" data-name="@item.Name" title="Select the assembly which contains the application version">Version assembly</a>
23-
<a class="btn btn-danger" href="#@item.Id" data-name="@item.Name">Delete</a>
21+
<a class="btn btn-outline-primary" href="@Url.Action("Edit", new {id=item.Id})" data-name="@item.Name">Rename</a>
22+
<a class="btn btn-outline-primary" href="@Url.Action("Versions", new {id=item.Id})" data-name="@item.Name" title="Select the assembly which contains the application version">Version assembly</a>
23+
<a class="btn btn-outline-danger" href="#@item.Id" data-name="@item.Name">Delete</a>
2424
</td>
2525
</tr>
2626
}
@@ -33,11 +33,11 @@
3333
</form>
3434
@section scripts{
3535
<script>
36-
$('#applications a.btn-danger').click(function (e) {
36+
$('#applications a.btn-outline-danger').click(function (e) {
3737
e.preventDefault();
3838
var name = $(this).attr('data-name');
3939
var id = $(this).attr('href').substr(1);
40-
if (confirm('Do you really want to deleted "' + name + '"?')) {
40+
if (confirm('Do you really want to delete "' + name + '"?')) {
4141
$('#delete-form input').val(id);
4242
$('#delete-form').submit();
4343
}

src/Server/Coderr.Server.Web/Areas/Admin/Views/Shared/_Layout.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
@RenderSection("Styles", false)
1313
</head>
1414
<body>
15-
<div class="navbar navbar-dark bg-dark">
15+
<div class="navbar navbar-dark bg-dark text-white">
1616
<div class="container">
1717
<span class="navbar-brand">codeRR - Administration area</span>
18-
<span>
18+
<span class="pull-right">
1919
<a href="@Url.Content("~/#")">
2020
<span class="fa fa-2x fa-home text-warning"></span>
2121
</a>

src/Server/Coderr.Server.Web/Controllers/AccountController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ public async Task<ActionResult> Login(LoginViewModel model)
163163
if (!ModelState.IsValid)
164164
return View(model);
165165

166-
167166
try
168167
{
169168
var principal = await _accountService.Login(model.UserName, model.Password);
@@ -177,6 +176,8 @@ public async Task<ActionResult> Login(LoginViewModel model)
177176

178177
SignIn(principal);
179178

179+
if (model.ReturnUrl != null && model.ReturnUrl.StartsWith("/"))
180+
return Redirect(model.ReturnUrl);
180181
return Redirect("~/#/");
181182
}
182183
catch (AuthenticationException err)

src/Server/Coderr.Server.Web/Models/Account/LoginViewmodel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ public class LoginViewModel
1212
[Required]
1313
public string UserName { get; set; }
1414

15+
public string ReturnUrl { get; set; }
16+
1517
/// <summary>
16-
/// Allow new users to register.
18+
/// Allow new users to register. (view only)
1719
/// </summary>
1820
public bool AllowRegistrations { get; set; }
1921
}

src/Server/Coderr.Server.Web/Scripts/dashboard/jquery.app.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ toggleMenuItem = function (uri) {
1616
var selector = '#sidebar-menu a[href="' + uri + '"]';
1717
$a = $(selector);
1818

19+
//try to append trailing slash
20+
if ($a.length === 0) {
21+
$a = $('#sidebar-menu a[href="' + uri + '/"]');
22+
}
23+
1924
// divide the url until we find a parent menu item
2025
// (since some pages only exist in context menus)
2126
while ($a.length === 0) {

src/Server/Coderr.Server.Web/ViewModels/Application/DetailsViewModel.js

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)