File

src/app/features/audit-overview/audit-overview.component.ts

Implements

OnInit

Metadata

selector app-audit-overview
styleUrls ./audit-overview.component.scss
templateUrl ./audit-overview.component.html

Index

Properties
Methods

Constructor

constructor(store: Store)
Parameters :
Name Type Optional
store Store No

Methods

ngOnInit
ngOnInit()
Returns : void

Properties

audit$
Type : Observable<Audit>
auditId$
Type : Observable<number>
Decorators :
@Select(AppRouterState.auditId)
interviews$
Type : Observable<Interview[]>
tabs
Type : any[]
Default value : [ { title: 'Interviews', icon: 'attach-2-outline', route: './interviews', responsive: true, active: true, }, { title: 'Kontakte', icon: 'person-outline', route: './contact-persons', responsive: true, }, ]
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { Store, Select } from '@ngxs/store';
import { Audit } from 'src/app/core/data/models/audit.model';
import { AuditState } from 'src/app/core/ngxs/audit.state';
import { Interview } from 'src/app/core/data/models/interview.model';
import { InterviewState } from 'src/app/core/ngxs/interview.state';
import { AppRouterState } from 'src/app/core/ngxs/app-router.state';

@Component({
  selector: 'app-audit-overview',
  templateUrl: './audit-overview.component.html',
  styleUrls: ['./audit-overview.component.scss'],
})
export class AuditOverviewComponent implements OnInit {
  interviews$: Observable<Interview[]>;
  audit$: Observable<Audit>;

  @Select(AppRouterState.auditId) auditId$: Observable<number>;

  tabs: any[] = [
    {
      title: 'Interviews',
      icon: 'attach-2-outline',
      route: './interviews',
      responsive: true,
      active: true,
    },
    {
      title: 'Kontakte',
      icon: 'person-outline',
      route: './contact-persons',
      responsive: true,
    },
  ];

  constructor(private store: Store) {}

  ngOnInit(): void {
    this.auditId$.subscribe(id => {
      this.audit$ = this.store.select(AuditState.audit(id));
      this.interviews$ = this.store.select(InterviewState.interviewsByAuditId(id));
    });
  }
}
<header class="grid-1 mb-2" data-cy="audit-short-infos">
  <h4 data-cy="heading">
    {{ (audit$ | async)?.name }}
  </h4>
  <p class="label" *ngIf="(audit$ | async)?.startDate" data-cy="subheading">
    {{ (audit$ | async).startDate | date: 'dd.MM.yyyy' }} - <span *ngIf="(audit$ | async).endDate; else tbd">{{ (audit$ | async).endDate | date: 'dd.MM.yyyy' }}</span>
    <ng-template #tbd>TBD</ng-template>
  </p>
</header>
<nb-route-tabset [tabs]="tabs"></nb-route-tabset>

./audit-overview.component.scss

@import '../../../sass/utils';

.edit-icon-bar {
  text-align: right;
}

.audit-params {
  margin-top: 7px;
}
.content-active {
  padding-left: 0;
  padding-right: 0;
}

.factor-container {
  margin-bottom: 20px;

  &:last-child {
    margin-bottom: 0px;
  }
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""