update angular

This commit is contained in:
2025-01-02 15:01:59 +01:00
parent 73d3ecfd42
commit 802c309679
199 changed files with 13745 additions and 11691 deletions

View File

@@ -8,7 +8,8 @@ import {DbService} from '../../../services/db.service';
providedIn: 'root',
})
export class FileDataService {
public constructor(private db: DbService) {}
public constructor(private db: DbService) {
}
public async set(songId: string, file: FileServer): Promise<string> {
const songRef = this.db.doc('songs/' + songId);

View File

@@ -7,7 +7,8 @@ import {FileDataService} from './file-data.service';
providedIn: 'root',
})
export class FileService {
public constructor(private storage: AngularFireStorage, private fileDataService: FileDataService) {}
public constructor(private storage: AngularFireStorage, private fileDataService: FileDataService) {
}
public getDownloadUrl(path: string): Observable<string> {
const ref = this.storage.ref(path);

View File

@@ -19,7 +19,7 @@ describe('SongDataService', () => {
() =>
void TestBed.configureTestingModule({
providers: [{provide: AngularFirestore, useValue: mockAngularFirestore}],
})
}),
);
it('should be created', () => {
@@ -34,6 +34,6 @@ describe('SongDataService', () => {
service.list$().subscribe(s => {
void expect(s[0].title).toEqual('title1');
});
})
}),
);
});

View File

@@ -8,14 +8,14 @@ import {map} from 'rxjs/operators';
providedIn: 'root',
})
export class SongDataService {
public list$ = new BehaviorSubject<Song[]>([]);
private collection = 'songs';
public constructor(private dbService: DbService) {
this.dbService.col$<Song>(this.collection).subscribe(_ => this.list$.next(_));
}
public list$ = new BehaviorSubject<Song[]>([]);
// public list$ = (): Observable<Song[]> => this.dbService.col$(this.collection);
//public read$ = (songId: string): Observable<Song | null> => this.dbService.doc$(this.collection + '/' + songId);
public read$ = (songId: string): Observable<Song | null> => this.list$.pipe(map(_ => _.find(s => s.id === songId) || null));
public update$ = async (songId: string, data: Partial<Song>): Promise<void> => await this.dbService.doc(this.collection + '/' + songId).update(data);

View File

@@ -9,7 +9,8 @@ import {filter} from 'rxjs/operators';
providedIn: 'root',
})
export class SongListResolver {
public constructor(private songService: SongService) {}
public constructor(private songService: SongService) {
}
public resolve(): Observable<Song[]> {
return this.songService.list$().pipe(filter(_ => _.length > 0));

View File

@@ -15,7 +15,7 @@ describe('SongService', () => {
() =>
void TestBed.configureTestingModule({
providers: [{provide: SongDataService, useValue: mockSongDataService}],
})
}),
);
it('should be created', () => {
@@ -30,6 +30,6 @@ describe('SongService', () => {
service.list$().subscribe(s => {
void expect(s[0].title).toEqual('title1');
});
})
}),
);
});

View File

@@ -27,7 +27,7 @@ export class SongService {
public constructor(
private songDataService: SongDataService,
private userService: UserService
private userService: UserService,
) {
// importCCLI = (songs: Song[]) => this.updateFromCLI(songs);
}

View File

@@ -13,7 +13,8 @@ import {Line} from './line';
export class TextRenderingService {
private regexSection = /(Strophe|Refrain|Bridge)/;
public constructor(private transposeService: TransposeService) {}
public constructor(private transposeService: TransposeService) {
}
public parse(text: string, transpose: TransposeMode | null): Section[] {
if (!text) {