Compare commits
23 Commits
song-usage
...
update-ang
| Author | SHA1 | Date | |
|---|---|---|---|
| 597e89ffb3 | |||
| e3fa1678c2 | |||
| 88a574aa80 | |||
| 898c6c4d7e | |||
| 802c309679 | |||
| 73d3ecfd42 | |||
| 3ff7c8c17e | |||
| 2f523c5092 | |||
| 669bd0d852 | |||
| 3d31594dbc | |||
| 107fc41c4f | |||
| 9025d2c8a5 | |||
| 4aeb452434 | |||
| 150e20ccfb | |||
| 9cd565acb8 | |||
| 5cb7b12508 | |||
| a364536127 | |||
| 8a9e2d58c5 | |||
| 45677eb1c3 | |||
| 28b669fc2d | |||
| 2f5a732ffc | |||
| d71bd41495 | |||
| c19e115b43 |
12
.run/build.run.xml
Normal file
12
.run/build.run.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="build" type="js.build_tools.npm" nameIsGenerated="true">
|
||||||
|
<package-json value="$PROJECT_DIR$/package.json"/>
|
||||||
|
<command value="run"/>
|
||||||
|
<scripts>
|
||||||
|
<script value="build"/>
|
||||||
|
</scripts>
|
||||||
|
<node-interpreter value="project"/>
|
||||||
|
<envs/>
|
||||||
|
<method v="2"/>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
12
.run/deploy.run.xml
Normal file
12
.run/deploy.run.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="deploy" type="js.build_tools.npm" nameIsGenerated="true">
|
||||||
|
<package-json value="$PROJECT_DIR$/package.json"/>
|
||||||
|
<command value="run"/>
|
||||||
|
<scripts>
|
||||||
|
<script value="deploy"/>
|
||||||
|
</scripts>
|
||||||
|
<node-interpreter value="project"/>
|
||||||
|
<envs/>
|
||||||
|
<method v="2"/>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
39
angular.json
39
angular.json
@@ -15,12 +15,15 @@
|
|||||||
"prefix": "app",
|
"prefix": "app",
|
||||||
"architect": {
|
"architect": {
|
||||||
"build": {
|
"build": {
|
||||||
"builder": "@angular-devkit/build-angular:browser",
|
"builder": "@angular-devkit/build-angular:application",
|
||||||
"options": {
|
"options": {
|
||||||
"outputPath": "dist/wgenerator",
|
"outputPath": {
|
||||||
|
"base": "dist/wgenerator"
|
||||||
|
},
|
||||||
"index": "src/index.html",
|
"index": "src/index.html",
|
||||||
"main": "src/main.ts",
|
"polyfills": [
|
||||||
"polyfills": "src/polyfills.ts",
|
"src/polyfills.ts"
|
||||||
|
],
|
||||||
"tsConfig": "tsconfig.app.json",
|
"tsConfig": "tsconfig.app.json",
|
||||||
"aot": false,
|
"aot": false,
|
||||||
"assets": [
|
"assets": [
|
||||||
@@ -42,15 +45,16 @@
|
|||||||
"src/styles/shadow.less"
|
"src/styles/shadow.less"
|
||||||
],
|
],
|
||||||
"scripts": [],
|
"scripts": [],
|
||||||
"vendorChunk": true,
|
|
||||||
"extractLicenses": false,
|
"extractLicenses": false,
|
||||||
"buildOptimizer": false,
|
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"optimization": false,
|
"optimization": false,
|
||||||
"namedChunks": true,
|
"namedChunks": true,
|
||||||
"allowedCommonJsDependencies": [
|
"allowedCommonJsDependencies": [
|
||||||
"lodash", "docx"
|
"lodash",
|
||||||
]
|
"docx",
|
||||||
|
"qrcode"
|
||||||
|
],
|
||||||
|
"browser": "src/main.ts"
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
@@ -66,8 +70,6 @@
|
|||||||
"namedChunks": false,
|
"namedChunks": false,
|
||||||
"aot": true,
|
"aot": true,
|
||||||
"extractLicenses": true,
|
"extractLicenses": true,
|
||||||
"vendorChunk": false,
|
|
||||||
"buildOptimizer": true,
|
|
||||||
"budgets": [
|
"budgets": [
|
||||||
{
|
{
|
||||||
"type": "initial",
|
"type": "initial",
|
||||||
@@ -80,26 +82,25 @@
|
|||||||
"maximumError": "10kb"
|
"maximumError": "10kb"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"serviceWorker": true,
|
"serviceWorker": "ngsw-config.json"
|
||||||
"ngswConfigPath": "ngsw-config.json"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"serve": {
|
"serve": {
|
||||||
"builder": "@angular-devkit/build-angular:dev-server",
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
"options": {
|
"options": {
|
||||||
"browserTarget": "wgenerator:build"
|
"buildTarget": "wgenerator:build"
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
"browserTarget": "wgenerator:build:production"
|
"buildTarget": "wgenerator:build:production"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"extract-i18n": {
|
"extract-i18n": {
|
||||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
"options": {
|
"options": {
|
||||||
"browserTarget": "wgenerator:build"
|
"buildTarget": "wgenerator:build"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
@@ -147,5 +148,13 @@
|
|||||||
"schematicCollections": [
|
"schematicCollections": [
|
||||||
"@angular-eslint/schematics"
|
"@angular-eslint/schematics"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"schematics": {
|
||||||
|
"@angular-eslint/schematics:application": {
|
||||||
|
"setParserOptionsProject": true
|
||||||
|
},
|
||||||
|
"@angular-eslint/schematics:library": {
|
||||||
|
"setParserOptionsProject": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"indexes": "firestore.indexes.json"
|
"indexes": "firestore.indexes.json"
|
||||||
},
|
},
|
||||||
"hosting": {
|
"hosting": {
|
||||||
"public": "dist/wgenerator",
|
"public": "dist/wgenerator/browser",
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"firebase.json",
|
"firebase.json",
|
||||||
"**/.*",
|
"**/.*",
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ service cloud.firestore {
|
|||||||
allow read: if request.auth.uid != null;
|
allow read: if request.auth.uid != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
match /guest/{guestId} {
|
||||||
|
allow read: if true;
|
||||||
|
allow write: if request.auth.uid != null;
|
||||||
|
}
|
||||||
match /songs/{song} {
|
match /songs/{song} {
|
||||||
allow read: if request.auth.uid != null;
|
allow read: if request.auth.uid != null;
|
||||||
allow write: if request.auth.uid != null;
|
allow write: if request.auth.uid != null;
|
||||||
|
|||||||
52809
package-lock.json
generated
52809
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
107
package.json
107
package.json
@@ -1,75 +1,70 @@
|
|||||||
{
|
{
|
||||||
"name": "wgenerator",
|
"name": "wgenerator",
|
||||||
"version": "1.3",
|
"version": "1.6",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
"deploy": "ng build --configuration production && firebase deploy",
|
"deploy": "ng build --configuration production && firebase deploy",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"lint": "ng lint --fix",
|
"lint": "ng lint --fix",
|
||||||
"postinstall": "ngcc"
|
"update": "ng update @angular/cdk @angular/cli @angular/core @angular/material && ncu -u && npm i && npm fix"
|
||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/animations": "^14.2.10",
|
"@angular/animations": "^19.0.5",
|
||||||
"@angular/cdk": "^14.2.6",
|
"@angular/cdk": "^19.0.4",
|
||||||
"@angular/common": "^14.2.10",
|
"@angular/common": "^19.0.5",
|
||||||
"@angular/compiler": "^14.2.10",
|
"@angular/compiler": "^19.0.5",
|
||||||
"@angular/core": "^14.2.10",
|
"@angular/core": "^19.0.5",
|
||||||
"@angular/fire": "^7.4.1",
|
"@angular/fire": "^18.0.1",
|
||||||
"@angular/forms": "^14.2.10",
|
"@angular/forms": "^19.0.5",
|
||||||
"@angular/material": "^14.2.6",
|
"@angular/material": "^19.0.4",
|
||||||
"@angular/platform-browser": "^14.2.10",
|
"@angular/platform-browser": "^19.0.5",
|
||||||
"@angular/platform-browser-dynamic": "^14.2.10",
|
"@angular/platform-browser-dynamic": "^19.0.5",
|
||||||
"@angular/router": "^14.2.10",
|
"@angular/router": "^19.0.5",
|
||||||
"@angular/service-worker": "^14.2.10",
|
"@angular/service-worker": "^19.0.5",
|
||||||
"@fortawesome/angular-fontawesome": "^0.11.1",
|
"@fortawesome/angular-fontawesome": "^0.14.1",
|
||||||
"@fortawesome/fontawesome-svg-core": "^6.1.2",
|
"@fortawesome/fontawesome-svg-core": "^6.5.1",
|
||||||
"@fortawesome/free-solid-svg-icons": "^6.1.2",
|
"@fortawesome/free-solid-svg-icons": "^6.5.1",
|
||||||
"docx": "^7.4.1",
|
"docx": "^8.5.0",
|
||||||
"firebase": "^9.6.10",
|
"firebase": "^10.8.0",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"ngx-mat-select-search": "^4.2.1",
|
"ngx-mat-select-search": "^7.0.5",
|
||||||
"ngx-perfect-scrollbar": "^10.1.1",
|
"qrcode": "^1.5.3",
|
||||||
"rxfire": "^6.0.3",
|
"rxfire": "^6.0.5",
|
||||||
"rxjs": "~7.5.6",
|
"rxjs": "~7.8.1",
|
||||||
"swiper": "^9.3.2",
|
"swiper": "^11.0.6",
|
||||||
"tslib": "^2.4.0",
|
"tslib": "^2.6.2",
|
||||||
"uuid": "^8.3.2",
|
"zone.js": "~0.15.0"
|
||||||
"zone.js": "~0.11.8"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@angular-devkit/architect": "0.1402.9",
|
"@angular-devkit/architect": "0.1900.6",
|
||||||
"@angular-devkit/build-angular": "^14.2.9",
|
"@angular-devkit/build-angular": "^19.0.6",
|
||||||
"@angular-eslint/builder": "14.1.2",
|
"@angular-eslint/builder": "19.0.2",
|
||||||
"@angular-eslint/eslint-plugin": "14.1.2",
|
"@angular-eslint/eslint-plugin": "19.0.2",
|
||||||
"@angular-eslint/eslint-plugin-template": "14.1.2",
|
"@angular-eslint/eslint-plugin-template": "19.0.2",
|
||||||
"@angular-eslint/schematics": "14.1.2",
|
"@angular-eslint/schematics": "19.0.2",
|
||||||
"@angular-eslint/template-parser": "14.1.2",
|
"@angular-eslint/template-parser": "19.0.2",
|
||||||
"@angular/cli": "^14.2.9",
|
"@angular/cli": "^19.0.6",
|
||||||
"@angular/compiler-cli": "^14.2.10",
|
"@angular/compiler-cli": "^19.0.5",
|
||||||
"@angular/language-service": "^14.2.10",
|
"@angular/language-service": "^19.0.5",
|
||||||
"@types/jasmine": "~4.0.3",
|
"@types/jasmine": "~5.1.4",
|
||||||
"@types/jasminewd2": "~2.0.10",
|
"@types/jasminewd2": "~2.0.13",
|
||||||
"@types/lodash": "^4.14.182",
|
"@types/lodash": "^4.14.202",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
||||||
"@typescript-eslint/parser": "^5.33.0",
|
"@typescript-eslint/parser": "^7.2.0",
|
||||||
"eslint": "^8.22.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-config-prettier": "^8.5.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"firebase-tools": "^11.6.0",
|
"firebase-tools": "^13.3.1",
|
||||||
"fuzzy": "^0.1.3",
|
"jasmine-core": "~5.1.2",
|
||||||
"inquirer": "^9.1.0",
|
|
||||||
"inquirer-autocomplete-prompt": "^2.0.0",
|
|
||||||
"jasmine-core": "~4.3.0",
|
|
||||||
"jasmine-spec-reporter": "~7.0.0",
|
"jasmine-spec-reporter": "~7.0.0",
|
||||||
"karma": "~6.4.0",
|
"karma": "~6.4.2",
|
||||||
"karma-chrome-launcher": "~3.1.1",
|
"karma-chrome-launcher": "~3.2.0",
|
||||||
"karma-coverage-istanbul-reporter": "~3.0.3",
|
"karma-coverage-istanbul-reporter": "~3.0.3",
|
||||||
"karma-jasmine": "~5.1.0",
|
"karma-jasmine": "~5.1.0",
|
||||||
"karma-jasmine-html-reporter": "^2.0.0",
|
"karma-jasmine-html-reporter": "^2.1.0",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "^3.2.5",
|
||||||
"protractor": "~7.0.0",
|
"typescript": "~5.5.4"
|
||||||
"typescript": "~4.7.4"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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},
|
||||||
),
|
),
|
||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -54,9 +54,11 @@ const routes: Routes = [
|
|||||||
imports: [
|
imports: [
|
||||||
RouterModule.forRoot(routes, {
|
RouterModule.forRoot(routes, {
|
||||||
preloadingStrategy: PreloadAllModules,
|
preloadingStrategy: PreloadAllModules,
|
||||||
relativeLinkResolution: 'legacy',
|
scrollPositionRestoration: 'enabled',
|
||||||
|
// relativeLinkResolution: 'legacy',
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
exports: [RouterModule],
|
exports: [RouterModule],
|
||||||
})
|
})
|
||||||
export class AppRoutingModule {}
|
export class AppRoutingModule {
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,12 +1,6 @@
|
|||||||
<app-navigation></app-navigation>
|
<app-navigation></app-navigation>
|
||||||
<perfect-scrollbar
|
|
||||||
#scrollbar
|
<div [@fader]="o.isActivated ? o.activatedRoute : ''" class="content">
|
||||||
(psScrollY)="onScoll($event)"
|
<router-outlet #o="outlet"></router-outlet>
|
||||||
[perfectScrollbar]
|
</div>
|
||||||
class="scroll"
|
|
||||||
style="max-height: calc(100vh); width: 100%; overflow: hidden"
|
|
||||||
>
|
|
||||||
<div [@fader]="o.isActivated ? o.activatedRoute : ''" class="content">
|
|
||||||
<router-outlet #o="outlet"></router-outlet>
|
|
||||||
</div>
|
|
||||||
</perfect-scrollbar>
|
|
||||||
|
|||||||
@@ -1,10 +1,3 @@
|
|||||||
h1 {
|
h1 {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.manager {
|
|
||||||
//display: grid;
|
|
||||||
//grid-template-columns: 1fr 1fr;
|
|
||||||
//transition: all 1s ease-in-out;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ describe('AppComponent', () => {
|
|||||||
imports: [RouterTestingModule],
|
imports: [RouterTestingModule],
|
||||||
declarations: [AppComponent],
|
declarations: [AppComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
it('should create the app', () => {
|
it('should create the app', () => {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import {ChangeDetectionStrategy, Component, OnInit, ViewChild} from '@angular/core';
|
import {ChangeDetectionStrategy, Component, OnInit} from '@angular/core';
|
||||||
import {fader} from './animations';
|
import {fader} from './animations';
|
||||||
import {ScrollService} from './services/scroll.service';
|
import {ScrollService} from './services/scroll.service';
|
||||||
import {PerfectScrollbarComponent} from 'ngx-perfect-scrollbar';
|
|
||||||
import {register} from 'swiper/element/bundle';
|
import {register} from 'swiper/element/bundle';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -10,14 +9,10 @@ import {register} from 'swiper/element/bundle';
|
|||||||
styleUrls: ['./app.component.less'],
|
styleUrls: ['./app.component.less'],
|
||||||
animations: [fader],
|
animations: [fader],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class AppComponent implements OnInit {
|
export class AppComponent implements OnInit {
|
||||||
@ViewChild('scrollbar', {static: false}) public scrollbar: PerfectScrollbarComponent | null = null;
|
|
||||||
|
|
||||||
public constructor(private scrollService: ScrollService) {
|
public constructor(private scrollService: ScrollService) {
|
||||||
scrollService.restoreScrollPosition$.subscribe(pos => {
|
|
||||||
if (this.scrollbar && pos) this.scrollbar.directiveRef?.scrollTo(0, pos, 300);
|
|
||||||
});
|
|
||||||
register();
|
register();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import {AngularFireAuthModule} from '@angular/fire/compat/auth';
|
|||||||
import {AngularFireAuthGuardModule} from '@angular/fire/compat/auth-guard';
|
import {AngularFireAuthGuardModule} from '@angular/fire/compat/auth-guard';
|
||||||
import {MAT_DATE_LOCALE} from '@angular/material/core';
|
import {MAT_DATE_LOCALE} from '@angular/material/core';
|
||||||
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
|
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
|
||||||
import {PerfectScrollbarModule} from 'ngx-perfect-scrollbar';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [AppComponent],
|
declarations: [AppComponent],
|
||||||
@@ -37,9 +36,9 @@ import {PerfectScrollbarModule} from 'ngx-perfect-scrollbar';
|
|||||||
AngularFireAuthModule,
|
AngularFireAuthModule,
|
||||||
AngularFireAuthGuardModule,
|
AngularFireAuthGuardModule,
|
||||||
FontAwesomeModule,
|
FontAwesomeModule,
|
||||||
PerfectScrollbarModule,
|
|
||||||
],
|
],
|
||||||
providers: [{provide: MAT_DATE_LOCALE, useValue: 'de-DE'}],
|
providers: [{provide: MAT_DATE_LOCALE, useValue: 'de-DE'}],
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
})
|
})
|
||||||
export class AppModule {}
|
export class AppModule {
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="brand">
|
<div class="brand">
|
||||||
<app-logo></app-logo>
|
<app-logo></app-logo>
|
||||||
<div class="copyright">© 2019 - 2023 - Benjamin Ifland</div>
|
<div class="copyright">© 2019 - 2024 - Benjamin Ifland</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('BrandComponent', () => {
|
|||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
declarations: [BrandComponent],
|
declarations: [BrandComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -4,5 +4,7 @@ import {Component} from '@angular/core';
|
|||||||
selector: 'app-brand',
|
selector: 'app-brand',
|
||||||
templateUrl: './brand.component.html',
|
templateUrl: './brand.component.html',
|
||||||
styleUrls: ['./brand.component.less'],
|
styleUrls: ['./brand.component.less'],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class BrandComponent {}
|
export class BrandComponent {
|
||||||
|
}
|
||||||
|
|||||||
@@ -21,4 +21,5 @@ const routes: Routes = [
|
|||||||
declarations: [BrandComponent, NewUserComponent],
|
declarations: [BrandComponent, NewUserComponent],
|
||||||
imports: [CommonModule, RouterModule.forChild(routes), LogoModule],
|
imports: [CommonModule, RouterModule.forChild(routes), LogoModule],
|
||||||
})
|
})
|
||||||
export class BrandModule {}
|
export class BrandModule {
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('NewUserComponent', () => {
|
|||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
declarations: [NewUserComponent],
|
declarations: [NewUserComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {User} from '../../../services/user/user';
|
|||||||
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'],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class NewUserComponent {
|
export class NewUserComponent {
|
||||||
public user$: Observable<User | null> | null = null;
|
public user$: Observable<User | null> | null = null;
|
||||||
|
|||||||
23
src/app/modules/guest/guest-show-data.service.ts
Normal file
23
src/app/modules/guest/guest-show-data.service.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import {Injectable} from '@angular/core';
|
||||||
|
import {BehaviorSubject, Observable} from 'rxjs';
|
||||||
|
import {map} from 'rxjs/operators';
|
||||||
|
import {DbService} from 'src/app/services/db.service';
|
||||||
|
import {GuestShow} from './guest-show';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
|
export class GuestShowDataService {
|
||||||
|
public list$: BehaviorSubject<GuestShow[]> = new BehaviorSubject<GuestShow[]>([]);
|
||||||
|
private collection = 'guest';
|
||||||
|
|
||||||
|
public constructor(private dbService: DbService) {
|
||||||
|
this.dbService.col$<GuestShow>(this.collection).subscribe(_ => this.list$.next(_));
|
||||||
|
}
|
||||||
|
|
||||||
|
public read$: (id: string) => Observable<GuestShow | null> = (id: string): Observable<GuestShow | null> => this.list$.pipe(map(_ => _.find(s => s.id === id) || null));
|
||||||
|
public update$: (id: string, data: Partial<GuestShow>) => Promise<void> = async (id: string, data: Partial<GuestShow>): Promise<void> =>
|
||||||
|
await this.dbService.doc(this.collection + '/' + id).update(data);
|
||||||
|
public add: (data: Partial<GuestShow>) => Promise<string> = async (data: Partial<GuestShow>): Promise<string> => (await this.dbService.col(this.collection).add(data)).id;
|
||||||
|
public delete: (id: string) => Promise<void> = async (id: string): Promise<void> => await this.dbService.doc(this.collection + '/' + id).delete();
|
||||||
|
}
|
||||||
33
src/app/modules/guest/guest-show.service.ts
Normal file
33
src/app/modules/guest/guest-show.service.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import {Injectable} from '@angular/core';
|
||||||
|
import {Show} from '../shows/services/show';
|
||||||
|
import {Song} from '../songs/services/song';
|
||||||
|
import {GuestShowDataService} from './guest-show-data.service';
|
||||||
|
import {ShowService} from '../shows/services/show.service';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
|
export class GuestShowService {
|
||||||
|
public constructor(
|
||||||
|
private showService: ShowService,
|
||||||
|
private guestShowDataService: GuestShowDataService,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
public async share(show: Show, songs: Song[]): Promise<string> {
|
||||||
|
const data = {
|
||||||
|
showType: show.showType,
|
||||||
|
date: show.date,
|
||||||
|
songs: songs,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!show.shareId) {
|
||||||
|
const shareId = await this.guestShowDataService.add(data);
|
||||||
|
await this.showService.update$(show.id, {shareId});
|
||||||
|
} else {
|
||||||
|
await this.guestShowDataService.update$(show.shareId, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
return window.location.protocol + '//' + window.location.host + '/guest/' + show.shareId;
|
||||||
|
}
|
||||||
|
}
|
||||||
10
src/app/modules/guest/guest-show.ts
Normal file
10
src/app/modules/guest/guest-show.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import firebase from 'firebase/compat/app';
|
||||||
|
import {Song} from '../songs/services/song';
|
||||||
|
import Timestamp = firebase.firestore.Timestamp;
|
||||||
|
|
||||||
|
export interface GuestShow {
|
||||||
|
id: string;
|
||||||
|
showType: string;
|
||||||
|
date: Timestamp;
|
||||||
|
songs: Song[];
|
||||||
|
}
|
||||||
@@ -1,11 +1,25 @@
|
|||||||
<div *ngIf="songs$ | async as songs" class="view">
|
<div *ngIf="show$|async as show" class="page">
|
||||||
<!-- <swiper>-->
|
<div class="title">
|
||||||
<!-- <div *ngFor="let song of songs" class="song">-->
|
<div class="left">{{ show.showType|showType }}</div>
|
||||||
<!-- <app-song-text-->
|
<div class="right">{{ show.date.toDate() | date: 'dd.MM.yyyy' }}</div>
|
||||||
<!-- [showSwitch]="false"-->
|
</div>
|
||||||
<!-- [text]="song"-->
|
|
||||||
<!-- chordMode="hide"-->
|
<div class="view">
|
||||||
<!-- ></app-song-text>-->
|
<swiper-container scrollbar="true">
|
||||||
<!-- </div>-->
|
<swiper-slide *ngFor="let song of show.songs; let i = index; trackBy: trackBy"
|
||||||
<!-- </swiper>-->
|
class="song-swipe">
|
||||||
|
<div class="song-title">{{ song.title }}</div>
|
||||||
|
|
||||||
|
<div class="legal">
|
||||||
|
<p *ngIf="song.artist">{{ song.artist }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<app-song-text
|
||||||
|
[text]="song.text"
|
||||||
|
></app-song-text>
|
||||||
|
</swiper-slide>
|
||||||
|
</swiper-container>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,49 @@
|
|||||||
|
.page {
|
||||||
|
background: #0009;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
backdrop-filter: blur(8px);
|
||||||
|
|
||||||
|
--swiper-scrollbar-bg-color: #fff3;
|
||||||
|
--swiper-scrollbar-drag-bg-color: #fff9;
|
||||||
|
--swiper-scrollbar-sides-offset: 20px;
|
||||||
|
--swiper-scrollbar-top: 100px;
|
||||||
|
--swiper-scrollbar-bottom: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
color: white;
|
||||||
|
padding: 70px 20px 0;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
font-size: 1.8em;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.song-title {
|
||||||
|
padding: 20px 20px 0;
|
||||||
|
font-size: 1.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.legal {
|
||||||
|
padding: 0 20px;
|
||||||
|
font-size: 0.6em;
|
||||||
|
color: #fff9;
|
||||||
|
}
|
||||||
|
|
||||||
.view {
|
.view {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
background: #0003;
|
|
||||||
backdrop-filter: blur(10px);
|
|
||||||
z-index: 1;
|
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -14,3 +51,9 @@ app-song-text {
|
|||||||
margin: 20px;
|
margin: 20px;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.song-swipe {
|
||||||
|
margin-top: 100px;
|
||||||
|
margin-bottom: 50px;
|
||||||
|
min-height: calc(100vh - 150px);
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('GuestComponent', () => {
|
|||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
declarations: [GuestComponent],
|
declarations: [GuestComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -1,32 +1,29 @@
|
|||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {SongService} from '../songs/services/song.service';
|
import {GuestShowDataService} from './guest-show-data.service';
|
||||||
import {GlobalSettingsService} from '../../services/global-settings.service';
|
import {ActivatedRoute} from '@angular/router';
|
||||||
import {Observable} from 'rxjs';
|
import {map, switchMap} from 'rxjs/operators';
|
||||||
import {filter, map, switchMap} from 'rxjs/operators';
|
import {Song} from '../songs/services/song';
|
||||||
import {ShowSongService} from '../shows/services/show-song.service';
|
import {ConfigService} from '../../services/config.service';
|
||||||
import {GlobalSettings} from '../../services/global-settings';
|
|
||||||
import {ShowService} from '../shows/services/show.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-guest',
|
selector: 'app-guest',
|
||||||
templateUrl: './guest.component.html',
|
templateUrl: './guest.component.html',
|
||||||
styleUrls: ['./guest.component.less'],
|
styleUrls: ['./guest.component.less'],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class GuestComponent {
|
export class GuestComponent {
|
||||||
public songs$: Observable<string[]> = this.globalSettingsService.get$.pipe(
|
public show$ = this.currentRoute.params.pipe(
|
||||||
filter(_ => !!_),
|
map(param => param.id as string),
|
||||||
map(_ => _ as GlobalSettings),
|
switchMap(id => this.service.read$(id)),
|
||||||
map(_ => _.currentShow),
|
|
||||||
switchMap(_ => this.showSongService.list$(_).pipe(map(l => ({showSongs: l, currentShow: _})))),
|
|
||||||
switchMap(_ => this.showService.read$(_.currentShow).pipe(map(l => ({showSongs: _.showSongs, show: l})))),
|
|
||||||
filter(_ => !!_.showSongs),
|
|
||||||
map(_ => (_?.show ? _.show.order.map(o => _.showSongs.find(f => f.id === o) ?? _.showSongs[0]).map(m => m.text) : []))
|
|
||||||
);
|
);
|
||||||
|
public config$ = this.configService.get$();
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
private songService: SongService,
|
private currentRoute: ActivatedRoute,
|
||||||
private showService: ShowService,
|
private service: GuestShowDataService,
|
||||||
private globalSettingsService: GlobalSettingsService,
|
private configService: ConfigService,
|
||||||
private showSongService: ShowSongService
|
) {
|
||||||
) {}
|
}
|
||||||
|
|
||||||
|
public trackBy = (index: number, show: Song) => show.id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,23 @@
|
|||||||
import {NgModule} from '@angular/core';
|
import {CUSTOM_ELEMENTS_SCHEMA, NgModule} from '@angular/core';
|
||||||
import {CommonModule} from '@angular/common';
|
import {CommonModule} from '@angular/common';
|
||||||
import {GuestComponent} from './guest.component';
|
import {GuestComponent} from './guest.component';
|
||||||
import {RouterModule} from '@angular/router';
|
import {RouterModule} from '@angular/router';
|
||||||
import {SongTextModule} from '../../widget-modules/components/song-text/song-text.module';
|
import {ShowTypeTranslaterModule} from '../../widget-modules/pipes/show-type-translater/show-type-translater.module';
|
||||||
|
import {SongTextComponent} from '../../widget-modules/components/song-text/song-text.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [GuestComponent],
|
declarations: [GuestComponent],
|
||||||
imports: [CommonModule, RouterModule.forChild([{path: '', component: GuestComponent}]), SongTextModule],
|
imports: [
|
||||||
|
CommonModule,
|
||||||
|
RouterModule.forChild([
|
||||||
|
{
|
||||||
|
path: ':id',
|
||||||
|
component: GuestComponent,
|
||||||
|
},
|
||||||
|
]),
|
||||||
|
SongTextComponent,
|
||||||
|
ShowTypeTranslaterModule,
|
||||||
|
],
|
||||||
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||||
})
|
})
|
||||||
export class GuestModule {}
|
export class GuestModule {}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('LegalComponent', () => {
|
|||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
declarations: [LegalComponent],
|
declarations: [LegalComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {Config} from '../../../../services/config';
|
|||||||
selector: 'app-legal',
|
selector: 'app-legal',
|
||||||
templateUrl: './legal.component.html',
|
templateUrl: './legal.component.html',
|
||||||
styleUrls: ['./legal.component.less'],
|
styleUrls: ['./legal.component.less'],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class LegalComponent {
|
export class LegalComponent {
|
||||||
@Input() public song: Song | null = null;
|
@Input() public song: Song | null = null;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('LogoComponent', () => {
|
|||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
declarations: [LogoComponent],
|
declarations: [LogoComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -4,5 +4,7 @@ import {Component} from '@angular/core';
|
|||||||
selector: 'app-logo',
|
selector: 'app-logo',
|
||||||
templateUrl: './logo.component.html',
|
templateUrl: './logo.component.html',
|
||||||
styleUrls: ['./logo.component.less'],
|
styleUrls: ['./logo.component.less'],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class LogoComponent {}
|
export class LogoComponent {
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
<div class="fullscreen background"></div>
|
<div class="fullscreen background"></div>
|
||||||
<div *ngIf="song && showType" [style.font-size.px]="zoom" class="fullscreen background">
|
<div *ngIf="song && showType" [style.font-size.px]="zoom" class="fullscreen background">
|
||||||
|
|
||||||
<div class="bg-blue fullscreen bg-image" [class.visible]="presentationBackground==='blue'"></div>
|
<div [class.visible]="presentationBackground==='blue'" class="bg-blue fullscreen bg-image"></div>
|
||||||
<div class="bg-green fullscreen bg-image" [class.visible]="presentationBackground==='green'"></div>
|
<div [class.visible]="presentationBackground==='green'" class="bg-green fullscreen bg-image"></div>
|
||||||
<div class="bg-leder fullscreen bg-image" [class.visible]="presentationBackground==='leder'"></div>
|
<div [class.visible]="presentationBackground==='leder'" class="bg-leder fullscreen bg-image"></div>
|
||||||
<div class="bg-praise fullscreen bg-image" [class.visible]="presentationBackground==='praise'"></div>
|
<div [class.visible]="presentationBackground==='praise'" class="bg-praise fullscreen bg-image"></div>
|
||||||
<div class="bg-bible fullscreen bg-image" [class.visible]="presentationBackground==='bible'"></div>
|
<div [class.visible]="presentationBackground==='bible'" class="bg-bible fullscreen bg-image"></div>
|
||||||
|
|
||||||
|
|
||||||
<div
|
<div
|
||||||
[@songSwitch]="songId"
|
[@songSwitch]="songId"
|
||||||
[class.blur]="songId === 'title' || songId === 'dynamicText'"
|
[class.blur]="songId === 'title' || songId === 'dynamicText'"
|
||||||
[class.no-logo]="presentationBackground!=='none'"
|
|
||||||
[class.hide]="songId !== 'title' && songId !== 'empty' && songId !== 'dynamicText'"
|
[class.hide]="songId !== 'title' && songId !== 'empty' && songId !== 'dynamicText'"
|
||||||
|
[class.no-logo]="presentationBackground!=='none'"
|
||||||
class="start fullscreen logo"
|
class="start fullscreen logo"
|
||||||
>
|
>
|
||||||
<app-logo></app-logo>
|
<app-logo></app-logo>
|
||||||
@@ -29,12 +29,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-song-text
|
<app-song-text
|
||||||
[header]="song.title"
|
|
||||||
*ngIf="songId !== 'title' && songId !== 'empty'"
|
*ngIf="songId !== 'title' && songId !== 'empty'"
|
||||||
[@songSwitch]="songId"
|
[@songSwitch]="songId"
|
||||||
[fullscreen]="true"
|
[fullscreen]="true"
|
||||||
|
[header]="song.title"
|
||||||
[index]="index??0"
|
[index]="index??0"
|
||||||
[showSwitch]="false"
|
[showSwitch]="false"
|
||||||
|
[showComments]="false"
|
||||||
[text]="song.text"
|
[text]="song.text"
|
||||||
chordMode="hide"
|
chordMode="hide"
|
||||||
></app-song-text>
|
></app-song-text>
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
.bg-blue {
|
.bg-blue {
|
||||||
background-image: url("/assets/bg-dark-blue.jpg");
|
background-image: url("/assets/bg-dark-blue.jpg");
|
||||||
filter: blur(10px);
|
filter: blur(10px);
|
||||||
|
|
||||||
&.visible {
|
&.visible {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
@@ -42,6 +43,7 @@
|
|||||||
.bg-green {
|
.bg-green {
|
||||||
background-image: url("/assets/bg-dark-green.jpg");
|
background-image: url("/assets/bg-dark-green.jpg");
|
||||||
filter: blur(5px);
|
filter: blur(5px);
|
||||||
|
|
||||||
&.visible {
|
&.visible {
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
}
|
}
|
||||||
@@ -50,6 +52,7 @@
|
|||||||
.bg-leder {
|
.bg-leder {
|
||||||
background-image: url("/assets/bg-leder.jpg");
|
background-image: url("/assets/bg-leder.jpg");
|
||||||
filter: blur(5px);
|
filter: blur(5px);
|
||||||
|
|
||||||
&.visible {
|
&.visible {
|
||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
}
|
}
|
||||||
@@ -58,6 +61,7 @@
|
|||||||
.bg-praise {
|
.bg-praise {
|
||||||
background-image: url("/assets/bg-praise.jpg");
|
background-image: url("/assets/bg-praise.jpg");
|
||||||
filter: blur(8px);
|
filter: blur(8px);
|
||||||
|
|
||||||
&.visible {
|
&.visible {
|
||||||
opacity: 0.2;
|
opacity: 0.2;
|
||||||
}
|
}
|
||||||
@@ -66,6 +70,7 @@
|
|||||||
.bg-bible {
|
.bg-bible {
|
||||||
background-image: url("/assets/bg-bible.jpg");
|
background-image: url("/assets/bg-bible.jpg");
|
||||||
filter: blur(8px);
|
filter: blur(8px);
|
||||||
|
|
||||||
&.visible {
|
&.visible {
|
||||||
opacity: 0.2;
|
opacity: 0.2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('MonitorComponent', () => {
|
|||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
declarations: [MonitorComponent],
|
declarations: [MonitorComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import {openFullscreen} from '../../../services/fullscreen';
|
|||||||
templateUrl: './monitor.component.html',
|
templateUrl: './monitor.component.html',
|
||||||
styleUrls: ['./monitor.component.less'],
|
styleUrls: ['./monitor.component.less'],
|
||||||
animations: [songSwitch],
|
animations: [songSwitch],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class MonitorComponent implements OnInit {
|
export class MonitorComponent implements OnInit {
|
||||||
public song: Song | null = null;
|
public song: Song | null = null;
|
||||||
@@ -40,7 +41,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$();
|
||||||
}
|
}
|
||||||
@@ -54,7 +55,7 @@ export class MonitorComponent implements OnInit {
|
|||||||
map(_ => _ as GlobalSettings),
|
map(_ => _ as GlobalSettings),
|
||||||
map(_ => _.currentShow),
|
map(_ => _.currentShow),
|
||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
tap(_ => (this.currentShowId = _))
|
tap(_ => (this.currentShowId = _)),
|
||||||
)
|
)
|
||||||
.pipe(
|
.pipe(
|
||||||
switchMap(_ => this.showService.read$(_)),
|
switchMap(_ => this.showService.read$(_)),
|
||||||
@@ -76,7 +77,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,4 +28,5 @@ const routes: Routes = [
|
|||||||
imports: [RouterModule.forChild(routes)],
|
imports: [RouterModule.forChild(routes)],
|
||||||
exports: [RouterModule],
|
exports: [RouterModule],
|
||||||
})
|
})
|
||||||
export class PresentationRoutingModule {}
|
export class PresentationRoutingModule {
|
||||||
|
}
|
||||||
|
|||||||
@@ -9,17 +9,17 @@ import {MatFormFieldModule} from '@angular/material/form-field';
|
|||||||
import {MatSelectModule} from '@angular/material/select';
|
import {MatSelectModule} from '@angular/material/select';
|
||||||
import {ShowTypeTranslaterModule} from '../../widget-modules/pipes/show-type-translater/show-type-translater.module';
|
import {ShowTypeTranslaterModule} from '../../widget-modules/pipes/show-type-translater/show-type-translater.module';
|
||||||
import {SectionTypeTranslatorModule} from '../../widget-modules/pipes/section-type-translator/section-type-translator.module';
|
import {SectionTypeTranslatorModule} from '../../widget-modules/pipes/section-type-translator/section-type-translator.module';
|
||||||
import {SongTextModule} from '../../widget-modules/components/song-text/song-text.module';
|
|
||||||
import {LegalComponent} from './monitor/legal/legal.component';
|
import {LegalComponent} from './monitor/legal/legal.component';
|
||||||
import {MatButtonModule} from '@angular/material/button';
|
import {MatButtonModule} from '@angular/material/button';
|
||||||
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
|
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
|
||||||
import {MatSliderModule} from '@angular/material/slider';
|
import {MatSliderModule} from '@angular/material/slider';
|
||||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {AddSongModule} from '../../widget-modules/components/add-song/add-song.module';
|
|
||||||
import {LogoComponent} from './monitor/logo/logo.component';
|
import {LogoComponent} from './monitor/logo/logo.component';
|
||||||
import {SelectComponent} from './select/select.component';
|
import {SelectComponent} from './select/select.component';
|
||||||
import {MatInputModule} from '@angular/material/input';
|
import {MatInputModule} from '@angular/material/input';
|
||||||
import {UserNameModule} from '../../services/user/user-name/user-name.module';
|
import {UserNameModule} from '../../services/user/user-name/user-name.module';
|
||||||
|
import {SongTextComponent} from '../../widget-modules/components/song-text/song-text.component';
|
||||||
|
import {AddSongComponent} from '../../widget-modules/components/add-song/add-song.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [MonitorComponent, RemoteComponent, LegalComponent, LogoComponent, SelectComponent],
|
declarations: [MonitorComponent, RemoteComponent, LegalComponent, LogoComponent, SelectComponent],
|
||||||
@@ -32,12 +32,12 @@ import {UserNameModule} from '../../services/user/user-name/user-name.module';
|
|||||||
MatSelectModule,
|
MatSelectModule,
|
||||||
ShowTypeTranslaterModule,
|
ShowTypeTranslaterModule,
|
||||||
SectionTypeTranslatorModule,
|
SectionTypeTranslatorModule,
|
||||||
SongTextModule,
|
SongTextComponent,
|
||||||
MatButtonModule,
|
MatButtonModule,
|
||||||
FontAwesomeModule,
|
FontAwesomeModule,
|
||||||
MatSliderModule,
|
MatSliderModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
AddSongModule,
|
AddSongComponent,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
MatInputModule,
|
MatInputModule,
|
||||||
UserNameModule,
|
UserNameModule,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<div *ngIf="show" @fade>
|
<div *ngIf="show" @fade>
|
||||||
<app-card [heading]="show.showType | showType" [subheading]="show.date.toDate() | date:'dd.MM.yyyy'"
|
<app-card [closeIcon]="faIcon" [heading]="show.showType | showType"
|
||||||
closeLink="/presentation/select" [closeIcon]="faIcon">
|
[subheading]="show.date.toDate() | date:'dd.MM.yyyy'" closeLink="/presentation/select">
|
||||||
|
|
||||||
<ng-container *ngIf="!progress">
|
<ng-container *ngIf="!progress">
|
||||||
<div class="song">
|
<div class="song">
|
||||||
@@ -61,7 +61,8 @@
|
|||||||
|
|
||||||
<mat-form-field appearance="outline">
|
<mat-form-field appearance="outline">
|
||||||
<mat-label>Überschrift</mat-label>
|
<mat-label>Überschrift</mat-label>
|
||||||
<input (ngModelChange)="onDynamicCaption($event, show.id)" [ngModel]="show.presentationDynamicCaption" autocomplete="off" id="dynamic-caption"
|
<input (ngModelChange)="onDynamicCaption($event, show.id)" [ngModel]="show.presentationDynamicCaption"
|
||||||
|
autocomplete="off" id="dynamic-caption"
|
||||||
matInput
|
matInput
|
||||||
type="text">
|
type="text">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
@@ -77,7 +78,7 @@
|
|||||||
|
|
||||||
<div *ngIf="show" class="div-bottom">
|
<div *ngIf="show" class="div-bottom">
|
||||||
|
|
||||||
<button routerLink="/presentation/monitor" mat-button>
|
<button class="btn-start-presentation" mat-button routerLink="/presentation/monitor">
|
||||||
<fa-icon [icon]="faDesktop"></fa-icon>
|
<fa-icon [icon]="faDesktop"></fa-icon>
|
||||||
Präsentation starten
|
Präsentation starten
|
||||||
</button>
|
</button>
|
||||||
@@ -86,8 +87,8 @@
|
|||||||
<mat-form-field appearance="outline">
|
<mat-form-field appearance="outline">
|
||||||
<mat-label>Hintergrund</mat-label>
|
<mat-label>Hintergrund</mat-label>
|
||||||
<mat-select
|
<mat-select
|
||||||
[ngModel]="show.presentationBackground"
|
(ngModelChange)="onBackground($event, show.id)"
|
||||||
(ngModelChange)="onBackground($event, show.id)">
|
[ngModel]="show.presentationBackground">
|
||||||
<mat-option value="none">kein Hintergrund</mat-option>
|
<mat-option value="none">kein Hintergrund</mat-option>
|
||||||
<mat-option value="blue">Sternenhimmel</mat-option>
|
<mat-option value="blue">Sternenhimmel</mat-option>
|
||||||
<mat-option value="green">Blätter</mat-option>
|
<mat-option value="green">Blätter</mat-option>
|
||||||
@@ -98,25 +99,27 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-slider
|
<mat-slider
|
||||||
(ngModelChange)="onZoom($event, show.id)"
|
#slider
|
||||||
[max]="100"
|
[max]="100"
|
||||||
[min]="10"
|
[min]="10"
|
||||||
[ngModel]="show.presentationZoom"
|
|
||||||
[step]="2"
|
[step]="2"
|
||||||
[thumbLabel]="true"
|
|
||||||
color="primary"
|
|
||||||
class="zoom-slider"
|
class="zoom-slider"
|
||||||
>
|
color="primary"
|
||||||
|
ngDefaultControl
|
||||||
|
><input (ngModelChange)="onZoom($event, show.id)"
|
||||||
|
[ngModel]="show.presentationZoom"
|
||||||
|
matSliderThumb>
|
||||||
</mat-slider>
|
</mat-slider>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-add-song
|
<app-add-song
|
||||||
*ngIf="show"
|
*ngIf="show"
|
||||||
[addedLive]="true"
|
[addedLive]="true"
|
||||||
[showSongs]="showSongs"
|
[showSongs]="showSongs"
|
||||||
[songs]="songs$|async"
|
|
||||||
[show]="show"
|
[show]="show"
|
||||||
|
[songs]="songs$|async"
|
||||||
></app-add-song>
|
></app-add-song>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</app-card>
|
</app-card>
|
||||||
|
|||||||
@@ -47,21 +47,17 @@
|
|||||||
outline: 0.5px solid #eee;
|
outline: 0.5px solid #eee;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
.card-1;
|
outline: 0.5px solid var(--color-primary-light);
|
||||||
outline: 0 solid transparent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
.card-2;
|
outline: 0.5px solid var(--color-primary);
|
||||||
outline: 0 solid transparent;
|
|
||||||
|
|
||||||
.head {
|
.head {
|
||||||
background: #4286f4;
|
background-color: var(--color-primary);
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fragment {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +75,11 @@
|
|||||||
.div-bottom {
|
.div-bottom {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
grid-template-columns: min-content min-content auto;
|
grid-template-columns: 1fr 1fr 1fr;
|
||||||
|
|
||||||
|
.btn-start-presentation {
|
||||||
|
height: 56px;
|
||||||
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 860px) {
|
@media screen and (max-width: 860px) {
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('RemoteComponent', () => {
|
|||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
declarations: [RemoteComponent],
|
declarations: [RemoteComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ 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 {GlobalSettings} from '../../../services/global-settings';
|
||||||
|
import {LineType} from '../../songs/services/line-type';
|
||||||
|
|
||||||
export interface PresentationSong {
|
export interface PresentationSong {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -25,6 +26,7 @@ export interface PresentationSong {
|
|||||||
styleUrls: ['./remote.component.less'],
|
styleUrls: ['./remote.component.less'],
|
||||||
animations: [fade],
|
animations: [fade],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class RemoteComponent {
|
export class RemoteComponent {
|
||||||
public show: Show | null = null;
|
public show: Show | null = null;
|
||||||
@@ -35,13 +37,37 @@ export class RemoteComponent {
|
|||||||
public faIcon = faFolderOpen;
|
public faIcon = faFolderOpen;
|
||||||
|
|
||||||
public faDesktop = faDesktop;
|
public faDesktop = faDesktop;
|
||||||
|
public presentationDynamicCaptionChanged$ = new Subject<{presentationDynamicCaption: string; showId: string}>();
|
||||||
|
public presentationDynamicTextChanged$ = new Subject<{presentationDynamicText: string; showId: string}>();
|
||||||
|
|
||||||
|
public constructor(
|
||||||
|
private showService: ShowService,
|
||||||
|
private showSongService: ShowSongService,
|
||||||
|
private songService: SongService,
|
||||||
|
private textRenderingService: TextRenderingService,
|
||||||
|
globalSettingsService: GlobalSettingsService,
|
||||||
|
private cRef: ChangeDetectorRef,
|
||||||
|
) {
|
||||||
|
globalSettingsService.get$
|
||||||
|
.pipe(
|
||||||
|
filter(_ => !!_),
|
||||||
|
map(_ => _.currentShow),
|
||||||
|
)
|
||||||
|
.subscribe(_ => {
|
||||||
|
this.onShowChanged(_);
|
||||||
|
this.cRef.markForCheck();
|
||||||
|
});
|
||||||
|
|
||||||
|
this.presentationDynamicCaptionChanged$
|
||||||
|
.pipe(debounceTime(1000))
|
||||||
|
.subscribe(_ => void this.showService.update$(_.showId, {presentationDynamicCaption: _.presentationDynamicCaption}));
|
||||||
|
this.presentationDynamicTextChanged$.pipe(debounceTime(1000)).subscribe(_ => void this.showService.update$(_.showId, {presentationDynamicText: _.presentationDynamicText}));
|
||||||
|
}
|
||||||
|
|
||||||
public trackBy(index: number, item: PresentationSong): string {
|
public trackBy(index: number, item: PresentationSong): string {
|
||||||
return item.id;
|
return item.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public presentationDynamicCaptionChanged$ = new Subject<{presentationDynamicCaption: string; showId: string}>();
|
|
||||||
|
|
||||||
public onShowChanged(change: string): void {
|
public onShowChanged(change: string): void {
|
||||||
combineLatest([this.showService.read$(change), this.showSongService.list$(change)]).subscribe(([show, list]) => {
|
combineLatest([this.showService.read$(change), this.showSongService.list$(change)]).subscribe(([show, list]) => {
|
||||||
this.showSongs = list;
|
this.showSongs = list;
|
||||||
@@ -49,7 +75,7 @@ export class RemoteComponent {
|
|||||||
const presentationSongs = list.map(song => ({
|
const presentationSongs = list.map(song => ({
|
||||||
id: song.id,
|
id: song.id,
|
||||||
title: song.title,
|
title: song.title,
|
||||||
sections: this.textRenderingService.parse(song.text, null),
|
sections: this.textRenderingService.parse(song.text, null, false),
|
||||||
}));
|
}));
|
||||||
this.presentationSongs = show?.order.map(_ => presentationSongs.filter(f => f.id === _)[0]) ?? [];
|
this.presentationSongs = show?.order.map(_ => presentationSongs.filter(f => f.id === _)[0]) ?? [];
|
||||||
this.cRef.markForCheck();
|
this.cRef.markForCheck();
|
||||||
@@ -57,7 +83,7 @@ export class RemoteComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getFirstLine(section: Section): string {
|
public getFirstLine(section: Section): string {
|
||||||
return section.lines.filter(_ => _.type === 1)[0].text;
|
return section.lines.filter(_ => _.type === LineType.text)[0].text;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async onSectionClick(id: string, index: number, showId: string): Promise<void> {
|
public async onSectionClick(id: string, index: number, showId: string): Promise<void> {
|
||||||
@@ -74,32 +100,6 @@ export class RemoteComponent {
|
|||||||
public async onBackground(presentationBackground: PresentationBackground, showId: string): Promise<void> {
|
public async onBackground(presentationBackground: PresentationBackground, showId: string): Promise<void> {
|
||||||
await this.showService.update$(showId, {presentationBackground});
|
await this.showService.update$(showId, {presentationBackground});
|
||||||
}
|
}
|
||||||
public presentationDynamicTextChanged$ = new Subject<{presentationDynamicText: string; showId: string}>();
|
|
||||||
|
|
||||||
public constructor(
|
|
||||||
private showService: ShowService,
|
|
||||||
private showSongService: ShowSongService,
|
|
||||||
private songService: SongService,
|
|
||||||
private textRenderingService: TextRenderingService,
|
|
||||||
private globalSettingsService: GlobalSettingsService,
|
|
||||||
private cRef: ChangeDetectorRef
|
|
||||||
) {
|
|
||||||
globalSettingsService.get$
|
|
||||||
.pipe(
|
|
||||||
filter(_ => !!_),
|
|
||||||
map(_ => _ as GlobalSettings),
|
|
||||||
map(_ => _.currentShow)
|
|
||||||
)
|
|
||||||
.subscribe(_ => {
|
|
||||||
this.onShowChanged(_);
|
|
||||||
this.cRef.markForCheck();
|
|
||||||
});
|
|
||||||
|
|
||||||
this.presentationDynamicCaptionChanged$
|
|
||||||
.pipe(debounceTime(1000))
|
|
||||||
.subscribe(_ => void this.showService.update$(_.showId, {presentationDynamicCaption: _.presentationDynamicCaption}));
|
|
||||||
this.presentationDynamicTextChanged$.pipe(debounceTime(1000)).subscribe(_ => void this.showService.update$(_.showId, {presentationDynamicText: _.presentationDynamicText}));
|
|
||||||
}
|
|
||||||
|
|
||||||
public onDynamicCaption(presentationDynamicCaption: string, showId: string): void {
|
public onDynamicCaption(presentationDynamicCaption: string, showId: string): void {
|
||||||
this.presentationDynamicCaptionChanged$.next({presentationDynamicCaption, showId});
|
this.presentationDynamicCaptionChanged$.next({presentationDynamicCaption, showId});
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<div *ngIf="shows$ | async as shows" @fade>
|
<div *ngIf="shows$ | async as shows" @fade>
|
||||||
<app-card heading="Bitte eine Veranstaltung auswählen" *ngIf="visible">
|
<app-card *ngIf="visible" heading="Bitte eine Veranstaltung auswählen">
|
||||||
<p *ngIf="!shows.length">
|
<p *ngIf="!shows.length">
|
||||||
Es ist derzeit keine Veranstaltung vorhanden
|
Es ist derzeit keine Veranstaltung vorhanden
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div *ngIf="shows.length>0" class="list">
|
<div *ngIf="shows.length>0" class="list">
|
||||||
<button mat-stroked-button *ngFor="let show of shows" (click)="selectShow(show)">
|
<button (click)="selectShow(show)" *ngFor="let show of shows" mat-stroked-button>
|
||||||
<app-user-name [userId]="show.owner"></app-user-name>
|
<app-user-name [userId]="show.owner"></app-user-name>
|
||||||
,
|
,
|
||||||
{{ show.showType | showType }},
|
{{ show.showType | showType }},
|
||||||
|
|||||||
@@ -11,15 +11,17 @@ import {fade} from '../../../animations';
|
|||||||
templateUrl: './select.component.html',
|
templateUrl: './select.component.html',
|
||||||
styleUrls: ['./select.component.less'],
|
styleUrls: ['./select.component.less'],
|
||||||
animations: [fade],
|
animations: [fade],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class SelectComponent implements OnInit {
|
export class SelectComponent implements OnInit {
|
||||||
public constructor(private showService: ShowService, private globalSettingsService: GlobalSettingsService, private router: Router) {}
|
|
||||||
public visible = false;
|
public visible = false;
|
||||||
|
|
||||||
public shows$ = this.showService
|
public shows$ = this.showService
|
||||||
.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 async selectShow(show: Show) {
|
public async selectShow(show: Show) {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
|
|
||||||
|
|||||||
@@ -3,4 +3,5 @@ import {Injectable} from '@angular/core';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class PresentationService {}
|
export class PresentationService {
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,5 +4,7 @@ import {Component} from '@angular/core';
|
|||||||
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'],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class ArchiveDialogComponent {}
|
export class ArchiveDialogComponent {
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<div mat-dialog-content>
|
||||||
|
<a [href]="data.url">{{ data.url }}</a>
|
||||||
|
<div [style.background-image]="'url('+qrCode+')'" alt="qrcode" class="qrcode">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div mat-dialog-actions>
|
||||||
|
<button [mat-dialog-close]="true" cdkFocusInitial mat-button>
|
||||||
|
Schließen
|
||||||
|
</button>
|
||||||
|
<button (click)="share()" mat-button>
|
||||||
|
Teilen
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
.qrcode {
|
||||||
|
width: 300px;
|
||||||
|
height: 300px;
|
||||||
|
background-size: contain;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center;
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import {ComponentFixture, TestBed} from '@angular/core/testing';
|
||||||
|
|
||||||
|
import {ShareDialogComponent} from './share-dialog.component';
|
||||||
|
|
||||||
|
describe('ShareDialogComponent', () => {
|
||||||
|
let component: ShareDialogComponent;
|
||||||
|
let fixture: ComponentFixture<ShareDialogComponent>;
|
||||||
|
|
||||||
|
beforeEach(async () => {
|
||||||
|
await TestBed.configureTestingModule({
|
||||||
|
imports: [ShareDialogComponent],
|
||||||
|
}).compileComponents();
|
||||||
|
|
||||||
|
fixture = TestBed.createComponent(ShareDialogComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import {Component, Inject} from '@angular/core';
|
||||||
|
import {MAT_DIALOG_DATA, MatDialogActions, MatDialogClose, MatDialogContent} from '@angular/material/dialog';
|
||||||
|
import {MatButton} from '@angular/material/button';
|
||||||
|
import QRCode from 'qrcode';
|
||||||
|
import {ShowTypePipe} from '../../../../widget-modules/pipes/show-type-translater/show-type.pipe';
|
||||||
|
import {Show} from '../../services/show';
|
||||||
|
|
||||||
|
export interface ShareDialogData {
|
||||||
|
url: string;
|
||||||
|
show: Show;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-share-dialog',
|
||||||
|
imports: [MatButton, MatDialogActions, MatDialogContent, MatDialogClose],
|
||||||
|
templateUrl: './share-dialog.component.html',
|
||||||
|
styleUrl: './share-dialog.component.less',
|
||||||
|
})
|
||||||
|
export class ShareDialogComponent {
|
||||||
|
public qrCode: string;
|
||||||
|
|
||||||
|
public constructor(@Inject(MAT_DIALOG_DATA) public data: ShareDialogData) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment
|
||||||
|
QRCode.toDataURL(data.url, {
|
||||||
|
type: 'image/jpeg',
|
||||||
|
quality: 0.92,
|
||||||
|
width: 1280,
|
||||||
|
height: 1280,
|
||||||
|
color: {
|
||||||
|
dark: '#010414',
|
||||||
|
light: '#ffffff',
|
||||||
|
},
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-return
|
||||||
|
}).then(_ => (this.qrCode = _));
|
||||||
|
}
|
||||||
|
|
||||||
|
public async share() {
|
||||||
|
if (navigator.clipboard) await navigator.clipboard.writeText(this.data.url);
|
||||||
|
|
||||||
|
if (navigator.share)
|
||||||
|
await navigator.share({
|
||||||
|
title: new ShowTypePipe().transform(this.data.show.showType),
|
||||||
|
text: new ShowTypePipe().transform(this.data.show.showType) + ' am ' + this.data.show.date.toDate().toLocaleString('de'),
|
||||||
|
url: this.data.url,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -6,19 +6,21 @@
|
|||||||
<mat-select formControlName="showType">
|
<mat-select formControlName="showType">
|
||||||
<mat-optgroup label="öffentlich">
|
<mat-optgroup label="öffentlich">
|
||||||
<mat-option *ngFor="let key of showTypePublic" [value]="key">{{
|
<mat-option *ngFor="let key of showTypePublic" [value]="key">{{
|
||||||
key | showType
|
key | showType
|
||||||
}}</mat-option>
|
}}
|
||||||
|
</mat-option>
|
||||||
</mat-optgroup>
|
</mat-optgroup>
|
||||||
<mat-optgroup label="privat">
|
<mat-optgroup label="privat">
|
||||||
<mat-option *ngFor="let key of showTypePrivate" [value]="key">{{
|
<mat-option *ngFor="let key of showTypePrivate" [value]="key">{{
|
||||||
key | showType
|
key | showType
|
||||||
}}</mat-option>
|
}}
|
||||||
|
</mat-option>
|
||||||
</mat-optgroup>
|
</mat-optgroup>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field appearance="outline">
|
<mat-form-field appearance="outline">
|
||||||
<mat-label>Datum</mat-label>
|
<mat-label>Datum</mat-label>
|
||||||
<input [matDatepicker]="picker" formControlName="date" matInput/>
|
<input [matDatepicker]="picker" formControlName="date" matInput />
|
||||||
<mat-datepicker-toggle [for]="picker" matSuffix></mat-datepicker-toggle>
|
<mat-datepicker-toggle [for]="picker" matSuffix></mat-datepicker-toggle>
|
||||||
<mat-datepicker #picker touchUi></mat-datepicker>
|
<mat-datepicker #picker touchUi></mat-datepicker>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|||||||
@@ -7,11 +7,14 @@ import {FormControl, FormGroup, 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';
|
||||||
|
import firebase from 'firebase/compat/app';
|
||||||
|
import Timestamp = firebase.firestore.Timestamp;
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-edit',
|
selector: 'app-edit',
|
||||||
templateUrl: './edit.component.html',
|
templateUrl: './edit.component.html',
|
||||||
styleUrls: ['./edit.component.less'],
|
styleUrls: ['./edit.component.less'],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class EditComponent implements OnInit {
|
export class EditComponent implements OnInit {
|
||||||
public shows$: Observable<Show[]>;
|
public shows$: Observable<Show[]>;
|
||||||
@@ -36,7 +39,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({
|
||||||
@@ -56,9 +59,9 @@ export class EditComponent implements OnInit {
|
|||||||
await this.showService.update$(
|
await this.showService.update$(
|
||||||
this.form.value.id as string,
|
this.form.value.id as string,
|
||||||
{
|
{
|
||||||
date: 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,3 +1,5 @@
|
|||||||
export interface FilterValues {
|
export interface FilterValues {
|
||||||
time: number;
|
time: number;
|
||||||
|
owner: string;
|
||||||
|
showType: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,37 @@
|
|||||||
<mat-label>Zeitraum</mat-label>
|
<mat-label>Zeitraum</mat-label>
|
||||||
<mat-select formControlName="time">
|
<mat-select formControlName="time">
|
||||||
<mat-option *ngFor="let time of times" [value]="time.key">{{
|
<mat-option *ngFor="let time of times" [value]="time.key">{{
|
||||||
time.value
|
time.value
|
||||||
}}</mat-option>
|
}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>Ersteller</mat-label>
|
||||||
|
<mat-select formControlName="owner">
|
||||||
|
<mat-option *ngFor="let owner of owners" [value]="owner.key">{{
|
||||||
|
owner.value
|
||||||
|
}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>Art der Veranstaltung</mat-label>
|
||||||
|
<mat-select formControlName="showType">
|
||||||
|
<mat-optgroup label="öffentlich">
|
||||||
|
<mat-option *ngFor="let key of showTypePublic" [value]="key">{{
|
||||||
|
key | showType
|
||||||
|
}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-optgroup>
|
||||||
|
<mat-optgroup label="privat">
|
||||||
|
<mat-option *ngFor="let key of showTypePrivate" [value]="key">{{
|
||||||
|
key | showType
|
||||||
|
}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-optgroup>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
.third {
|
.third {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
grid-template-columns: 1fr 1fr 1fr;
|
||||||
column-gap: 20px;
|
column-gap: 20px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,16 +4,26 @@ import {ActivatedRoute, Router} from '@angular/router';
|
|||||||
import {UntypedFormBuilder, UntypedFormGroup} from '@angular/forms';
|
import {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 {distinctUntilChanged, map} from 'rxjs/operators';
|
||||||
|
import {combineLatest, Observable} from 'rxjs';
|
||||||
|
import {dynamicSort, onlyUnique} from '../../../../services/filter.helper';
|
||||||
|
import {UserService} from '../../../../services/user/user.service';
|
||||||
|
import {isEqual} from 'lodash';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-filter',
|
selector: 'app-filter',
|
||||||
templateUrl: './filter.component.html',
|
templateUrl: './filter.component.html',
|
||||||
styleUrls: ['./filter.component.less'],
|
styleUrls: ['./filter.component.less'],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class FilterComponent {
|
export class FilterComponent {
|
||||||
@Input() public route = '/shows/';
|
@Input() public route = '/shows/';
|
||||||
@Input() public shows: Show[] = [];
|
@Input() public shows: Show[] = [];
|
||||||
|
|
||||||
|
public showTypePublic = ShowService.SHOW_TYPE_PUBLIC;
|
||||||
|
public showTypePrivate = ShowService.SHOW_TYPE_PRIVATE;
|
||||||
|
|
||||||
public filterFormGroup: UntypedFormGroup;
|
public filterFormGroup: UntypedFormGroup;
|
||||||
public times: KeyValue<number, string>[] = [
|
public times: KeyValue<number, string>[] = [
|
||||||
{key: 1, value: 'letzter Monat'},
|
{key: 1, value: 'letzter Monat'},
|
||||||
@@ -22,9 +32,19 @@ export class FilterComponent {
|
|||||||
{key: 99999, value: 'alle'},
|
{key: 99999, value: 'alle'},
|
||||||
];
|
];
|
||||||
|
|
||||||
public constructor(private router: Router, activatedRoute: ActivatedRoute, fb: UntypedFormBuilder) {
|
public owners: {key: string; value: string}[] = [];
|
||||||
|
|
||||||
|
public constructor(
|
||||||
|
private router: Router,
|
||||||
|
private showService: ShowService,
|
||||||
|
private userService: UserService,
|
||||||
|
activatedRoute: ActivatedRoute,
|
||||||
|
fb: UntypedFormBuilder,
|
||||||
|
) {
|
||||||
this.filterFormGroup = fb.group({
|
this.filterFormGroup = fb.group({
|
||||||
time: 1,
|
time: 1,
|
||||||
|
owner: null,
|
||||||
|
showType: null,
|
||||||
});
|
});
|
||||||
|
|
||||||
activatedRoute.queryParams.subscribe(params => {
|
activatedRoute.queryParams.subscribe(params => {
|
||||||
@@ -33,8 +53,34 @@ export class FilterComponent {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.filterFormGroup.controls.time.valueChanges.subscribe(_ => void this.filerValueChanged('time', _ as number));
|
this.filterFormGroup.controls.time.valueChanges.subscribe(_ => void this.filerValueChanged('time', _ as number));
|
||||||
|
this.filterFormGroup.controls.owner.valueChanges.subscribe(_ => void this.filerValueChanged('owner', _ as string));
|
||||||
|
this.filterFormGroup.controls.showType.valueChanges.subscribe(_ => void this.filerValueChanged('showType', _ as string));
|
||||||
|
|
||||||
|
this.owners$().subscribe(owners => (this.owners = owners));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public owners$ = (): Observable<{key: string; value: string}[]> => {
|
||||||
|
return combineLatest([
|
||||||
|
this.showService.list$().pipe(
|
||||||
|
map(shows => {
|
||||||
|
return shows.map(show => show.owner).filter(onlyUnique);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
this.userService.users$,
|
||||||
|
]).pipe(
|
||||||
|
map(([owners, users]) => {
|
||||||
|
return owners
|
||||||
|
.map(ownerId => ({
|
||||||
|
key: ownerId,
|
||||||
|
value: users.find(user => user.id === ownerId)?.name,
|
||||||
|
}))
|
||||||
|
.sort(dynamicSort('value'));
|
||||||
|
}),
|
||||||
|
distinctUntilChanged(isEqual),
|
||||||
|
map(_ => _ as {key: string; value: string}[]),
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
private async filerValueChanged<T>(key: string, value: T): Promise<void> {
|
private async filerValueChanged<T>(key: string, value: T): Promise<void> {
|
||||||
const route = this.router.createUrlTree([this.route], {
|
const route = this.router.createUrlTree([this.route], {
|
||||||
queryParams: {[key]: value},
|
queryParams: {[key]: value},
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
<div class="list-item" *ngIf="show">
|
<div *ngIf="show" class="list-item">
|
||||||
<div>{{ show.date.toDate() | date: "dd.MM.yyyy" }}</div>
|
<div>{{ show.date.toDate() | date: "dd.MM.yyyy" }}</div>
|
||||||
<div><app-user-name [userId]="show.owner"></app-user-name></div>
|
<div>
|
||||||
|
<app-user-name [userId]="show.owner"></app-user-name>
|
||||||
|
</div>
|
||||||
<div>{{ show.showType | showType }}</div>
|
<div>{{ show.showType | showType }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('ListItemComponent', () => {
|
|||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
declarations: [ListItemComponent],
|
declarations: [ListItemComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {Show} from '../../services/show';
|
|||||||
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'],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class ListItemComponent {
|
export class ListItemComponent {
|
||||||
@Input() public show: Show | null = null;
|
@Input() public show: Show | null = null;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<div>
|
<div>
|
||||||
<!-- <app-list-header *appRole="['leader']"></app-list-header>-->
|
<!-- <app-list-header *appRole="['leader']"></app-list-header>-->
|
||||||
<app-list-header *appRole="['leader']">
|
<app-list-header *appRole="['leader']">
|
||||||
<app-filter *ngIf="shows$ | async as shows" [shows]="publicShows$ | async"></app-filter>
|
<app-filter *ngIf="shows$ | async as shows" [shows]="publicShows$ | async"></app-filter>
|
||||||
</app-list-header>
|
</app-list-header>
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
<app-card
|
<app-card
|
||||||
*ngIf="shows.length > 0"
|
*ngIf="shows.length > 0"
|
||||||
[padding]="false"
|
[padding]="false"
|
||||||
heading="meine Veranstaltungen"
|
heading="Meine Veranstaltungen"
|
||||||
>
|
>
|
||||||
<app-list-item
|
<app-list-item
|
||||||
*ngFor="let show of shows | sortBy: 'desc':'date'"
|
*ngFor="let show of shows | sortBy: 'desc':'date'"
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
<app-card
|
<app-card
|
||||||
*ngIf="shows.length > 0"
|
*ngIf="shows.length > 0"
|
||||||
[padding]="false"
|
[padding]="false"
|
||||||
heading="veröffentlichte Veranstaltungen"
|
heading="Veröffentlichte Veranstaltungen"
|
||||||
>
|
>
|
||||||
<app-list-item
|
<app-list-item
|
||||||
*ngFor="let show of shows | sortBy: 'desc':'date'; trackBy: trackBy"
|
*ngFor="let show of shows | sortBy: 'desc':'date'; trackBy: trackBy"
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('ListComponent', () => {
|
|||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
declarations: [ListComponent],
|
declarations: [ListComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {map} from 'rxjs/operators';
|
|||||||
templateUrl: './list.component.html',
|
templateUrl: './list.component.html',
|
||||||
styleUrls: ['./list.component.less'],
|
styleUrls: ['./list.component.less'],
|
||||||
animations: [fade],
|
animations: [fade],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class ListComponent {
|
export class ListComponent {
|
||||||
public shows$ = this.showService.list$();
|
public shows$ = this.showService.list$();
|
||||||
@@ -21,20 +22,32 @@ 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(
|
||||||
|
map(params => {
|
||||||
|
const filterValues = params as FilterValues;
|
||||||
|
return filterValues?.owner;
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
public publicShows$ = combineLatest([this.shows$, this.lastMonths$]).pipe(
|
public publicShows$ = combineLatest([this.shows$, this.lastMonths$, this.owner$]).pipe(
|
||||||
map(_ =>
|
map(([shows, lastMonths, owner]) =>
|
||||||
_[0].filter(f => {
|
shows
|
||||||
const d = new Date();
|
.filter(f => {
|
||||||
d.setMonth(d.getMonth() - _[1]);
|
const d = new Date();
|
||||||
return f.published && f.date.toDate() >= d;
|
d.setMonth(d.getMonth() - lastMonths);
|
||||||
})
|
return f.published && f.date.toDate() >= d;
|
||||||
)
|
})
|
||||||
|
.filter(show => !owner || show.owner === owner),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
public constructor(private showService: ShowService, private activatedRoute: ActivatedRoute) {}
|
public constructor(
|
||||||
|
private showService: ShowService,
|
||||||
|
private activatedRoute: ActivatedRoute,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
public trackBy = (index: number, show: unknown) => (show as Show).id;
|
public trackBy = (index: number, show: unknown) => (show as Show).id;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,19 +6,21 @@
|
|||||||
<mat-select formControlName="showType">
|
<mat-select formControlName="showType">
|
||||||
<mat-optgroup label="öffentlich">
|
<mat-optgroup label="öffentlich">
|
||||||
<mat-option *ngFor="let key of showTypePublic" [value]="key">{{
|
<mat-option *ngFor="let key of showTypePublic" [value]="key">{{
|
||||||
key | showType
|
key | showType
|
||||||
}}</mat-option>
|
}}
|
||||||
|
</mat-option>
|
||||||
</mat-optgroup>
|
</mat-optgroup>
|
||||||
<mat-optgroup label="privat">
|
<mat-optgroup label="privat">
|
||||||
<mat-option *ngFor="let key of showTypePrivate" [value]="key">{{
|
<mat-option *ngFor="let key of showTypePrivate" [value]="key">{{
|
||||||
key | showType
|
key | showType
|
||||||
}}</mat-option>
|
}}
|
||||||
|
</mat-option>
|
||||||
</mat-optgroup>
|
</mat-optgroup>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field appearance="outline">
|
<mat-form-field appearance="outline">
|
||||||
<mat-label>Datum</mat-label>
|
<mat-label>Datum</mat-label>
|
||||||
<input [matDatepicker]="picker" formControlName="date" matInput/>
|
<input [matDatepicker]="picker" formControlName="date" matInput />
|
||||||
<mat-datepicker-toggle [for]="picker" matSuffix></mat-datepicker-toggle>
|
<mat-datepicker-toggle [for]="picker" matSuffix></mat-datepicker-toggle>
|
||||||
<mat-datepicker #picker touchUi></mat-datepicker>
|
<mat-datepicker #picker touchUi></mat-datepicker>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('NewComponent', () => {
|
|||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
declarations: [NewComponent],
|
declarations: [NewComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {faSave} from '@fortawesome/free-solid-svg-icons';
|
|||||||
selector: 'app-new',
|
selector: 'app-new',
|
||||||
templateUrl: './new.component.html',
|
templateUrl: './new.component.html',
|
||||||
styleUrls: ['./new.component.less'],
|
styleUrls: ['./new.component.less'],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class NewComponent implements OnInit {
|
export class NewComponent implements OnInit {
|
||||||
public shows$: Observable<Show[]>;
|
public shows$: Observable<Show[]>;
|
||||||
@@ -22,7 +23,11 @@ export class NewComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
public faSave = faSave;
|
public faSave = faSave;
|
||||||
|
|
||||||
public constructor(private showService: ShowService, showDataService: ShowDataService, private router: Router) {
|
public constructor(
|
||||||
|
private showService: ShowService,
|
||||||
|
showDataService: ShowDataService,
|
||||||
|
private router: Router,
|
||||||
|
) {
|
||||||
this.shows$ = showDataService.list$;
|
this.shows$ = showDataService.list$;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,10 +30,9 @@ export class DocxService {
|
|||||||
public constructor(
|
public constructor(
|
||||||
private showService: ShowService,
|
private showService: ShowService,
|
||||||
private showSongService: ShowSongService,
|
private showSongService: ShowSongService,
|
||||||
private songService: SongService,
|
|
||||||
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> {
|
||||||
@@ -94,7 +93,14 @@ export class DocxService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private renderSongs(songs: {showSong: ShowSong; sections: Section[]}[], options: DownloadOptions, config: Config): Paragraph[] {
|
private renderSongs(
|
||||||
|
songs: {
|
||||||
|
showSong: ShowSong;
|
||||||
|
sections: Section[];
|
||||||
|
}[],
|
||||||
|
options: DownloadOptions,
|
||||||
|
config: Config
|
||||||
|
): Paragraph[] {
|
||||||
return songs.reduce((p: Paragraph[], song) => [...p, ...this.renderSong(song.showSong, song.showSong, song.sections, options, config)], []);
|
return songs.reduce((p: Paragraph[], song) => [...p, ...this.renderSong(song.showSong, song.showSong, song.sections, options, config)], []);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,7 +205,15 @@ export class DocxService {
|
|||||||
sections,
|
sections,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
const songsLoaded = (await Promise.all(songsAsync)).filter(_ => !!_).map(_ => _ as {showSong: ShowSong; sections: Section[]});
|
const songsLoaded = (await Promise.all(songsAsync))
|
||||||
|
.filter(_ => !!_)
|
||||||
|
.map(
|
||||||
|
_ =>
|
||||||
|
_ as {
|
||||||
|
showSong: ShowSong;
|
||||||
|
sections: Section[];
|
||||||
|
}
|
||||||
|
);
|
||||||
const songs = show.order.map(_ => songsLoaded.filter(f => f.showSong.id === _)[0]);
|
const songs = show.order.map(_ => songsLoaded.filter(f => f.showSong.id === _)[0]);
|
||||||
return {songs, show, user, config};
|
return {songs, show, user, config};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,13 +8,15 @@ import {map} from 'rxjs/operators';
|
|||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class ShowDataService {
|
export class ShowDataService {
|
||||||
|
public list$ = new BehaviorSubject<Show[]>([]);
|
||||||
private collection = 'shows';
|
private collection = 'shows';
|
||||||
|
|
||||||
public constructor(private dbService: DbService) {
|
public constructor(private dbService: DbService) {
|
||||||
this.dbService.col$<Show>(this.collection).subscribe(_ => this.list$.next(_));
|
this.dbService.col$<Show>(this.collection).subscribe(_ => this.list$.next(_));
|
||||||
}
|
}
|
||||||
|
|
||||||
public list$ = new BehaviorSubject<Show[]>([]);
|
public listRaw$ = () => this.dbService.col$<Show>(this.collection);
|
||||||
|
|
||||||
public read$ = (showId: string): Observable<Show | null> => this.list$.pipe(map(_ => _.find(s => s.id === showId) || null));
|
public read$ = (showId: string): Observable<Show | null> => this.list$.pipe(map(_ => _.find(s => s.id === showId) || null));
|
||||||
|
|
||||||
// public list$ = (): Observable<Show[]> => this.dbService.col$(this.collection);
|
// public list$ = (): Observable<Show[]> => this.dbService.col$(this.collection);
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ 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,8 +14,9 @@ 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));
|
||||||
@@ -29,6 +30,7 @@ export class ShowSongService {
|
|||||||
chordMode: user.chordMode,
|
chordMode: user.chordMode,
|
||||||
addedLive,
|
addedLive,
|
||||||
};
|
};
|
||||||
|
await this.userService.incSongCount(songId);
|
||||||
return await this.showSongDataService.add(showId, data);
|
return await this.showSongDataService.add(showId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,13 +40,15 @@ export class ShowSongService {
|
|||||||
public list$ = (showId: string): Observable<ShowSong[]> => this.showSongDataService.list$(showId);
|
public list$ = (showId: string): Observable<ShowSong[]> => this.showSongDataService.list$(showId);
|
||||||
public list = (showId: string): Promise<ShowSong[]> => firstValueFrom(this.list$(showId));
|
public list = (showId: string): Promise<ShowSong[]> => firstValueFrom(this.list$(showId));
|
||||||
|
|
||||||
public async delete$(showId: string, songId: string, index: number): Promise<void> {
|
public async delete$(showId: string, showSongId: string, index: number): Promise<void> {
|
||||||
await this.showSongDataService.delete(showId, songId);
|
const showSong = await this.read(showId, showSongId);
|
||||||
|
await this.showSongDataService.delete(showId, showSongId);
|
||||||
const show = await firstValueFrom(this.showService.read$(showId));
|
const show = await firstValueFrom(this.showService.read$(showId));
|
||||||
if (!show) return;
|
if (!show) return;
|
||||||
const order = show.order;
|
const order = show.order;
|
||||||
order.splice(index, 1);
|
order.splice(index, 1);
|
||||||
await this.showService.update$(showId, {order});
|
await this.showService.update$(showId, {order});
|
||||||
|
await this.userService.decSongCount(showSong.songId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public update$ = async (showId: string, songId: string, data: Partial<ShowSong>): Promise<void> => await this.showSongDataService.update$(showId, songId, data);
|
public update$ = async (showId: string, songId: string, data: Partial<ShowSong>): Promise<void> => await this.showSongDataService.update$(showId, songId, data);
|
||||||
|
|||||||
@@ -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 => {
|
||||||
|
|||||||
@@ -25,14 +25,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)),
|
||||||
)
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export interface Show {
|
|||||||
published: boolean;
|
published: boolean;
|
||||||
archived: boolean;
|
archived: boolean;
|
||||||
order: string[];
|
order: string[];
|
||||||
|
shareId: string;
|
||||||
|
|
||||||
presentationSongId: string;
|
presentationSongId: string;
|
||||||
presentationDynamicCaption: string;
|
presentationDynamicCaption: string;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
show.date.toDate() | date: 'dd.MM.yyyy'
|
show.date.toDate() | date: 'dd.MM.yyyy'
|
||||||
}} - {{ getStatus(show) }}"
|
}} - {{ getStatus(show) }}"
|
||||||
>
|
>
|
||||||
<p *ngIf="!useSwiper">{{show.public ? 'öffentliche' : 'geschlossene'}} Veranstaltung von
|
<p *ngIf="!useSwiper">{{ show.public ? 'öffentliche' : 'geschlossene' }} Veranstaltung von
|
||||||
<app-user-name [userId]="show.owner"></app-user-name>
|
<app-user-name [userId]="show.owner"></app-user-name>
|
||||||
</p>
|
</p>
|
||||||
<div class="head">
|
<div class="head">
|
||||||
@@ -14,34 +14,35 @@
|
|||||||
<mat-checkbox *ngIf="!useSwiper" [(ngModel)]="showText">Text anzeigen</mat-checkbox>
|
<mat-checkbox *ngIf="!useSwiper" [(ngModel)]="showText">Text anzeigen</mat-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<div [class.floating]="useSwiper">
|
<div [class.floating]="useSwiper">
|
||||||
<app-menu-button @fade (click)="onZoomOut()" [icon]="faZoomOut" class="btn-delete btn-icon"
|
<app-menu-button (click)="onZoomOut()" @fade [icon]="faZoomOut" class="btn-delete btn-icon"
|
||||||
matTooltip="Verkleinern"></app-menu-button>
|
matTooltip="Verkleinern"></app-menu-button>
|
||||||
<app-menu-button @fade (click)="onZoomIn()" [icon]="faZoomIn" class="btn-delete btn-icon"
|
<app-menu-button (click)="onZoomIn()" @fade [icon]="faZoomIn" class="btn-delete btn-icon"
|
||||||
matTooltip="Vergrößern"></app-menu-button>
|
matTooltip="Vergrößern"></app-menu-button>
|
||||||
<app-menu-button (click)="useSwiper=!useSwiper;fullscreen(useSwiper)" @fade
|
<app-menu-button (click)="useSwiper=!useSwiper;fullscreen(useSwiper)" @fade
|
||||||
[icon]="useSwiper ? faFileLines : faFile" class="btn-delete btn-icon"
|
[icon]="useSwiper ? faFileLines : faFile" class="btn-delete btn-icon"
|
||||||
matTooltip="Swiper umschalten"></app-menu-button>
|
matTooltip="Swiper umschalten"></app-menu-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="showSongs && !useSwiper" [cdkDropListDisabled]="show.published || showText" cdkDropList
|
<div (cdkDropListDropped)="drop($event, show)" *ngIf="showSongs && !useSwiper" [cdkDropListDisabled]="show.published || showText"
|
||||||
class="song-list"
|
|
||||||
[style.cursor]="!(show.published || showText) ? 'drag' : 'inherit'"
|
[style.cursor]="!(show.published || showText) ? 'drag' : 'inherit'"
|
||||||
[style.font-size]="textSize + 'em'"
|
[style.font-size]="textSize + 'em'"
|
||||||
(cdkDropListDropped)="drop($event, show)">
|
cdkDropList
|
||||||
<div *ngFor="let song of orderedShowSongs(show); let i = index; trackBy: trackBy" class="song-row" cdkDrag>
|
class="song-list">
|
||||||
|
<div *ngFor="let song of orderedShowSongs(show); let i = index; trackBy: trackBy" cdkDrag class="song-row">
|
||||||
<app-song
|
<app-song
|
||||||
[showSong]="song"
|
|
||||||
[showId]="showId"
|
|
||||||
[showText]="showText"
|
|
||||||
[show]="show"
|
|
||||||
[fullscreen]="useSwiper"
|
[fullscreen]="useSwiper"
|
||||||
[index]="i"
|
[index]="i"
|
||||||
|
[showId]="showId"
|
||||||
|
[showSong]="song"
|
||||||
|
[showText]="showText"
|
||||||
|
[show]="show"
|
||||||
></app-song>
|
></app-song>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<swiper-container *ngIf="useSwiper" scrollbar="true">
|
<swiper-container *ngIf="useSwiper" scrollbar="true">
|
||||||
<swiper-slide *ngFor="let song of orderedShowSongs(show); let i = index; trackBy: trackBy" [style.font-size]="textSize + 'em'"
|
<swiper-slide *ngFor="let song of orderedShowSongs(show); let i = index; trackBy: trackBy"
|
||||||
|
[style.font-size]="textSize + 'em'"
|
||||||
class="song-swipe">
|
class="song-swipe">
|
||||||
<app-song
|
<app-song
|
||||||
[fullscreen]="true"
|
[fullscreen]="true"
|
||||||
@@ -51,13 +52,14 @@
|
|||||||
[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>
|
||||||
</swiper-slide>
|
</swiper-slide>
|
||||||
</swiper-container>
|
</swiper-container>
|
||||||
|
|
||||||
<app-add-song
|
<app-add-song
|
||||||
*ngIf="songs && !show.published && !useSwiper"
|
*ngIf="songs && !show.published && !useSwiper"
|
||||||
[show]="show"
|
|
||||||
[showSongs]="showSongs"
|
[showSongs]="showSongs"
|
||||||
|
[show]="show"
|
||||||
[songs]="songs"
|
[songs]="songs"
|
||||||
></app-add-song>
|
></app-add-song>
|
||||||
|
|
||||||
@@ -76,7 +78,10 @@
|
|||||||
<app-button (click)="onPublish(false)" *ngIf="show.published" [icon]="faUnpublish">
|
<app-button (click)="onPublish(false)" *ngIf="show.published" [icon]="faUnpublish">
|
||||||
Veröffentlichung zurückziehen
|
Veröffentlichung zurückziehen
|
||||||
</app-button>
|
</app-button>
|
||||||
<app-button (click)="onChange(show.id)" [icon]="faSliders" *ngIf="!show.published">
|
<app-button (click)="onShare(show)" *ngIf="show.published" [icon]="faShare">
|
||||||
|
Teilen
|
||||||
|
</app-button>
|
||||||
|
<app-button (click)="onChange(show.id)" *ngIf="!show.published" [icon]="faSliders">
|
||||||
Ändern
|
Ändern
|
||||||
</app-button>
|
</app-button>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|||||||
@@ -49,3 +49,14 @@
|
|||||||
top: 12px;
|
top: 12px;
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.next-song {
|
||||||
|
color: #0008;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
right: 10px;
|
||||||
|
|
||||||
|
fa-icon {
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('ShowComponent', () => {
|
|||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
declarations: [ShowComponent],
|
declarations: [ShowComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -10,9 +10,10 @@ import {ShowSongService} from '../services/show-song.service';
|
|||||||
import {ShowSong} from '../services/show-song';
|
import {ShowSong} from '../services/show-song';
|
||||||
import {DocxService} from '../services/docx.service';
|
import {DocxService} from '../services/docx.service';
|
||||||
import {
|
import {
|
||||||
|
faArrowUpRightFromSquare,
|
||||||
faBox,
|
faBox,
|
||||||
faBoxOpen,
|
faBoxOpen,
|
||||||
faExternalLinkAlt,
|
faChevronRight,
|
||||||
faFile,
|
faFile,
|
||||||
faFileDownload,
|
faFileDownload,
|
||||||
faFileLines,
|
faFileLines,
|
||||||
@@ -20,6 +21,7 @@ import {
|
|||||||
faMagnifyingGlassMinus,
|
faMagnifyingGlassMinus,
|
||||||
faMagnifyingGlassPlus,
|
faMagnifyingGlassPlus,
|
||||||
faSliders,
|
faSliders,
|
||||||
|
faUnlock,
|
||||||
faUser,
|
faUser,
|
||||||
faUsers,
|
faUsers,
|
||||||
} from '@fortawesome/free-solid-svg-icons';
|
} from '@fortawesome/free-solid-svg-icons';
|
||||||
@@ -28,12 +30,15 @@ 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 {ShareDialogComponent} from '../dialog/share-dialog/share-dialog.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-show',
|
selector: 'app-show',
|
||||||
templateUrl: './show.component.html',
|
templateUrl: './show.component.html',
|
||||||
styleUrls: ['./show.component.less'],
|
styleUrls: ['./show.component.less'],
|
||||||
animations: [fade],
|
animations: [fade],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class ShowComponent implements OnInit, OnDestroy {
|
export class ShowComponent implements OnInit, OnDestroy {
|
||||||
public show$: Observable<Show | null> | null = null;
|
public show$: Observable<Show | null> | null = null;
|
||||||
@@ -44,18 +49,21 @@ export class ShowComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
public faBox = faBox;
|
public faBox = faBox;
|
||||||
public faBoxOpen = faBoxOpen;
|
public faBoxOpen = faBoxOpen;
|
||||||
public faPublish = faExternalLinkAlt;
|
public faPublish = faUnlock;
|
||||||
public faUnpublish = faLock;
|
public faUnpublish = faLock;
|
||||||
|
public faShare = faArrowUpRightFromSquare;
|
||||||
public faDownload = faFileDownload;
|
public faDownload = faFileDownload;
|
||||||
public faSliders = faSliders;
|
public faSliders = faSliders;
|
||||||
public faUser = faUser;
|
public faUser = faUser;
|
||||||
public faUsers = faUsers;
|
public faUsers = faUsers;
|
||||||
public faZoomIn = faMagnifyingGlassPlus;
|
public faZoomIn = faMagnifyingGlassPlus;
|
||||||
public faZoomOut = faMagnifyingGlassMinus;
|
public faZoomOut = faMagnifyingGlassMinus;
|
||||||
public faPage = faFile;
|
|
||||||
public faLines = faFileLines;
|
|
||||||
private subs: Subscription[] = [];
|
|
||||||
public useSwiper = false;
|
public useSwiper = false;
|
||||||
|
public textSize = 1;
|
||||||
|
public faFileLines = faFileLines;
|
||||||
|
public faFile = faFile;
|
||||||
|
public faNextSong = faChevronRight;
|
||||||
|
private subs: Subscription[] = [];
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
private activatedRoute: ActivatedRoute,
|
private activatedRoute: ActivatedRoute,
|
||||||
@@ -65,15 +73,17 @@ export class ShowComponent implements OnInit, OnDestroy {
|
|||||||
private docxService: DocxService,
|
private docxService: DocxService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private cRef: ChangeDetectorRef,
|
private cRef: ChangeDetectorRef,
|
||||||
public dialog: MatDialog
|
public dialog: MatDialog,
|
||||||
) {}
|
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
|
||||||
@@ -81,7 +91,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 = _;
|
||||||
@@ -93,7 +103,7 @@ export class ShowComponent implements OnInit, OnDestroy {
|
|||||||
.subscribe(_ => {
|
.subscribe(_ => {
|
||||||
this.songs = _;
|
this.songs = _;
|
||||||
this.cRef.markForCheck();
|
this.cRef.markForCheck();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,8 +111,6 @@ export class ShowComponent implements OnInit, OnDestroy {
|
|||||||
this.subs.forEach(_ => _.unsubscribe());
|
this.subs.forEach(_ => _.unsubscribe());
|
||||||
}
|
}
|
||||||
|
|
||||||
public textSize = 1;
|
|
||||||
|
|
||||||
public onZoomIn() {
|
public onZoomIn() {
|
||||||
this.textSize += 0.1;
|
this.textSize += 0.1;
|
||||||
}
|
}
|
||||||
@@ -128,6 +136,11 @@ export class ShowComponent implements OnInit, OnDestroy {
|
|||||||
if (this.showId != null) await this.showService.update$(this.showId, {published});
|
if (this.showId != null) await this.showService.update$(this.showId, {published});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public onShare = async (show: Show): Promise<void> => {
|
||||||
|
const url = await this.guestShowService.share(show, this.orderedShowSongs(show));
|
||||||
|
this.dialog.open(ShareDialogComponent, {data: {url, show}});
|
||||||
|
};
|
||||||
|
|
||||||
public getStatus(show: Show): string {
|
public getStatus(show: Show): string {
|
||||||
if (show.published) {
|
if (show.published) {
|
||||||
return 'veröffentlicht';
|
return 'veröffentlicht';
|
||||||
@@ -162,15 +175,12 @@ export class ShowComponent implements OnInit, OnDestroy {
|
|||||||
return show.order.map(_ => list.filter(f => f.id === _)[0]);
|
return show.order.map(_ => list.filter(f => f.id === _)[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public trackBy = (index: number, show: ShowSong) => show.id;
|
public trackBy = (_: number, show: ShowSong) => show.id;
|
||||||
|
|
||||||
public async onChange(showId: string) {
|
public async onChange(showId: string) {
|
||||||
await this.router.navigateByUrl('/shows/' + showId + '/edit');
|
await this.router.navigateByUrl('/shows/' + showId + '/edit');
|
||||||
}
|
}
|
||||||
|
|
||||||
public faFileLines = faFileLines;
|
|
||||||
public faFile = faFile;
|
|
||||||
|
|
||||||
@HostListener('document:keydown', ['$event'])
|
@HostListener('document:keydown', ['$event'])
|
||||||
public handleKeyboardEvent(event: KeyboardEvent) {
|
public handleKeyboardEvent(event: KeyboardEvent) {
|
||||||
const swiperEl = document.querySelector('swiper-container') as unknown as Swiper;
|
const swiperEl = document.querySelector('swiper-container') as unknown as Swiper;
|
||||||
@@ -190,6 +200,12 @@ export class ShowComponent implements OnInit, OnDestroy {
|
|||||||
if (useSwiper) openFullscreen();
|
if (useSwiper) openFullscreen();
|
||||||
else closeFullscreen();
|
else closeFullscreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getNextSong(showSongs: ShowSong[], i: number): string {
|
||||||
|
if (!showSongs || showSongs.length === 0) return '';
|
||||||
|
const song = showSongs[i + 1];
|
||||||
|
return song?.title ?? '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Swiper {
|
export interface Swiper {
|
||||||
|
|||||||
@@ -7,9 +7,10 @@
|
|||||||
<div *ngIf="!show.published && !fullscreen" class="song">
|
<div *ngIf="!show.published && !fullscreen" class="song">
|
||||||
<span class="title">{{ iSong.title }}</span>
|
<span class="title">{{ iSong.title }}</span>
|
||||||
<span *ngIf="!edit" class="keys">
|
<span *ngIf="!edit" class="keys">
|
||||||
<span *ngIf="iSong.keyOriginal !== iSong.key">{{ iSong.keyOriginal }} → </span>
|
<span *ngIf="iSong.keyOriginal !== iSong.key">{{ iSong.keyOriginal }} → </span><span
|
||||||
<mat-form-field *ngIf="keys" appearance="standard" class="keys">
|
(click)="openKeySelect()">{{ iSong.key }}</span>
|
||||||
<mat-select [formControl]="keyFormControl">
|
<mat-form-field (click)="option.open()" *ngIf="keys" class="transpose">
|
||||||
|
<mat-select #option [formControl]="keyFormControl">
|
||||||
<mat-option *ngFor="let key of keys" [value]="key">{{ key }}</mat-option>
|
<mat-option *ngFor="let key of keys" [value]="key">{{ key }}</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
@@ -22,10 +23,11 @@
|
|||||||
|
|
||||||
<mat-form-field *ngIf="edit" appearance="outline">
|
<mat-form-field *ngIf="edit" appearance="outline">
|
||||||
<mat-label>Songtext</mat-label>
|
<mat-label>Songtext</mat-label>
|
||||||
<textarea matTooltip="Tonart ändern"
|
<textarea [cdkTextareaAutosize]="true"
|
||||||
[cdkTextareaAutosize]="true"
|
|
||||||
[formControl]="editSongControl"
|
[formControl]="editSongControl"
|
||||||
|
class="edit"
|
||||||
matInput
|
matInput
|
||||||
|
matTooltip="Tonart ändern"
|
||||||
></textarea>
|
></textarea>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<div *ngIf="edit">Es wird nur der Liedtext für dieser Veranstaltung geändert.</div>
|
<div *ngIf="edit">Es wird nur der Liedtext für dieser Veranstaltung geändert.</div>
|
||||||
|
|||||||
@@ -17,8 +17,18 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.keys {
|
.keys {
|
||||||
width: 40px;
|
position: relative;
|
||||||
margin: -24px 0 -20px 0;
|
margin-right: 10px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: var(--color-primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.transpose {
|
||||||
|
height: 0;
|
||||||
|
position: absolute;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-up {
|
.btn-up {
|
||||||
@@ -54,6 +64,7 @@
|
|||||||
grid-area: delete;
|
grid-area: delete;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-edit {
|
.btn-edit {
|
||||||
grid-area: edit;
|
grid-area: edit;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
@@ -67,6 +78,6 @@ button {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
textarea {
|
textarea.edit {
|
||||||
font-family: 'Ubuntu Mono', monospace;
|
font-family: 'Ubuntu Mono', monospace;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('SongComponent', () => {
|
|||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
declarations: [SongComponent],
|
declarations: [SongComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {Component, Input, OnInit} from '@angular/core';
|
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';
|
||||||
@@ -7,12 +7,14 @@ import {ChordMode} from '../../../../widget-modules/components/song-text/song-te
|
|||||||
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';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-song',
|
selector: 'app-song',
|
||||||
templateUrl: './song.component.html',
|
templateUrl: './song.component.html',
|
||||||
styleUrls: ['./song.component.less'],
|
styleUrls: ['./song.component.less'],
|
||||||
animations: [fade],
|
animations: [fade],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class SongComponent implements OnInit {
|
export class SongComponent implements OnInit {
|
||||||
@Input() public show: Show | null = null;
|
@Input() public show: Show | null = null;
|
||||||
@@ -20,7 +22,6 @@ export class SongComponent implements OnInit {
|
|||||||
@Input() public showText: boolean | null = null;
|
@Input() public showText: boolean | null = null;
|
||||||
@Input() public index = -1;
|
@Input() public index = -1;
|
||||||
@Input() public fullscreen = false;
|
@Input() public fullscreen = false;
|
||||||
|
|
||||||
public keys: string[] = [];
|
public keys: string[] = [];
|
||||||
public faDelete = faTrash;
|
public faDelete = faTrash;
|
||||||
public faEdit = faPenToSquare;
|
public faEdit = faPenToSquare;
|
||||||
@@ -30,8 +31,10 @@ export class SongComponent implements OnInit {
|
|||||||
public iSong: ShowSong | null = null;
|
public iSong: ShowSong | null = null;
|
||||||
public edit = false;
|
public edit = false;
|
||||||
public editSongControl = new UntypedFormControl();
|
public editSongControl = new UntypedFormControl();
|
||||||
|
@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) {
|
||||||
@@ -75,4 +78,8 @@ export class SongComponent implements OnInit {
|
|||||||
chordMode: value,
|
chordMode: value,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public openKeySelect(): void {
|
||||||
|
this.keyOptions.open();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,4 +29,5 @@ const routes: Routes = [
|
|||||||
imports: [RouterModule.forChild(routes)],
|
imports: [RouterModule.forChild(routes)],
|
||||||
exports: [RouterModule],
|
exports: [RouterModule],
|
||||||
})
|
})
|
||||||
export class ShowsRoutingModule {}
|
export class ShowsRoutingModule {
|
||||||
|
}
|
||||||
|
|||||||
@@ -21,9 +21,7 @@ import {ShowComponent} from './show/show.component';
|
|||||||
import {SongComponent} from './show/song/song.component';
|
import {SongComponent} from './show/song/song.component';
|
||||||
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
|
import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
|
||||||
import {MenuButtonModule} from '../../widget-modules/components/menu-button/menu-button.module';
|
import {MenuButtonModule} from '../../widget-modules/components/menu-button/menu-button.module';
|
||||||
import {SongTextModule} from '../../widget-modules/components/song-text/song-text.module';
|
|
||||||
import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
|
import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
|
||||||
import {AddSongModule} from '../../widget-modules/components/add-song/add-song.module';
|
|
||||||
import {ButtonModule} from '../../widget-modules/components/button/button.module';
|
import {ButtonModule} from '../../widget-modules/components/button/button.module';
|
||||||
import {OwnerModule} from '../../services/user/owner.module';
|
import {OwnerModule} from '../../services/user/owner.module';
|
||||||
import {UserNameModule} from '../../services/user/user-name/user-name.module';
|
import {UserNameModule} from '../../services/user/user-name/user-name.module';
|
||||||
@@ -36,6 +34,8 @@ import {FilterComponent} from './list/filter/filter.component';
|
|||||||
import {EditComponent} from './edit/edit.component';
|
import {EditComponent} from './edit/edit.component';
|
||||||
import {ArchiveDialogComponent} from './dialog/archive-dialog/archive-dialog.component';
|
import {ArchiveDialogComponent} from './dialog/archive-dialog/archive-dialog.component';
|
||||||
import {MatDialogModule} from '@angular/material/dialog';
|
import {MatDialogModule} from '@angular/material/dialog';
|
||||||
|
import {SongTextComponent} from '../../widget-modules/components/song-text/song-text.component';
|
||||||
|
import {AddSongComponent} from '../../widget-modules/components/add-song/add-song.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [NewComponent, ListComponent, ListItemComponent, ShowComponent, SongComponent, FilterComponent, EditComponent, ArchiveDialogComponent],
|
declarations: [NewComponent, ListComponent, ListItemComponent, ShowComponent, SongComponent, FilterComponent, EditComponent, ArchiveDialogComponent],
|
||||||
@@ -57,9 +57,9 @@ import {MatDialogModule} from '@angular/material/dialog';
|
|||||||
FontAwesomeModule,
|
FontAwesomeModule,
|
||||||
MenuButtonModule,
|
MenuButtonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
SongTextModule,
|
SongTextComponent,
|
||||||
NgxMatSelectSearchModule,
|
NgxMatSelectSearchModule,
|
||||||
AddSongModule,
|
AddSongComponent,
|
||||||
ButtonModule,
|
ButtonModule,
|
||||||
OwnerModule,
|
OwnerModule,
|
||||||
UserNameModule,
|
UserNameModule,
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ 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,7 +7,8 @@ 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);
|
||||||
|
|||||||
@@ -2,4 +2,5 @@ export enum SectionType {
|
|||||||
Verse,
|
Verse,
|
||||||
Chorus,
|
Chorus,
|
||||||
Bridge,
|
Bridge,
|
||||||
|
Comment,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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', () => {
|
||||||
@@ -34,6 +34,6 @@ describe('SongDataService', () => {
|
|||||||
service.list$().subscribe(s => {
|
service.list$().subscribe(s => {
|
||||||
void expect(s[0].title).toEqual('title1');
|
void expect(s[0].title).toEqual('title1');
|
||||||
});
|
});
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ import {map} from 'rxjs/operators';
|
|||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class SongDataService {
|
export class SongDataService {
|
||||||
|
public list$ = new BehaviorSubject<Song[]>([]);
|
||||||
private collection = 'songs';
|
private collection = 'songs';
|
||||||
|
|
||||||
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$ = new BehaviorSubject<Song[]>([]);
|
|
||||||
// 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);
|
||||||
public read$ = (songId: string): Observable<Song | null> => this.list$.pipe(map(_ => _.find(s => s.id === songId) || null));
|
public read$ = (songId: string): Observable<Song | null> => this.list$.pipe(map(_ => _.find(s => s.id === songId) || null));
|
||||||
public update$ = async (songId: string, data: Partial<Song>): Promise<void> => await this.dbService.doc(this.collection + '/' + songId).update(data);
|
public update$ = async (songId: string, data: Partial<Song>): Promise<void> => await this.dbService.doc(this.collection + '/' + songId).update(data);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {Resolve} from '@angular/router';
|
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {SongService} from './song.service';
|
import {SongService} from './song.service';
|
||||||
import {Song} from './song';
|
import {Song} from './song';
|
||||||
@@ -8,8 +8,9 @@ import {filter} from 'rxjs/operators';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root',
|
providedIn: 'root',
|
||||||
})
|
})
|
||||||
export class SongListResolver implements Resolve<Song[]> {
|
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', () => {
|
||||||
@@ -30,6 +30,6 @@ describe('SongService', () => {
|
|||||||
service.list$().subscribe(s => {
|
service.list$().subscribe(s => {
|
||||||
void expect(s[0].title).toEqual('title1');
|
void expect(s[0].title).toEqual('title1');
|
||||||
});
|
});
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,7 +25,10 @@ export class SongService {
|
|||||||
|
|
||||||
// private list: Song[];
|
// private list: Song[];
|
||||||
|
|
||||||
public constructor(private songDataService: SongDataService, private userService: UserService) {
|
public constructor(
|
||||||
|
private songDataService: SongDataService,
|
||||||
|
private userService: UserService,
|
||||||
|
) {
|
||||||
// importCCLI = (songs: Song[]) => this.updateFromCLI(songs);
|
// importCCLI = (songs: Song[]) => this.updateFromCLI(songs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ export class TextRenderingService {
|
|||||||
|
|
||||||
public constructor(private transposeService: TransposeService) {}
|
public constructor(private transposeService: TransposeService) {}
|
||||||
|
|
||||||
public parse(text: string, transpose: TransposeMode | null): Section[] {
|
public parse(text: string, transpose: TransposeMode | null, withComments = true): Section[] {
|
||||||
if (!text) {
|
if (!text) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
const arrayOfLines = text.split(/\r?\n/).filter(_ => _);
|
const arrayOfLines = text.split(/\r?\n/).filter(_ => _ && (!_.startsWith('#') || withComments));
|
||||||
const indices = {
|
const indices = {
|
||||||
[SectionType.Bridge]: 0,
|
[SectionType.Bridge]: 0,
|
||||||
[SectionType.Chorus]: 0,
|
[SectionType.Chorus]: 0,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div [formGroup]="filterFormGroup">
|
<div [formGroup]="filterFormGroup">
|
||||||
<mat-form-field appearance="outline">
|
<mat-form-field appearance="outline">
|
||||||
<mat-label>Titel oder Text</mat-label>
|
<mat-label>Titel oder Text</mat-label>
|
||||||
<input formControlName="q" matInput/>
|
<input formControlName="q" matInput />
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<div class="third">
|
<div class="third">
|
||||||
@@ -10,8 +10,9 @@
|
|||||||
<mat-select formControlName="type">
|
<mat-select formControlName="type">
|
||||||
<mat-option [value]="null">- kein Filter -</mat-option>
|
<mat-option [value]="null">- kein Filter -</mat-option>
|
||||||
<mat-option *ngFor="let type of types" [value]="type">{{
|
<mat-option *ngFor="let type of types" [value]="type">{{
|
||||||
type | songType
|
type | songType
|
||||||
}}</mat-option>
|
}}
|
||||||
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -20,8 +21,9 @@
|
|||||||
<mat-select formControlName="key">
|
<mat-select formControlName="key">
|
||||||
<mat-option [value]="null">- kein Filter -</mat-option>
|
<mat-option [value]="null">- kein Filter -</mat-option>
|
||||||
<mat-option *ngFor="let key of keys" [value]="key">{{
|
<mat-option *ngFor="let key of keys" [value]="key">{{
|
||||||
key | key
|
key | key
|
||||||
}}</mat-option>
|
}}
|
||||||
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -30,8 +32,9 @@
|
|||||||
<mat-select formControlName="legalType">
|
<mat-select formControlName="legalType">
|
||||||
<mat-option [value]="null">- kein Filter -</mat-option>
|
<mat-option [value]="null">- kein Filter -</mat-option>
|
||||||
<mat-option *ngFor="let key of legalType" [value]="key">{{
|
<mat-option *ngFor="let key of legalType" [value]="key">{{
|
||||||
key | legalType
|
key | legalType
|
||||||
}}</mat-option>
|
}}
|
||||||
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
@@ -40,8 +43,9 @@
|
|||||||
<mat-select formControlName="flag">
|
<mat-select formControlName="flag">
|
||||||
<mat-option [value]="null">- kein Filter -</mat-option>
|
<mat-option [value]="null">- kein Filter -</mat-option>
|
||||||
<mat-option *ngFor="let flag of getFlags()" [value]="flag">{{
|
<mat-option *ngFor="let flag of getFlags()" [value]="flag">{{
|
||||||
flag
|
flag
|
||||||
}}</mat-option>
|
}}
|
||||||
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('FilterComponent', () => {
|
|||||||
void TestBed.configureTestingModule({
|
void TestBed.configureTestingModule({
|
||||||
declarations: [FilterComponent],
|
declarations: [FilterComponent],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {KEYS} from '../../services/key.helper';
|
|||||||
selector: 'app-filter',
|
selector: 'app-filter',
|
||||||
templateUrl: './filter.component.html',
|
templateUrl: './filter.component.html',
|
||||||
styleUrls: ['./filter.component.less'],
|
styleUrls: ['./filter.component.less'],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class FilterComponent {
|
export class FilterComponent {
|
||||||
public filterFormGroup: UntypedFormGroup;
|
public filterFormGroup: UntypedFormGroup;
|
||||||
|
|||||||
@@ -9,11 +9,19 @@
|
|||||||
<div>{{ song.title }}</div>
|
<div>{{ song.title }}</div>
|
||||||
<div>
|
<div>
|
||||||
<ng-container *appRole="['contributor']">
|
<ng-container *appRole="['contributor']">
|
||||||
<div *ngIf="song.status === 'draft'" class="warning"><fa-icon [icon]="faDraft"></fa-icon></div>
|
<div *ngIf="song.status === 'draft'" class="warning">
|
||||||
<div *ngIf="song.status === 'set'" class="neutral"><fa-icon [icon]="faDraft"></fa-icon></div>
|
<fa-icon [icon]="faDraft"></fa-icon>
|
||||||
<div *ngIf="song.status === 'final'" class="success"><fa-icon [icon]="faFinal"></fa-icon></div>
|
</div>
|
||||||
|
<div *ngIf="song.status === 'set'" class="neutral">
|
||||||
|
<fa-icon [icon]="faDraft"></fa-icon>
|
||||||
|
</div>
|
||||||
|
<div *ngIf="song.status === 'final'" class="success">
|
||||||
|
<fa-icon [icon]="faFinal"></fa-icon>
|
||||||
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<div *ngIf="song.legalType === 'open'" class="warning" ><fa-icon [icon]="faLegal"></fa-icon></div>
|
<div *ngIf="song.legalType === 'open'" class="warning">
|
||||||
|
<fa-icon [icon]="faLegal"></fa-icon>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>{{ song.key }}</div>
|
<div>{{ song.key }}</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.neutral, .warning, .success {
|
.neutral, .warning, .success {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.neutral {
|
.neutral {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ describe('SongListComponent', () => {
|
|||||||
providers: [{provide: SongService, useValue: mockSongService}],
|
providers: [{provide: SongService, useValue: mockSongService}],
|
||||||
schemas: [NO_ERRORS_SCHEMA],
|
schemas: [NO_ERRORS_SCHEMA],
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
@@ -16,28 +16,30 @@ import {faBalanceScaleRight, faCheck, faPencilRuler} from '@fortawesome/free-sol
|
|||||||
styleUrls: ['./song-list.component.less'],
|
styleUrls: ['./song-list.component.less'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
animations: [fade],
|
animations: [fade],
|
||||||
|
standalone: false,
|
||||||
})
|
})
|
||||||
export class SongListComponent implements OnInit, OnDestroy {
|
export class SongListComponent implements OnInit, OnDestroy {
|
||||||
|
public anyFilterActive = false;
|
||||||
public songs$: Observable<Song[]> | null = combineLatest([
|
public songs$: Observable<Song[]> | null = combineLatest([
|
||||||
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(_ => {
|
||||||
const songs = _[1];
|
const songs = _[1];
|
||||||
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 anyFilterActive = false;
|
|
||||||
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);
|
||||||
@@ -48,6 +50,8 @@ export class SongListComponent implements OnInit, OnDestroy {
|
|||||||
this.scrollService.storeScrollPositionFor('songlist');
|
this.scrollService.storeScrollPositionFor('songlist');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public trackBy = (index: number, show: Song) => show.id;
|
||||||
|
|
||||||
private filter(song: Song, filter: FilterValues): boolean {
|
private filter(song: Song, filter: FilterValues): boolean {
|
||||||
let baseFilter = filterSong(song, filter.q);
|
let baseFilter = filterSong(song, filter.q);
|
||||||
baseFilter = baseFilter && (!filter.type || filter.type === song.type);
|
baseFilter = baseFilter && (!filter.type || filter.type === song.type);
|
||||||
@@ -74,6 +78,4 @@ export class SongListComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
return flagStrings.indexOf(flag) !== -1;
|
return flagStrings.indexOf(flag) !== -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public trackBy = (index: number, show: Song) => show.id;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ import {CommonModule} from '@angular/common';
|
|||||||
import {SongListComponent} from './song-list.component';
|
import {SongListComponent} from './song-list.component';
|
||||||
import {CardModule} from '../../../widget-modules/components/card/card.module';
|
import {CardModule} from '../../../widget-modules/components/card/card.module';
|
||||||
import {RouterModule} from '@angular/router';
|
import {RouterModule} from '@angular/router';
|
||||||
import {LegalTypeTranslatorModule} from '../../../widget-modules/pipes/legal-type-translator/legal-type-translator.module';
|
import {
|
||||||
|
LegalTypeTranslatorModule,
|
||||||
|
} from '../../../widget-modules/pipes/legal-type-translator/legal-type-translator.module';
|
||||||
import {ListHeaderModule} from '../../../widget-modules/components/list-header/list-header.module';
|
import {ListHeaderModule} from '../../../widget-modules/components/list-header/list-header.module';
|
||||||
import {MatFormFieldModule} from '@angular/material/form-field';
|
import {MatFormFieldModule} from '@angular/material/form-field';
|
||||||
import {MatInputModule} from '@angular/material/input';
|
import {MatInputModule} from '@angular/material/input';
|
||||||
@@ -37,4 +39,5 @@ import {KeyTranslatorModule} from '../../../widget-modules/pipes/key-translator/
|
|||||||
KeyTranslatorModule,
|
KeyTranslatorModule,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class SongListModule {}
|
export class SongListModule {
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="upload">
|
<div class="upload">
|
||||||
<label>
|
<label>
|
||||||
<input (change)="detectFiles($event)" type="file"/>
|
<input (change)="detectFiles($event)" type="file" />
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user