Skip to content

Commit

Permalink
fix(core/infrastructure): Fix deep links with filters (spinnaker#7459)
Browse files Browse the repository at this point in the history
This fixes a problem where deep links to infrastructure items (such as an instance chiclet) where filters are applied will lose the filters when the deep link is activated.  This was due to a but introduced when refactoring the filter save/restore code a few months back.  We started using router hooks to manage saving/restoring the filters.  However, the case where a user was navigating deeply was not accounted for in the router trigger criteria.  It only took effect when the top level view was activated.

This change switches to triggering the router hook on a wildcard glob on the beginning and end of the state names.
This causes the AngularJS compatibility code to be run whether you're activating the clusters tab, or deep linking to an instance _within_ the clusters tab.
  • Loading branch information
christopherthielen committed Sep 30, 2019
1 parent 01bc0da commit f41d955
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class ClusterFilterModel {

constructor() {
this.asFilterModel = FilterModelService.configureFilterModel(this as any, filterModelConfig);
FilterModelService.registerRouterHooks(this.asFilterModel, '**.application.insight.clusters');
FilterModelService.registerRouterHooks(this.asFilterModel, '**.application.insight.clusters.**');
this.asFilterModel.activate();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class LoadBalancerFilterModel {

constructor() {
this.asFilterModel = FilterModelService.configureFilterModel(this as any, filterModelConfig);
FilterModelService.registerRouterHooks(this.asFilterModel, '**.application.insight.loadBalancers');
FilterModelService.registerRouterHooks(this.asFilterModel, '**.application.insight.loadBalancers.**');
this.asFilterModel.activate();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class ExecutionFilterModel {
});

this.asFilterModel = FilterModelService.configureFilterModel(this as any, filterModelConfig);
FilterModelService.registerRouterHooks(this.asFilterModel, '**.application.pipelines.executions');
FilterModelService.registerRouterHooks(this.asFilterModel, '**.application.pipelines.executions.**');
this.asFilterModel.activate();

transitionService.onBefore({ entering: '**.application.pipelines.executions' }, trans => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class SecurityGroupFilterModel {

constructor() {
this.asFilterModel = FilterModelService.configureFilterModel(this as any, filterModelConfig);
FilterModelService.registerRouterHooks(this.asFilterModel, '**.application.insight.firewalls');
FilterModelService.registerRouterHooks(this.asFilterModel, '**.application.insight.firewalls.**');
this.asFilterModel.activate();
}
}
Expand Down

0 comments on commit f41d955

Please sign in to comment.