Skip to content

Commit 66667df

Browse files
committed
Implemented feature suggestions from our forum
1 parent 58b3eea commit 66667df

File tree

6 files changed

+67
-10
lines changed

6 files changed

+67
-10
lines changed

src/Server/Coderr.Server.Api/Core/Incidents/IncidentOrder.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ public enum IncidentOrder
1010
/// </summary>
1111
Newest,
1212

13+
/// <summary>
14+
/// The one that recieved a report most recent.
15+
/// </summary>
16+
LatestReport,
17+
1318
/// <summary>
1419
/// The incident with the highest number of reports
1520
/// </summary>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,13 @@ OR ErrorReports.ErrorId LIKE @FreeText
174174

175175
// then items
176176
if (query.SortType == IncidentOrder.Newest)
177+
{
178+
if (query.SortAscending)
179+
sqlQuery += " ORDER BY CreatedAtUtc";
180+
else
181+
sqlQuery += " ORDER BY CreatedAtUtc DESC";
182+
}
183+
else if (query.SortType == IncidentOrder.LatestReport)
177184
{
178185
if (query.SortAscending)
179186
sqlQuery += " ORDER BY LastReportAtUtc";

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ export default class IncidentSearchComponent extends Vue {
129129
});
130130
}
131131

132+
checkAll(e: Event) {
133+
const target = <HTMLInputElement>e.target;
134+
const elems = document.querySelectorAll('#searchTable tbody input[type="checkbox"]');
135+
console.log(elems);
136+
for (let i = 0; i < elems.length; i++) {
137+
const elem = <HTMLInputElement>elems[i];
138+
elem.checked = target.checked;
139+
}
140+
}
141+
132142
toggleFilterDisplay() {
133143
this.showFilters = !this.showFilters;
134144
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ <h2>Incidents</h2>
7777
<div class="filters">
7878

7979
</div>
80-
<table class="table w-100">
80+
<table class="table w-100" id="searchTable">
8181
<thead class="table-light search-head">
8282
<tr>
83-
<th>Name</th>
83+
<th><input class="form-check-inline" type="checkbox" v-on:click="checkAll($event)"/> Name</th>
8484
<th v-if="showApplicationColumn">Application</th>
85-
<th>Created</th>
86-
<th class="sortable" v-on:click.prevent="sort($event)" data-value="0">Last report <i class="fa"></i></th>
87-
<th class="sortable" v-on:click.prevent="sort($event)" data-value="1">Report count <i class="fa fa-chevron-up"></i></th>
85+
<th class="sortable" v-on:click.prevent="sort($event)" data-value="0">Created <i class="fa"></i></th>
86+
<th class="sortable" v-on:click.prevent="sort($event)" data-value="1">Last report <i class="fa"></i></th>
87+
<th class="sortable" v-on:click.prevent="sort($event)" data-value="2">Report count <i class="fa fa-chevron-up"></i></th>
8888
</tr>
8989
</thead>
9090
<tbody>

src/Server/Coderr.Server.Web/wwwroot/dist/main.js

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
/******/
6060
/******/
6161
/******/ var hotApplyOnUpdate = true;
62-
/******/ var hotCurrentHash = "bfd68759b20121ddf487"; // eslint-disable-line no-unused-vars
62+
/******/ var hotCurrentHash = "1c5e5eb9e76cf96fd5ff"; // eslint-disable-line no-unused-vars
6363
/******/ var hotCurrentModuleData = {};
6464
/******/ var hotCurrentChildModule; // eslint-disable-line no-unused-vars
6565
/******/ var hotCurrentParents = []; // eslint-disable-line no-unused-vars
@@ -41430,6 +41430,15 @@ var IncidentSearchComponent = /** @class */ (function (_super) {
4143041430
_this.search(true);
4143141431
});
4143241432
};
41433+
IncidentSearchComponent.prototype.checkAll = function (e) {
41434+
var target = e.target;
41435+
var elems = document.querySelectorAll('#searchTable tbody input[type="checkbox"]');
41436+
console.log(elems);
41437+
for (var i = 0; i < elems.length; i++) {
41438+
var elem = elems[i];
41439+
elem.checked = target.checked;
41440+
}
41441+
};
4143341442
IncidentSearchComponent.prototype.toggleFilterDisplay = function () {
4143441443
this.showFilters = !this.showFilters;
4143541444
};
@@ -63676,10 +63685,23 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
6367663685
}, [_c('h2', [_vm._v("Incidents")]), _vm._v(" "), _c('div', {
6367763686
staticClass: "filters"
6367863687
}), _vm._v(" "), _c('table', {
63679-
staticClass: "table w-100"
63688+
staticClass: "table w-100",
63689+
attrs: {
63690+
"id": "searchTable"
63691+
}
6368063692
}, [_c('thead', {
6368163693
staticClass: "table-light search-head"
63682-
}, [_c('tr', [_c('th', [_vm._v("Name")]), _vm._v(" "), (_vm.showApplicationColumn) ? _c('th', [_vm._v("Application")]) : _vm._e(), _vm._v(" "), _c('th', [_vm._v("Created")]), _vm._v(" "), _c('th', {
63694+
}, [_c('tr', [_c('th', [_c('input', {
63695+
staticClass: "form-check-inline",
63696+
attrs: {
63697+
"type": "checkbox"
63698+
},
63699+
on: {
63700+
"click": function($event) {
63701+
_vm.checkAll($event)
63702+
}
63703+
}
63704+
}), _vm._v(" Name")]), _vm._v(" "), (_vm.showApplicationColumn) ? _c('th', [_vm._v("Application")]) : _vm._e(), _vm._v(" "), _c('th', {
6368363705
staticClass: "sortable",
6368463706
attrs: {
6368563707
"data-value": "0"
@@ -63690,7 +63712,7 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
6369063712
_vm.sort($event)
6369163713
}
6369263714
}
63693-
}, [_vm._v("Last report "), _c('i', {
63715+
}, [_vm._v("Created "), _c('i', {
6369463716
staticClass: "fa"
6369563717
})]), _vm._v(" "), _c('th', {
6369663718
staticClass: "sortable",
@@ -63703,6 +63725,19 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
6370363725
_vm.sort($event)
6370463726
}
6370563727
}
63728+
}, [_vm._v("Last report "), _c('i', {
63729+
staticClass: "fa"
63730+
})]), _vm._v(" "), _c('th', {
63731+
staticClass: "sortable",
63732+
attrs: {
63733+
"data-value": "2"
63734+
},
63735+
on: {
63736+
"click": function($event) {
63737+
$event.preventDefault();
63738+
_vm.sort($event)
63739+
}
63740+
}
6370663741
}, [_vm._v("Report count "), _c('i', {
6370763742
staticClass: "fa fa-chevron-up"
6370863743
})])])]), _vm._v(" "), _c('tbody', _vm._l((_vm.incidents), function(incident) {

src/Server/Coderr.Server.Web/wwwroot/dist/main.js.map

Lines changed: 1 addition & 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)