new song GUI

This commit is contained in:
Benjamin Ifland
2019-03-25 15:13:52 +01:00
parent 881729ed84
commit dc01c60e67
24 changed files with 293 additions and 138 deletions

View File

@@ -4,6 +4,8 @@ import {
ChangeDetectionStrategy,
ChangeDetectorRef
} from '@angular/core';
import { State } from 'src/app/data/state';
import { faFileMedical } from '@fortawesome/free-solid-svg-icons';
@Component({
selector: 'app-table',
@@ -13,10 +15,12 @@ import {
})
export class TableComponent {
public selectedSongId = 0;
public State = State;
public faNew = faFileMedical;
public columnsFull = ['Number', 'Name', 'Key', 'SongType', 'Tempo'];
public columnsPinned = ['Number', 'Name'];
public get columns(): string[] {
return this.selectedSongId === 0 ? this.columnsFull : this.columnsPinned;
return this.songsService.state === State.list ? this.columnsFull : this.columnsPinned;
}
constructor(
@@ -42,4 +46,11 @@ export class TableComponent {
this.songsService.selectSong(id);
this.change.detectChanges();
}
public onClickNew(): void {
this.songsService.selectSong(null);
this.songsService.state = State.new;
this.change.detectChanges();
}
}