import {Component, OnInit, ChangeDetectionStrategy, Input, OnChanges} from '@angular/core';
import { Router } from '@angular/router';
import { BaseList } from 'src/app/core/base/base-list';
@Component({
  selector: 'grade-summary-list',
  templateUrl: './grade-summary-list.component.html',
  styleUrls: ['./grade-summary-list.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class GradeSummaryListComponent extends BaseList implements OnInit , OnChanges {
  column = [
    '1',
    '2',
    'testing_information_code',
    'testing_information_name',
    '5',
    'academic_semester_code',
    'academic_year_code',
    'created_by',
    'created_datetime'
  ];
  reload: boolean;
  @Input() testingInformationList: any = [];
  constructor(
    private router: Router,
  ) {
    super()
   }

  ngOnInit(): void {
    this.reload = false;
    setTimeout(() => {
      this.reload = true;
    }, 2000);
  }

  ngOnChanges(){
    this.testingInformationList = this.updateMatTable(this.testingInformationList? this.testingInformationList:[])
  }

  onEdit(id){
    this.router.navigate(['/grade-summary/',id])
  }


}
