|
|
|
@ -17,7 +17,7 @@ |
|
|
|
import { Component, NgZone, OnDestroy, OnInit } from '@angular/core'; |
|
|
|
import { StateObject, StateParams } from '@core/api/widget-api.models'; |
|
|
|
import { ActivatedRoute, Router } from '@angular/router'; |
|
|
|
import { Observable, of } from 'rxjs'; |
|
|
|
import { forkJoin, Observable, of } from 'rxjs'; |
|
|
|
import { StateControllerState } from './state-controller.models'; |
|
|
|
import { StateControllerComponent } from './state-controller.component'; |
|
|
|
import { StatesControllerService } from '@home/pages/dashboard/states/states-controller.service'; |
|
|
|
@ -116,6 +116,23 @@ export class EntityStateControllerComponent extends StateControllerComponent imp |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public pushAndOpenState(states: Array<StateObject>, openRightLayout?: boolean): void { |
|
|
|
if (this.states) { |
|
|
|
for (const state of states) { |
|
|
|
if (!this.states[state.id]) { |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
forkJoin(states.map(state => this.resolveEntity(state.params))).subscribe( |
|
|
|
() => { |
|
|
|
this.stateObject.push(...states); |
|
|
|
this.selectedStateIndex = this.stateObject.length - 1; |
|
|
|
this.gotoState(this.stateObject[this.stateObject.length - 1].id, true, openRightLayout); |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public updateState(id: string, params?: StateParams, openRightLayout?: boolean): void { |
|
|
|
if (!id) { |
|
|
|
id = this.getStateId(); |
|
|
|
|