update angular version
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<div class="brand">
|
||||
<app-logo></app-logo>
|
||||
<div class="copyright">© 2020 - Benjamin Ifland</div>
|
||||
<div class="copyright">© 2022 - Benjamin Ifland</div>
|
||||
</div>
|
||||
|
||||
@@ -37,7 +37,7 @@ export class MonitorComponent implements OnInit {
|
||||
private globalSettingsService: GlobalSettingsService,
|
||||
private configService: ConfigService
|
||||
) {
|
||||
this.config$ = configService.get$;
|
||||
this.config$ = configService.get$();
|
||||
}
|
||||
|
||||
public ngOnInit(): void {
|
||||
|
||||
@@ -2,7 +2,6 @@ import {Injectable} from '@angular/core';
|
||||
import {Document, HeadingLevel, ISectionOptions, Packer, Paragraph} from 'docx';
|
||||
import {ShowService} from './show.service';
|
||||
import {ShowTypePipe} from '../../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
||||
import {first} from 'rxjs/operators';
|
||||
import {ShowSongService} from './show-song.service';
|
||||
import {Song} from '../../songs/services/song';
|
||||
import {SongService} from '../../songs/services/song.service';
|
||||
@@ -17,6 +16,7 @@ import {TextRenderingService} from '../../songs/services/text-rendering.service'
|
||||
import {Section} from '../../songs/services/section';
|
||||
import {LineType} from '../../songs/services/line-type';
|
||||
import {Line} from '../../songs/services/line';
|
||||
import {firstValueFrom} from 'rxjs';
|
||||
|
||||
export interface DownloadOptions {
|
||||
copyright?: boolean;
|
||||
@@ -181,7 +181,7 @@ export class DocxService {
|
||||
user: User;
|
||||
config: Config;
|
||||
} | null> {
|
||||
const show = await this.showService.read$(showId).pipe(first()).toPromise();
|
||||
const show = await firstValueFrom(this.showService.read$(showId));
|
||||
if (!show) return null;
|
||||
const user = await this.userService.getUserbyId(show.owner);
|
||||
if (!user) return null;
|
||||
|
||||
@@ -2,7 +2,7 @@ import {Injectable} from '@angular/core';
|
||||
import {Observable} from 'rxjs';
|
||||
import {DbService} from '../../../services/db.service';
|
||||
import {Show} from './show';
|
||||
import {QueryFn} from '@angular/fire/firestore/interfaces';
|
||||
import {QueryFn} from '@angular/fire/compat/firestore/interfaces';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
|
||||
@@ -2,7 +2,7 @@ import {Injectable} from '@angular/core';
|
||||
import {DbService} from '../../../services/db.service';
|
||||
import {Observable} from 'rxjs';
|
||||
import {ShowSong} from './show-song';
|
||||
import {QueryFn} from '@angular/fire/firestore/interfaces';
|
||||
import {QueryFn} from '@angular/fire/compat/firestore/interfaces';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {ShowSongDataService} from './show-song-data.service';
|
||||
import {Observable} from 'rxjs';
|
||||
import {firstValueFrom, Observable} from 'rxjs';
|
||||
import {ShowSong} from './show-song';
|
||||
import {SongDataService} from '../../songs/services/song-data.service';
|
||||
import {first, take} from 'rxjs/operators';
|
||||
import {UserService} from '../../../services/user/user.service';
|
||||
import {ShowService} from './show.service';
|
||||
|
||||
@@ -19,8 +18,8 @@ export class ShowSongService {
|
||||
) {}
|
||||
|
||||
public async new$(showId: string, songId: string, addedLive = false): Promise<string | null> {
|
||||
const song = await this.songDataService.read$(songId).pipe(take(1)).toPromise();
|
||||
const user = await this.userService.user$.pipe(take(1)).toPromise();
|
||||
const song = await firstValueFrom(this.songDataService.read$(songId));
|
||||
const user = await firstValueFrom(this.userService.user$);
|
||||
if (!song || !user) return null;
|
||||
const data: Partial<ShowSong> = {
|
||||
...song,
|
||||
@@ -34,14 +33,14 @@ export class ShowSongService {
|
||||
}
|
||||
|
||||
public read$ = (showId: string, songId: string): Observable<ShowSong | null> => this.showSongDataService.read$(showId, songId);
|
||||
public read = (showId: string, songId: string): Promise<ShowSong | null> => this.read$(showId, songId).pipe(first()).toPromise();
|
||||
public read = (showId: string, songId: string): Promise<ShowSong | null> => firstValueFrom(this.read$(showId, songId));
|
||||
|
||||
public list$ = (showId: string): Observable<ShowSong[]> => this.showSongDataService.list$(showId);
|
||||
public list = (showId: string): Promise<ShowSong[]> => this.list$(showId).pipe(first()).toPromise();
|
||||
public list = (showId: string): Promise<ShowSong[]> => firstValueFrom(this.list$(showId));
|
||||
|
||||
public async delete$(showId: string, songId: string, index: number): Promise<void> {
|
||||
await this.showSongDataService.delete(showId, songId);
|
||||
const show = await this.showService.read$(showId).pipe(first()).toPromise();
|
||||
const show = await firstValueFrom(this.showService.read$(showId));
|
||||
if (!show) return;
|
||||
const order = show.order;
|
||||
order.splice(index, 1);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import firebase from 'firebase/app';
|
||||
import firebase from 'firebase/compat/app';
|
||||
import Timestamp = firebase.firestore.Timestamp;
|
||||
|
||||
export interface Show {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {AngularFireStorage} from '@angular/fire/storage';
|
||||
import {Observable} from 'rxjs';
|
||||
import {AngularFireStorage} from '@angular/fire/compat/storage';
|
||||
import {firstValueFrom, Observable} from 'rxjs';
|
||||
import {FileDataService} from './file-data.service';
|
||||
|
||||
@Injectable({
|
||||
@@ -16,7 +16,7 @@ export class FileService {
|
||||
|
||||
public async delete(path: string, songId: string, fileId: string): Promise<void> {
|
||||
const ref = this.storage.ref(path);
|
||||
await ref.delete().toPromise();
|
||||
await firstValueFrom(ref.delete());
|
||||
await this.fileDataService.delete(songId, fileId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {TestBed, waitForAsync} from '@angular/core/testing';
|
||||
|
||||
import {SongDataService} from './song-data.service';
|
||||
import {AngularFirestore} from '@angular/fire/firestore';
|
||||
import {AngularFirestore} from '@angular/fire/compat/firestore';
|
||||
import {of} from 'rxjs';
|
||||
|
||||
describe('SongDataService', () => {
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Observable} from 'rxjs';
|
||||
import {firstValueFrom, Observable} from 'rxjs';
|
||||
import {Song} from './song';
|
||||
import {SongDataService} from './song-data.service';
|
||||
import {first} from 'rxjs/operators';
|
||||
import {UserService} from '../../../services/user/user.service';
|
||||
import firebase from 'firebase/app';
|
||||
import firebase from 'firebase/compat/app';
|
||||
import Timestamp = firebase.firestore.Timestamp;
|
||||
|
||||
// declare let importCCLI: any;
|
||||
@@ -27,7 +26,7 @@ export class SongService {
|
||||
|
||||
public list$ = (): Observable<Song[]> => this.songDataService.list$(); //.pipe(tap(_ => (this.list = _)));
|
||||
public read$ = (songId: string): Observable<Song | null> => this.songDataService.read$(songId);
|
||||
public read = (songId: string): Promise<Song | null> => this.read$(songId).pipe(first()).toPromise();
|
||||
public read = (songId: string): Promise<Song | null> => firstValueFrom(this.read$(songId));
|
||||
|
||||
public async update$(songId: string, data: Partial<Song>): Promise<void> {
|
||||
const song = await this.read(songId);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import firebase from 'firebase/app';
|
||||
import firebase from 'firebase/compat/app';
|
||||
import Timestamp = firebase.firestore.Timestamp;
|
||||
|
||||
export interface Song {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Upload} from './upload';
|
||||
import {FileDataService} from './file-data.service';
|
||||
import {AngularFireStorage} from '@angular/fire/storage';
|
||||
import {AngularFireStorage} from '@angular/fire/compat/storage';
|
||||
import {finalize} from 'rxjs/operators';
|
||||
import {FileBase} from './fileBase';
|
||||
import {FileServer} from './fileServer';
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<textarea
|
||||
(focus)="songtextFocus = true"
|
||||
(focusout)="songtextFocus = false"
|
||||
[mat-autosize]="true"
|
||||
[cdkTextareaAutosize]="true"
|
||||
formControlName="text"
|
||||
matInput
|
||||
></textarea>
|
||||
@@ -88,7 +88,7 @@
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-label>Kommentar</mat-label>
|
||||
<textarea
|
||||
[mat-autosize]="true"
|
||||
[cdkTextareaAutosize]="true"
|
||||
formControlName="comment"
|
||||
matInput
|
||||
></textarea>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {File} from '../../services/file';
|
||||
import {AngularFireStorage} from '@angular/fire/storage';
|
||||
import {AngularFireStorage} from '@angular/fire/compat/storage';
|
||||
import {Observable} from 'rxjs';
|
||||
|
||||
@Component({
|
||||
|
||||
@@ -3,7 +3,7 @@ import {RouterModule, Routes} from '@angular/router';
|
||||
import {LoginComponent} from './login/login.component';
|
||||
import {InfoComponent} from './info/info.component';
|
||||
import {LogoutComponent} from './logout/logout.component';
|
||||
import {AngularFireAuthGuard, redirectUnauthorizedTo} from '@angular/fire/auth-guard';
|
||||
import {AngularFireAuthGuard, redirectUnauthorizedTo} from '@angular/fire/compat/auth-guard';
|
||||
import {PasswordComponent} from './password/password.component';
|
||||
import {PasswordSendComponent} from './password-send/password-send.component';
|
||||
import {NewComponent} from './new/new.component';
|
||||
|
||||
Reference in New Issue
Block a user