From 128a84273f7683b14dd3720c5171d7d0821d2a20 Mon Sep 17 00:00:00 2001 From: benjamin Date: Sun, 4 Aug 2019 16:24:47 +0200 Subject: [PATCH] npm update --- .../songs/song-edit/song-edit.component.ts | 2 +- .../songs/song-new/song-new.component.ts | 2 +- .../components/songs/song/song.component.ts | 2 +- .../app/components/songs/songs.component.html | 14 +++++++---- .../app/components/songs/songs.component.less | 8 ++++++ .../songs/table/table.component.html | 6 ++--- .../songs/table/table.component.less | 5 ++-- .../components/songs/table/table.component.ts | 8 +++--- WEB/src/app/data/songs.service.ts | 6 ++--- WEB/src/styles.less | 25 +++++-------------- 10 files changed, 39 insertions(+), 39 deletions(-) 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 9a6ead6..a912bb9 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 @@ -29,6 +29,6 @@ export class SongEditComponent implements OnInit { } public onBack(): void { - this.songsService.state = State.read; + this.songsService.state.next(State.read); } } diff --git a/WEB/src/app/components/songs/song-new/song-new.component.ts b/WEB/src/app/components/songs/song-new/song-new.component.ts index 43f402a..e3e9879 100644 --- a/WEB/src/app/components/songs/song-new/song-new.component.ts +++ b/WEB/src/app/components/songs/song-new/song-new.component.ts @@ -29,7 +29,7 @@ export class SongNewComponent implements OnInit { } public onBack(): void { - this.songsService.state = State.list; + this.songsService.state.next(State.list); this.songsService.resetSelectedSong(); } diff --git a/WEB/src/app/components/songs/song/song.component.ts b/WEB/src/app/components/songs/song/song.component.ts index edc2074..0a16fcc 100644 --- a/WEB/src/app/components/songs/song/song.component.ts +++ b/WEB/src/app/components/songs/song/song.component.ts @@ -45,7 +45,7 @@ export class SongComponent { } public onClickEdit(): void { - this.songService.state = State.edit; + this.songService.state.next(State.edit); } public renderSongType(songType: string) { diff --git a/WEB/src/app/components/songs/songs.component.html b/WEB/src/app/components/songs/songs.component.html index fc668b7..e90a351 100644 --- a/WEB/src/app/components/songs/songs.component.html +++ b/WEB/src/app/components/songs/songs.component.html @@ -1,5 +1,9 @@ - - - - - +
+ +
+ + + + +
+
diff --git a/WEB/src/app/components/songs/songs.component.less b/WEB/src/app/components/songs/songs.component.less index e69de29..4bc65a9 100644 --- a/WEB/src/app/components/songs/songs.component.less +++ b/WEB/src/app/components/songs/songs.component.less @@ -0,0 +1,8 @@ +.songs-container, .song-container { + display: flex; +} + +.song-container { + padding: 10px; + flex-flow: column; +} diff --git a/WEB/src/app/components/songs/table/table.component.html b/WEB/src/app/components/songs/table/table.component.html index 59b414a..a7cedff 100644 --- a/WEB/src/app/components/songs/table/table.component.html +++ b/WEB/src/app/components/songs/table/table.component.html @@ -1,5 +1,5 @@
@@ -63,10 +63,10 @@ - + diff --git a/WEB/src/app/components/songs/table/table.component.less b/WEB/src/app/components/songs/table/table.component.less index 6054036..f57a3bc 100644 --- a/WEB/src/app/components/songs/table/table.component.less +++ b/WEB/src/app/components/songs/table/table.component.less @@ -1,13 +1,12 @@ table { - width: 100%; border-radius: 8px; background: #fffe; - } .table-container { - height: 100%; + //height: 100%; overflow: auto; + position: relative; } .button-new { diff --git a/WEB/src/app/components/songs/table/table.component.ts b/WEB/src/app/components/songs/table/table.component.ts index 435f06d..534ea5a 100644 --- a/WEB/src/app/components/songs/table/table.component.ts +++ b/WEB/src/app/components/songs/table/table.component.ts @@ -2,6 +2,8 @@ import {SongsService} from '../../../data/songs.service'; import {ChangeDetectionStrategy, ChangeDetectorRef, Component} from '@angular/core'; import {State} from 'src/app/data/state'; import {faFileMedical} from '@fortawesome/free-solid-svg-icons'; +import {Observable} from 'rxjs'; +import {map} from 'rxjs/operators'; @Component({ selector: 'app-table', @@ -27,8 +29,8 @@ export class TableComponent { ); } - public get columns(): string[] { - return this.songsService.state === State.list ? this.columnsFull : this.columnsPinned; + public get columns(): Observable { + return this.songsService.state.pipe(map(_ => _ === State.list ? this.columnsFull : this.columnsPinned)); } public renderSongType(songType: string) { @@ -49,7 +51,7 @@ export class TableComponent { public onClickNew(): void { this.songsService.selectSong(null).subscribe(); - this.songsService.state = State.new; + this.songsService.state.next(State.new); this.change.detectChanges(); } diff --git a/WEB/src/app/data/songs.service.ts b/WEB/src/app/data/songs.service.ts index d3a2a39..21f1ccf 100644 --- a/WEB/src/app/data/songs.service.ts +++ b/WEB/src/app/data/songs.service.ts @@ -13,7 +13,7 @@ import {base} from './urls'; providedIn: 'root' }) export class SongsService extends OdataService { - public state = State.list; + public state = new BehaviorSubject(State.list); public songs: BehaviorSubject = new BehaviorSubject([]); public selectedSong: BehaviorSubject = new BehaviorSubject(null); @@ -43,7 +43,7 @@ export class SongsService extends OdataService { } public selectSong(id: number): Observable { - this.state = State.read; + this.state.next(State.read); const filter = this.songs.value.filter(_ => _.ID === id); const song = filter.length === 1 ? filter[0] : null; if (!song) { @@ -61,7 +61,7 @@ export class SongsService extends OdataService { } public resetSelectedSong() { - this.state = State.list; + this.state.next(State.list); this.selectedSong.next(null); } diff --git a/WEB/src/styles.less b/WEB/src/styles.less index 4b3ed22..40df7d9 100644 --- a/WEB/src/styles.less +++ b/WEB/src/styles.less @@ -10,15 +10,10 @@ html { } .page-container { - position: fixed; - top: 20px; - left: 20px; - bottom: 20px; - right: 20px; + padding: 20px; box-sizing: border-box; overflow: hidden; border-radius: 8px; - transition: all 300ms ease-in-out; .mat-table tbody { background: none; @@ -26,18 +21,15 @@ html { th.mat-header-cell:first-of-type { border-top-left-radius: 8px; - transition: all 300ms ease-in-out; } th.mat-header-cell:last-of-type { border-top-right-radius: 8px; - transition: all 300ms ease-in-out; } .mat-table thead { border-top-right-radius: 8px; border-top-left-radius: 8px; - transition: all 300ms ease-in-out; } tbody { @@ -60,26 +52,21 @@ html { } &.pinned { - top: 0; - left: 0; - bottom: 0; - right: 70vw; - border-radius: 0px; + padding: 0; + max-width: 300px; + border-radius: 0; th.mat-header-cell:first-of-type { border-top-left-radius: 0px; - transition: all 300ms ease-in-out; } th.mat-header-cell:last-of-type { border-top-right-radius: 0px; - transition: all 300ms ease-in-out; } .mat-table thead { border-top-right-radius: 0px; border-top-left-radius: 0px; - transition: all 300ms ease-in-out; } } } @@ -88,7 +75,7 @@ html { width: 600px; border-radius: 8px; background: #fffd; - margin: 20px; + margin: 10px; box-sizing: border-box; } @@ -104,7 +91,7 @@ html { } .song-detail-container { - margin-left: 30vw; + .mat-form-field-infix { width: 80px;