migrate angular 21 finalize

This commit is contained in:
2026-03-09 22:56:31 +01:00
parent 26c99a0dae
commit bb08e46b0c
63 changed files with 738 additions and 783 deletions

View File

@@ -1,4 +1,4 @@
import {ChangeDetectionStrategy, Component, Input} from '@angular/core';
import {ChangeDetectionStrategy, Component, Input, inject} from '@angular/core';
import {ReactiveFormsModule, UntypedFormControl} from '@angular/forms';
import {filterSong} from '../../../services/filter.helper';
import {MatFormField, MatLabel, MatOption, MatSelect, MatSelectChange} from '@angular/material/select';
@@ -18,17 +18,15 @@ import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
imports: [MatFormField, MatSelect, MatOption, MatLabel, NgxMatSelectSearchModule, ReactiveFormsModule],
})
export class AddSongComponent {
private showSongService = inject(ShowSongService);
private showService = inject(ShowService);
@Input() public songs: Song[] | null = null;
@Input() public showSongs: ShowSong[] | null = null;
@Input() public show: Show | null = null;
@Input() public addedLive = false;
public filteredSongsControl = new UntypedFormControl();
public constructor(
private showSongService: ShowSongService,
private showService: ShowService
) {}
public filteredSongs(): Song[] {
if (!this.songs) return [];
const songs = this.songs

View File

@@ -1,4 +1,4 @@
import {Component} from '@angular/core';
import {Component, inject} from '@angular/core';
import {ActivatedRoute, Params, Router} from '@angular/router';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
@@ -9,12 +9,13 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms';
imports: [ReactiveFormsModule, FormsModule],
})
export class FilterComponent {
private router = inject(Router);
public value = '';
public constructor(
private router: Router,
activatedRoute: ActivatedRoute
) {
public constructor() {
const activatedRoute = inject(ActivatedRoute);
activatedRoute.queryParams.subscribe((params: Params) => {
const typedParams = params as {q: string};
if (typedParams.q) this.value = typedParams.q;

View File

@@ -1,4 +1,4 @@
import {ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, OnInit, Output, QueryList, ViewChildren} from '@angular/core';
import {ChangeDetectorRef, Component, ElementRef, EventEmitter, Input, OnInit, Output, QueryList, ViewChildren, inject} from '@angular/core';
import {TextRenderingService} from '../../../modules/songs/services/text-rendering.service';
import {faGripLines} from '@fortawesome/free-solid-svg-icons';
import {songSwitch} from './animation';
@@ -21,6 +21,10 @@ export type ChordMode = 'show' | 'hide' | 'onlyFirst';
imports: [MatIconButton, FaIconComponent],
})
export class SongTextComponent implements OnInit {
private textRenderingService = inject(TextRenderingService);
private elRef = inject<ElementRef<HTMLElement>>(ElementRef);
private cRef = inject(ChangeDetectorRef);
public sections: Section[] = [];
@Input() public header: string | null = null;
@Input() public index = -1;
@@ -35,12 +39,6 @@ export class SongTextComponent implements OnInit {
private iText = '';
private iTranspose: TransposeMode | null = null;
public constructor(
private textRenderingService: TextRenderingService,
private elRef: ElementRef<HTMLElement>,
private cRef: ChangeDetectorRef
) {}
@Input()
public set chordMode(value: ChordMode) {
this.iChordMode = value ?? 'hide';