<commit_before>import { Component, OnInit } from '@angular/core';
import { DashboardApi, DashPerformance } from '../api/dashboard_api.service';

export type ProcessedDashPerformance = {
  title: string,
  dateStr: string,
  timeStr: string,
  location: string,
  uuid: string,
  routerLink: string
}

@Component({
  selector: 'app-dashboard',
  templateUrl: './dashboard.component.html',
  styleUrls: ['./dashboard.component.scss']
})
export class Dashboard implements OnInit {

  allDashPerfs: DashPerformance[];
  upcomingDashPerfs: DashPerformance[];
  pastDashPerfs: DashPerformance[];
  processedUpcomingDashPerfs: ProcessedDashPerformance[] = [];
  processedPastDashPerfs: ProcessedDashPerformance[] = [];
  dashPerfsLoaded: boolean = false;
  dataLoaded: boolean = false;

  constructor(private dashAPI: DashboardApi) { }

  ngOnInit(): void {
    this.dashAPI.dashPerformanceEmitter.subscribe(val => this.onDashPerfsLoad(val));
    this.dashAPI.getAllDashboard();
  }

  onDashPerfsLoad(dashPerfArr: DashPerformance[]) {
    this.allDashPerfs = dashPerfArr.sort((a, b) => a.dateTime - b.dateTime);
    let now = Date.now();
    this.upcomingDashPerfs = this.allDashPerfs.filter(val => val.dateTime >= now);
    this.pastDashPerfs = this.allDashPerfs.filter(val => val.dateTime < now);
    this.upcomingDashPerfs.push(...this.upcomingDashPerfs);
    let dateOpts = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
    let timeOpts = { hour: '2-digit', minute: '2-digit' };
    this.processedUpcomingDashPerfs = this.upcomingDashPerfs.map(perf => {
      let date = new Date(perf.dateTime);
      return {
        title: perf.title,
        dateStr: date.toLocaleDateString('en-US', dateOpts),
        timeStr: date.toLocaleTimeString('en-US', timeOpts),
        location: perf.location,
        uuid: String(perf.id),
        routerLink: "/performance/" + perf.id
      };<commit_msg>remove line for testing many dashboard upcoming performances<commit_after>import { Component, OnInit } from '@angular/core';
import { DashboardApi, DashPerformance } from '../api/dashboard_api.service';

export type ProcessedDashPerformance = {
  title: string,
  dateStr: string,
  timeStr: string,
  location: string,
  uuid: string,
  routerLink: string
}

@Component({
  selector: 'app-dashboard',
  templateUrl: './dashboard.component.html',
  styleUrls: ['./dashboard.component.scss']
})
export class Dashboard implements OnInit {

  allDashPerfs: DashPerformance[];
  upcomingDashPerfs: DashPerformance[];
  pastDashPerfs: DashPerformance[];
  processedUpcomingDashPerfs: ProcessedDashPerformance[] = [];
  processedPastDashPerfs: ProcessedDashPerformance[] = [];
  dashPerfsLoaded: boolean = false;
  dataLoaded: boolean = false;

  constructor(private dashAPI: DashboardApi) { }

  ngOnInit(): void {
    this.dashAPI.dashPerformanceEmitter.subscribe(val => this.onDashPerfsLoad(val));
    this.dashAPI.getAllDashboard();
  }

  onDashPerfsLoad(dashPerfArr: DashPerformance[]) {
    this.allDashPerfs = dashPerfArr.sort((a, b) => a.dateTime - b.dateTime);
    let now = Date.now();
    this.upcomingDashPerfs = this.allDashPerfs.filter(val => val.dateTime >= now);
    this.pastDashPerfs = this.allDashPerfs.filter(val => val.dateTime < now);
    let dateOpts = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
    let timeOpts = { hour: '2-digit', minute: '2-digit' };
    this.processedUpcomingDashPerfs = this.upcomingDashPerfs.map(perf => {
      let date = new Date(perf.dateTime);
      return {
        title: perf.title,
        dateStr: date.toLocaleDateString('en-US', dateOpts),
        timeStr: date.toLocaleTimeString('en-US', timeOpts),
        location: perf.location,
        uuid: String(perf.id),
        routerLink: "/performance/" + perf.id
      };
{'fraction_non_alphanumeric': 0.1357311630349173, 'fraction_numerical': 0.0010501443948542925, 'mean_word_length': 4.169606512890095, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1214673', 'n_tokens_mistral': 1252, 'n_tokens_neox': 1232, 'n_words': 242}