diff --git a/WEB/src/app/app.module.ts b/WEB/src/app/app.module.ts index 5ff2877..3a2e677 100644 --- a/WEB/src/app/app.module.ts +++ b/WEB/src/app/app.module.ts @@ -27,6 +27,7 @@ import { SongNewComponent } from './components/songs/song-new/song-new.component import { SongFormComponent } from './components/songs/song-form/song-form.component'; import { SongFilesComponent } from './components/songs/song-files/song-files.component'; import { FileUploadModule } from 'ng2-file-upload'; +import { SongFileEditComponent } from './components/songs/song-file-edit/song-file-edit.component'; @NgModule({ declarations: [ @@ -37,7 +38,8 @@ import { FileUploadModule } from 'ng2-file-upload'; SongEditComponent, SongNewComponent, SongFormComponent, - SongFilesComponent + SongFilesComponent, + SongFileEditComponent ], imports: [ BrowserModule, diff --git a/WEB/src/app/components/songs/song-edit/song-edit.component.ts b/WEB/src/app/components/songs/song-edit/song-edit.component.ts index 8c82cbe..925a8d6 100644 --- a/WEB/src/app/components/songs/song-edit/song-edit.component.ts +++ b/WEB/src/app/components/songs/song-edit/song-edit.component.ts @@ -28,7 +28,7 @@ export class SongEditComponent implements OnInit { ) {} ngOnInit() { - this.form = this.editSongService.initEditForm(true); + this.form = this.editSongService.initSongEditForm(true); this.change.markForCheck(); } diff --git a/WEB/src/app/components/songs/song-file-edit/song-file-edit.component.html b/WEB/src/app/components/songs/song-file-edit/song-file-edit.component.html new file mode 100644 index 0000000..87b48e4 --- /dev/null +++ b/WEB/src/app/components/songs/song-file-edit/song-file-edit.component.html @@ -0,0 +1,17 @@ +
diff --git a/WEB/src/app/components/songs/song-file-edit/song-file-edit.component.less b/WEB/src/app/components/songs/song-file-edit/song-file-edit.component.less new file mode 100644 index 0000000..63ccc69 --- /dev/null +++ b/WEB/src/app/components/songs/song-file-edit/song-file-edit.component.less @@ -0,0 +1,6 @@ +form { + display: grid; + grid-template-columns: 2fr 1fr; + grid-column-gap: 10px; + padding-top: 10px; +} \ No newline at end of file diff --git a/WEB/src/app/components/songs/song-file-edit/song-file-edit.component.ts b/WEB/src/app/components/songs/song-file-edit/song-file-edit.component.ts new file mode 100644 index 0000000..9cc4110 --- /dev/null +++ b/WEB/src/app/components/songs/song-file-edit/song-file-edit.component.ts @@ -0,0 +1,34 @@ +import { faLongArrowAltLeft } from '@fortawesome/free-solid-svg-icons'; +import { FileType } from './../../../models/files-types.model.ts'; +import { FormGroup } from '@angular/forms'; +import { Component, OnInit, OnDestroy, Input, Output, EventEmitter } from '@angular/core'; +import { EditSongService } from 'src/app/data/edit-song.service'; + +@Component({ + selector: 'app-song-file-edit', + templateUrl: './song-file-edit.component.html', + styleUrls: ['./song-file-edit.component.less'] +}) +export class SongFileEditComponent implements OnInit, OnDestroy { + @Input() fileId: number; + @Output() back = new EventEmitter(); + public form: FormGroup; + public fileTypes = [ + {value: FileType.None, text: null}, + {value: FileType.Sheet, text: 'Text'}, + {value: FileType.Chords, text: 'Text + Akkorde'}, + {value: FileType.MuseScore, text: 'MuseScore'}, + ]; + + constructor(private editSongService: EditSongService) { } + + public ngOnInit(): void { + this.form = this.editSongService.initFileEditForm(this.fileId); + } + + public ngOnDestroy(): void { + this.form = null; + + } + +} diff --git a/WEB/src/app/components/songs/song-files/song-files.component.html b/WEB/src/app/components/songs/song-files/song-files.component.html index f944ec1..ba4cc15 100644 --- a/WEB/src/app/components/songs/song-files/song-files.component.html +++ b/WEB/src/app/components/songs/song-files/song-files.component.html @@ -6,7 +6,14 @@