<commit_before>import { AfterViewInit, Component, ElementRef, OnInit, ViewChild } from '@angular/core';

import { Group } from 'src/app/models/group';
import { Poet } from 'src/app/models/poet';
import { GenericDataService } from 'src/app/services/generic-data.service';

import { PoetService } from 'src/app/services/poet.service';

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

  poets: Poet[] = []
  groups: Group[] = [];

  constructor(
    private poetService: PoetService,
    private groupService: GenericDataService<Group>
  ) {
    this.groupService.Init("groups");
  }

  ngOnInit(): void {
    this.poetService.poets.subscribe(p => this.poets = p);
    this.groupService.data.subscribe(d => this.groups = d);
  }

  add() {
    let g = new Group();
    g.id = crypto.randomUUID();
    this.groupService.Add(g);
  }

  countPoets(group_id: string | undefined): number {
    if (group_id) {
      return this.poets.filter(m =>m.group == group_id).length;
    }
<commit_msg>remove unused imports, try fixing admin groups<commit_after>import { Component, OnInit } from '@angular/core';
import { Group } from 'src/app/models/group';
import { Poet } from 'src/app/models/poet';
import { GenericDataService } from 'src/app/services/generic-data.service';
import { PoetService } from 'src/app/services/poet.service';

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

  poets: Poet[] = []
  groups: Group[] = [];

  constructor(
    private poetService: PoetService,
    private groupService: GenericDataService<Group>
  ) {
    this.groupService.Init("groups");
  }

  ngOnInit(): void {
    this.poetService.poets.subscribe(p => this.poets = p);
    this.groupService.data.subscribe(d => this.groups = d);
  }

  add() {
    let g = new Group();
    g.id = crypto.randomUUID();
    this.groupService.Add(g);
  }

  countPoets(group_id: string | undefined): number {
    if (group_id) {
      return this.poets.filter(m => m.group == group_id).length;
    }

{'fraction_non_alphanumeric': 0.15296198054818744, 'fraction_numerical': 0.0, 'mean_word_length': 3.8046709129511678, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '6269163', 'n_tokens_mistral': 742, 'n_tokens_neox': 735, 'n_words': 151}