Skip to content

Commit

Permalink
fix(executions): auto-navigate away from missing execution
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherchrisberry committed Mar 28, 2017
1 parent f6f8e49 commit 15c8650
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -71,6 +71,15 @@ module.exports = angular.module('spinnaker.core.delivery.executions.controller',
application.executions.activate();
application.pipelineConfigs.activate();

application.executions.onRefresh($scope, () => {
// if an execution was selected but is no longer present, navigate up
if ($state.params.executionId) {
if (application.getDataSource('executions').data.every(e => e.id !== $state.params.executionId)) {
$state.go('.^');
}
}
});

$q.all([application.executions.ready(), application.pipelineConfigs.ready()]).then(() => {
this.updateExecutionGroups();
if ($stateParams.executionId) {
Expand Down

0 comments on commit 15c8650

Please sign in to comment.