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

@@ -3,9 +3,13 @@
<mat-label>Lied hinzufügen...</mat-label>
<mat-select (selectionChange)="onAddSongSelectionChanged($event)">
<mat-option>
<ngx-mat-select-search [formControl]="filteredSongsControl"></ngx-mat-select-search>
<ngx-mat-select-search
[formControl]="filteredSongsControl"
></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let song of filteredSongs()" [value]="song.id">{{song.title}}</mat-option>
<mat-option *ngFor="let song of filteredSongs()" [value]="song.id">{{
song.title
}}</mat-option>
</mat-select>
</mat-form-field>
</div>

View File

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

View File

@@ -9,7 +9,7 @@ import {ShowSongService} from '../../../modules/shows/services/show-song.service
@Component({
selector: 'app-add-song',
templateUrl: './add-song.component.html',
styleUrls: ['./add-song.component.less']
styleUrls: ['./add-song.component.less'],
})
export class AddSongComponent {
@Input() public songs: Song[];
@@ -18,10 +18,9 @@ export class AddSongComponent {
@Input() public addedLive = false;
public filteredSongsControl = new FormControl();
constructor(private showSongService: ShowSongService) {
}
public constructor(private showSongService: ShowSongService) {}
filteredSongs() {
public filteredSongs(): Song[] {
const songs = this.songs
.filter(_ => !!_)
.filter(_ => !!_.title)
@@ -37,14 +36,13 @@ export class AddSongComponent {
return 0;
});
const filterValue = this.filteredSongsControl.value;
const filterValue = this.filteredSongsControl.value as string;
return filterValue ? songs.filter(_ => filterSong(_, filterValue)) : songs;
}
public async onAddSongSelectionChanged(event: MatSelectChange) {
public async onAddSongSelectionChanged(event: MatSelectChange): Promise<void> {
const order = this.showSongs.reduce((oa, u) => Math.max(oa, u.order), 0) + 1;
await this.showSongService.new$(this.showId, event.value, order, this.addedLive);
event.source.value = null;
}
}

View File

@@ -6,19 +6,9 @@ import {MatSelectModule} from '@angular/material/select';
import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
import {ReactiveFormsModule} from '@angular/forms';
@NgModule({
declarations: [AddSongComponent],
exports: [
AddSongComponent
],
imports: [
CommonModule,
MatFormFieldModule,
MatSelectModule,
NgxMatSelectSearchModule,
ReactiveFormsModule
]
exports: [AddSongComponent],
imports: [CommonModule, MatFormFieldModule, MatSelectModule, NgxMatSelectSearchModule, ReactiveFormsModule],
})
export class AddSongModule {
}
export class AddSongModule {}