From c0d6459d0b481472f8c609c4d04c3e59695ef9c1 Mon Sep 17 00:00:00 2001 From: "Maxence G. de Montauzan" Date: Fri, 5 May 2017 04:26:09 +0200 Subject: [PATCH] Add an amazing (and bugged) sort button for artist Just for test purpose - need to be improved --- dashboard/src/app/album.component.css | 5 +++++ dashboard/src/app/artist.component.html | 7 ++++++- dashboard/src/app/artist.component.ts | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/dashboard/src/app/album.component.css b/dashboard/src/app/album.component.css index ed5f6e0..0a3bcc4 100644 --- a/dashboard/src/app/album.component.css +++ b/dashboard/src/app/album.component.css @@ -29,4 +29,9 @@ /* the button becomes visible */ visibility: visible; opacity: 1; +} + +.btn-sort { + bottom: 20px; + right: 70px; } \ No newline at end of file diff --git a/dashboard/src/app/artist.component.html b/dashboard/src/app/artist.component.html index cac0a67..3f5dbf3 100644 --- a/dashboard/src/app/artist.component.html +++ b/dashboard/src/app/artist.component.html @@ -115,4 +115,9 @@ \ No newline at end of file + + + \ No newline at end of file diff --git a/dashboard/src/app/artist.component.ts b/dashboard/src/app/artist.component.ts index b6bc120..63f3b89 100644 --- a/dashboard/src/app/artist.component.ts +++ b/dashboard/src/app/artist.component.ts @@ -6,6 +6,8 @@ import { ElsService } from './els.service' import { Song } from './object/song'; import { Artist } from './object/artist'; +import { SortPipe } from './sortby.pipe' + @Component({ selector: 'artist-component', templateUrl: './artist.component.html', @@ -81,4 +83,8 @@ export class ArtistComponent implements OnInit { this.atBottom = false; } } + + sort(): void { + this.songs = new SortPipe().transform(this.songs, 'Album', 'Track Number', 'Play Count'); + } } \ No newline at end of file