From 4b62e85c95253cc45b42416f7fcd182784d21eb7 Mon Sep 17 00:00:00 2001 From: Alain Nussbaumer Date: Mon, 10 Jul 2023 15:37:40 +0200 Subject: [PATCH] [web] Use named route for playlist pages Switching to named routes in order to reduce future maintenance. --- ...aylist.vue => ListItemPlaylistSpotify.vue} | 5 +- web-src/src/components/ListPlaylists.vue | 7 +- .../src/components/ModalDialogPlaylist.vue | 5 +- ...ist.vue => ModalDialogPlaylistSpotify.vue} | 6 +- web-src/src/components/NavbarTop.vue | 7 +- web-src/src/pages/PagePlaylist.vue | 73 +++++-------- ...gePlaylist.vue => PagePlaylistSpotify.vue} | 12 +-- web-src/src/pages/PagePlaylistTracks.vue | 101 ++++++++++++++++++ web-src/src/pages/PagePlaylists.vue | 82 -------------- web-src/src/pages/PageSearchLibrary.vue | 4 +- web-src/src/pages/PageSearchSpotify.vue | 6 +- web-src/src/pages/SpotifyPageBrowse.vue | 10 +- .../SpotifyPageBrowseFeaturedPlaylists.vue | 16 +-- web-src/src/router/index.js | 56 +++++----- 14 files changed, 198 insertions(+), 192 deletions(-) rename web-src/src/components/{SpotifyListItemPlaylist.vue => ListItemPlaylistSpotify.vue} (82%) rename web-src/src/components/{SpotifyModalDialogPlaylist.vue => ModalDialogPlaylistSpotify.vue} (95%) rename web-src/src/pages/{SpotifyPagePlaylist.vue => PagePlaylistSpotify.vue} (94%) create mode 100644 web-src/src/pages/PagePlaylistTracks.vue delete mode 100644 web-src/src/pages/PagePlaylists.vue diff --git a/web-src/src/components/SpotifyListItemPlaylist.vue b/web-src/src/components/ListItemPlaylistSpotify.vue similarity index 82% rename from web-src/src/components/SpotifyListItemPlaylist.vue rename to web-src/src/components/ListItemPlaylistSpotify.vue index 594e0353..98f9b51b 100644 --- a/web-src/src/components/SpotifyListItemPlaylist.vue +++ b/web-src/src/components/ListItemPlaylistSpotify.vue @@ -12,13 +12,14 @@ + + diff --git a/web-src/src/pages/PagePlaylists.vue b/web-src/src/pages/PagePlaylists.vue deleted file mode 100644 index 2d3915b6..00000000 --- a/web-src/src/pages/PagePlaylists.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - - - diff --git a/web-src/src/pages/PageSearchLibrary.vue b/web-src/src/pages/PageSearchLibrary.vue index 4e5d5daa..5d16e00f 100644 --- a/web-src/src/pages/PageSearchLibrary.vue +++ b/web-src/src/pages/PageSearchLibrary.vue @@ -278,7 +278,7 @@ export default { ListComposers, ListPlaylists, ListTracks, - TabsSearch, + TabsSearch }, data() { @@ -574,7 +574,7 @@ export default { }, open_playlist(playlist) { - this.$router.push({ path: '/playlists/' + playlist.id + '/tracks' }) + this.$router.push({ name: 'playlist', params: { id: playlist.id } }) }, open_recent_search(query) { diff --git a/web-src/src/pages/PageSearchSpotify.vue b/web-src/src/pages/PageSearchSpotify.vue index ae7e8d8d..5ca63110 100644 --- a/web-src/src/pages/PageSearchSpotify.vue +++ b/web-src/src/pages/PageSearchSpotify.vue @@ -237,7 +237,7 @@ > - - import ContentWithHeading from '@/templates/ContentWithHeading.vue' import TabsMusic from '@/components/TabsMusic.vue' +import ModalDialogPlaylistSpotify from '@/components/ModalDialogPlaylistSpotify.vue' import SpotifyListItemAlbum from '@/components/SpotifyListItemAlbum.vue' import SpotifyListItemPlaylist from '@/components/SpotifyListItemPlaylist.vue' import SpotifyModalDialogAlbum from '@/components/SpotifyModalDialogAlbum.vue' -import SpotifyModalDialogPlaylist from '@/components/SpotifyModalDialogPlaylist.vue' import CoverArtwork from '@/components/CoverArtwork.vue' import store from '@/store' import * as types from '@/store/mutation_types' @@ -146,12 +146,12 @@ export default { name: 'SpotifyPageBrowse', components: { ContentWithHeading, - TabsMusic, + CoverArtwork, + ModalDialogPlaylistSpotify, SpotifyListItemAlbum, SpotifyListItemPlaylist, SpotifyModalDialogAlbum, - SpotifyModalDialogPlaylist, - CoverArtwork + TabsMusic }, beforeRouteEnter(to, from, next) { diff --git a/web-src/src/pages/SpotifyPageBrowseFeaturedPlaylists.vue b/web-src/src/pages/SpotifyPageBrowseFeaturedPlaylists.vue index 52814812..5a0228b9 100644 --- a/web-src/src/pages/SpotifyPageBrowseFeaturedPlaylists.vue +++ b/web-src/src/pages/SpotifyPageBrowseFeaturedPlaylists.vue @@ -24,7 +24,7 @@ -