Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
HAWKULAR-741 : Handle switch persona at Alert Center
Browse files Browse the repository at this point in the history
Includes required update to version 0.7.1.Final of Alerts
  • Loading branch information
ammendonca committed Dec 15, 2015
1 parent 4cb7895 commit 2162bd1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion console/src/main/scripts/plugins/metrics/ts/alerts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ module HawkularMetrics {
export class TriggerSetupController {

public static $inject = ['$scope', 'HawkularAlertsManager', 'ErrorsManager', 'NotificationsService',
'$log', '$q', '$rootScope', '$routeParams', 'MetricsService'];
'$log', '$q', '$rootScope', '$routeParams', '$location', 'MetricsService'];

public fullTrigger:any = {};

Expand All @@ -132,6 +132,7 @@ module HawkularMetrics {
protected $q:ng.IQService,
protected $rootScope:any,
protected $routeParams:any,
protected $location:any,
protected MetricsService:IMetricsService) {
// TODO - update the pfly notification service to support more and category based notifications containers.
this.$rootScope.hkNotifications = {alerts: []};
Expand All @@ -151,6 +152,8 @@ module HawkularMetrics {
}), () => {
this.isSettingChange = !angular.equals(this.adm, this.admBak);
}, true);

$scope.$on('SwitchedPersona', () => $location.path('/hawkular-ui/alerts-center-triggers/'));
}

public cancel():string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ module HawkularMetrics {
$scope.acd = this;
this._alertId = $routeParams.alertId;

$scope.$on('SwitchedPersona', () => $location.path('/hawkular-ui/alerts-center/'));

this.alertsTimeOffset = $routeParams.timeOffset || $rootScope.hkParams.timeOffset || DEF_TIME_OFFSET;
// If the end time is not specified in URL use current time as end time
this.alertsTimeEnd = $routeParams.endTime ? $routeParams.endTime : Date.now();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ module HawkularMetrics {
currentPersona && this.getAlerts());
}

$scope.$on('SwitchedPersona', () => this.getAlerts());

}

private autoRefresh(intervalInSeconds:number):void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ module HawkularMetrics {
$rootScope.$watch('currentPersona', (currentPersona) =>
currentPersona && this.getTriggers());
}

$scope.$on('SwitchedPersona', () => this.getTriggers());
}

private autoRefresh(intervalInSeconds:number):void {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<version.gnu.getopt>1.0.13</version.gnu.getopt>
<version.org.hawkular.accounts>1.1.3.Final</version.org.hawkular.accounts>
<version.org.hawkular.agent>0.13.7.Final-SRC-revision-9b176c17b571a2176b9a3d79456186d4ffc042ae</version.org.hawkular.agent>
<version.org.hawkular.alerts>0.7.0.Final</version.org.hawkular.alerts>
<version.org.hawkular.alerts>0.7.1.Final</version.org.hawkular.alerts>
<version.org.hawkular.bus>0.7.3.Final</version.org.hawkular.bus>
<version.org.hawkular.commons>0.2.3.Final</version.org.hawkular.commons>
<version.org.hawkular.cmdgw>0.10.4.Final</version.org.hawkular.cmdgw>
Expand Down

0 comments on commit 2162bd1

Please sign in to comment.