Skip to content

Commit a35a7c9

Browse files
WilliamBZAWojcikMike
authored andcommitted
Allow deep-linking to failed message groups (#399)
* Allow deep-linking to failed message groups
1 parent 547092f commit a35a7c9

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/ServicePulse.Host/app/js/views/failed_groups/controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
vm.viewExceptionGroup = function(group) {
3838
sharedDataService.set(group);
39-
$location.path('/failedMessages');
39+
$location.path('/failedMessages/' + group.id);
4040
};
4141

4242
vm.acknowledgeGroup = function (group) {

src/ServicePulse.Host/app/js/views/failed_messages/controller.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
$scope,
77
$timeout,
88
$location,
9+
$routeParams,
910
scConfig,
1011
toastService,
1112
sharedDataService,
@@ -19,7 +20,7 @@
1920
vm.selectedExceptionGroup = sharedDataService.get();
2021

2122
if (!vm.selectedExceptionGroup) {
22-
vm.selectedExceptionGroup = { 'id': undefined, 'title': 'All Failed Messages', 'count': 0, 'initialLoad': true };
23+
vm.selectedExceptionGroup = { 'id': $routeParams.groupId ? $routeParams.groupId : undefined, 'title': 'All Failed Messages', 'count': 0, 'initialLoad': true };
2324
}
2425

2526
if (!vm.selectedExceptionGroup.hasOwnProperty('title')) {
@@ -215,7 +216,11 @@
215216
loadPromise = serviceControlService.getFailedMessagesForExceptionGroup(group.id, vm.sort, vm.page, vm.direction);
216217
}
217218

218-
loadPromise.then(function(response) {
219+
loadPromise.then(function (response) {
220+
if (group.count === 0) {
221+
group.count = response.total;
222+
}
223+
219224
processLoadedMessages(response.data);
220225
});
221226
};
@@ -227,6 +232,7 @@
227232
"$scope",
228233
"$timeout",
229234
"$location",
235+
"$routeParams",
230236
"scConfig",
231237
"toastService",
232238
"sharedDataService",

src/ServicePulse.Host/app/js/views/failed_messages/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
'use strict';
33

44
function routeProvider($routeProvider) {
5-
$routeProvider.when('/failedMessages', {
5+
$routeProvider.when('/failedMessages/:groupId?', {
66
data: {
77
pageTitle: 'Failed Messages'
88
},

0 commit comments

Comments
 (0)