update angular
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
})
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -27,7 +27,7 @@ export class SongService {
|
||||
|
||||
public constructor(
|
||||
private songDataService: SongDataService,
|
||||
private userService: UserService
|
||||
private userService: UserService,
|
||||
) {
|
||||
// importCCLI = (songs: Song[]) => this.updateFromCLI(songs);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user