Ejemplo n.º 1
0
 this.$rootScope.$on('$stateChangeSuccess', (_event: IAngularEvent, toState: Ng1StateDeclaration, toParams: StateParams, fromState: Ng1StateDeclaration) => {
   if (this.movingToClusterState(toState) && this.isClusterStateOrChild(fromState.name)) {
     this.asFilterModel.applyParamsToUrl();
     return;
   }
   if (this.movingToClusterState(toState)) {
     if (this.shouldRouteToSavedState(toParams, fromState)) {
       this.asFilterModel.restoreState(toParams);
     }
     if (this.fromApplicationListState(fromState) && !this.asFilterModel.hasSavedState(toParams)) {
       this.asFilterModel.clearFilters();
     }
   }
 });
Ejemplo n.º 2
0
      (_event: IAngularEvent, toState: Ng1StateDeclaration, toParams: StateParams, fromState: Ng1StateDeclaration) => {
        if (this.isSecurityGroupStateOrChild(toState.name) && this.isSecurityGroupStateOrChild(fromState.name)) {
          this.asFilterModel.applyParamsToUrl();
          return;
        }
        if (this.movingToSecurityGroupState(toState)) {
          if (this.shouldRouteToSavedState(toParams, fromState)) {
            this.asFilterModel.restoreState(toParams);
          }

          if (this.fromSecurityGroupsState(fromState) && !this.asFilterModel.hasSavedState(toParams)) {
            this.asFilterModel.clearFilters();
          }
        }
      },
Ejemplo n.º 3
0
 (
   _event: IAngularEvent,
   toState: Ng1StateDeclaration,
   _toParams: StateParams,
   fromState: Ng1StateDeclaration,
   fromParams: StateParams,
 ) => {
   if (this.movingFromSecurityGroupState(toState, fromState)) {
     this.asFilterModel.saveState(fromState, fromParams, this.mostRecentParams);
   }
 },
Ejemplo n.º 4
0
 private shouldRouteToSavedState(toParams: StateParams, fromState: Ng1StateDeclaration) {
   return this.asFilterModel.hasSavedState(toParams) && !this.isSecurityGroupStateOrChild(fromState.name);
 }
Ejemplo n.º 5
0
 constructor() {
   'ngInject';
   this.asFilterModel = FilterModelService.configureFilterModel(this as any, filterModelConfig);
   this.bindEvents();
   this.asFilterModel.activate();
 }
Ejemplo n.º 6
0
 this.$rootScope.$on('$stateChangeStart', (_event: IAngularEvent, toState: Ng1StateDeclaration, _toParams: StateParams, fromState: Ng1StateDeclaration, fromParams: StateParams) => {
   if (this.movingFromSecurityGroupState(toState, fromState)) {
     this.asFilterModel.saveState(fromState, fromParams, this.mostRecentParams);
   }
 });
Ejemplo n.º 7
0
 constructor(private $rootScope: IRootScopeService, private filterModelService: any) {
   'ngInject';
   this.asFilterModel = this.filterModelService.configureFilterModel(this, filterModelConfig);
   this.bindEvents();
   this.asFilterModel.activate();
 }
Ejemplo n.º 8
0
 private shouldRouteToSavedState(toParams: StateParams, fromState: Ng1StateDeclaration): boolean {
   return this.asFilterModel.hasSavedState(toParams) && !this.isClusterStateOrChild(fromState.name);
 }