clean up and lint files
This commit is contained in:
@@ -25,7 +25,7 @@ export const fader = trigger('fader', [
|
|||||||
transform: 'scale(1) translateY(-10px)',
|
transform: 'scale(1) translateY(-10px)',
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
{optional: true},
|
{optional: true}
|
||||||
),
|
),
|
||||||
// Animate the new page in
|
// Animate the new page in
|
||||||
query(
|
query(
|
||||||
@@ -36,10 +36,10 @@ export const fader = trigger('fader', [
|
|||||||
style({
|
style({
|
||||||
opacity: 1,
|
opacity: 1,
|
||||||
transform: 'scale(1) translateY(0)',
|
transform: 'scale(1) translateY(0)',
|
||||||
}),
|
})
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
{optional: true},
|
{optional: true}
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -60,5 +60,4 @@ const routes: Routes = [
|
|||||||
],
|
],
|
||||||
exports: [RouterModule],
|
exports: [RouterModule],
|
||||||
})
|
})
|
||||||
export class AppRoutingModule {
|
export class AppRoutingModule {}
|
||||||
}
|
|
||||||
|
|||||||
@@ -3,13 +3,11 @@ import {RouterTestingModule} from '@angular/router/testing';
|
|||||||
import {AppComponent} from './app.component';
|
import {AppComponent} from './app.component';
|
||||||
|
|
||||||
describe('AppComponent', () => {
|
describe('AppComponent', () => {
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [RouterTestingModule, AppComponent],
|
imports: [RouterTestingModule, AppComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
it('should create the app', () => {
|
it('should create the app', () => {
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
const fixture = TestBed.createComponent(AppComponent);
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('BrandComponent', () => {
|
|||||||
let component: BrandComponent;
|
let component: BrandComponent;
|
||||||
let fixture: ComponentFixture<BrandComponent>;
|
let fixture: ComponentFixture<BrandComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [BrandComponent],
|
imports: [BrandComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(BrandComponent);
|
fixture = TestBed.createComponent(BrandComponent);
|
||||||
|
|||||||
@@ -7,5 +7,4 @@ import { LogoComponent } from '../../widget-modules/components/logo/logo.compone
|
|||||||
styleUrls: ['./brand.component.less'],
|
styleUrls: ['./brand.component.less'],
|
||||||
imports: [LogoComponent],
|
imports: [LogoComponent],
|
||||||
})
|
})
|
||||||
export class BrandComponent {
|
export class BrandComponent {}
|
||||||
}
|
|
||||||
|
|||||||
@@ -20,5 +20,4 @@ const routes: Routes = [
|
|||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [CommonModule, RouterModule.forChild(routes), BrandComponent, NewUserComponent],
|
imports: [CommonModule, RouterModule.forChild(routes), BrandComponent, NewUserComponent],
|
||||||
})
|
})
|
||||||
export class BrandModule {
|
export class BrandModule {}
|
||||||
}
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('NewUserComponent', () => {
|
|||||||
let component: NewUserComponent;
|
let component: NewUserComponent;
|
||||||
let fixture: ComponentFixture<NewUserComponent>;
|
let fixture: ComponentFixture<NewUserComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [NewUserComponent],
|
imports: [NewUserComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(NewUserComponent);
|
fixture = TestBed.createComponent(NewUserComponent);
|
||||||
|
|||||||
@@ -3,17 +3,13 @@ import {UserService} from '../../../services/user/user.service';
|
|||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {User} from '../../../services/user/user';
|
import {User} from '../../../services/user/user';
|
||||||
import {BrandComponent} from '../brand.component';
|
import {BrandComponent} from '../brand.component';
|
||||||
import { NgIf, AsyncPipe } from '@angular/common';
|
import {AsyncPipe, NgIf} from '@angular/common';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-new-user',
|
selector: 'app-new-user',
|
||||||
templateUrl: './new-user.component.html',
|
templateUrl: './new-user.component.html',
|
||||||
styleUrls: ['./new-user.component.less'],
|
styleUrls: ['./new-user.component.less'],
|
||||||
imports: [
|
imports: [BrandComponent, NgIf, AsyncPipe],
|
||||||
BrandComponent,
|
|
||||||
NgIf,
|
|
||||||
AsyncPipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class NewUserComponent {
|
export class NewUserComponent {
|
||||||
public user$: Observable<User | null> | null = null;
|
public user$: Observable<User | null> | null = null;
|
||||||
|
|||||||
@@ -10,9 +10,8 @@ import {ShowService} from '../shows/services/show.service';
|
|||||||
export class GuestShowService {
|
export class GuestShowService {
|
||||||
public constructor(
|
public constructor(
|
||||||
private showService: ShowService,
|
private showService: ShowService,
|
||||||
private guestShowDataService: GuestShowDataService,
|
private guestShowDataService: GuestShowDataService
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
public async share(show: Show, songs: Song[]): Promise<string> {
|
public async share(show: Show, songs: Song[]): Promise<string> {
|
||||||
const data = {
|
const data = {
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('GuestComponent', () => {
|
|||||||
let component: GuestComponent;
|
let component: GuestComponent;
|
||||||
let fixture: ComponentFixture<GuestComponent>;
|
let fixture: ComponentFixture<GuestComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [GuestComponent],
|
imports: [GuestComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(GuestComponent);
|
fixture = TestBed.createComponent(GuestComponent);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {ActivatedRoute} from '@angular/router';
|
|||||||
import {map, switchMap} from 'rxjs/operators';
|
import {map, switchMap} from 'rxjs/operators';
|
||||||
import {Song} from '../songs/services/song';
|
import {Song} from '../songs/services/song';
|
||||||
import {ConfigService} from '../../services/config.service';
|
import {ConfigService} from '../../services/config.service';
|
||||||
import { NgIf, NgFor, AsyncPipe, DatePipe } from '@angular/common';
|
import {AsyncPipe, DatePipe, NgFor, NgIf} from '@angular/common';
|
||||||
import {SongTextComponent} from '../../widget-modules/components/song-text/song-text.component';
|
import {SongTextComponent} from '../../widget-modules/components/song-text/song-text.component';
|
||||||
import {ShowTypePipe} from '../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
import {ShowTypePipe} from '../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
||||||
|
|
||||||
@@ -12,28 +12,20 @@ import { ShowTypePipe } from '../../widget-modules/pipes/show-type-translater/sh
|
|||||||
selector: 'app-guest',
|
selector: 'app-guest',
|
||||||
templateUrl: './guest.component.html',
|
templateUrl: './guest.component.html',
|
||||||
styleUrls: ['./guest.component.less'],
|
styleUrls: ['./guest.component.less'],
|
||||||
imports: [
|
imports: [NgIf, NgFor, SongTextComponent, AsyncPipe, DatePipe, ShowTypePipe],
|
||||||
NgIf,
|
|
||||||
NgFor,
|
|
||||||
SongTextComponent,
|
|
||||||
AsyncPipe,
|
|
||||||
DatePipe,
|
|
||||||
ShowTypePipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class GuestComponent {
|
export class GuestComponent {
|
||||||
public show$ = this.currentRoute.params.pipe(
|
public show$ = this.currentRoute.params.pipe(
|
||||||
map(param => param.id as string),
|
map(param => param.id as string),
|
||||||
switchMap(id => this.service.read$(id)),
|
switchMap(id => this.service.read$(id))
|
||||||
);
|
);
|
||||||
public config$ = this.configService.get$();
|
public config$ = this.configService.get$();
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
private currentRoute: ActivatedRoute,
|
private currentRoute: ActivatedRoute,
|
||||||
private service: GuestShowDataService,
|
private service: GuestShowDataService,
|
||||||
private configService: ConfigService,
|
private configService: ConfigService
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
public trackBy = (index: number, show: Song) => show.id;
|
public trackBy = (index: number, show: Song) => show.id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('LegalComponent', () => {
|
|||||||
let component: LegalComponent;
|
let component: LegalComponent;
|
||||||
let fixture: ComponentFixture<LegalComponent>;
|
let fixture: ComponentFixture<LegalComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [LegalComponent],
|
imports: [LegalComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(LegalComponent);
|
fixture = TestBed.createComponent(LegalComponent);
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('LogoComponent', () => {
|
|||||||
let component: LogoComponent;
|
let component: LogoComponent;
|
||||||
let fixture: ComponentFixture<LogoComponent>;
|
let fixture: ComponentFixture<LogoComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [LogoComponent],
|
imports: [LogoComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(LogoComponent);
|
fixture = TestBed.createComponent(LogoComponent);
|
||||||
|
|||||||
@@ -5,5 +5,4 @@ import {Component} from '@angular/core';
|
|||||||
templateUrl: './logo.component.html',
|
templateUrl: './logo.component.html',
|
||||||
styleUrls: ['./logo.component.less'],
|
styleUrls: ['./logo.component.less'],
|
||||||
})
|
})
|
||||||
export class LogoComponent {
|
export class LogoComponent {}
|
||||||
}
|
|
||||||
|
|||||||
@@ -34,8 +34,8 @@
|
|||||||
[fullscreen]="true"
|
[fullscreen]="true"
|
||||||
[header]="song.title"
|
[header]="song.title"
|
||||||
[index]="index??0"
|
[index]="index??0"
|
||||||
[showSwitch]="false"
|
|
||||||
[showComments]="false"
|
[showComments]="false"
|
||||||
|
[showSwitch]="false"
|
||||||
[text]="song.text"
|
[text]="song.text"
|
||||||
chordMode="hide"
|
chordMode="hide"
|
||||||
></app-song-text>
|
></app-song-text>
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('MonitorComponent', () => {
|
|||||||
let component: MonitorComponent;
|
let component: MonitorComponent;
|
||||||
let fixture: ComponentFixture<MonitorComponent>;
|
let fixture: ComponentFixture<MonitorComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [MonitorComponent],
|
imports: [MonitorComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(MonitorComponent);
|
fixture = TestBed.createComponent(MonitorComponent);
|
||||||
|
|||||||
@@ -10,10 +10,9 @@ import {ConfigService} from '../../../services/config.service';
|
|||||||
import {songSwitch} from '../../../widget-modules/components/song-text/animation';
|
import {songSwitch} from '../../../widget-modules/components/song-text/animation';
|
||||||
import {TextRenderingService} from '../../songs/services/text-rendering.service';
|
import {TextRenderingService} from '../../songs/services/text-rendering.service';
|
||||||
import {PresentationBackground, Show} from '../../shows/services/show';
|
import {PresentationBackground, Show} from '../../shows/services/show';
|
||||||
import {GlobalSettings} from '../../../services/global-settings';
|
|
||||||
import {ShowSongService} from '../../shows/services/show-song.service';
|
import {ShowSongService} from '../../shows/services/show-song.service';
|
||||||
import {openFullscreen} from '../../../services/fullscreen';
|
import {openFullscreen} from '../../../services/fullscreen';
|
||||||
import { NgIf, AsyncPipe, DatePipe } from '@angular/common';
|
import {AsyncPipe, DatePipe, NgIf} from '@angular/common';
|
||||||
import {LogoComponent} from './logo/logo.component';
|
import {LogoComponent} from './logo/logo.component';
|
||||||
import {SongTextComponent} from '../../../widget-modules/components/song-text/song-text.component';
|
import {SongTextComponent} from '../../../widget-modules/components/song-text/song-text.component';
|
||||||
import {LegalComponent} from './legal/legal.component';
|
import {LegalComponent} from './legal/legal.component';
|
||||||
@@ -24,15 +23,7 @@ import { ShowTypePipe } from '../../../widget-modules/pipes/show-type-translater
|
|||||||
templateUrl: './monitor.component.html',
|
templateUrl: './monitor.component.html',
|
||||||
styleUrls: ['./monitor.component.less'],
|
styleUrls: ['./monitor.component.less'],
|
||||||
animations: [songSwitch],
|
animations: [songSwitch],
|
||||||
imports: [
|
imports: [NgIf, LogoComponent, SongTextComponent, LegalComponent, AsyncPipe, DatePipe, ShowTypePipe],
|
||||||
NgIf,
|
|
||||||
LogoComponent,
|
|
||||||
SongTextComponent,
|
|
||||||
LegalComponent,
|
|
||||||
AsyncPipe,
|
|
||||||
DatePipe,
|
|
||||||
ShowTypePipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class MonitorComponent implements OnInit {
|
export class MonitorComponent implements OnInit {
|
||||||
public song: Song | null = null;
|
public song: Song | null = null;
|
||||||
@@ -54,7 +45,7 @@ export class MonitorComponent implements OnInit {
|
|||||||
private textRenderingService: TextRenderingService,
|
private textRenderingService: TextRenderingService,
|
||||||
private globalSettingsService: GlobalSettingsService,
|
private globalSettingsService: GlobalSettingsService,
|
||||||
private configService: ConfigService,
|
private configService: ConfigService,
|
||||||
private cRef: ChangeDetectorRef,
|
private cRef: ChangeDetectorRef
|
||||||
) {
|
) {
|
||||||
this.config$ = configService.get$();
|
this.config$ = configService.get$();
|
||||||
}
|
}
|
||||||
@@ -65,15 +56,15 @@ export class MonitorComponent implements OnInit {
|
|||||||
.pipe(
|
.pipe(
|
||||||
debounceTime(100),
|
debounceTime(100),
|
||||||
filter(_ => !!_),
|
filter(_ => !!_),
|
||||||
map(_ => _ as GlobalSettings),
|
map(_ => _),
|
||||||
map(_ => _.currentShow),
|
map(_ => _.currentShow),
|
||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
tap(_ => (this.currentShowId = _)),
|
tap(_ => (this.currentShowId = _))
|
||||||
)
|
)
|
||||||
.pipe(
|
.pipe(
|
||||||
switchMap(_ => this.showService.read$(_)),
|
switchMap(_ => this.showService.read$(_)),
|
||||||
filter(_ => !!_),
|
filter(_ => !!_),
|
||||||
map(_ => _ as Show),
|
map(_ => _),
|
||||||
tap<Show>(_ => {
|
tap<Show>(_ => {
|
||||||
this.showType = _.showType;
|
this.showType = _.showType;
|
||||||
this.date = _.date.toDate();
|
this.date = _.date.toDate();
|
||||||
@@ -90,7 +81,7 @@ export class MonitorComponent implements OnInit {
|
|||||||
}),
|
}),
|
||||||
switchMap((_: Show) => this.showSongService.read$(_.id, _.presentationSongId)),
|
switchMap((_: Show) => this.showSongService.read$(_.id, _.presentationSongId)),
|
||||||
filter(_ => !!_),
|
filter(_ => !!_),
|
||||||
map(_ => _ as Song),
|
map(_ => _ as Song)
|
||||||
)
|
)
|
||||||
.subscribe(_ => {
|
.subscribe(_ => {
|
||||||
this.song = _;
|
this.song = _;
|
||||||
|
|||||||
@@ -28,5 +28,4 @@ const routes: Routes = [
|
|||||||
imports: [RouterModule.forChild(routes)],
|
imports: [RouterModule.forChild(routes)],
|
||||||
exports: [RouterModule],
|
exports: [RouterModule],
|
||||||
})
|
})
|
||||||
export class PresentationRoutingModule {
|
export class PresentationRoutingModule {}
|
||||||
}
|
|
||||||
|
|||||||
@@ -38,7 +38,11 @@ import {ShowTypePipe} from '../../widget-modules/pipes/show-type-translater/show
|
|||||||
AddSongComponent,
|
AddSongComponent,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
MatInputModule,
|
MatInputModule,
|
||||||
MonitorComponent, RemoteComponent, LegalComponent, LogoComponent, SelectComponent,
|
MonitorComponent,
|
||||||
|
RemoteComponent,
|
||||||
|
LegalComponent,
|
||||||
|
LogoComponent,
|
||||||
|
SelectComponent,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class PresentationModule {}
|
export class PresentationModule {}
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('RemoteComponent', () => {
|
|||||||
let component: RemoteComponent;
|
let component: RemoteComponent;
|
||||||
let fixture: ComponentFixture<RemoteComponent>;
|
let fixture: ComponentFixture<RemoteComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [RemoteComponent],
|
imports: [RemoteComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(RemoteComponent);
|
fixture = TestBed.createComponent(RemoteComponent);
|
||||||
|
|||||||
@@ -11,13 +11,12 @@ import {debounceTime, filter, map} from 'rxjs/operators';
|
|||||||
import {fade} from '../../../animations';
|
import {fade} from '../../../animations';
|
||||||
import {TextRenderingService} from '../../songs/services/text-rendering.service';
|
import {TextRenderingService} from '../../songs/services/text-rendering.service';
|
||||||
import {Section} from '../../songs/services/section';
|
import {Section} from '../../songs/services/section';
|
||||||
import {GlobalSettings} from '../../../services/global-settings';
|
|
||||||
import {LineType} from '../../songs/services/line-type';
|
import {LineType} from '../../songs/services/line-type';
|
||||||
import { NgIf, NgFor, AsyncPipe, DatePipe } from '@angular/common';
|
import {AsyncPipe, DatePipe, NgFor, NgIf} from '@angular/common';
|
||||||
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
||||||
import {MatFormField, MatLabel} from '@angular/material/form-field';
|
import {MatFormField, MatLabel} from '@angular/material/form-field';
|
||||||
import {MatInput} from '@angular/material/input';
|
import {MatInput} from '@angular/material/input';
|
||||||
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {MatButton} from '@angular/material/button';
|
import {MatButton} from '@angular/material/button';
|
||||||
import {RouterLink} from '@angular/router';
|
import {RouterLink} from '@angular/router';
|
||||||
import {FaIconComponent} from '@fortawesome/angular-fontawesome';
|
import {FaIconComponent} from '@fortawesome/angular-fontawesome';
|
||||||
@@ -81,12 +80,12 @@ export class RemoteComponent {
|
|||||||
private songService: SongService,
|
private songService: SongService,
|
||||||
private textRenderingService: TextRenderingService,
|
private textRenderingService: TextRenderingService,
|
||||||
globalSettingsService: GlobalSettingsService,
|
globalSettingsService: GlobalSettingsService,
|
||||||
private cRef: ChangeDetectorRef,
|
private cRef: ChangeDetectorRef
|
||||||
) {
|
) {
|
||||||
globalSettingsService.get$
|
globalSettingsService.get$
|
||||||
.pipe(
|
.pipe(
|
||||||
filter(_ => !!_),
|
filter(_ => !!_),
|
||||||
map(_ => _.currentShow),
|
map(_ => _.currentShow)
|
||||||
)
|
)
|
||||||
.subscribe(_ => {
|
.subscribe(_ => {
|
||||||
this.onShowChanged(_);
|
this.onShowChanged(_);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {Show} from '../../shows/services/show';
|
|||||||
import {GlobalSettingsService} from '../../../services/global-settings.service';
|
import {GlobalSettingsService} from '../../../services/global-settings.service';
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
import {fade} from '../../../animations';
|
import {fade} from '../../../animations';
|
||||||
import { NgIf, NgFor, AsyncPipe, DatePipe } from '@angular/common';
|
import {AsyncPipe, DatePipe, NgFor, NgIf} from '@angular/common';
|
||||||
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
||||||
import {MatButton} from '@angular/material/button';
|
import {MatButton} from '@angular/material/button';
|
||||||
import {UserNameComponent} from '../../../services/user/user-name/user-name.component';
|
import {UserNameComponent} from '../../../services/user/user-name/user-name.component';
|
||||||
@@ -16,16 +16,7 @@ import { ShowTypePipe } from '../../../widget-modules/pipes/show-type-translater
|
|||||||
templateUrl: './select.component.html',
|
templateUrl: './select.component.html',
|
||||||
styleUrls: ['./select.component.less'],
|
styleUrls: ['./select.component.less'],
|
||||||
animations: [fade],
|
animations: [fade],
|
||||||
imports: [
|
imports: [NgIf, CardComponent, NgFor, MatButton, UserNameComponent, AsyncPipe, DatePipe, ShowTypePipe],
|
||||||
NgIf,
|
|
||||||
CardComponent,
|
|
||||||
NgFor,
|
|
||||||
MatButton,
|
|
||||||
UserNameComponent,
|
|
||||||
AsyncPipe,
|
|
||||||
DatePipe,
|
|
||||||
ShowTypePipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class SelectComponent implements OnInit {
|
export class SelectComponent implements OnInit {
|
||||||
public visible = false;
|
public visible = false;
|
||||||
@@ -33,8 +24,11 @@ export class SelectComponent implements OnInit {
|
|||||||
.list$(true)
|
.list$(true)
|
||||||
.pipe(map(_ => _.filter(_ => _.date.toDate() > new Date(new Date().setMonth(new Date().getMonth() - 1))).sort((a, b) => (b.date < a.date ? -1 : b.date > a.date ? 1 : 0))));
|
.pipe(map(_ => _.filter(_ => _.date.toDate() > new Date(new Date().setMonth(new Date().getMonth() - 1))).sort((a, b) => (b.date < a.date ? -1 : b.date > a.date ? 1 : 0))));
|
||||||
|
|
||||||
public constructor(private showService: ShowService, private globalSettingsService: GlobalSettingsService, private router: Router) {
|
public constructor(
|
||||||
}
|
private showService: ShowService,
|
||||||
|
private globalSettingsService: GlobalSettingsService,
|
||||||
|
private router: Router
|
||||||
|
) {}
|
||||||
|
|
||||||
public async selectShow(show: Show) {
|
public async selectShow(show: Show) {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
|
|||||||
@@ -3,5 +3,4 @@ import {Injectable} from '@angular/core';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class PresentationService {
|
export class PresentationService {}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,19 +1,11 @@
|
|||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import { CdkScrollable } from '@angular/cdk/scrolling';
|
import {MatDialogActions, MatDialogClose, MatDialogContent} from '@angular/material/dialog';
|
||||||
import { MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog';
|
|
||||||
import {MatButton} from '@angular/material/button';
|
import {MatButton} from '@angular/material/button';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-archive-dialog',
|
selector: 'app-archive-dialog',
|
||||||
templateUrl: './archive-dialog.component.html',
|
templateUrl: './archive-dialog.component.html',
|
||||||
styleUrls: ['./archive-dialog.component.less'],
|
styleUrls: ['./archive-dialog.component.less'],
|
||||||
imports: [
|
imports: [MatDialogContent, MatDialogActions, MatButton, MatDialogClose],
|
||||||
CdkScrollable,
|
|
||||||
MatDialogContent,
|
|
||||||
MatDialogActions,
|
|
||||||
MatButton,
|
|
||||||
MatDialogClose,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class ArchiveDialogComponent {
|
export class ArchiveDialogComponent {}
|
||||||
}
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {ShowDataService} from '../services/show-data.service';
|
|||||||
import {Observable, take} from 'rxjs';
|
import {Observable, take} from 'rxjs';
|
||||||
import {Show} from '../services/show';
|
import {Show} from '../services/show';
|
||||||
import {ShowService} from '../services/show.service';
|
import {ShowService} from '../services/show.service';
|
||||||
import { FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
|
import {FormControl, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import {faSave} from '@fortawesome/free-solid-svg-icons';
|
import {faSave} from '@fortawesome/free-solid-svg-icons';
|
||||||
import {map, switchMap} from 'rxjs/operators';
|
import {map, switchMap} from 'rxjs/operators';
|
||||||
@@ -14,7 +14,7 @@ import { MatSelect } from '@angular/material/select';
|
|||||||
import {MatOptgroup, MatOption} from '@angular/material/core';
|
import {MatOptgroup, MatOption} from '@angular/material/core';
|
||||||
import {NgFor} from '@angular/common';
|
import {NgFor} from '@angular/common';
|
||||||
import {MatInput} from '@angular/material/input';
|
import {MatInput} from '@angular/material/input';
|
||||||
import { MatDatepickerInput, MatDatepickerToggle, MatDatepicker } from '@angular/material/datepicker';
|
import {MatDatepicker, MatDatepickerInput, MatDatepickerToggle} from '@angular/material/datepicker';
|
||||||
import {ButtonRowComponent} from '../../../widget-modules/components/button-row/button-row.component';
|
import {ButtonRowComponent} from '../../../widget-modules/components/button-row/button-row.component';
|
||||||
import {ButtonComponent} from '../../../widget-modules/components/button/button.component';
|
import {ButtonComponent} from '../../../widget-modules/components/button/button.component';
|
||||||
import {ShowTypePipe} from '../../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
import {ShowTypePipe} from '../../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
||||||
@@ -54,7 +54,12 @@ export class EditComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
public faSave = faSave;
|
public faSave = faSave;
|
||||||
|
|
||||||
public constructor(private showService: ShowService, showDataService: ShowDataService, private router: Router, private activatedRoute: ActivatedRoute) {
|
public constructor(
|
||||||
|
private showService: ShowService,
|
||||||
|
showDataService: ShowDataService,
|
||||||
|
private router: Router,
|
||||||
|
private activatedRoute: ActivatedRoute
|
||||||
|
) {
|
||||||
this.shows$ = showDataService.list$;
|
this.shows$ = showDataService.list$;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +71,7 @@ export class EditComponent implements OnInit {
|
|||||||
map(param => param as {showId: string}),
|
map(param => param as {showId: string}),
|
||||||
map(param => param.showId),
|
map(param => param.showId),
|
||||||
switchMap((showId: string) => this.showService.read$(showId)),
|
switchMap((showId: string) => this.showService.read$(showId)),
|
||||||
take(1),
|
take(1)
|
||||||
)
|
)
|
||||||
.subscribe(show => {
|
.subscribe(show => {
|
||||||
this.form.setValue({
|
this.form.setValue({
|
||||||
@@ -83,13 +88,10 @@ export class EditComponent implements OnInit {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.showService.update$(
|
await this.showService.update$(this.form.value.id, {
|
||||||
this.form.value.id as string,
|
|
||||||
{
|
|
||||||
date: Timestamp.fromDate(this.form.value.date),
|
date: Timestamp.fromDate(this.form.value.date),
|
||||||
showType: this.form.value.showType,
|
showType: this.form.value.showType,
|
||||||
} as Partial<Show>,
|
} as Partial<Show>);
|
||||||
);
|
|
||||||
await this.router.navigateByUrl(`/shows/${this.form.value.id ?? ''}`);
|
await this.router.navigateByUrl(`/shows/${this.form.value.id ?? ''}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {Component, Input} from '@angular/core';
|
import {Component, Input} from '@angular/core';
|
||||||
import {KeyValue, NgFor} from '@angular/common';
|
import {KeyValue, NgFor} from '@angular/common';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import { UntypedFormBuilder, UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
|
import {ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup} from '@angular/forms';
|
||||||
import {FilterValues} from './filter-values';
|
import {FilterValues} from './filter-values';
|
||||||
import {Show} from '../../services/show';
|
import {Show} from '../../services/show';
|
||||||
import {ShowService} from '../../services/show.service';
|
import {ShowService} from '../../services/show.service';
|
||||||
@@ -12,23 +12,14 @@ import {UserService} from '../../../../services/user/user.service';
|
|||||||
import {isEqual} from 'lodash';
|
import {isEqual} from 'lodash';
|
||||||
import {MatFormField, MatLabel} from '@angular/material/form-field';
|
import {MatFormField, MatLabel} from '@angular/material/form-field';
|
||||||
import {MatSelect} from '@angular/material/select';
|
import {MatSelect} from '@angular/material/select';
|
||||||
import { MatOption, MatOptgroup } from '@angular/material/core';
|
import {MatOptgroup, MatOption} from '@angular/material/core';
|
||||||
import {ShowTypePipe} from '../../../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
import {ShowTypePipe} from '../../../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-filter',
|
selector: 'app-filter',
|
||||||
templateUrl: './filter.component.html',
|
templateUrl: './filter.component.html',
|
||||||
styleUrls: ['./filter.component.less'],
|
styleUrls: ['./filter.component.less'],
|
||||||
imports: [
|
imports: [ReactiveFormsModule, MatFormField, MatLabel, MatSelect, NgFor, MatOption, MatOptgroup, ShowTypePipe],
|
||||||
ReactiveFormsModule,
|
|
||||||
MatFormField,
|
|
||||||
MatLabel,
|
|
||||||
MatSelect,
|
|
||||||
NgFor,
|
|
||||||
MatOption,
|
|
||||||
MatOptgroup,
|
|
||||||
ShowTypePipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class FilterComponent {
|
export class FilterComponent {
|
||||||
@Input() public route = '/shows/';
|
@Input() public route = '/shows/';
|
||||||
@@ -52,7 +43,7 @@ export class FilterComponent {
|
|||||||
private showService: ShowService,
|
private showService: ShowService,
|
||||||
private userService: UserService,
|
private userService: UserService,
|
||||||
activatedRoute: ActivatedRoute,
|
activatedRoute: ActivatedRoute,
|
||||||
fb: UntypedFormBuilder,
|
fb: UntypedFormBuilder
|
||||||
) {
|
) {
|
||||||
this.filterFormGroup = fb.group({
|
this.filterFormGroup = fb.group({
|
||||||
time: 1,
|
time: 1,
|
||||||
@@ -77,7 +68,7 @@ export class FilterComponent {
|
|||||||
this.showService.list$().pipe(
|
this.showService.list$().pipe(
|
||||||
map(shows => {
|
map(shows => {
|
||||||
return shows.map(show => show.owner).filter(onlyUnique);
|
return shows.map(show => show.owner).filter(onlyUnique);
|
||||||
}),
|
})
|
||||||
),
|
),
|
||||||
this.userService.users$,
|
this.userService.users$,
|
||||||
]).pipe(
|
]).pipe(
|
||||||
@@ -90,7 +81,7 @@ export class FilterComponent {
|
|||||||
.sort(dynamicSort('value'));
|
.sort(dynamicSort('value'));
|
||||||
}),
|
}),
|
||||||
distinctUntilChanged(isEqual),
|
distinctUntilChanged(isEqual),
|
||||||
map(_ => _ as {key: string; value: string}[]),
|
map(_ => _ as {key: string; value: string}[])
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('ListItemComponent', () => {
|
|||||||
let component: ListItemComponent;
|
let component: ListItemComponent;
|
||||||
let fixture: ComponentFixture<ListItemComponent>;
|
let fixture: ComponentFixture<ListItemComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [ListItemComponent],
|
imports: [ListItemComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(ListItemComponent);
|
fixture = TestBed.createComponent(ListItemComponent);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {Component, Input} from '@angular/core';
|
import {Component, Input} from '@angular/core';
|
||||||
import {Show} from '../../services/show';
|
import {Show} from '../../services/show';
|
||||||
import { NgIf, DatePipe } from '@angular/common';
|
import {DatePipe, NgIf} from '@angular/common';
|
||||||
import {UserNameComponent} from '../../../../services/user/user-name/user-name.component';
|
import {UserNameComponent} from '../../../../services/user/user-name/user-name.component';
|
||||||
import {ShowTypePipe} from '../../../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
import {ShowTypePipe} from '../../../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
||||||
|
|
||||||
@@ -8,12 +8,7 @@ import { ShowTypePipe } from '../../../../widget-modules/pipes/show-type-transla
|
|||||||
selector: 'app-list-item',
|
selector: 'app-list-item',
|
||||||
templateUrl: './list-item.component.html',
|
templateUrl: './list-item.component.html',
|
||||||
styleUrls: ['./list-item.component.less'],
|
styleUrls: ['./list-item.component.less'],
|
||||||
imports: [
|
imports: [NgIf, UserNameComponent, DatePipe, ShowTypePipe],
|
||||||
NgIf,
|
|
||||||
UserNameComponent,
|
|
||||||
DatePipe,
|
|
||||||
ShowTypePipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class ListItemComponent {
|
export class ListItemComponent {
|
||||||
@Input() public show: Show | null = null;
|
@Input() public show: Show | null = null;
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('ListComponent', () => {
|
|||||||
let component: ListComponent;
|
let component: ListComponent;
|
||||||
let fixture: ComponentFixture<ListComponent>;
|
let fixture: ComponentFixture<ListComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [ListComponent],
|
imports: [ListComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(ListComponent);
|
fixture = TestBed.createComponent(ListComponent);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { ActivatedRoute, RouterLink } from '@angular/router';
|
|||||||
import {map} from 'rxjs/operators';
|
import {map} from 'rxjs/operators';
|
||||||
import {RoleDirective} from '../../../services/user/role.directive';
|
import {RoleDirective} from '../../../services/user/role.directive';
|
||||||
import {ListHeaderComponent} from '../../../widget-modules/components/list-header/list-header.component';
|
import {ListHeaderComponent} from '../../../widget-modules/components/list-header/list-header.component';
|
||||||
import { NgIf, NgFor, AsyncPipe } from '@angular/common';
|
import {AsyncPipe, NgFor, NgIf} from '@angular/common';
|
||||||
import {FilterComponent} from './filter/filter.component';
|
import {FilterComponent} from './filter/filter.component';
|
||||||
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
||||||
import {ListItemComponent} from './list-item/list-item.component';
|
import {ListItemComponent} from './list-item/list-item.component';
|
||||||
@@ -19,18 +19,7 @@ import { SortByPipe } from '../../../widget-modules/pipes/sort-by/sort-by.pipe';
|
|||||||
templateUrl: './list.component.html',
|
templateUrl: './list.component.html',
|
||||||
styleUrls: ['./list.component.less'],
|
styleUrls: ['./list.component.less'],
|
||||||
animations: [fade],
|
animations: [fade],
|
||||||
imports: [
|
imports: [RoleDirective, ListHeaderComponent, NgIf, FilterComponent, CardComponent, NgFor, ListItemComponent, RouterLink, AsyncPipe, SortByPipe],
|
||||||
RoleDirective,
|
|
||||||
ListHeaderComponent,
|
|
||||||
NgIf,
|
|
||||||
FilterComponent,
|
|
||||||
CardComponent,
|
|
||||||
NgFor,
|
|
||||||
ListItemComponent,
|
|
||||||
RouterLink,
|
|
||||||
AsyncPipe,
|
|
||||||
SortByPipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class ListComponent {
|
export class ListComponent {
|
||||||
public shows$ = this.showService.list$();
|
public shows$ = this.showService.list$();
|
||||||
@@ -40,13 +29,13 @@ export class ListComponent {
|
|||||||
const filterValues = params as FilterValues;
|
const filterValues = params as FilterValues;
|
||||||
if (!filterValues?.time) return 1;
|
if (!filterValues?.time) return 1;
|
||||||
return +filterValues.time;
|
return +filterValues.time;
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
public owner$ = this.activatedRoute.queryParams.pipe(
|
public owner$ = this.activatedRoute.queryParams.pipe(
|
||||||
map(params => {
|
map(params => {
|
||||||
const filterValues = params as FilterValues;
|
const filterValues = params as FilterValues;
|
||||||
return filterValues?.owner;
|
return filterValues?.owner;
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
public publicShows$ = combineLatest([this.shows$, this.lastMonths$, this.owner$]).pipe(
|
public publicShows$ = combineLatest([this.shows$, this.lastMonths$, this.owner$]).pipe(
|
||||||
@@ -57,15 +46,14 @@ export class ListComponent {
|
|||||||
d.setMonth(d.getMonth() - lastMonths);
|
d.setMonth(d.getMonth() - lastMonths);
|
||||||
return f.published && f.date.toDate() >= d;
|
return f.published && f.date.toDate() >= d;
|
||||||
})
|
})
|
||||||
.filter(show => !owner || show.owner === owner),
|
.filter(show => !owner || show.owner === owner)
|
||||||
),
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
private showService: ShowService,
|
private showService: ShowService,
|
||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
public trackBy = (index: number, show: unknown) => (show as Show).id;
|
public trackBy = (index: number, show: unknown) => (show as Show).id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('NewComponent', () => {
|
|||||||
let component: NewComponent;
|
let component: NewComponent;
|
||||||
let fixture: ComponentFixture<NewComponent>;
|
let fixture: ComponentFixture<NewComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [NewComponent],
|
imports: [NewComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(NewComponent);
|
fixture = TestBed.createComponent(NewComponent);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {ShowDataService} from '../services/show-data.service';
|
|||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {Show} from '../services/show';
|
import {Show} from '../services/show';
|
||||||
import {ShowService} from '../services/show.service';
|
import {ShowService} from '../services/show.service';
|
||||||
import { UntypedFormControl, UntypedFormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
|
import {ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, Validators} from '@angular/forms';
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
import {faSave} from '@fortawesome/free-solid-svg-icons';
|
import {faSave} from '@fortawesome/free-solid-svg-icons';
|
||||||
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
||||||
@@ -12,7 +12,7 @@ import { MatSelect } from '@angular/material/select';
|
|||||||
import {MatOptgroup, MatOption} from '@angular/material/core';
|
import {MatOptgroup, MatOption} from '@angular/material/core';
|
||||||
import {NgFor} from '@angular/common';
|
import {NgFor} from '@angular/common';
|
||||||
import {MatInput} from '@angular/material/input';
|
import {MatInput} from '@angular/material/input';
|
||||||
import { MatDatepickerInput, MatDatepickerToggle, MatDatepicker } from '@angular/material/datepicker';
|
import {MatDatepicker, MatDatepickerInput, MatDatepickerToggle} from '@angular/material/datepicker';
|
||||||
import {ButtonRowComponent} from '../../../widget-modules/components/button-row/button-row.component';
|
import {ButtonRowComponent} from '../../../widget-modules/components/button-row/button-row.component';
|
||||||
import {ButtonComponent} from '../../../widget-modules/components/button/button.component';
|
import {ButtonComponent} from '../../../widget-modules/components/button/button.component';
|
||||||
import {ShowTypePipe} from '../../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
import {ShowTypePipe} from '../../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
||||||
@@ -53,7 +53,7 @@ export class NewComponent implements OnInit {
|
|||||||
public constructor(
|
public constructor(
|
||||||
private showService: ShowService,
|
private showService: ShowService,
|
||||||
showDataService: ShowDataService,
|
showDataService: ShowDataService,
|
||||||
private router: Router,
|
private router: Router
|
||||||
) {
|
) {
|
||||||
this.shows$ = showDataService.list$;
|
this.shows$ = showDataService.list$;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import {ShowService} from './show.service';
|
|||||||
import {ShowTypePipe} from '../../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
import {ShowTypePipe} from '../../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
||||||
import {ShowSongService} from './show-song.service';
|
import {ShowSongService} from './show-song.service';
|
||||||
import {Song} from '../../songs/services/song';
|
import {Song} from '../../songs/services/song';
|
||||||
import {SongService} from '../../songs/services/song.service';
|
|
||||||
import {ShowSong} from './show-song';
|
import {ShowSong} from './show-song';
|
||||||
import {Show} from './show';
|
import {Show} from './show';
|
||||||
import {ChordMode} from '../../../widget-modules/components/song-text/song-text.component';
|
import {ChordMode} from '../../../widget-modules/components/song-text/song-text.component';
|
||||||
@@ -32,7 +31,7 @@ export class DocxService {
|
|||||||
private showSongService: ShowSongService,
|
private showSongService: ShowSongService,
|
||||||
private textRenderingService: TextRenderingService,
|
private textRenderingService: TextRenderingService,
|
||||||
private userService: UserService,
|
private userService: UserService,
|
||||||
private configService: ConfigService,
|
private configService: ConfigService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public async create(showId: string, options: DownloadOptions = {}): Promise<void> {
|
public async create(showId: string, options: DownloadOptions = {}): Promise<void> {
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ export class ShowSongDataService {
|
|||||||
private collection = 'shows';
|
private collection = 'shows';
|
||||||
private subCollection = 'songs';
|
private subCollection = 'songs';
|
||||||
|
|
||||||
public constructor(private dbService: DbService) {
|
public constructor(private dbService: DbService) {}
|
||||||
}
|
|
||||||
|
|
||||||
public list$ = (showId: string, queryFn?: QueryFn): Observable<ShowSong[]> => this.dbService.col$(`${this.collection}/${showId}/${this.subCollection}`, queryFn);
|
public list$ = (showId: string, queryFn?: QueryFn): Observable<ShowSong[]> => this.dbService.col$(`${this.collection}/${showId}/${this.subCollection}`, queryFn);
|
||||||
public read$ = (showId: string, songId: string): Observable<ShowSong | null> => this.dbService.doc$(`${this.collection}/${showId}/${this.subCollection}/${songId}`);
|
public read$ = (showId: string, songId: string): Observable<ShowSong | null> => this.dbService.doc$(`${this.collection}/${showId}/${this.subCollection}/${songId}`);
|
||||||
|
|||||||
@@ -14,9 +14,8 @@ export class ShowSongService {
|
|||||||
private showSongDataService: ShowSongDataService,
|
private showSongDataService: ShowSongDataService,
|
||||||
private songDataService: SongDataService,
|
private songDataService: SongDataService,
|
||||||
private userService: UserService,
|
private userService: UserService,
|
||||||
private showService: ShowService,
|
private showService: ShowService
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
public async new$(showId: string, songId: string, addedLive = false): Promise<string | null> {
|
public async new$(showId: string, songId: string, addedLive = false): Promise<string | null> {
|
||||||
const song = await firstValueFrom(this.songDataService.read$(songId));
|
const song = await firstValueFrom(this.songDataService.read$(songId));
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ describe('ShowService', () => {
|
|||||||
() =>
|
() =>
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
providers: [{provide: ShowDataService, useValue: mockShowDataService}],
|
providers: [{provide: ShowDataService, useValue: mockShowDataService}],
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
ShowService.SHOW_TYPE_PUBLIC.forEach(type => {
|
ShowService.SHOW_TYPE_PUBLIC.forEach(type => {
|
||||||
|
|||||||
@@ -15,7 +15,10 @@ export class ShowService {
|
|||||||
public static SHOW_TYPE_PRIVATE = ['home-group', 'prayer-group', 'misc-private'];
|
public static SHOW_TYPE_PRIVATE = ['home-group', 'prayer-group', 'misc-private'];
|
||||||
private user: User | null = null;
|
private user: User | null = null;
|
||||||
|
|
||||||
public constructor(private showDataService: ShowDataService, private userService: UserService) {
|
public constructor(
|
||||||
|
private showDataService: ShowDataService,
|
||||||
|
private userService: UserService
|
||||||
|
) {
|
||||||
userService.user$.subscribe(_ => (this.user = _));
|
userService.user$.subscribe(_ => (this.user = _));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,14 +28,14 @@ export class ShowService {
|
|||||||
return this.userService.user$.pipe(
|
return this.userService.user$.pipe(
|
||||||
switchMap(
|
switchMap(
|
||||||
() => this.showDataService.list$,
|
() => this.showDataService.list$,
|
||||||
(user: User | null, shows: Show[]) => ({user, shows}),
|
(user: User | null, shows: Show[]) => ({user, shows})
|
||||||
),
|
),
|
||||||
map(s =>
|
map(s =>
|
||||||
s.shows
|
s.shows
|
||||||
.sort((a, b) => a.date.toMillis() - b.date.toMillis())
|
.sort((a, b) => a.date.toMillis() - b.date.toMillis())
|
||||||
.filter(_ => !_.archived)
|
.filter(_ => !_.archived)
|
||||||
.filter(show => show.published || (show.owner === s.user?.id && !publishedOnly)),
|
.filter(show => show.published || (show.owner === s.user?.id && !publishedOnly))
|
||||||
),
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,8 @@
|
|||||||
matTooltip="Swiper umschalten"></app-menu-button>
|
matTooltip="Swiper umschalten"></app-menu-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div (cdkDropListDropped)="drop($event, show)" *ngIf="showSongs && !useSwiper" [cdkDropListDisabled]="show.published || showText"
|
<div (cdkDropListDropped)="drop($event, show)" *ngIf="showSongs && !useSwiper"
|
||||||
|
[cdkDropListDisabled]="show.published || showText"
|
||||||
[style.cursor]="!(show.published || showText) ? 'drag' : 'inherit'"
|
[style.cursor]="!(show.published || showText) ? 'drag' : 'inherit'"
|
||||||
[style.font-size]="textSize + 'em'"
|
[style.font-size]="textSize + 'em'"
|
||||||
cdkDropList
|
cdkDropList
|
||||||
@@ -52,7 +53,9 @@
|
|||||||
[showText]="true"
|
[showText]="true"
|
||||||
[show]="show"
|
[show]="show"
|
||||||
></app-song>
|
></app-song>
|
||||||
<div class="next-song" *ngIf="getNextSong(orderedShowSongs(show), i) as next">{{next}}<fa-icon [icon]="faNextSong"></fa-icon></div>
|
<div *ngIf="getNextSong(orderedShowSongs(show), i) as next" class="next-song">{{ next }}
|
||||||
|
<fa-icon [icon]="faNextSong"></fa-icon>
|
||||||
|
</div>
|
||||||
</swiper-slide>
|
</swiper-slide>
|
||||||
</swiper-container>
|
</swiper-container>
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('ShowComponent', () => {
|
|||||||
let component: ShowComponent;
|
let component: ShowComponent;
|
||||||
let fixture: ComponentFixture<ShowComponent>;
|
let fixture: ComponentFixture<ShowComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [ShowComponent],
|
imports: [ShowComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(ShowComponent);
|
fixture = TestBed.createComponent(ShowComponent);
|
||||||
|
|||||||
@@ -25,18 +25,18 @@ import {
|
|||||||
faUser,
|
faUser,
|
||||||
faUsers,
|
faUsers,
|
||||||
} from '@fortawesome/free-solid-svg-icons';
|
} from '@fortawesome/free-solid-svg-icons';
|
||||||
import { CdkDragDrop, moveItemInArray, CdkDropList, CdkDrag } from '@angular/cdk/drag-drop';
|
import {CdkDrag, CdkDragDrop, CdkDropList, moveItemInArray} from '@angular/cdk/drag-drop';
|
||||||
import {fade} from '../../../animations';
|
import {fade} from '../../../animations';
|
||||||
import {MatDialog} from '@angular/material/dialog';
|
import {MatDialog} from '@angular/material/dialog';
|
||||||
import {ArchiveDialogComponent} from '../dialog/archive-dialog/archive-dialog.component';
|
import {ArchiveDialogComponent} from '../dialog/archive-dialog/archive-dialog.component';
|
||||||
import {closeFullscreen, openFullscreen} from '../../../services/fullscreen';
|
import {closeFullscreen, openFullscreen} from '../../../services/fullscreen';
|
||||||
import {GuestShowService} from '../../guest/guest-show.service';
|
import {GuestShowService} from '../../guest/guest-show.service';
|
||||||
import {ShareDialogComponent} from '../dialog/share-dialog/share-dialog.component';
|
import {ShareDialogComponent} from '../dialog/share-dialog/share-dialog.component';
|
||||||
import { NgIf, NgFor, AsyncPipe, DatePipe } from '@angular/common';
|
import {AsyncPipe, DatePipe, NgFor, NgIf} from '@angular/common';
|
||||||
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
||||||
import {UserNameComponent} from '../../../services/user/user-name/user-name.component';
|
import {UserNameComponent} from '../../../services/user/user-name/user-name.component';
|
||||||
import {MatCheckbox} from '@angular/material/checkbox';
|
import {MatCheckbox} from '@angular/material/checkbox';
|
||||||
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {MenuButtonComponent} from '../../../widget-modules/components/menu-button/menu-button.component';
|
import {MenuButtonComponent} from '../../../widget-modules/components/menu-button/menu-button.component';
|
||||||
import {MatTooltip} from '@angular/material/tooltip';
|
import {MatTooltip} from '@angular/material/tooltip';
|
||||||
import {SongComponent} from './song/song.component';
|
import {SongComponent} from './song/song.component';
|
||||||
@@ -46,7 +46,7 @@ import { ButtonRowComponent } from '../../../widget-modules/components/button-ro
|
|||||||
import {RoleDirective} from '../../../services/user/role.directive';
|
import {RoleDirective} from '../../../services/user/role.directive';
|
||||||
import {OwnerDirective} from '../../../services/user/owner.directive';
|
import {OwnerDirective} from '../../../services/user/owner.directive';
|
||||||
import {ButtonComponent} from '../../../widget-modules/components/button/button.component';
|
import {ButtonComponent} from '../../../widget-modules/components/button/button.component';
|
||||||
import { MatMenuTrigger, MatMenu } from '@angular/material/menu';
|
import {MatMenu, MatMenuTrigger} from '@angular/material/menu';
|
||||||
import {ShowTypePipe} from '../../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
import {ShowTypePipe} from '../../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -114,16 +114,15 @@ export class ShowComponent implements OnInit, OnDestroy {
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
private cRef: ChangeDetectorRef,
|
private cRef: ChangeDetectorRef,
|
||||||
public dialog: MatDialog,
|
public dialog: MatDialog,
|
||||||
private guestShowService: GuestShowService,
|
private guestShowService: GuestShowService
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
public ngOnInit(): void {
|
public ngOnInit(): void {
|
||||||
this.show$ = this.activatedRoute.params.pipe(
|
this.show$ = this.activatedRoute.params.pipe(
|
||||||
map(param => param as {showId: string}),
|
map(param => param as {showId: string}),
|
||||||
map(param => param.showId),
|
map(param => param.showId),
|
||||||
tap((_: string) => (this.showId = _)),
|
tap((_: string) => (this.showId = _)),
|
||||||
switchMap((showId: string) => this.showService.read$(showId)),
|
switchMap((showId: string) => this.showService.read$(showId))
|
||||||
);
|
);
|
||||||
this.subs.push(
|
this.subs.push(
|
||||||
this.activatedRoute.params
|
this.activatedRoute.params
|
||||||
@@ -131,7 +130,7 @@ export class ShowComponent implements OnInit, OnDestroy {
|
|||||||
map(param => param as {showId: string}),
|
map(param => param as {showId: string}),
|
||||||
map(param => param.showId),
|
map(param => param.showId),
|
||||||
switchMap(showId => this.showSongService.list$(showId)),
|
switchMap(showId => this.showSongService.list$(showId)),
|
||||||
filter(_ => !!_ && _.length > 0),
|
filter(_ => !!_ && _.length > 0)
|
||||||
)
|
)
|
||||||
.subscribe(_ => {
|
.subscribe(_ => {
|
||||||
this.showSongs = _;
|
this.showSongs = _;
|
||||||
@@ -143,7 +142,7 @@ export class ShowComponent implements OnInit, OnDestroy {
|
|||||||
.subscribe(_ => {
|
.subscribe(_ => {
|
||||||
this.songs = _;
|
this.songs = _;
|
||||||
this.cRef.markForCheck();
|
this.cRef.markForCheck();
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('SongComponent', () => {
|
|||||||
let component: SongComponent;
|
let component: SongComponent;
|
||||||
let fixture: ComponentFixture<SongComponent>;
|
let fixture: ComponentFixture<SongComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [SongComponent],
|
imports: [SongComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(SongComponent);
|
fixture = TestBed.createComponent(SongComponent);
|
||||||
|
|||||||
@@ -2,13 +2,13 @@ import {Component, Input, OnInit, ViewChild} from '@angular/core';
|
|||||||
import {ShowSongService} from '../../services/show-song.service';
|
import {ShowSongService} from '../../services/show-song.service';
|
||||||
import {ShowSong} from '../../services/show-song';
|
import {ShowSong} from '../../services/show-song';
|
||||||
import {getScale} from '../../../songs/services/key.helper';
|
import {getScale} from '../../../songs/services/key.helper';
|
||||||
import { UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
|
import {ReactiveFormsModule, UntypedFormControl} from '@angular/forms';
|
||||||
import {ChordMode, SongTextComponent} from '../../../../widget-modules/components/song-text/song-text.component';
|
import {ChordMode, SongTextComponent} from '../../../../widget-modules/components/song-text/song-text.component';
|
||||||
import {Show} from '../../services/show';
|
import {Show} from '../../services/show';
|
||||||
import {faEraser, faPenToSquare, faSave, faTrash} from '@fortawesome/free-solid-svg-icons';
|
import {faEraser, faPenToSquare, faSave, faTrash} from '@fortawesome/free-solid-svg-icons';
|
||||||
import {fade} from '../../../../animations';
|
import {fade} from '../../../../animations';
|
||||||
import {MatSelect} from '@angular/material/select';
|
import {MatSelect} from '@angular/material/select';
|
||||||
import { NgIf, NgFor } from '@angular/common';
|
import {NgFor, NgIf} from '@angular/common';
|
||||||
import {MatFormField, MatLabel} from '@angular/material/form-field';
|
import {MatFormField, MatLabel} from '@angular/material/form-field';
|
||||||
import {MatOption} from '@angular/material/core';
|
import {MatOption} from '@angular/material/core';
|
||||||
import {MenuButtonComponent} from '../../../../widget-modules/components/menu-button/menu-button.component';
|
import {MenuButtonComponent} from '../../../../widget-modules/components/menu-button/menu-button.component';
|
||||||
@@ -57,8 +57,7 @@ export class SongComponent implements OnInit {
|
|||||||
public editSongControl = new UntypedFormControl();
|
public editSongControl = new UntypedFormControl();
|
||||||
@ViewChild('option') private keyOptions: MatSelect;
|
@ViewChild('option') private keyOptions: MatSelect;
|
||||||
|
|
||||||
public constructor(private showSongService: ShowSongService) {
|
public constructor(private showSongService: ShowSongService) {}
|
||||||
}
|
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
public set showSong(song: ShowSong) {
|
public set showSong(song: ShowSong) {
|
||||||
|
|||||||
@@ -29,5 +29,4 @@ const routes: Routes = [
|
|||||||
imports: [RouterModule.forChild(routes)],
|
imports: [RouterModule.forChild(routes)],
|
||||||
exports: [RouterModule],
|
exports: [RouterModule],
|
||||||
})
|
})
|
||||||
export class ShowsRoutingModule {
|
export class ShowsRoutingModule {}
|
||||||
}
|
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
|
|||||||
|
|
||||||
import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
|
import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import {MatMenuModule} from '@angular/material/menu';
|
import {MatMenuModule} from '@angular/material/menu';
|
||||||
import {DragDropModule} from '@angular/cdk/drag-drop';
|
import {DragDropModule} from '@angular/cdk/drag-drop';
|
||||||
|
|
||||||
@@ -60,7 +58,14 @@ import {SortByPipe} from '../../widget-modules/pipes/sort-by/sort-by.pipe';
|
|||||||
SortByPipe,
|
SortByPipe,
|
||||||
MatTooltipModule,
|
MatTooltipModule,
|
||||||
MatDialogModule,
|
MatDialogModule,
|
||||||
NewComponent, ListComponent, ListItemComponent, ShowComponent, SongComponent, FilterComponent, EditComponent, ArchiveDialogComponent,
|
NewComponent,
|
||||||
|
ListComponent,
|
||||||
|
ListItemComponent,
|
||||||
|
ShowComponent,
|
||||||
|
SongComponent,
|
||||||
|
FilterComponent,
|
||||||
|
EditComponent,
|
||||||
|
ArchiveDialogComponent,
|
||||||
],
|
],
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ import {DbService} from '../../../services/db.service';
|
|||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class FileDataService {
|
export class FileDataService {
|
||||||
public constructor(private db: DbService) {
|
public constructor(private db: DbService) {}
|
||||||
}
|
|
||||||
|
|
||||||
public async set(songId: string, file: FileServer): Promise<string> {
|
public async set(songId: string, file: FileServer): Promise<string> {
|
||||||
const songRef = this.db.doc('songs/' + songId);
|
const songRef = this.db.doc('songs/' + songId);
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ import {FileDataService} from './file-data.service';
|
|||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class FileService {
|
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> {
|
public getDownloadUrl(path: string): Observable<string> {
|
||||||
const ref = this.storage.ref(path);
|
const ref = this.storage.ref(path);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ describe('SongDataService', () => {
|
|||||||
() =>
|
() =>
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
providers: [{provide: AngularFirestore, useValue: mockAngularFirestore}],
|
providers: [{provide: AngularFirestore, useValue: mockAngularFirestore}],
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
it('should be created', () => {
|
it('should be created', () => {
|
||||||
@@ -27,13 +27,10 @@ describe('SongDataService', () => {
|
|||||||
void expect(service).toBeTruthy();
|
void expect(service).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(
|
it('should list songs', waitForAsync(() => {
|
||||||
'should list songs',
|
|
||||||
waitForAsync(() => {
|
|
||||||
const service: SongDataService = TestBed.inject(SongDataService);
|
const service: SongDataService = TestBed.inject(SongDataService);
|
||||||
service.list$().subscribe(s => {
|
service.list$().subscribe(s => {
|
||||||
void expect(s[0].title).toEqual('title1');
|
void expect(s[0].title).toEqual('title1');
|
||||||
});
|
});
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ export class SongDataService {
|
|||||||
public constructor(private dbService: DbService) {
|
public constructor(private dbService: DbService) {
|
||||||
this.dbService.col$<Song>(this.collection).subscribe(_ => this.list$.next(_));
|
this.dbService.col$<Song>(this.collection).subscribe(_ => this.list$.next(_));
|
||||||
}
|
}
|
||||||
|
|
||||||
// public list$ = (): Observable<Song[]> => this.dbService.col$(this.collection);
|
// 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.dbService.doc$(this.collection + '/' + songId);
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ import {filter} from 'rxjs/operators';
|
|||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class SongListResolver {
|
export class SongListResolver {
|
||||||
public constructor(private songService: SongService) {
|
public constructor(private songService: SongService) {}
|
||||||
}
|
|
||||||
|
|
||||||
public resolve(): Observable<Song[]> {
|
public resolve(): Observable<Song[]> {
|
||||||
return this.songService.list$().pipe(filter(_ => _.length > 0));
|
return this.songService.list$().pipe(filter(_ => _.length > 0));
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ describe('SongService', () => {
|
|||||||
() =>
|
() =>
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
providers: [{provide: SongDataService, useValue: mockSongDataService}],
|
providers: [{provide: SongDataService, useValue: mockSongDataService}],
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
it('should be created', () => {
|
it('should be created', () => {
|
||||||
@@ -23,13 +23,10 @@ describe('SongService', () => {
|
|||||||
void expect(service).toBeTruthy();
|
void expect(service).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(
|
it('should list songs', waitForAsync(() => {
|
||||||
'should list songs',
|
|
||||||
waitForAsync(() => {
|
|
||||||
const service: SongService = TestBed.inject(SongService);
|
const service: SongService = TestBed.inject(SongService);
|
||||||
service.list$().subscribe(s => {
|
service.list$().subscribe(s => {
|
||||||
void expect(s[0].title).toEqual('title1');
|
void expect(s[0].title).toEqual('title1');
|
||||||
});
|
});
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export class SongService {
|
|||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
private songDataService: SongDataService,
|
private songDataService: SongDataService,
|
||||||
private userService: UserService,
|
private userService: UserService
|
||||||
) {
|
) {
|
||||||
// importCCLI = (songs: Song[]) => this.updateFromCLI(songs);
|
// importCCLI = (songs: Song[]) => this.updateFromCLI(songs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,10 @@ import {FileServer} from './fileServer';
|
|||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class UploadService extends FileBase {
|
export class UploadService extends FileBase {
|
||||||
public constructor(private fileDataService: FileDataService, private angularFireStorage: AngularFireStorage) {
|
public constructor(
|
||||||
|
private fileDataService: FileDataService,
|
||||||
|
private angularFireStorage: AngularFireStorage
|
||||||
|
) {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('FilterComponent', () => {
|
|||||||
let component: FilterComponent;
|
let component: FilterComponent;
|
||||||
let fixture: ComponentFixture<FilterComponent>;
|
let fixture: ComponentFixture<FilterComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [FilterComponent],
|
imports: [FilterComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(FilterComponent);
|
fixture = TestBed.createComponent(FilterComponent);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {Component, Input} from '@angular/core';
|
import {Component, Input} from '@angular/core';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
import { UntypedFormBuilder, UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
|
import {ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup} from '@angular/forms';
|
||||||
import {SongService} from '../../services/song.service';
|
import {SongService} from '../../services/song.service';
|
||||||
import {FilterValues} from './filter-values';
|
import {FilterValues} from './filter-values';
|
||||||
import {Song} from '../../services/song';
|
import {Song} from '../../services/song';
|
||||||
@@ -18,18 +18,7 @@ import { SongTypePipe } from '../../../../widget-modules/pipes/song-type-transla
|
|||||||
selector: 'app-filter',
|
selector: 'app-filter',
|
||||||
templateUrl: './filter.component.html',
|
templateUrl: './filter.component.html',
|
||||||
styleUrls: ['./filter.component.less'],
|
styleUrls: ['./filter.component.less'],
|
||||||
imports: [
|
imports: [ReactiveFormsModule, MatFormField, MatLabel, MatInput, MatSelect, MatOption, NgFor, LegalTypePipe, KeyPipe, SongTypePipe],
|
||||||
ReactiveFormsModule,
|
|
||||||
MatFormField,
|
|
||||||
MatLabel,
|
|
||||||
MatInput,
|
|
||||||
MatSelect,
|
|
||||||
MatOption,
|
|
||||||
NgFor,
|
|
||||||
LegalTypePipe,
|
|
||||||
KeyPipe,
|
|
||||||
SongTypePipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class FilterComponent {
|
export class FilterComponent {
|
||||||
public filterFormGroup: UntypedFormGroup;
|
public filterFormGroup: UntypedFormGroup;
|
||||||
@@ -39,7 +28,11 @@ export class FilterComponent {
|
|||||||
public legalType = SongService.LEGAL_TYPE;
|
public legalType = SongService.LEGAL_TYPE;
|
||||||
public keys = KEYS;
|
public keys = KEYS;
|
||||||
|
|
||||||
public constructor(private router: Router, activatedRoute: ActivatedRoute, fb: UntypedFormBuilder) {
|
public constructor(
|
||||||
|
private router: Router,
|
||||||
|
activatedRoute: ActivatedRoute,
|
||||||
|
fb: UntypedFormBuilder
|
||||||
|
) {
|
||||||
this.filterFormGroup = fb.group({
|
this.filterFormGroup = fb.group({
|
||||||
q: '',
|
q: '',
|
||||||
type: '',
|
type: '',
|
||||||
|
|||||||
@@ -15,15 +15,13 @@ describe('SongListComponent', () => {
|
|||||||
list: () => of(songs),
|
list: () => of(songs),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [SongListComponent],
|
imports: [SongListComponent],
|
||||||
providers: [{provide: SongService, useValue: mockSongService}],
|
providers: [{provide: SongService, useValue: mockSongService}],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(SongListComponent);
|
fixture = TestBed.createComponent(SongListComponent);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {filterSong} from '../../../services/filter.helper';
|
|||||||
import {FilterValues} from './filter/filter-values';
|
import {FilterValues} from './filter/filter-values';
|
||||||
import {ScrollService} from '../../../services/scroll.service';
|
import {ScrollService} from '../../../services/scroll.service';
|
||||||
import {faBalanceScaleRight, faCheck, faPencilRuler} from '@fortawesome/free-solid-svg-icons';
|
import {faBalanceScaleRight, faCheck, faPencilRuler} from '@fortawesome/free-solid-svg-icons';
|
||||||
import { NgIf, NgFor, AsyncPipe } from '@angular/common';
|
import {AsyncPipe, NgFor, NgIf} from '@angular/common';
|
||||||
import {ListHeaderComponent} from '../../../widget-modules/components/list-header/list-header.component';
|
import {ListHeaderComponent} from '../../../widget-modules/components/list-header/list-header.component';
|
||||||
import {FilterComponent} from './filter/filter.component';
|
import {FilterComponent} from './filter/filter.component';
|
||||||
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
||||||
@@ -22,17 +22,7 @@ import { FaIconComponent } from '@fortawesome/angular-fontawesome';
|
|||||||
styleUrls: ['./song-list.component.less'],
|
styleUrls: ['./song-list.component.less'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
animations: [fade],
|
animations: [fade],
|
||||||
imports: [
|
imports: [NgIf, ListHeaderComponent, FilterComponent, CardComponent, NgFor, RouterLink, RoleDirective, FaIconComponent, AsyncPipe],
|
||||||
NgIf,
|
|
||||||
ListHeaderComponent,
|
|
||||||
FilterComponent,
|
|
||||||
CardComponent,
|
|
||||||
NgFor,
|
|
||||||
RouterLink,
|
|
||||||
RoleDirective,
|
|
||||||
FaIconComponent,
|
|
||||||
AsyncPipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class SongListComponent implements OnInit, OnDestroy {
|
export class SongListComponent implements OnInit, OnDestroy {
|
||||||
public anyFilterActive = false;
|
public anyFilterActive = false;
|
||||||
@@ -40,7 +30,7 @@ export class SongListComponent implements OnInit, OnDestroy {
|
|||||||
this.activatedRoute.queryParams.pipe(map(_ => _ as FilterValues)),
|
this.activatedRoute.queryParams.pipe(map(_ => _ as FilterValues)),
|
||||||
this.activatedRoute.data.pipe(
|
this.activatedRoute.data.pipe(
|
||||||
map(data => data.songList as Song[]),
|
map(data => data.songList as Song[]),
|
||||||
map(songs => songs.sort((a, b) => a.number - b.number)),
|
map(songs => songs.sort((a, b) => a.number - b.number))
|
||||||
),
|
),
|
||||||
]).pipe(
|
]).pipe(
|
||||||
map(_ => {
|
map(_ => {
|
||||||
@@ -48,14 +38,17 @@ export class SongListComponent implements OnInit, OnDestroy {
|
|||||||
const filter = _[0];
|
const filter = _[0];
|
||||||
this.anyFilterActive = this.checkIfFilterActive(filter);
|
this.anyFilterActive = this.checkIfFilterActive(filter);
|
||||||
return songs.filter(song => this.filter(song, filter)).sort((a, b) => a.title?.localeCompare(b.title));
|
return songs.filter(song => this.filter(song, filter)).sort((a, b) => a.title?.localeCompare(b.title));
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
public faLegal = faBalanceScaleRight;
|
public faLegal = faBalanceScaleRight;
|
||||||
public faDraft = faPencilRuler;
|
public faDraft = faPencilRuler;
|
||||||
public faFinal = faCheck;
|
public faFinal = faCheck;
|
||||||
|
|
||||||
public constructor(private songService: SongService, private activatedRoute: ActivatedRoute, private scrollService: ScrollService) {
|
public constructor(
|
||||||
}
|
private songService: SongService,
|
||||||
|
private activatedRoute: ActivatedRoute,
|
||||||
|
private scrollService: ScrollService
|
||||||
|
) {}
|
||||||
|
|
||||||
public ngOnInit(): void {
|
public ngOnInit(): void {
|
||||||
setTimeout(() => this.scrollService.restoreScrollPositionFor('songlist'), 100);
|
setTimeout(() => this.scrollService.restoreScrollPositionFor('songlist'), 100);
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('EditFileComponent', () => {
|
|||||||
let component: EditFileComponent;
|
let component: EditFileComponent;
|
||||||
let fixture: ComponentFixture<EditFileComponent>;
|
let fixture: ComponentFixture<EditFileComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [EditFileComponent],
|
imports: [EditFileComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(EditFileComponent);
|
fixture = TestBed.createComponent(EditFileComponent);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {FileDataService} from '../../../services/file-data.service';
|
|||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {File} from '../../../services/file';
|
import {File} from '../../../services/file';
|
||||||
import {CardComponent} from '../../../../../widget-modules/components/card/card.component';
|
import {CardComponent} from '../../../../../widget-modules/components/card/card.component';
|
||||||
import { NgIf, NgStyle, NgFor, AsyncPipe } from '@angular/common';
|
import {AsyncPipe, NgFor, NgIf, NgStyle} from '@angular/common';
|
||||||
import {MatIconButton} from '@angular/material/button';
|
import {MatIconButton} from '@angular/material/button';
|
||||||
import {MatIcon} from '@angular/material/icon';
|
import {MatIcon} from '@angular/material/icon';
|
||||||
import {FileComponent} from './file/file.component';
|
import {FileComponent} from './file/file.component';
|
||||||
@@ -16,16 +16,7 @@ import { FileComponent } from './file/file.component';
|
|||||||
selector: 'app-edit-file',
|
selector: 'app-edit-file',
|
||||||
templateUrl: './edit-file.component.html',
|
templateUrl: './edit-file.component.html',
|
||||||
styleUrls: ['./edit-file.component.less'],
|
styleUrls: ['./edit-file.component.less'],
|
||||||
imports: [
|
imports: [CardComponent, NgIf, NgStyle, MatIconButton, MatIcon, NgFor, FileComponent, AsyncPipe],
|
||||||
CardComponent,
|
|
||||||
NgIf,
|
|
||||||
NgStyle,
|
|
||||||
MatIconButton,
|
|
||||||
MatIcon,
|
|
||||||
NgFor,
|
|
||||||
FileComponent,
|
|
||||||
AsyncPipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class EditFileComponent {
|
export class EditFileComponent {
|
||||||
public selectedFiles: FileList | null = null;
|
public selectedFiles: FileList | null = null;
|
||||||
@@ -33,11 +24,15 @@ export class EditFileComponent {
|
|||||||
public songId: string | null = null;
|
public songId: string | null = null;
|
||||||
public files$: Observable<File[]>;
|
public files$: Observable<File[]>;
|
||||||
|
|
||||||
public constructor(private activatedRoute: ActivatedRoute, private uploadService: UploadService, private fileService: FileDataService) {
|
public constructor(
|
||||||
|
private activatedRoute: ActivatedRoute,
|
||||||
|
private uploadService: UploadService,
|
||||||
|
private fileService: FileDataService
|
||||||
|
) {
|
||||||
this.activatedRoute.params
|
this.activatedRoute.params
|
||||||
.pipe(
|
.pipe(
|
||||||
map(param => param as {songId: string}),
|
map(param => param as {songId: string}),
|
||||||
map(param => param.songId),
|
map(param => param.songId)
|
||||||
)
|
)
|
||||||
.subscribe(songId => {
|
.subscribe(songId => {
|
||||||
this.songId = songId;
|
this.songId = songId;
|
||||||
@@ -46,7 +41,7 @@ export class EditFileComponent {
|
|||||||
this.files$ = this.activatedRoute.params.pipe(
|
this.files$ = this.activatedRoute.params.pipe(
|
||||||
map(param => param as {songId: string}),
|
map(param => param as {songId: string}),
|
||||||
map(param => param.songId),
|
map(param => param.songId),
|
||||||
switchMap(songId => this.fileService.read$(songId)),
|
switchMap(songId => this.fileService.read$(songId))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('FileComponent', () => {
|
|||||||
let component: FileComponent;
|
let component: FileComponent;
|
||||||
let fixture: ComponentFixture<FileComponent>;
|
let fixture: ComponentFixture<FileComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [FileComponent],
|
imports: [FileComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(FileComponent);
|
fixture = TestBed.createComponent(FileComponent);
|
||||||
|
|||||||
@@ -11,11 +11,7 @@ import { AsyncPipe } from '@angular/common';
|
|||||||
selector: 'app-file',
|
selector: 'app-file',
|
||||||
templateUrl: './file.component.html',
|
templateUrl: './file.component.html',
|
||||||
styleUrls: ['./file.component.less'],
|
styleUrls: ['./file.component.less'],
|
||||||
imports: [
|
imports: [MatIconButton, FaIconComponent, AsyncPipe],
|
||||||
MatIconButton,
|
|
||||||
FaIconComponent,
|
|
||||||
AsyncPipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class FileComponent {
|
export class FileComponent {
|
||||||
public url$: Observable<string> | null = null;
|
public url$: Observable<string> | null = null;
|
||||||
@@ -25,8 +21,7 @@ export class FileComponent {
|
|||||||
private fileId: string | null = null;
|
private fileId: string | null = null;
|
||||||
private path: string | null = null;
|
private path: string | null = null;
|
||||||
|
|
||||||
public constructor(private fileService: FileService) {
|
public constructor(private fileService: FileService) {}
|
||||||
}
|
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
public set file(file: File) {
|
public set file(file: File) {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export class EditSongGuard {
|
|||||||
component: EditComponent,
|
component: EditComponent,
|
||||||
currentRoute: ActivatedRouteSnapshot,
|
currentRoute: ActivatedRouteSnapshot,
|
||||||
currentState: RouterStateSnapshot,
|
currentState: RouterStateSnapshot,
|
||||||
nextState: RouterStateSnapshot,
|
nextState: RouterStateSnapshot
|
||||||
): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||||
return component.editSongComponent ? component.editSongComponent.askForSave(nextState) : true;
|
return component.editSongComponent ? component.editSongComponent.askForSave(nextState) : true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('EditSongComponent', () => {
|
|||||||
let component: EditSongComponent;
|
let component: EditSongComponent;
|
||||||
let fixture: ComponentFixture<EditSongComponent>;
|
let fixture: ComponentFixture<EditSongComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [EditSongComponent],
|
imports: [EditSongComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(EditSongComponent);
|
fixture = TestBed.createComponent(EditSongComponent);
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
import {Component, OnInit} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import {Song} from '../../../services/song';
|
import {Song} from '../../../services/song';
|
||||||
import { UntypedFormGroup, ReactiveFormsModule } from '@angular/forms';
|
import {ReactiveFormsModule, UntypedFormGroup} from '@angular/forms';
|
||||||
import {ActivatedRoute, Router, RouterStateSnapshot} from '@angular/router';
|
import {ActivatedRoute, Router, RouterStateSnapshot} from '@angular/router';
|
||||||
import {SongService} from '../../../services/song.service';
|
import {SongService} from '../../../services/song.service';
|
||||||
import {EditService} from '../edit.service';
|
import {EditService} from '../edit.service';
|
||||||
import {first, map, switchMap} from 'rxjs/operators';
|
import {first, map, switchMap} from 'rxjs/operators';
|
||||||
import {KEYS} from '../../../services/key.helper';
|
import {KEYS} from '../../../services/key.helper';
|
||||||
import {COMMA, ENTER} from '@angular/cdk/keycodes';
|
import {COMMA, ENTER} from '@angular/cdk/keycodes';
|
||||||
import { MatChipInputEvent, MatChipGrid, MatChipRow, MatChipInput } from '@angular/material/chips';
|
import {MatChipGrid, MatChipInput, MatChipInputEvent, MatChipRow} from '@angular/material/chips';
|
||||||
import {faExternalLinkAlt, faSave, faTimesCircle} from '@fortawesome/free-solid-svg-icons';
|
import {faExternalLinkAlt, faSave, faTimesCircle} from '@fortawesome/free-solid-svg-icons';
|
||||||
import {MatDialog} from '@angular/material/dialog';
|
import {MatDialog} from '@angular/material/dialog';
|
||||||
import {SaveDialogComponent} from './save-dialog/save-dialog.component';
|
import {SaveDialogComponent} from './save-dialog/save-dialog.component';
|
||||||
import { NgIf, NgFor } from '@angular/common';
|
import {NgFor, NgIf} from '@angular/common';
|
||||||
import {CardComponent} from '../../../../../widget-modules/components/card/card.component';
|
import {CardComponent} from '../../../../../widget-modules/components/card/card.component';
|
||||||
import {MatFormField, MatLabel, MatSuffix} from '@angular/material/form-field';
|
import {MatFormField, MatLabel, MatSuffix} from '@angular/material/form-field';
|
||||||
import {MatInput} from '@angular/material/input';
|
import {MatInput} from '@angular/material/input';
|
||||||
@@ -80,9 +80,8 @@ export class EditSongComponent implements OnInit {
|
|||||||
private songService: SongService,
|
private songService: SongService,
|
||||||
private editService: EditService,
|
private editService: EditService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
public dialog: MatDialog,
|
public dialog: MatDialog
|
||||||
) {
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
public ngOnInit(): void {
|
public ngOnInit(): void {
|
||||||
this.activatedRoute.params
|
this.activatedRoute.params
|
||||||
@@ -90,7 +89,7 @@ export class EditSongComponent implements OnInit {
|
|||||||
map(param => param as {songId: string}),
|
map(param => param as {songId: string}),
|
||||||
map(param => param.songId),
|
map(param => param.songId),
|
||||||
switchMap(songId => this.songService.read$(songId)),
|
switchMap(songId => this.songService.read$(songId)),
|
||||||
first(),
|
first()
|
||||||
)
|
)
|
||||||
.subscribe(song => {
|
.subscribe(song => {
|
||||||
this.song = song;
|
this.song = song;
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('SaveDialogComponent', () => {
|
|||||||
let component: SaveDialogComponent;
|
let component: SaveDialogComponent;
|
||||||
let fixture: ComponentFixture<SaveDialogComponent>;
|
let fixture: ComponentFixture<SaveDialogComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
declarations: [SaveDialogComponent],
|
declarations: [SaveDialogComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(SaveDialogComponent);
|
fixture = TestBed.createComponent(SaveDialogComponent);
|
||||||
|
|||||||
@@ -4,7 +4,5 @@ import {Component} from '@angular/core';
|
|||||||
selector: 'app-save-dialog',
|
selector: 'app-save-dialog',
|
||||||
templateUrl: './save-dialog.component.html',
|
templateUrl: './save-dialog.component.html',
|
||||||
styleUrls: ['./save-dialog.component.less'],
|
styleUrls: ['./save-dialog.component.less'],
|
||||||
standalone: false,
|
|
||||||
})
|
})
|
||||||
export class SaveDialogComponent {
|
export class SaveDialogComponent {}
|
||||||
}
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('EditComponent', () => {
|
|||||||
let component: EditComponent;
|
let component: EditComponent;
|
||||||
let fixture: ComponentFixture<EditComponent>;
|
let fixture: ComponentFixture<EditComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [EditComponent],
|
imports: [EditComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(EditComponent);
|
fixture = TestBed.createComponent(EditComponent);
|
||||||
|
|||||||
@@ -7,11 +7,7 @@ import { HistoryComponent } from './history/history.component';
|
|||||||
selector: 'app-edit',
|
selector: 'app-edit',
|
||||||
templateUrl: './edit.component.html',
|
templateUrl: './edit.component.html',
|
||||||
styleUrls: ['./edit.component.less'],
|
styleUrls: ['./edit.component.less'],
|
||||||
imports: [
|
imports: [EditSongComponent, EditFileComponent, HistoryComponent],
|
||||||
EditSongComponent,
|
|
||||||
EditFileComponent,
|
|
||||||
HistoryComponent,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class EditComponent {
|
export class EditComponent {
|
||||||
@ViewChild(EditSongComponent) public editSongComponent: EditSongComponent | null = null;
|
@ViewChild(EditSongComponent) public editSongComponent: EditSongComponent | null = null;
|
||||||
|
|||||||
@@ -50,7 +50,11 @@ import {StatusPipe} from '../../../../widget-modules/pipes/status-translater/sta
|
|||||||
MatTooltipModule,
|
MatTooltipModule,
|
||||||
MatDialogModule,
|
MatDialogModule,
|
||||||
SongTextComponent,
|
SongTextComponent,
|
||||||
EditComponent, EditSongComponent, EditFileComponent, FileComponent, HistoryComponent,
|
EditComponent,
|
||||||
|
EditSongComponent,
|
||||||
|
EditFileComponent,
|
||||||
|
FileComponent,
|
||||||
|
HistoryComponent,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class EditModule {}
|
export class EditModule {}
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('HistoryComponent', () => {
|
|||||||
let component: HistoryComponent;
|
let component: HistoryComponent;
|
||||||
let fixture: ComponentFixture<HistoryComponent>;
|
let fixture: ComponentFixture<HistoryComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [HistoryComponent],
|
imports: [HistoryComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(HistoryComponent);
|
fixture = TestBed.createComponent(HistoryComponent);
|
||||||
|
|||||||
@@ -3,25 +3,22 @@ import {first, map, switchMap} from 'rxjs/operators';
|
|||||||
import {ActivatedRoute} from '@angular/router';
|
import {ActivatedRoute} from '@angular/router';
|
||||||
import {SongService} from '../../../services/song.service';
|
import {SongService} from '../../../services/song.service';
|
||||||
import {Song} from '../../../services/song';
|
import {Song} from '../../../services/song';
|
||||||
import { NgIf, NgFor, DatePipe } from '@angular/common';
|
import {DatePipe, NgFor, NgIf} from '@angular/common';
|
||||||
import {CardComponent} from '../../../../../widget-modules/components/card/card.component';
|
import {CardComponent} from '../../../../../widget-modules/components/card/card.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-history',
|
selector: 'app-history',
|
||||||
templateUrl: './history.component.html',
|
templateUrl: './history.component.html',
|
||||||
styleUrls: ['./history.component.less'],
|
styleUrls: ['./history.component.less'],
|
||||||
imports: [
|
imports: [NgIf, CardComponent, NgFor, DatePipe],
|
||||||
NgIf,
|
|
||||||
CardComponent,
|
|
||||||
NgFor,
|
|
||||||
DatePipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class HistoryComponent implements OnInit {
|
export class HistoryComponent implements OnInit {
|
||||||
public song: Song | null = null;
|
public song: Song | null = null;
|
||||||
|
|
||||||
public constructor(private activatedRoute: ActivatedRoute, private songService: SongService) {
|
public constructor(
|
||||||
}
|
private activatedRoute: ActivatedRoute,
|
||||||
|
private songService: SongService
|
||||||
|
) {}
|
||||||
|
|
||||||
public ngOnInit(): void {
|
public ngOnInit(): void {
|
||||||
this.activatedRoute.params
|
this.activatedRoute.params
|
||||||
@@ -29,7 +26,7 @@ export class HistoryComponent implements OnInit {
|
|||||||
map(param => param as {songId: string}),
|
map(param => param as {songId: string}),
|
||||||
map(param => param.songId),
|
map(param => param.songId),
|
||||||
switchMap(songId => this.songService.read$(songId)),
|
switchMap(songId => this.songService.read$(songId)),
|
||||||
first(),
|
first()
|
||||||
)
|
)
|
||||||
.subscribe(song => {
|
.subscribe(song => {
|
||||||
this.song = song;
|
this.song = song;
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('FileComponent', () => {
|
|||||||
let component: FileComponent;
|
let component: FileComponent;
|
||||||
let fixture: ComponentFixture<FileComponent>;
|
let fixture: ComponentFixture<FileComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [FileComponent],
|
imports: [FileComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(FileComponent);
|
fixture = TestBed.createComponent(FileComponent);
|
||||||
|
|||||||
@@ -14,8 +14,7 @@ export class FileComponent {
|
|||||||
public url$: Observable<string> | null = null;
|
public url$: Observable<string> | null = null;
|
||||||
public name = '';
|
public name = '';
|
||||||
|
|
||||||
public constructor(private storage: AngularFireStorage) {
|
public constructor(private storage: AngularFireStorage) {}
|
||||||
}
|
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
public set file(file: File) {
|
public set file(file: File) {
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('NewComponent', () => {
|
|||||||
let component: NewComponent;
|
let component: NewComponent;
|
||||||
let fixture: ComponentFixture<NewComponent>;
|
let fixture: ComponentFixture<NewComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [NewComponent],
|
imports: [NewComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(NewComponent);
|
fixture = TestBed.createComponent(NewComponent);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {Component, OnDestroy, OnInit} from '@angular/core';
|
import {Component, OnDestroy, OnInit} from '@angular/core';
|
||||||
import {faSave} from '@fortawesome/free-solid-svg-icons';
|
import {faSave} from '@fortawesome/free-solid-svg-icons';
|
||||||
import { UntypedFormControl, UntypedFormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
|
import {ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, Validators} from '@angular/forms';
|
||||||
import {SongService} from '../../services/song.service';
|
import {SongService} from '../../services/song.service';
|
||||||
import {Song} from '../../services/song';
|
import {Song} from '../../services/song';
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
@@ -15,15 +15,7 @@ import { ButtonComponent } from '../../../../widget-modules/components/button/bu
|
|||||||
selector: 'app-new',
|
selector: 'app-new',
|
||||||
templateUrl: './new.component.html',
|
templateUrl: './new.component.html',
|
||||||
styleUrls: ['./new.component.less'],
|
styleUrls: ['./new.component.less'],
|
||||||
imports: [
|
imports: [CardComponent, ReactiveFormsModule, MatFormField, MatLabel, MatInput, ButtonRowComponent, ButtonComponent],
|
||||||
CardComponent,
|
|
||||||
ReactiveFormsModule,
|
|
||||||
MatFormField,
|
|
||||||
MatLabel,
|
|
||||||
MatInput,
|
|
||||||
ButtonRowComponent,
|
|
||||||
ButtonComponent,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class NewComponent implements OnInit, OnDestroy {
|
export class NewComponent implements OnInit, OnDestroy {
|
||||||
public faSave = faSave;
|
public faSave = faSave;
|
||||||
@@ -33,8 +25,10 @@ export class NewComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
private subs: Subscription[] = [];
|
private subs: Subscription[] = [];
|
||||||
|
|
||||||
public constructor(private songService: SongService, private router: Router) {
|
public constructor(
|
||||||
}
|
private songService: SongService,
|
||||||
|
private router: Router
|
||||||
|
) {}
|
||||||
|
|
||||||
public ngOnInit(): void {
|
public ngOnInit(): void {
|
||||||
this.form.reset();
|
this.form.reset();
|
||||||
@@ -43,7 +37,7 @@ export class NewComponent implements OnInit, OnDestroy {
|
|||||||
this.songService.list$().subscribe(songs => {
|
this.songService.list$().subscribe(songs => {
|
||||||
const freeSongnumber = this.getFreeSongNumber(songs);
|
const freeSongnumber = this.getFreeSongNumber(songs);
|
||||||
this.form.controls.number.setValue(freeSongnumber);
|
this.form.controls.number.setValue(freeSongnumber);
|
||||||
}),
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,14 +12,12 @@ describe('SongComponent', () => {
|
|||||||
params: of({songId: '4711'}),
|
params: of({songId: '4711'}),
|
||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [SongComponent],
|
imports: [SongComponent],
|
||||||
providers: [{provide: ActivatedRoute, useValue: mockActivatedRoute}],
|
providers: [{provide: ActivatedRoute, useValue: mockActivatedRoute}],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(SongComponent);
|
fixture = TestBed.createComponent(SongComponent);
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ import {faEdit, faFileCirclePlus, faTrash} from '@fortawesome/free-solid-svg-ico
|
|||||||
import {ShowService} from '../../shows/services/show.service';
|
import {ShowService} from '../../shows/services/show.service';
|
||||||
import {Show} from '../../shows/services/show';
|
import {Show} from '../../shows/services/show';
|
||||||
import {ShowSongService} from '../../shows/services/show-song.service';
|
import {ShowSongService} from '../../shows/services/show-song.service';
|
||||||
import { NgIf, NgFor, AsyncPipe, DatePipe } from '@angular/common';
|
import {AsyncPipe, DatePipe, NgFor, NgIf} from '@angular/common';
|
||||||
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
||||||
import {RoleDirective} from '../../../services/user/role.directive';
|
import {RoleDirective} from '../../../services/user/role.directive';
|
||||||
import {SongTextComponent} from '../../../widget-modules/components/song-text/song-text.component';
|
import {SongTextComponent} from '../../../widget-modules/components/song-text/song-text.component';
|
||||||
import {MatChipListbox, MatChipOption} from '@angular/material/chips';
|
import {MatChipListbox, MatChipOption} from '@angular/material/chips';
|
||||||
import {ButtonRowComponent} from '../../../widget-modules/components/button-row/button-row.component';
|
import {ButtonRowComponent} from '../../../widget-modules/components/button-row/button-row.component';
|
||||||
import {ButtonComponent} from '../../../widget-modules/components/button/button.component';
|
import {ButtonComponent} from '../../../widget-modules/components/button/button.component';
|
||||||
import { MatMenuTrigger, MatMenu } from '@angular/material/menu';
|
import {MatMenu, MatMenuTrigger} from '@angular/material/menu';
|
||||||
import {FileComponent} from './file/file.component';
|
import {FileComponent} from './file/file.component';
|
||||||
import {SongTypePipe} from '../../../widget-modules/pipes/song-type-translater/song-type.pipe';
|
import {SongTypePipe} from '../../../widget-modules/pipes/song-type-translater/song-type.pipe';
|
||||||
import {LegalOwnerPipe} from '../../../widget-modules/pipes/legal-owner-translator/legal-owner.pipe';
|
import {LegalOwnerPipe} from '../../../widget-modules/pipes/legal-owner-translator/legal-owner.pipe';
|
||||||
@@ -68,7 +68,7 @@ export class SongComponent implements OnInit {
|
|||||||
private userService: UserService,
|
private userService: UserService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private showService: ShowService,
|
private showService: ShowService,
|
||||||
private showSongService: ShowSongService,
|
private showSongService: ShowSongService
|
||||||
) {
|
) {
|
||||||
this.user$ = userService.user$;
|
this.user$ = userService.user$;
|
||||||
}
|
}
|
||||||
@@ -77,13 +77,13 @@ export class SongComponent implements OnInit {
|
|||||||
this.song$ = this.activatedRoute.params.pipe(
|
this.song$ = this.activatedRoute.params.pipe(
|
||||||
map(param => param as {songId: string}),
|
map(param => param as {songId: string}),
|
||||||
map(param => param.songId),
|
map(param => param.songId),
|
||||||
switchMap(songId => this.songService.read$(songId)),
|
switchMap(songId => this.songService.read$(songId))
|
||||||
);
|
);
|
||||||
|
|
||||||
this.files$ = this.activatedRoute.params.pipe(
|
this.files$ = this.activatedRoute.params.pipe(
|
||||||
map(param => param as {songId: string}),
|
map(param => param as {songId: string}),
|
||||||
map(param => param.songId),
|
map(param => param.songId),
|
||||||
switchMap(songId => this.fileService.read$(songId)),
|
switchMap(songId => this.fileService.read$(songId))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,6 +111,6 @@ export class SongComponent implements OnInit {
|
|||||||
map(([user, song]) => {
|
map(([user, song]) => {
|
||||||
return user.songUsage[song.id];
|
return user.songUsage[song.id];
|
||||||
}),
|
}),
|
||||||
distinctUntilChanged(),
|
distinctUntilChanged()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,5 +33,4 @@ const routes: Routes = [
|
|||||||
imports: [RouterModule.forChild(routes)],
|
imports: [RouterModule.forChild(routes)],
|
||||||
exports: [RouterModule],
|
exports: [RouterModule],
|
||||||
})
|
})
|
||||||
export class SongsRoutingModule {
|
export class SongsRoutingModule {}
|
||||||
}
|
|
||||||
|
|||||||
@@ -3,13 +3,10 @@ import {CommonModule} from '@angular/common';
|
|||||||
|
|
||||||
import {SongsRoutingModule} from './songs-routing.module';
|
import {SongsRoutingModule} from './songs-routing.module';
|
||||||
|
|
||||||
|
|
||||||
import {EditModule} from './song/edit/edit.module';
|
import {EditModule} from './song/edit/edit.module';
|
||||||
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [],
|
declarations: [],
|
||||||
imports: [CommonModule, SongsRoutingModule, EditModule],
|
imports: [CommonModule, SongsRoutingModule, EditModule],
|
||||||
})
|
})
|
||||||
export class SongsModule {
|
export class SongsModule {}
|
||||||
}
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('InfoComponent', () => {
|
|||||||
let component: InfoComponent;
|
let component: InfoComponent;
|
||||||
let fixture: ComponentFixture<InfoComponent>;
|
let fixture: ComponentFixture<InfoComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [InfoComponent],
|
imports: [InfoComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(InfoComponent);
|
fixture = TestBed.createComponent(InfoComponent);
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import {ChordMode} from '../../../widget-modules/components/song-text/song-text.
|
|||||||
import {faSignOutAlt} from '@fortawesome/free-solid-svg-icons';
|
import {faSignOutAlt} from '@fortawesome/free-solid-svg-icons';
|
||||||
import {RolePipe} from './role.pipe';
|
import {RolePipe} from './role.pipe';
|
||||||
import {roles} from '../../../services/user/roles';
|
import {roles} from '../../../services/user/roles';
|
||||||
import { NgIf, AsyncPipe } from '@angular/common';
|
import {AsyncPipe, NgIf} from '@angular/common';
|
||||||
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
||||||
import { MatFormField, MatLabel, MatHint } from '@angular/material/form-field';
|
import {MatFormField, MatHint, MatLabel} from '@angular/material/form-field';
|
||||||
import {MatSelect} from '@angular/material/select';
|
import {MatSelect} from '@angular/material/select';
|
||||||
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {MatOption} from '@angular/material/core';
|
import {MatOption} from '@angular/material/core';
|
||||||
import {ButtonRowComponent} from '../../../widget-modules/components/button-row/button-row.component';
|
import {ButtonRowComponent} from '../../../widget-modules/components/button-row/button-row.component';
|
||||||
import {ButtonComponent} from '../../../widget-modules/components/button/button.component';
|
import {ButtonComponent} from '../../../widget-modules/components/button/button.component';
|
||||||
@@ -44,8 +44,7 @@ export class InfoComponent implements OnInit {
|
|||||||
public user$: Observable<User | null> | null = null;
|
public user$: Observable<User | null> | null = null;
|
||||||
public faSignOut = faSignOutAlt;
|
public faSignOut = faSignOutAlt;
|
||||||
|
|
||||||
public constructor(private userService: UserService) {
|
public constructor(private userService: UserService) {}
|
||||||
}
|
|
||||||
|
|
||||||
public ngOnInit(): void {
|
public ngOnInit(): void {
|
||||||
this.user$ = this.userService.user$;
|
this.user$ = this.userService.user$;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {Pipe, PipeTransform} from '@angular/core';
|
import {Pipe, PipeTransform} from '@angular/core';
|
||||||
import {roles} from '../../../services/user/roles';
|
import {roles} from '../../../services/user/roles';
|
||||||
|
|
||||||
@Pipe({ name: 'role', })
|
@Pipe({name: 'role'})
|
||||||
export class RolePipe implements PipeTransform {
|
export class RolePipe implements PipeTransform {
|
||||||
public transform(role: roles): string {
|
public transform(role: roles): string {
|
||||||
switch (role) {
|
switch (role) {
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('UserComponent', () => {
|
|||||||
let component: UserComponent;
|
let component: UserComponent;
|
||||||
let fixture: ComponentFixture<UserComponent>;
|
let fixture: ComponentFixture<UserComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [UserComponent],
|
imports: [UserComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(UserComponent);
|
fixture = TestBed.createComponent(UserComponent);
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ import {User} from '../../../../../services/user/user';
|
|||||||
import {UserService} from '../../../../../services/user/user.service';
|
import {UserService} from '../../../../../services/user/user.service';
|
||||||
import {ROLE_TYPES} from '../../../../../services/user/roles';
|
import {ROLE_TYPES} from '../../../../../services/user/roles';
|
||||||
import {faTimes} from '@fortawesome/free-solid-svg-icons';
|
import {faTimes} from '@fortawesome/free-solid-svg-icons';
|
||||||
import { NgIf, NgFor } from '@angular/common';
|
import {NgFor, NgIf} from '@angular/common';
|
||||||
import {MatFormField, MatLabel} from '@angular/material/form-field';
|
import {MatFormField, MatLabel} from '@angular/material/form-field';
|
||||||
import {MatInput} from '@angular/material/input';
|
import {MatInput} from '@angular/material/input';
|
||||||
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {MatSelect} from '@angular/material/select';
|
import {MatSelect} from '@angular/material/select';
|
||||||
import {MatOption} from '@angular/material/core';
|
import {MatOption} from '@angular/material/core';
|
||||||
import {MatIconButton} from '@angular/material/button';
|
import {MatIconButton} from '@angular/material/button';
|
||||||
@@ -17,20 +17,7 @@ import { RolePipe } from '../../role.pipe';
|
|||||||
selector: 'app-user',
|
selector: 'app-user',
|
||||||
templateUrl: './user.component.html',
|
templateUrl: './user.component.html',
|
||||||
styleUrls: ['./user.component.less'],
|
styleUrls: ['./user.component.less'],
|
||||||
imports: [
|
imports: [NgIf, MatFormField, MatLabel, MatInput, ReactiveFormsModule, FormsModule, MatSelect, NgFor, MatOption, MatIconButton, FaIconComponent, RolePipe],
|
||||||
NgIf,
|
|
||||||
MatFormField,
|
|
||||||
MatLabel,
|
|
||||||
MatInput,
|
|
||||||
ReactiveFormsModule,
|
|
||||||
FormsModule,
|
|
||||||
MatSelect,
|
|
||||||
NgFor,
|
|
||||||
MatOption,
|
|
||||||
MatIconButton,
|
|
||||||
FaIconComponent,
|
|
||||||
RolePipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class UserComponent {
|
export class UserComponent {
|
||||||
public id = '';
|
public id = '';
|
||||||
@@ -40,8 +27,7 @@ export class UserComponent {
|
|||||||
public edit = false;
|
public edit = false;
|
||||||
public faClose = faTimes;
|
public faClose = faTimes;
|
||||||
|
|
||||||
public constructor(private userService: UserService) {
|
public constructor(private userService: UserService) {}
|
||||||
}
|
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
public set user(value: User) {
|
public set user(value: User) {
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('UsersComponent', () => {
|
|||||||
let component: UsersComponent;
|
let component: UsersComponent;
|
||||||
let fixture: ComponentFixture<UsersComponent>;
|
let fixture: ComponentFixture<UsersComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [UsersComponent],
|
imports: [UsersComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(UsersComponent);
|
fixture = TestBed.createComponent(UsersComponent);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {UserService} from '../../../../services/user/user.service';
|
|||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {User} from '../../../../services/user/user';
|
import {User} from '../../../../services/user/user';
|
||||||
import {CardComponent} from '../../../../widget-modules/components/card/card.component';
|
import {CardComponent} from '../../../../widget-modules/components/card/card.component';
|
||||||
import { NgFor, AsyncPipe } from '@angular/common';
|
import {AsyncPipe, NgFor} from '@angular/common';
|
||||||
import {UserComponent} from './user/user.component';
|
import {UserComponent} from './user/user.component';
|
||||||
import {SortByPipe} from '../../../../widget-modules/pipes/sort-by/sort-by.pipe';
|
import {SortByPipe} from '../../../../widget-modules/pipes/sort-by/sort-by.pipe';
|
||||||
|
|
||||||
@@ -11,13 +11,7 @@ import { SortByPipe } from '../../../../widget-modules/pipes/sort-by/sort-by.pip
|
|||||||
selector: 'app-users',
|
selector: 'app-users',
|
||||||
templateUrl: './users.component.html',
|
templateUrl: './users.component.html',
|
||||||
styleUrls: ['./users.component.less'],
|
styleUrls: ['./users.component.less'],
|
||||||
imports: [
|
imports: [CardComponent, NgFor, UserComponent, AsyncPipe, SortByPipe],
|
||||||
CardComponent,
|
|
||||||
NgFor,
|
|
||||||
UserComponent,
|
|
||||||
AsyncPipe,
|
|
||||||
SortByPipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class UsersComponent {
|
export class UsersComponent {
|
||||||
public users$: Observable<User[]>;
|
public users$: Observable<User[]>;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {Pipe, PipeTransform} from '@angular/core';
|
import {Pipe, PipeTransform} from '@angular/core';
|
||||||
|
|
||||||
@Pipe({ name: 'authMessage', })
|
@Pipe({name: 'authMessage'})
|
||||||
export class AuthMessagePipe implements PipeTransform {
|
export class AuthMessagePipe implements PipeTransform {
|
||||||
public transform(code: string): string {
|
public transform(code: string): string {
|
||||||
switch (code) {
|
switch (code) {
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('LoginComponent', () => {
|
|||||||
let component: LoginComponent;
|
let component: LoginComponent;
|
||||||
let fixture: ComponentFixture<LoginComponent>;
|
let fixture: ComponentFixture<LoginComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [LoginComponent],
|
imports: [LoginComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(LoginComponent);
|
fixture = TestBed.createComponent(LoginComponent);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Component, OnInit} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import { UntypedFormControl, UntypedFormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
|
import {ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, Validators} from '@angular/forms';
|
||||||
import {Router, RouterLink} from '@angular/router';
|
import {Router, RouterLink} from '@angular/router';
|
||||||
import {UserService} from '../../../services/user/user.service';
|
import {UserService} from '../../../services/user/user.service';
|
||||||
import {faSignInAlt, faUserPlus} from '@fortawesome/free-solid-svg-icons';
|
import {faSignInAlt, faUserPlus} from '@fortawesome/free-solid-svg-icons';
|
||||||
@@ -14,17 +14,7 @@ import { AuthMessagePipe } from './auth-message.pipe';
|
|||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
templateUrl: './login.component.html',
|
templateUrl: './login.component.html',
|
||||||
styleUrls: ['./login.component.less'],
|
styleUrls: ['./login.component.less'],
|
||||||
imports: [
|
imports: [LogoComponent, ReactiveFormsModule, MatFormField, MatLabel, MatInput, NgIf, MatButton, RouterLink, AuthMessagePipe],
|
||||||
LogoComponent,
|
|
||||||
ReactiveFormsModule,
|
|
||||||
MatFormField,
|
|
||||||
MatLabel,
|
|
||||||
MatInput,
|
|
||||||
NgIf,
|
|
||||||
MatButton,
|
|
||||||
RouterLink,
|
|
||||||
AuthMessagePipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class LoginComponent implements OnInit {
|
export class LoginComponent implements OnInit {
|
||||||
public form: UntypedFormGroup = new UntypedFormGroup({
|
public form: UntypedFormGroup = new UntypedFormGroup({
|
||||||
@@ -35,8 +25,10 @@ export class LoginComponent implements OnInit {
|
|||||||
public faSignIn = faSignInAlt;
|
public faSignIn = faSignInAlt;
|
||||||
public faNewUser = faUserPlus;
|
public faNewUser = faUserPlus;
|
||||||
|
|
||||||
public constructor(private userService: UserService, private router: Router) {
|
public constructor(
|
||||||
}
|
private userService: UserService,
|
||||||
|
private router: Router
|
||||||
|
) {}
|
||||||
|
|
||||||
public ngOnInit(): void {
|
public ngOnInit(): void {
|
||||||
this.form.reset;
|
this.form.reset;
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('LogoutComponent', () => {
|
|||||||
let component: LogoutComponent;
|
let component: LogoutComponent;
|
||||||
let fixture: ComponentFixture<LogoutComponent>;
|
let fixture: ComponentFixture<LogoutComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [LogoutComponent],
|
imports: [LogoutComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(LogoutComponent);
|
fixture = TestBed.createComponent(LogoutComponent);
|
||||||
|
|||||||
@@ -8,8 +8,10 @@ import {UserService} from '../../../services/user/user.service';
|
|||||||
styleUrls: ['./logout.component.less'],
|
styleUrls: ['./logout.component.less'],
|
||||||
})
|
})
|
||||||
export class LogoutComponent implements AfterViewInit {
|
export class LogoutComponent implements AfterViewInit {
|
||||||
public constructor(private userService: UserService, private router: Router) {
|
public constructor(
|
||||||
}
|
private userService: UserService,
|
||||||
|
private router: Router
|
||||||
|
) {}
|
||||||
|
|
||||||
public async ngAfterViewInit(): Promise<void> {
|
public async ngAfterViewInit(): Promise<void> {
|
||||||
await this.userService.logout();
|
await this.userService.logout();
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('NewComponent', () => {
|
|||||||
let component: NewComponent;
|
let component: NewComponent;
|
||||||
let fixture: ComponentFixture<NewComponent>;
|
let fixture: ComponentFixture<NewComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [NewComponent],
|
imports: [NewComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(NewComponent);
|
fixture = TestBed.createComponent(NewComponent);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Component, OnInit} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
|
import {ReactiveFormsModule, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators} from '@angular/forms';
|
||||||
import {UserService} from '../../../services/user/user.service';
|
import {UserService} from '../../../services/user/user.service';
|
||||||
import {faUserPlus} from '@fortawesome/free-solid-svg-icons';
|
import {faUserPlus} from '@fortawesome/free-solid-svg-icons';
|
||||||
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
import {CardComponent} from '../../../widget-modules/components/card/card.component';
|
||||||
@@ -12,15 +12,7 @@ import { ButtonComponent } from '../../../widget-modules/components/button/butto
|
|||||||
selector: 'app-new',
|
selector: 'app-new',
|
||||||
templateUrl: './new.component.html',
|
templateUrl: './new.component.html',
|
||||||
styleUrls: ['./new.component.less'],
|
styleUrls: ['./new.component.less'],
|
||||||
imports: [
|
imports: [CardComponent, ReactiveFormsModule, MatFormField, MatLabel, MatInput, ButtonRowComponent, ButtonComponent],
|
||||||
CardComponent,
|
|
||||||
ReactiveFormsModule,
|
|
||||||
MatFormField,
|
|
||||||
MatLabel,
|
|
||||||
MatInput,
|
|
||||||
ButtonRowComponent,
|
|
||||||
ButtonComponent,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class NewComponent implements OnInit {
|
export class NewComponent implements OnInit {
|
||||||
public form: UntypedFormGroup = this.fb.group({
|
public form: UntypedFormGroup = this.fb.group({
|
||||||
@@ -30,8 +22,10 @@ export class NewComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
public faNewUser = faUserPlus;
|
public faNewUser = faUserPlus;
|
||||||
|
|
||||||
public constructor(private fb: UntypedFormBuilder, private userService: UserService) {
|
public constructor(
|
||||||
}
|
private fb: UntypedFormBuilder,
|
||||||
|
private userService: UserService
|
||||||
|
) {}
|
||||||
|
|
||||||
public ngOnInit(): void {
|
public ngOnInit(): void {
|
||||||
this.form.reset();
|
this.form.reset();
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('PasswordSendComponent', () => {
|
|||||||
let component: PasswordSendComponent;
|
let component: PasswordSendComponent;
|
||||||
let fixture: ComponentFixture<PasswordSendComponent>;
|
let fixture: ComponentFixture<PasswordSendComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [PasswordSendComponent],
|
imports: [PasswordSendComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(PasswordSendComponent);
|
fixture = TestBed.createComponent(PasswordSendComponent);
|
||||||
|
|||||||
@@ -7,5 +7,4 @@ import { CardComponent } from '../../../widget-modules/components/card/card.comp
|
|||||||
styleUrls: ['./password-send.component.less'],
|
styleUrls: ['./password-send.component.less'],
|
||||||
imports: [CardComponent],
|
imports: [CardComponent],
|
||||||
})
|
})
|
||||||
export class PasswordSendComponent {
|
export class PasswordSendComponent {}
|
||||||
}
|
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ describe('PasswordComponent', () => {
|
|||||||
let component: PasswordComponent;
|
let component: PasswordComponent;
|
||||||
let fixture: ComponentFixture<PasswordComponent>;
|
let fixture: ComponentFixture<PasswordComponent>;
|
||||||
|
|
||||||
beforeEach(
|
beforeEach(waitForAsync(() => {
|
||||||
waitForAsync(() => {
|
|
||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
imports: [PasswordComponent],
|
imports: [PasswordComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}),
|
}));
|
||||||
);
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fixture = TestBed.createComponent(PasswordComponent);
|
fixture = TestBed.createComponent(PasswordComponent);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Component, OnInit} from '@angular/core';
|
import {Component, OnInit} from '@angular/core';
|
||||||
import { UntypedFormControl, UntypedFormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
|
import {ReactiveFormsModule, UntypedFormControl, UntypedFormGroup, Validators} from '@angular/forms';
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
import {UserService} from '../../../services/user/user.service';
|
import {UserService} from '../../../services/user/user.service';
|
||||||
import {faWindowRestore} from '@fortawesome/free-solid-svg-icons';
|
import {faWindowRestore} from '@fortawesome/free-solid-svg-icons';
|
||||||
@@ -15,17 +15,7 @@ import { AuthMessagePipe } from '../login/auth-message.pipe';
|
|||||||
selector: 'app-password',
|
selector: 'app-password',
|
||||||
templateUrl: './password.component.html',
|
templateUrl: './password.component.html',
|
||||||
styleUrls: ['./password.component.less'],
|
styleUrls: ['./password.component.less'],
|
||||||
imports: [
|
imports: [CardComponent, ReactiveFormsModule, MatFormField, MatLabel, MatInput, ButtonRowComponent, ButtonComponent, NgIf, AuthMessagePipe],
|
||||||
CardComponent,
|
|
||||||
ReactiveFormsModule,
|
|
||||||
MatFormField,
|
|
||||||
MatLabel,
|
|
||||||
MatInput,
|
|
||||||
ButtonRowComponent,
|
|
||||||
ButtonComponent,
|
|
||||||
NgIf,
|
|
||||||
AuthMessagePipe,
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
export class PasswordComponent implements OnInit {
|
export class PasswordComponent implements OnInit {
|
||||||
public form: UntypedFormGroup = new UntypedFormGroup({
|
public form: UntypedFormGroup = new UntypedFormGroup({
|
||||||
@@ -35,8 +25,10 @@ export class PasswordComponent implements OnInit {
|
|||||||
public errorMessage = '';
|
public errorMessage = '';
|
||||||
public faNewPassword = faWindowRestore;
|
public faNewPassword = faWindowRestore;
|
||||||
|
|
||||||
public constructor(public userService: UserService, private router: Router) {
|
public constructor(
|
||||||
}
|
public userService: UserService,
|
||||||
|
private router: Router
|
||||||
|
) {}
|
||||||
|
|
||||||
public ngOnInit(): void {
|
public ngOnInit(): void {
|
||||||
this.form.reset();
|
this.form.reset();
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import {UsersComponent} from './info/users/users.component';
|
|||||||
import {UserComponent} from './info/users/user/user.component';
|
import {UserComponent} from './info/users/user/user.component';
|
||||||
import {NewComponent} from './new/new.component';
|
import {NewComponent} from './new/new.component';
|
||||||
|
|
||||||
|
|
||||||
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
|
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
|
||||||
import {SortByPipe} from '../../widget-modules/pipes/sort-by/sort-by.pipe';
|
import {SortByPipe} from '../../widget-modules/pipes/sort-by/sort-by.pipe';
|
||||||
|
|
||||||
@@ -36,7 +35,16 @@ import {SortByPipe} from '../../widget-modules/pipes/sort-by/sort-by.pipe';
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
FontAwesomeModule,
|
FontAwesomeModule,
|
||||||
SortByPipe,
|
SortByPipe,
|
||||||
LoginComponent, AuthMessagePipe, InfoComponent, LogoutComponent, RolePipe, PasswordComponent, PasswordSendComponent, UsersComponent, UserComponent, NewComponent,
|
LoginComponent,
|
||||||
|
AuthMessagePipe,
|
||||||
|
InfoComponent,
|
||||||
|
LogoutComponent,
|
||||||
|
RolePipe,
|
||||||
|
PasswordComponent,
|
||||||
|
PasswordSendComponent,
|
||||||
|
UsersComponent,
|
||||||
|
UserComponent,
|
||||||
|
NewComponent,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class UserModule {}
|
export class UserModule {}
|
||||||
|
|||||||
@@ -7,10 +7,8 @@ import {Config} from './config';
|
|||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class ConfigService {
|
export class ConfigService {
|
||||||
public constructor(private db: DbService) {
|
public constructor(private db: DbService) {}
|
||||||
}
|
|
||||||
|
|
||||||
public get$ = (): Observable<Config | null> => this.db.doc$<Config>('global/config');
|
public get$ = (): Observable<Config | null> => this.db.doc$<Config>('global/config');
|
||||||
public get = (): Promise<Config | null> => firstValueFrom(this.get$());
|
public get = (): Promise<Config | null> => firstValueFrom(this.get$());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ type DocumentPredicate<T> = string | AngularFirestoreDocument<T>;
|
|||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class DbService {
|
export class DbService {
|
||||||
public constructor(private afs: AngularFirestore) {
|
public constructor(private afs: AngularFirestore) {}
|
||||||
}
|
|
||||||
|
|
||||||
public col<T>(ref: CollectionPredicate<T>, queryFn?: QueryFn): AngularFirestoreCollection<T> {
|
public col<T>(ref: CollectionPredicate<T>, queryFn?: QueryFn): AngularFirestoreCollection<T> {
|
||||||
return typeof ref === 'string' ? this.afs.collection<T>(ref, queryFn) : ref;
|
return typeof ref === 'string' ? this.afs.collection<T>(ref, queryFn) : ref;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {filterSong} from './filter.helper';
|
|||||||
describe('Filter Helper', () => {
|
describe('Filter Helper', () => {
|
||||||
const song: Song = {
|
const song: Song = {
|
||||||
title: 'Song Title',
|
title: 'Song Title',
|
||||||
text: 'This is a songtext, aa?bb!cc,dd.ee\'ff',
|
text: "This is a songtext, aa?bb!cc,dd.ee'ff",
|
||||||
legalOwner: '',
|
legalOwner: '',
|
||||||
label: '',
|
label: '',
|
||||||
id: '',
|
id: '',
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user