import { Component } from '@angular/core'; import { IntegrationError } from '../../../store/supervision-api.model'; import { Store } from '@ngrx/store'; import { SupervisionSelectors } from '../../../store/supervision.selectors'; import { Observable } from 'rxjs'; import { SupervisionActions } from '../../../store/supervision.actions'; let nextCompId = 0; @Component({ selector: 'yap-supervision-integration-errors-select', templateUrl: './supervision-integration-errors-select.component.html' }) export class SupervisionIntegrationErrorsSelectComponent { tab: number = 0; compId: number = nextCompId++; currentIntegrationError$: Observable; constructor(private store: Store) { this.currentIntegrationError$ = this.store.select(SupervisionSelectors.currentIntegrationError); } closePanel() { this.store.dispatch(SupervisionActions.loadIntegrationErrors()); this.store.dispatch(SupervisionActions.toggleErrorDetails({ error: null, errorDetailsOpen: false })); } }