read ccli license from global config
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
<div *ngIf="song.legalOwnerId">
|
||||
<p *ngIf="song.legalType==='CCLI'">CCLI-Liednummer {{song.legalOwnerId}}</p>
|
||||
<p *ngIf="song.legalType!=='CCLI'">Liednummer {{song.legalOwnerId}}</p>
|
||||
</div>
|
||||
|
||||
<p *ngIf="song.artist">{{song.artist}}</p>
|
||||
<p *ngIf="song.label">{{song.label}}</p>
|
||||
<p *ngIf="song.termsOfUse" class="terms-of-use">{{song.termsOfUse}}</p>
|
||||
<p *ngIf="song.origin">{{song.origin}}</p>
|
||||
|
||||
<div *ngIf="song.legalLicenseId">
|
||||
<p *ngIf="song.legalType==='CCLI'">CCLI-Lizenznummer {{song.legalLicenseId}}</p>
|
||||
<p *ngIf="song.legalType!=='CCLI'">Lizenznummer {{song.legalLicenseId}}</p>
|
||||
<div *ngIf="song.legalOwnerId">
|
||||
<p *ngIf="song.legalOwner==='CCLI' && config">CCLI-Liednummer {{song.legalOwnerId}},
|
||||
CCLI-Lizenznummer {{config.ccliLicenseId}}</p>
|
||||
<p *ngIf="song.legalOwner!=='CCLI'">Liednummer {{song.legalOwnerId}}</p>
|
||||
</div>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div *ngIf="song" [style.font-size.px]="zoom" class="fullscreen">
|
||||
<app-song-text [fullscreen]="true" [index]="index" [showSwitch]="false" [text]="song.text"
|
||||
chordMode="hide"></app-song-text>
|
||||
<app-legal [song]="song"></app-legal>
|
||||
<app-legal [config]="config$|async" [song]="song"></app-legal>
|
||||
</div>
|
||||
|
||||
@@ -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<Config>;
|
||||
|
||||
constructor(
|
||||
private showService: ShowService,
|
||||
private songService: SongService,
|
||||
private textRenderingService: TextRenderingService,
|
||||
private globalSettingsService: GlobalSettingsService,
|
||||
private configService: ConfigService,
|
||||
) {
|
||||
this.config$ = configService.get$;
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
@@ -15,7 +15,6 @@ export interface Song {
|
||||
legalLink: string;
|
||||
legalOwner: string;
|
||||
legalOwnerId: string;
|
||||
legalLicenseId: string;
|
||||
|
||||
artist: string;
|
||||
label: string;
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<div>Status: {{(song.status|status) || 'entwurf'}}</div>
|
||||
<div *ngIf="song.legalOwner">Rechteinhaber: {{song.legalOwner|legalOwner}}</div>
|
||||
<div *ngIf="song.legalOwnerId">Rechteinhaber ID: {{song.legalOwnerId}}</div>
|
||||
<div *ngIf="song.legalLicenseId">Lizenznummer: {{song.legalLicenseId}}</div>
|
||||
<div *ngIf="song.artist">Künstler: {{song.artist}}</div>
|
||||
<div *ngIf="song.label">Verlag: {{song.label}}</div>
|
||||
<div *ngIf="song.origin">Quelle: {{song.origin}}</div>
|
||||
|
||||
16
src/app/services/config.service.spec.ts
Normal file
16
src/app/services/config.service.spec.ts
Normal file
@@ -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();
|
||||
});
|
||||
});
|
||||
16
src/app/services/config.service.ts
Normal file
16
src/app/services/config.service.ts
Normal file
@@ -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<Config> {
|
||||
return this.db.doc$<Config>('global/config');
|
||||
}
|
||||
}
|
||||
3
src/app/services/config.ts
Normal file
3
src/app/services/config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export interface Config {
|
||||
ccliLicenseId: string
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import {StatusPipe} from './status.pipe';
|
||||
|
||||
describe('StatusPipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new StatusPipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -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 '';
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,5 +2,6 @@ import {firebase} from './firebase';
|
||||
|
||||
export const environment = {
|
||||
production: true,
|
||||
url: 'https://worshipgenerator.web.app',
|
||||
firebase
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user