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 {ChangeDetectorRef, Component, OnDestroy, OnInit} from '@angular/core';
import {ChangeDetectorRef, Component, OnDestroy, OnInit, inject} from '@angular/core';
import {distinctUntilChanged, filter, map, shareReplay, switchMap, takeUntil, tap} from 'rxjs/operators';
import {ShowService} from '../../shows/services/show.service';
import {Song} from '../../songs/services/song';
@@ -25,6 +25,12 @@ import {ShowTypePipe} from '../../../widget-modules/pipes/show-type-translater/s
imports: [LogoComponent, SongTextComponent, LegalComponent, AsyncPipe, DatePipe, ShowTypePipe],
})
export class MonitorComponent implements OnInit, OnDestroy {
private showService = inject(ShowService);
private showSongService = inject(ShowSongService);
private globalSettingsService = inject(GlobalSettingsService);
private configService = inject(ConfigService);
private cRef = inject(ChangeDetectorRef);
public song: Song | null = null;
public zoom = 10;
public currentShowId: string | null = null;
@@ -38,13 +44,9 @@ export class MonitorComponent implements OnInit, OnDestroy {
public presentationBackground: PresentationBackground = 'none';
private destroy$ = new Subject<void>();
public constructor(
private showService: ShowService,
private showSongService: ShowSongService,
private globalSettingsService: GlobalSettingsService,
private configService: ConfigService,
private cRef: ChangeDetectorRef
) {
public constructor() {
const configService = this.configService;
this.config$ = configService.get$();
}

View File

@@ -1,4 +1,4 @@
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy} from '@angular/core';
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, inject} from '@angular/core';
import {combineLatest, Subject} from 'rxjs';
import {PresentationBackground, Show} from '../../shows/services/show';
import {ShowSongService} from '../../shows/services/show-song.service';
@@ -61,6 +61,12 @@ export interface PresentationSong {
],
})
export class RemoteComponent implements OnDestroy {
private showService = inject(ShowService);
private showSongService = inject(ShowSongService);
private songService = inject(SongService);
private textRenderingService = inject(TextRenderingService);
private cRef = inject(ChangeDetectorRef);
public show: Show | null = null;
public showSongs: ShowSong[] = [];
public songs$ = this.songService.list$();
@@ -73,14 +79,9 @@ export class RemoteComponent implements OnDestroy {
public presentationDynamicTextChanged$ = new Subject<{presentationDynamicText: string; showId: string}>();
private destroy$ = new Subject<void>();
public constructor(
private showService: ShowService,
private showSongService: ShowSongService,
private songService: SongService,
private textRenderingService: TextRenderingService,
globalSettingsService: GlobalSettingsService,
private cRef: ChangeDetectorRef
) {
public constructor() {
const globalSettingsService = inject(GlobalSettingsService);
const currentShowId$ = globalSettingsService.get$.pipe(
filter((settings): settings is NonNullable<typeof settings> => !!settings),
map(_ => _.currentShow),

View File

@@ -1,4 +1,4 @@
import {Component, OnInit} from '@angular/core';
import {Component, OnInit, inject} from '@angular/core';
import {map} from 'rxjs/operators';
import {ShowService} from '../../shows/services/show.service';
import {Show} from '../../shows/services/show';
@@ -19,17 +19,15 @@ import {ShowTypePipe} from '../../../widget-modules/pipes/show-type-translater/s
imports: [CardComponent, MatButton, UserNameComponent, AsyncPipe, DatePipe, ShowTypePipe],
})
export class SelectComponent implements OnInit {
private showService = inject(ShowService);
private globalSettingsService = inject(GlobalSettingsService);
private router = inject(Router);
public visible = false;
public shows$ = this.showService
.list$(true)
.pipe(map(_ => _.filter(_ => _.date.toDate() > new Date(new Date().setMonth(new Date().getMonth() - 1))).sort((a, b) => (b.date < a.date ? -1 : b.date > a.date ? 1 : 0))));
public constructor(
private showService: ShowService,
private globalSettingsService: GlobalSettingsService,
private router: Router
) {}
public async selectShow(show: Show) {
this.visible = false;