fix adding song, with no editable show
This commit is contained in:
@@ -47,21 +47,25 @@
|
|||||||
<div *appRole="['leader', 'contributor']" class="text">{{ song.comment }}</div>
|
<div *appRole="['leader', 'contributor']" class="text">{{ song.comment }}</div>
|
||||||
</div>
|
</div>
|
||||||
<app-button-row>
|
<app-button-row>
|
||||||
<app-button (click)="onDelete(song.id)" *appRole="['admin']" [icon]="faDelete">Löschen</app-button>
|
<app-button (click)="onDelete(song.id)" *appRole="['admin']" [icon]="faDelete">Löschen</app-button>
|
||||||
<app-button *appRole="['contributor']" [icon]="faEdit" routerLink="edit">Bearbeiten</app-button>
|
<app-button *appRole="['contributor']" [icon]="faEdit" routerLink="edit">Bearbeiten</app-button>
|
||||||
<ng-container *appRole="['leader']">
|
<ng-container *appRole="['leader']">
|
||||||
<app-button [icon]="faFileCirclePlus" [matMenuTriggerFor]="menu"> Zu Veranstaltung hinzufügen</app-button>
|
@if (privateShows$ | async; as privateShows) {
|
||||||
<mat-menu #menu="matMenu">
|
@if (privateShows.length > 0) {
|
||||||
@for (show of privateShows$|async; track show.id) {
|
<app-button [icon]="faFileCirclePlus" [matMenuTriggerFor]="menu"> Zu Veranstaltung hinzufügen</app-button>
|
||||||
<app-button
|
<mat-menu #menu="matMenu">
|
||||||
(click)="addSongToShow(show, song)"> {{ show.date.toDate() | date: "dd.MM.yyyy" }} {{ show.showType | showType }}
|
@for (show of privateShows; track show.id) {
|
||||||
</app-button>
|
<app-button
|
||||||
}
|
(click)="addSongToShow(show, song)"> {{ show.date.toDate() | date: "dd.MM.yyyy" }} {{ show.showType | showType }}
|
||||||
</mat-menu>
|
</app-button>
|
||||||
</ng-container>
|
}
|
||||||
</app-button-row>
|
</mat-menu>
|
||||||
</app-card>
|
}
|
||||||
}
|
}
|
||||||
|
</ng-container>
|
||||||
|
</app-button-row>
|
||||||
|
</app-card>
|
||||||
|
}
|
||||||
@if (files$ | async; as files) {
|
@if (files$ | async; as files) {
|
||||||
@if (files.length > 0) {
|
@if (files.length > 0) {
|
||||||
<app-card heading="Anhänge">
|
<app-card heading="Anhänge">
|
||||||
|
|||||||
@@ -55,4 +55,11 @@ describe('SongComponent', () => {
|
|||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
void expect(component).toBeTruthy();
|
void expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should hide add-to-show when there are no private shows', () => {
|
||||||
|
const buttons = Array.from(fixture.nativeElement.querySelectorAll('app-button button')) as HTMLButtonElement[];
|
||||||
|
const addButton = buttons.find(button => button.textContent?.includes('Zu Veranstaltung hinzufügen'));
|
||||||
|
|
||||||
|
void expect(addButton).toBeUndefined();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user