diff --git a/src/app/modules/presentation/monitor/legal/legal.component.html b/src/app/modules/presentation/monitor/legal/legal.component.html index 9bd9a5e..0294809 100644 --- a/src/app/modules/presentation/monitor/legal/legal.component.html +++ b/src/app/modules/presentation/monitor/legal/legal.component.html @@ -1,14 +1,10 @@ -
-

CCLI-Liednummer {{song.legalOwnerId}}

-

Liednummer {{song.legalOwnerId}}

-
-

{{song.artist}}

{{song.label}}

{{song.termsOfUse}}

{{song.origin}}

-
-

CCLI-Lizenznummer {{song.legalLicenseId}}

-

Lizenznummer {{song.legalLicenseId}}

+
+

CCLI-Liednummer {{song.legalOwnerId}}, + CCLI-Lizenznummer {{config.ccliLicenseId}}

+

Liednummer {{song.legalOwnerId}}

diff --git a/src/app/modules/presentation/monitor/legal/legal.component.ts b/src/app/modules/presentation/monitor/legal/legal.component.ts index 26c2738..dfe4687 100644 --- a/src/app/modules/presentation/monitor/legal/legal.component.ts +++ b/src/app/modules/presentation/monitor/legal/legal.component.ts @@ -1,5 +1,6 @@ import {Component, Input} from '@angular/core'; import {Song} from '../../../songs/services/song'; +import {Config} from '../../../../services/config'; @Component({ selector: 'app-legal', @@ -8,4 +9,5 @@ import {Song} from '../../../songs/services/song'; }) export class LegalComponent { @Input() public song: Song; + @Input() public config: Config; } diff --git a/src/app/modules/presentation/monitor/monitor.component.html b/src/app/modules/presentation/monitor/monitor.component.html index dd51db8..0962639 100644 --- a/src/app/modules/presentation/monitor/monitor.component.html +++ b/src/app/modules/presentation/monitor/monitor.component.html @@ -1,5 +1,5 @@
- +
diff --git a/src/app/modules/presentation/monitor/monitor.component.ts b/src/app/modules/presentation/monitor/monitor.component.ts index 6ecfb5d..6f7de2a 100644 --- a/src/app/modules/presentation/monitor/monitor.component.ts +++ b/src/app/modules/presentation/monitor/monitor.component.ts @@ -5,6 +5,9 @@ import {SongService} from '../../songs/services/song.service'; import {Section, TextRenderingService} from '../../songs/services/text-rendering.service'; import {Song} from '../../songs/services/song'; import {GlobalSettingsService} from '../../../services/global-settings.service'; +import {Config} from '../../../services/config'; +import {Observable} from 'rxjs'; +import {ConfigService} from '../../../services/config.service'; @Component({ selector: 'app-monitor', @@ -16,13 +19,16 @@ export class MonitorComponent implements OnInit { public zoom: number; public index: number; private sections: Section[]; + private config$: Observable; constructor( private showService: ShowService, private songService: SongService, private textRenderingService: TextRenderingService, private globalSettingsService: GlobalSettingsService, + private configService: ConfigService, ) { + this.config$ = configService.get$; } ngOnInit(): void { diff --git a/src/app/modules/songs/services/song.ts b/src/app/modules/songs/services/song.ts index 2c07e1f..42556ec 100644 --- a/src/app/modules/songs/services/song.ts +++ b/src/app/modules/songs/services/song.ts @@ -15,7 +15,6 @@ export interface Song { legalLink: string; legalOwner: string; legalOwnerId: string; - legalLicenseId: string; artist: string; label: string; diff --git a/src/app/modules/songs/song/edit/edit.service.ts b/src/app/modules/songs/song/edit/edit.service.ts index 6508e7e..0054036 100644 --- a/src/app/modules/songs/song/edit/edit.service.ts +++ b/src/app/modules/songs/song/edit/edit.service.ts @@ -25,7 +25,6 @@ export class EditService { legalLink: new FormControl(song.legalLink), legalOwner: new FormControl(song.legalOwner), legalOwnerId: new FormControl(song.legalOwnerId), - legalLicenseId: new FormControl(song.legalLicenseId), artist: new FormControl(song.artist), label: new FormControl(song.label), diff --git a/src/app/modules/songs/song/song.component.html b/src/app/modules/songs/song/song.component.html index b22a02f..1e49e68 100644 --- a/src/app/modules/songs/song/song.component.html +++ b/src/app/modules/songs/song/song.component.html @@ -9,7 +9,6 @@
Status: {{(song.status|status) || 'entwurf'}}
Rechteinhaber: {{song.legalOwner|legalOwner}}
Rechteinhaber ID: {{song.legalOwnerId}}
-
Lizenznummer: {{song.legalLicenseId}}
Künstler: {{song.artist}}
Verlag: {{song.label}}
Quelle: {{song.origin}}
diff --git a/src/app/services/config.service.spec.ts b/src/app/services/config.service.spec.ts new file mode 100644 index 0000000..2264bb7 --- /dev/null +++ b/src/app/services/config.service.spec.ts @@ -0,0 +1,16 @@ +import {TestBed} from '@angular/core/testing'; + +import {ConfigService} from './config.service'; + +describe('ConfigService', () => { + let service: ConfigService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(ConfigService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/services/config.service.ts b/src/app/services/config.service.ts new file mode 100644 index 0000000..f213be3 --- /dev/null +++ b/src/app/services/config.service.ts @@ -0,0 +1,16 @@ +import {Injectable} from '@angular/core'; +import {DbService} from './db.service'; +import {Observable} from 'rxjs'; +import {Config} from './config'; + +@Injectable({ + providedIn: 'root' +}) +export class ConfigService { + constructor(private db: DbService) { + } + + public get get$(): Observable { + return this.db.doc$('global/config'); + } +} diff --git a/src/app/services/config.ts b/src/app/services/config.ts new file mode 100644 index 0000000..1f8ebff --- /dev/null +++ b/src/app/services/config.ts @@ -0,0 +1,3 @@ +export interface Config { + ccliLicenseId: string +} diff --git a/src/app/services/user/user.ts b/src/app/services/user/user.ts index a166c98..ee7f7a0 100644 --- a/src/app/services/user/user.ts +++ b/src/app/services/user/user.ts @@ -1,9 +1,8 @@ import {ChordMode} from '../../widget-modules/components/song-text/song-text.component'; -import {roles} from './roles'; export interface User { id: string; name: string; - role: roles; + role: string; chordMode: ChordMode } diff --git a/src/app/widget-modules/pipes/status-translater/status.pipe.spec.ts b/src/app/widget-modules/pipes/status-translater/status.pipe.spec.ts new file mode 100644 index 0000000..f74cb17 --- /dev/null +++ b/src/app/widget-modules/pipes/status-translater/status.pipe.spec.ts @@ -0,0 +1,8 @@ +import {StatusPipe} from './status.pipe'; + +describe('StatusPipe', () => { + it('create an instance', () => { + const pipe = new StatusPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/src/app/widget-modules/pipes/status-translater/status.pipe.ts b/src/app/widget-modules/pipes/status-translater/status.pipe.ts new file mode 100644 index 0000000..1f8ce7f --- /dev/null +++ b/src/app/widget-modules/pipes/status-translater/status.pipe.ts @@ -0,0 +1,21 @@ +import {Pipe, PipeTransform} from '@angular/core'; + +@Pipe({ + name: 'status' +}) +export class StatusPipe implements PipeTransform { + + transform(songTypeKey: string): string { + switch (songTypeKey) { + case 'draft': + return 'Entwurf'; + case 'set': + return 'offen'; + case 'final': + return 'final'; + default: + return ''; + } + } + +} diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 7d4dc0b..d759bc5 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -2,5 +2,6 @@ import {firebase} from './firebase'; export const environment = { production: true, + url: 'https://worshipgenerator.web.app', firebase };