All files / src/app/extensions/punchout/pages/account-punchout-details account-punchout-details-page.component.ts

87.5% Statements 7/8
50% Branches 3/6
66.66% Functions 2/3
87.5% Lines 7/8

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 311x         1x               1x         1x     1x 1x 1x              
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
 
import { HttpError } from 'ish-core/models/http-error/http-error.model';
 
import { PunchoutFacade } from '../../facades/punchout.facade';
import { PunchoutUser } from '../../models/punchout-user/punchout-user.model';
 
@Component({
  selector: 'ish-account-punchout-details-page',
  templateUrl: './account-punchout-details-page.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AccountPunchoutDetailsPageComponent implements OnInit {
  selectedUser$: Observable<PunchoutUser>;
  loading$: Observable<boolean>;
  error$: Observable<HttpError>;
 
  constructor(private punchoutFacade: PunchoutFacade) {}
 
  ngOnInit() {
    this.selectedUser$ = this.punchoutFacade.selectedPunchoutUser$;
    this.loading$ = this.punchoutFacade.punchoutLoading$;
    this.error$ = this.punchoutFacade.punchoutError$;
  }
 
  submitForm(user: PunchoutUser) {
    this.punchoutFacade.updatePunchoutUser({ ...user, password: user.password || undefined });
  }
}