import { Component, OnInit, ChangeDetectionStrategy, EventEmitter, Input, OnChanges, Output } from '@angular/core';
import { BaseList } from 'src/app/core/base/base-list';
import { OBJECT } from 'src/app/core/enum/role';
import { AppTokenService } from 'src/app/core/service/security/app-token.service';

@Component({
  selector: 'app-testing-info-list',
  templateUrl: './testing-info-list.component.html',
  styleUrls: ['./testing-info-list.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class TestingInfoListComponent extends BaseList implements OnInit, OnChanges {
  @Input() testingInfoList: any = [];
  role = [];
  roleConfig = OBJECT;
  @Output() view = new EventEmitter();
  column = ['1', '0', '2', '3', '4', '8', '9', '10', '5', '6', '7'];
  constructor(
    private appTokenSV: AppTokenService
  ) {
    super();
  }

  ngOnInit(): void {
    this.role = this.appTokenSV.user.rights;
  }
  ngOnChanges(){
    this.testingInfoList = this.updateMatTable(this.testingInfoList ? this.testingInfoList : []);
  }
}
