update tslint -> eslint

This commit is contained in:
2021-05-21 20:17:26 +02:00
parent 80260df71f
commit a195fafa6b
252 changed files with 3080 additions and 2420 deletions

View File

@@ -1,41 +1,60 @@
<div *ngIf="shows$|async as shows">
<div *ngIf="shows$ | async as shows">
<app-card>
<p *ngIf="!shows.length" @fade>
Es ist derzeit keine Veranstaltung vorhanden
</p>
<p *ngIf="!shows.length" @fade>Es ist derzeit keine Veranstaltung vorhanden</p>
<mat-form-field *ngIf="shows.length>0" @fade appearance="outline">
<mat-form-field *ngIf="shows.length > 0" @fade appearance="outline">
<mat-label>Veranstaltung</mat-label>
<mat-select [formControl]="showControl">
<mat-option *ngFor="let show of shows" [value]="show.id">
{{show.showType|showType}}, {{show.date.toDate()|date:'dd.MM.yyyy'}}
{{ show.showType | showType }},
{{ show.date.toDate() | date: "dd.MM.yyyy" }}
</mat-option>
</mat-select>
</mat-form-field>
<ng-container *ngIf="!progress">
<div *ngIf="show" class="song-parts padding-bottom">
<div (click)="onSectionClick('title', -1)"
[class.active]="show.presentationSongId==='title'"
class="song-part">
<div
(click)="onSectionClick('title', -1)"
[class.active]="show.presentationSongId === 'title'"
class="song-part"
>
<div class="head">Veranstaltung</div>
</div>
<div (click)="onSectionClick('empty', -1)"
[class.active]="show.presentationSongId==='empty'"
class="song-part">
<div
(click)="onSectionClick('empty', -1)"
[class.active]="show.presentationSongId === 'empty'"
class="song-part"
>
<div class="head">Leer</div>
</div>
</div>
<div *ngFor="let song of presentationSongs" @fade class="song">
<div [class.active]="show.presentationSongId===song.id" class="title song-part">
<div (click)="onSectionClick(song.id, -1)" class="head">{{song.title}}</div>
<div
[class.active]="show.presentationSongId === song.id"
class="title song-part"
>
<div (click)="onSectionClick(song.id, -1)" class="head">
{{ song.title }}
</div>
</div>
<div *ngIf="show" class="song-parts">
<div (click)="onSectionClick(song.id, i)" *ngFor="let section of song.sections; index as i"
[class.active]="show.presentationSongId===song.id && show.presentationSection===i"
class="song-part">
<div class="head">{{section.type|sectionType}} {{section.number + 1}}</div>
<div class="fragment">{{getFirstLine(section)}}</div>
<div
(click)="onSectionClick(song.id, i)"
*ngFor="let section of song.sections; index as i"
[class.active]="
show.presentationSongId === song.id &&
show.presentationSection === i
"
class="song-part"
>
<div class="head">
{{ section.type | sectionType }} {{ section.number + 1 }}
</div>
<div class="fragment">{{ getFirstLine(section) }}</div>
</div>
</div>
</div>
@@ -56,11 +75,13 @@
</mat-slider>
</div>
<app-add-song *ngIf="show" [addedLive]="true" [showId]="currentShowId" [showSongs]="showSongs"
[songs]="songs"></app-add-song>
<app-add-song
*ngIf="show"
[addedLive]="true"
[showId]="currentShowId"
[showSongs]="showSongs"
[songs]="songs"
></app-add-song>
</ng-container>
</app-card>
</div>

View File

@@ -6,12 +6,13 @@ describe('RemoteComponent', () => {
let component: RemoteComponent;
let fixture: ComponentFixture<RemoteComponent>;
beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [RemoteComponent]
beforeEach(
waitForAsync(() => {
void TestBed.configureTestingModule({
declarations: [RemoteComponent],
}).compileComponents();
})
.compileComponents();
}));
);
beforeEach(() => {
fixture = TestBed.createComponent(RemoteComponent);
@@ -20,6 +21,6 @@ describe('RemoteComponent', () => {
});
it('should create', () => {
expect(component).toBeTruthy();
void expect(component).toBeTruthy();
});
});

View File

@@ -25,7 +25,7 @@ export interface PresentationSong {
selector: 'app-remote',
templateUrl: './remote.component.html',
styleUrls: ['./remote.component.less'],
animations: [fade]
animations: [fade],
})
export class RemoteComponent {
public shows$: Observable<Show[]>;
@@ -39,24 +39,26 @@ export class RemoteComponent {
public faDesktop = faDesktop;
public showControl = new FormControl();
constructor(
public constructor(
private showService: ShowService,
private showSongService: ShowSongService,
private songService: SongService,
private textRenderingService: TextRenderingService,
private globalSettingsService: GlobalSettingsService,
private globalSettingsService: GlobalSettingsService
) {
this.shows$ = showService.list$(true);
songService.list$().subscribe(_ => this.songs = _);
songService.list$().subscribe(_ => (this.songs = _));
globalSettingsService.get$.pipe(
map(_ => _.currentShow),
distinctUntilChanged()
).subscribe(_ => {
this.showControl.setValue(_, {emitEvent: false});
this.onShowChanged(_, false);
});
this.showControl.valueChanges.subscribe(value => this.onShowChanged(value));
globalSettingsService.get$
.pipe(
map(_ => _.currentShow),
distinctUntilChanged()
)
.subscribe(_ => {
this.showControl.setValue(_, {emitEvent: false});
void this.onShowChanged(_, false);
});
this.showControl.valueChanges.subscribe((value: string) => void this.onShowChanged(value));
}
public async onShowChanged(change: string, updateShow = true): Promise<void> {
@@ -68,16 +70,14 @@ export class RemoteComponent {
await this.showService.update$(change, {presentationSongId: 'title'});
}
this.currentShowId = change;
this.showService.read$(change).subscribe(_ => this.show = _);
this.showService.read$(change).subscribe(_ => (this.show = _));
this.showSongService.list$(change).subscribe(_ => {
this.showSongs = _;
this.presentationSongs = _
.map(song => this.songs.filter(f => f.id == song.songId)[0])
.map(song => ({
id: song.id,
title: song.title,
sections: this.textRenderingService.parse(song.text, null)
}));
this.presentationSongs = _.map(song => this.songs.filter(f => f.id === song.songId)[0]).map(song => ({
id: song.id,
title: song.title,
sections: this.textRenderingService.parse(song.text, null),
}));
});
await delay(500);
this.progress = false;
@@ -90,13 +90,11 @@ export class RemoteComponent {
public async onSectionClick(id: string, index: number): Promise<void> {
await this.showService.update$(this.currentShowId, {
presentationSongId: id,
presentationSection: index
presentationSection: index,
});
}
public async onZoom(zoom: number) {
await this.showService.update$(this.currentShowId, {
presentationZoom: zoom,
});
public async onZoom(zoom: number): Promise<void> {
await this.showService.update$(this.currentShowId, {presentationZoom: zoom});
}
}