All files / src/app/extensions/quoting/pages/quote quote-page.component.ts

100% Statements 10/10
75% Branches 3/4
100% Functions 2/2
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 331x         1x 1x                 1x             4x     4x 4x 4x 4x 4x      
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
 
import { HttpError } from 'ish-core/models/http-error/http-error.model';
 
import { QuoteContextFacade } from '../../facades/quote-context.facade';
import { SelectedQuoteContextFacade } from '../../facades/selected-quote-context.facade';
import { Quote, QuoteRequest, QuoteStatus } from '../../models/quoting/quoting.model';
 
@Component({
  selector: 'ish-quote-page',
  templateUrl: './quote-page.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
  providers: [{ provide: QuoteContextFacade, useClass: SelectedQuoteContextFacade }],
})
export class QuotePageComponent implements OnInit {
  selectedQuote$: Observable<Quote | QuoteRequest>;
  loading$: Observable<boolean>;
  state$: Observable<QuoteStatus>;
  error$: Observable<HttpError>;
  justSubmitted$: Observable<boolean>;
 
  constructor(private context: QuoteContextFacade) {}
 
  ngOnInit() {
    this.selectedQuote$ = this.context.select('entity');
    this.loading$ = this.context.select('loading');
    this.state$ = this.context.select('state');
    this.error$ = this.context.select('error');
    this.justSubmitted$ = this.context.select('justSubmitted');
  }
}