CCLI Button
Some checks failed
Angular Build / build (push) Has been cancelled

This commit is contained in:
2026-03-20 18:39:06 +01:00
parent c5fde72782
commit 902f1e97ee
2 changed files with 40 additions and 43 deletions

View File

@@ -82,26 +82,26 @@
<ng-container *appRole="['leader']">
<ng-container *appOwner="show.owner">
@if (!show.archived) {
<app-button (click)="onArchive(true)" [icon]="faBox"> Archivieren </app-button>
<app-button (click)="onArchive(true)" [icon]="faBox"> Archivieren</app-button>
} @if (show.archived) {
<app-button (click)="onArchive(false)" [icon]="faBoxOpen"> Wiederherstellen </app-button>
<app-button (click)="onArchive(false)" [icon]="faBoxOpen"> Wiederherstellen</app-button>
} @if (!show.published) {
<app-button (click)="onPublish(show, true)" [icon]="faPublish"> Veröffentlichen </app-button>
<app-button (click)="onPublish(show, true)" [icon]="faPublish"> Veröffentlichen</app-button>
} @if (show.published) {
<app-button (click)="onPublish(show, false)" [icon]="faUnpublish"> Veröffentlichung zurückziehen </app-button>
} @if (show.published) {
<app-button (click)="onShare(show)" [icon]="faShare"> Teilen </app-button>
<app-button (click)="onShare(show)" [icon]="faShare"> Teilen</app-button>
} @if (show.published && show.reportedType === 'pending') {
<app-button (click)="onReport(show)" [icon]="faReport"> Melden </app-button>
<app-button (click)="onReport(show)" [icon]="faReport"> CCLI</app-button>
} @if (!show.published) {
<app-button (click)="onChange(show.id)" [icon]="faSliders"> Ändern </app-button>
<app-button (click)="onChange(show.id)" [icon]="faSliders"> Ändern</app-button>
}
</ng-container>
</ng-container>
<app-button [icon]="faDownload" [matMenuTriggerFor]="menu"> Herunterladen </app-button>
<app-button [icon]="faDownload" [matMenuTriggerFor]="menu"> Herunterladen</app-button>
<mat-menu #menu="matMenu">
<app-button (click)="onDownload()" [icon]="faUser"> Ablauf für Lobpreisgruppe </app-button>
<app-button (click)="onDownloadHandout()" [icon]="faUsers"> Handout mit Copyright Infos </app-button>
<app-button (click)="onDownload()" [icon]="faUser"> Ablauf für Lobpreisgruppe</app-button>
<app-button (click)="onDownloadHandout()" [icon]="faUsers"> Handout mit Copyright Infos</app-button>
</mat-menu>
</app-button-row>
}

View File

@@ -1,9 +1,8 @@
import {ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, HostListener, OnDestroy, OnInit, inject} from '@angular/core';
import {filter, map, shareReplay, switchMap, tap} from 'rxjs/operators';
import {ChangeDetectorRef, Component, CUSTOM_ELEMENTS_SCHEMA, HostListener, inject, OnDestroy, OnInit} from '@angular/core';
import {filter, map, shareReplay, switchMap, take, tap} from 'rxjs/operators';
import {ActivatedRoute, Router} from '@angular/router';
import {ShowService} from '../services/show.service';
import {Observable, of, Subscription} from 'rxjs';
import {take} from 'rxjs/operators';
import {Show} from '../services/show';
import {SongService} from '../../songs/services/song.service';
import {Song} from '../../songs/services/song';
@@ -14,8 +13,8 @@ import {
faArrowUpRightFromSquare,
faBox,
faBoxOpen,
faCheck,
faChevronRight,
faCompactDisc,
faFileDownload,
faLock,
faMagnifyingGlassMinus,
@@ -90,26 +89,15 @@ import {PublishedTypePipe} from '../../../widget-modules/pipes/published-type-tr
],
})
export class ShowComponent implements OnInit, OnDestroy {
private activatedRoute = inject(ActivatedRoute);
private showService = inject(ShowService);
private songService = inject(SongService);
private showSongService = inject(ShowSongService);
private docxService = inject(DocxService);
private router = inject(Router);
private cRef = inject(ChangeDetectorRef);
private userService = inject(UserService);
public dialog = inject(MatDialog);
private guestShowService = inject(GuestShowService);
public show$: Observable<Show | null> | null = null;
public songs$: Observable<Song[] | null> | null = null;
public showSongs: ShowSong[] | null = null;
public showId: string | null = null;
public showText = false;
public faBox = faBox;
public faBoxOpen = faBoxOpen;
public faReport = faCheck;
public faReport = faCompactDisc;
public faPublish = faUnlock;
public faUnpublish = faLock;
public faShare = faArrowUpRightFromSquare;
@@ -125,6 +113,15 @@ export class ShowComponent implements OnInit, OnDestroy {
public faMaximize = faMaximize;
public faNextSong = faChevronRight;
public currentTime!: Date;
private activatedRoute = inject(ActivatedRoute);
private showService = inject(ShowService);
private songService = inject(SongService);
private showSongService = inject(ShowSongService);
private docxService = inject(DocxService);
private router = inject(Router);
private cRef = inject(ChangeDetectorRef);
private userService = inject(UserService);
private guestShowService = inject(GuestShowService);
private subs: Subscription[] = [];
private clockIntervalId: ReturnType<typeof setInterval> | null = null;
@@ -270,24 +267,6 @@ export class ShowComponent implements OnInit, OnDestroy {
return show.published ? 'ok' : 'none';
}
private getReportableSongs(show: Show): ReportDialogSong[] {
const uniqueSongs = new Map<string, ReportDialogSong>();
this.orderedShowSongs(show)
.filter(song => song.legalOwner === 'CCLI' && !!song.legalOwnerId)
.forEach(song => {
const key = song.songId || `${song.title}:${song.legalOwnerId}`;
if (!uniqueSongs.has(key)) {
uniqueSongs.set(key, {
title: song.title,
ccliNumber: song.legalOwnerId,
});
}
});
return Array.from(uniqueSongs.values());
}
public async onDownload(): Promise<void> {
if (this.showId != null) await this.docxService.create(this.showId);
}
@@ -361,6 +340,24 @@ export class ShowComponent implements OnInit, OnDestroy {
return `${widthInCh}ch`;
}
private getReportableSongs(show: Show): ReportDialogSong[] {
const uniqueSongs = new Map<string, ReportDialogSong>();
this.orderedShowSongs(show)
.filter(song => song.legalOwner === 'CCLI' && !!song.legalOwnerId)
.forEach(song => {
const key = song.songId || `${song.title}:${song.legalOwnerId}`;
if (!uniqueSongs.has(key)) {
uniqueSongs.set(key, {
title: song.title,
ccliNumber: song.legalOwnerId,
});
}
});
return Array.from(uniqueSongs.values());
}
private async setArchiveState(archived: boolean): Promise<void> {
if (!this.showId) {
return;