{
await this.docxService.create(this.showId);
}
-
- public filteredSongsControl = new FormControl();
-
- filteredSongs() {
- const filterValue = this.filteredSongsControl.value;
- return filterValue ? this.songs.filter(_ => filterSong(_, filterValue)) : this.songs;
- }
}
diff --git a/src/app/modules/shows/show/song/song.component.ts b/src/app/modules/shows/show/song/song.component.ts
index b019b86..5efb41c 100644
--- a/src/app/modules/shows/show/song/song.component.ts
+++ b/src/app/modules/shows/show/song/song.component.ts
@@ -4,7 +4,7 @@ import {faTrash} from '@fortawesome/free-solid-svg-icons/faTrash';
import {faCaretUp} from '@fortawesome/free-solid-svg-icons/faCaretUp';
import {faCaretDown} from '@fortawesome/free-solid-svg-icons/faCaretDown';
import {ShowSongService} from '../../services/show-song.service';
-import {ShowSong} from '../../services/showSong';
+import {ShowSong} from '../../services/show-song';
import {getScale} from '../../../songs/services/key.helper';
import {FormControl} from '@angular/forms';
import {ChordMode} from '../../../../widget-modules/components/song-text/song-text.component';
diff --git a/src/app/modules/shows/shows.module.ts b/src/app/modules/shows/shows.module.ts
index a944e17..a8c3415 100644
--- a/src/app/modules/shows/shows.module.ts
+++ b/src/app/modules/shows/shows.module.ts
@@ -23,6 +23,7 @@ import {FontAwesomeModule} from '@fortawesome/angular-fontawesome';
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 {AddSongModule} from '../../widget-modules/components/add-song/add-song.module';
@NgModule({
@@ -47,6 +48,7 @@ import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
FormsModule,
SongTextModule,
NgxMatSelectSearchModule,
+ AddSongModule,
]
})
export class ShowsModule {
diff --git a/src/app/widget-modules/components/add-song/add-song.component.html b/src/app/widget-modules/components/add-song/add-song.component.html
new file mode 100644
index 0000000..def72e6
--- /dev/null
+++ b/src/app/widget-modules/components/add-song/add-song.component.html
@@ -0,0 +1,11 @@
+
+
+ Lied hinzufügen...
+
+
+
+
+ {{song.title}}
+
+
+
diff --git a/src/app/widget-modules/components/add-song/add-song.component.less b/src/app/widget-modules/components/add-song/add-song.component.less
new file mode 100644
index 0000000..56cde8c
--- /dev/null
+++ b/src/app/widget-modules/components/add-song/add-song.component.less
@@ -0,0 +1,8 @@
+.add-row {
+ display: flex;
+ margin-top: 10px;
+
+ .mat-form-field {
+ width: 100%;
+ }
+}
diff --git a/src/app/widget-modules/components/add-song/add-song.component.spec.ts b/src/app/widget-modules/components/add-song/add-song.component.spec.ts
new file mode 100644
index 0000000..697188d
--- /dev/null
+++ b/src/app/widget-modules/components/add-song/add-song.component.spec.ts
@@ -0,0 +1,25 @@
+import {async, ComponentFixture, TestBed} from '@angular/core/testing';
+
+import {AddSongComponent} from './add-song.component';
+
+describe('AddSongComponent', () => {
+ let component: AddSongComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [AddSongComponent]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(AddSongComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/widget-modules/components/add-song/add-song.component.ts b/src/app/widget-modules/components/add-song/add-song.component.ts
new file mode 100644
index 0000000..2820921
--- /dev/null
+++ b/src/app/widget-modules/components/add-song/add-song.component.ts
@@ -0,0 +1,50 @@
+import {Component, Input} from '@angular/core';
+import {FormControl} from '@angular/forms';
+import {filterSong} from '../../../services/filter.helper';
+import {MatSelectChange} from '@angular/material/select';
+import {Song} from '../../../modules/songs/services/song';
+import {ShowSong} from '../../../modules/shows/services/show-song';
+import {ShowSongService} from '../../../modules/shows/services/show-song.service';
+
+@Component({
+ selector: 'app-add-song',
+ templateUrl: './add-song.component.html',
+ styleUrls: ['./add-song.component.less']
+})
+export class AddSongComponent {
+ @Input() public songs: Song[];
+ @Input() public showSongs: ShowSong[];
+ @Input() public showId: string;
+ @Input() public addedLive = false;
+ public filteredSongsControl = new FormControl();
+
+ constructor(private showSongService: ShowSongService) {
+ }
+
+ filteredSongs() {
+ const songs = this.songs
+ .filter(_ => !!_)
+ .filter(_ => !!_.title)
+ .filter(_ => _.title !== 'nicht gefunden')
+ .filter(_ => _.title !== 'nicht vorhanden')
+ .sort((a, b) => {
+ if (a.title < b.title) {
+ return -1;
+ }
+ if (a.title > b.title) {
+ return 1;
+ }
+ return 0;
+ })
+
+ const filterValue = this.filteredSongsControl.value;
+ return filterValue ? songs.filter(_ => filterSong(_, filterValue)) : songs;
+ }
+
+ public async onAddSongSelectionChanged(event: MatSelectChange) {
+ let order = this.showSongs.reduce((oa, u) => Math.max(oa, u.order), 0) + 1;
+ await this.showSongService.new$(this.showId, event.value, order, this.addedLive);
+ event.source.value = null;
+ }
+
+}
diff --git a/src/app/widget-modules/components/add-song/add-song.module.ts b/src/app/widget-modules/components/add-song/add-song.module.ts
new file mode 100644
index 0000000..62a167a
--- /dev/null
+++ b/src/app/widget-modules/components/add-song/add-song.module.ts
@@ -0,0 +1,24 @@
+import {NgModule} from '@angular/core';
+import {CommonModule} from '@angular/common';
+import {AddSongComponent} from './add-song.component';
+import {MatFormFieldModule} from '@angular/material/form-field';
+import {MatSelectModule} from '@angular/material/select';
+import {NgxMatSelectSearchModule} from 'ngx-mat-select-search';
+import {ReactiveFormsModule} from '@angular/forms';
+
+
+@NgModule({
+ declarations: [AddSongComponent],
+ exports: [
+ AddSongComponent
+ ],
+ imports: [
+ CommonModule,
+ MatFormFieldModule,
+ MatSelectModule,
+ NgxMatSelectSearchModule,
+ ReactiveFormsModule
+ ]
+})
+export class AddSongModule {
+}