update angular
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<div *ngIf="show" @fade>
|
||||
<app-card [heading]="show.showType | showType" [subheading]="show.date.toDate() | date:'dd.MM.yyyy'"
|
||||
closeLink="/presentation/select" [closeIcon]="faIcon">
|
||||
<app-card [closeIcon]="faIcon" [heading]="show.showType | showType"
|
||||
[subheading]="show.date.toDate() | date:'dd.MM.yyyy'" closeLink="/presentation/select">
|
||||
|
||||
<ng-container *ngIf="!progress">
|
||||
<div class="song">
|
||||
@@ -61,7 +61,8 @@
|
||||
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-label>Überschrift</mat-label>
|
||||
<input (ngModelChange)="onDynamicCaption($event, show.id)" [ngModel]="show.presentationDynamicCaption" autocomplete="off" id="dynamic-caption"
|
||||
<input (ngModelChange)="onDynamicCaption($event, show.id)" [ngModel]="show.presentationDynamicCaption"
|
||||
autocomplete="off" id="dynamic-caption"
|
||||
matInput
|
||||
type="text">
|
||||
</mat-form-field>
|
||||
@@ -86,8 +87,8 @@
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-label>Hintergrund</mat-label>
|
||||
<mat-select
|
||||
[ngModel]="show.presentationBackground"
|
||||
(ngModelChange)="onBackground($event, show.id)">
|
||||
(ngModelChange)="onBackground($event, show.id)"
|
||||
[ngModel]="show.presentationBackground">
|
||||
<mat-option value="none">kein Hintergrund</mat-option>
|
||||
<mat-option value="blue">Sternenhimmel</mat-option>
|
||||
<mat-option value="green">Blätter</mat-option>
|
||||
@@ -98,12 +99,12 @@
|
||||
</mat-form-field>
|
||||
|
||||
<mat-slider
|
||||
#slider
|
||||
[max]="100"
|
||||
[min]="10"
|
||||
[step]="2"
|
||||
color="primary"
|
||||
class="zoom-slider"
|
||||
#slider
|
||||
color="primary"
|
||||
ngDefaultControl
|
||||
><input (ngModelChange)="onZoom($event, show.id)"
|
||||
[ngModel]="show.presentationZoom"
|
||||
@@ -117,8 +118,8 @@
|
||||
*ngIf="show"
|
||||
[addedLive]="true"
|
||||
[showSongs]="showSongs"
|
||||
[songs]="songs$|async"
|
||||
[show]="show"
|
||||
[songs]="songs$|async"
|
||||
></app-add-song>
|
||||
</ng-container>
|
||||
</app-card>
|
||||
|
||||
@@ -11,7 +11,7 @@ describe('RemoteComponent', () => {
|
||||
void TestBed.configureTestingModule({
|
||||
declarations: [RemoteComponent],
|
||||
}).compileComponents();
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -25,6 +25,7 @@ export interface PresentationSong {
|
||||
styleUrls: ['./remote.component.less'],
|
||||
animations: [fade],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: false,
|
||||
})
|
||||
export class RemoteComponent {
|
||||
public show: Show | null = null;
|
||||
@@ -35,13 +36,38 @@ export class RemoteComponent {
|
||||
public faIcon = faFolderOpen;
|
||||
|
||||
public faDesktop = faDesktop;
|
||||
public presentationDynamicCaptionChanged$ = new Subject<{presentationDynamicCaption: string; showId: string}>();
|
||||
public presentationDynamicTextChanged$ = new Subject<{presentationDynamicText: string; showId: string}>();
|
||||
|
||||
public constructor(
|
||||
private showService: ShowService,
|
||||
private showSongService: ShowSongService,
|
||||
private songService: SongService,
|
||||
private textRenderingService: TextRenderingService,
|
||||
private globalSettingsService: GlobalSettingsService,
|
||||
private cRef: ChangeDetectorRef,
|
||||
) {
|
||||
globalSettingsService.get$
|
||||
.pipe(
|
||||
filter(_ => !!_),
|
||||
map(_ => _ as GlobalSettings),
|
||||
map(_ => _.currentShow),
|
||||
)
|
||||
.subscribe(_ => {
|
||||
this.onShowChanged(_);
|
||||
this.cRef.markForCheck();
|
||||
});
|
||||
|
||||
this.presentationDynamicCaptionChanged$
|
||||
.pipe(debounceTime(1000))
|
||||
.subscribe(_ => void this.showService.update$(_.showId, {presentationDynamicCaption: _.presentationDynamicCaption}));
|
||||
this.presentationDynamicTextChanged$.pipe(debounceTime(1000)).subscribe(_ => void this.showService.update$(_.showId, {presentationDynamicText: _.presentationDynamicText}));
|
||||
}
|
||||
|
||||
public trackBy(index: number, item: PresentationSong): string {
|
||||
return item.id;
|
||||
}
|
||||
|
||||
public presentationDynamicCaptionChanged$ = new Subject<{presentationDynamicCaption: string; showId: string}>();
|
||||
|
||||
public onShowChanged(change: string): void {
|
||||
combineLatest([this.showService.read$(change), this.showSongService.list$(change)]).subscribe(([show, list]) => {
|
||||
this.showSongs = list;
|
||||
@@ -74,32 +100,6 @@ export class RemoteComponent {
|
||||
public async onBackground(presentationBackground: PresentationBackground, showId: string): Promise<void> {
|
||||
await this.showService.update$(showId, {presentationBackground});
|
||||
}
|
||||
public presentationDynamicTextChanged$ = new Subject<{presentationDynamicText: string; showId: string}>();
|
||||
|
||||
public constructor(
|
||||
private showService: ShowService,
|
||||
private showSongService: ShowSongService,
|
||||
private songService: SongService,
|
||||
private textRenderingService: TextRenderingService,
|
||||
private globalSettingsService: GlobalSettingsService,
|
||||
private cRef: ChangeDetectorRef
|
||||
) {
|
||||
globalSettingsService.get$
|
||||
.pipe(
|
||||
filter(_ => !!_),
|
||||
map(_ => _ as GlobalSettings),
|
||||
map(_ => _.currentShow)
|
||||
)
|
||||
.subscribe(_ => {
|
||||
this.onShowChanged(_);
|
||||
this.cRef.markForCheck();
|
||||
});
|
||||
|
||||
this.presentationDynamicCaptionChanged$
|
||||
.pipe(debounceTime(1000))
|
||||
.subscribe(_ => void this.showService.update$(_.showId, {presentationDynamicCaption: _.presentationDynamicCaption}));
|
||||
this.presentationDynamicTextChanged$.pipe(debounceTime(1000)).subscribe(_ => void this.showService.update$(_.showId, {presentationDynamicText: _.presentationDynamicText}));
|
||||
}
|
||||
|
||||
public onDynamicCaption(presentationDynamicCaption: string, showId: string): void {
|
||||
this.presentationDynamicCaptionChanged$.next({presentationDynamicCaption, showId});
|
||||
|
||||
Reference in New Issue
Block a user