From 59aa462b05da2001cd87dbb2eff6d18e67338647 Mon Sep 17 00:00:00 2001 From: Alain Nussbaumer Date: Mon, 10 Jul 2023 20:54:52 +0200 Subject: [PATCH] [web] Use named route for genres Switching to named routes in order to reduce future maintenance. --- web-src/src/components/ListGenres.vue | 2 +- web-src/src/components/ModalDialogGenre.vue | 5 +++- .../src/components/ModalDialogQueueItem.vue | 5 +++- web-src/src/components/ModalDialogTrack.vue | 5 +++- web-src/src/components/NavbarTop.vue | 2 +- web-src/src/components/TabsMusic.vue | 6 ++--- web-src/src/pages/PageGenre.vue | 2 +- web-src/src/pages/PageGenreTracks.vue | 7 +++-- web-src/src/router/index.js | 26 +++++++++---------- 9 files changed, 36 insertions(+), 24 deletions(-) diff --git a/web-src/src/components/ListGenres.vue b/web-src/src/components/ListGenres.vue index 2cf53f17..ab1e0194 100644 --- a/web-src/src/components/ListGenres.vue +++ b/web-src/src/components/ListGenres.vue @@ -57,7 +57,7 @@ export default { methods: { open_genre(genre) { - this.$router.push({ name: 'Genre', params: { genre: genre.name } }) + this.$router.push({ name: 'music-genre', params: { genre: genre.name } }) }, open_dialog(genre) { diff --git a/web-src/src/components/ModalDialogGenre.vue b/web-src/src/components/ModalDialogGenre.vue index 83faa52c..06848ac1 100644 --- a/web-src/src/components/ModalDialogGenre.vue +++ b/web-src/src/components/ModalDialogGenre.vue @@ -90,7 +90,10 @@ export default { open_genre() { this.$emit('close') - this.$router.push({ name: 'Genre', params: { genre: this.genre.name } }) + this.$router.push({ + name: 'music-genre', + params: { genre: this.genre.name } + }) } } } diff --git a/web-src/src/components/ModalDialogQueueItem.vue b/web-src/src/components/ModalDialogQueueItem.vue index d9d6f587..4bb04b9c 100644 --- a/web-src/src/components/ModalDialogQueueItem.vue +++ b/web-src/src/components/ModalDialogQueueItem.vue @@ -234,7 +234,10 @@ export default { }, open_genre() { - this.$router.push({ name: 'Genre', params: { genre: this.item.genre } }) + this.$router.push({ + name: 'music-genre', + params: { genre: this.item.genre } + }) }, open_spotify_artist() { diff --git a/web-src/src/components/ModalDialogTrack.vue b/web-src/src/components/ModalDialogTrack.vue index 9dd5f58c..86124fd8 100644 --- a/web-src/src/components/ModalDialogTrack.vue +++ b/web-src/src/components/ModalDialogTrack.vue @@ -269,7 +269,10 @@ export default { }, open_genre() { - this.$router.push({ name: 'Genre', params: { genre: this.track.genre } }) + this.$router.push({ + name: 'music-genre', + params: { genre: this.track.genre } + }) }, open_spotify_artist() { diff --git a/web-src/src/components/NavbarTop.vue b/web-src/src/components/NavbarTop.vue index 0d6be672..fc1f215a 100644 --- a/web-src/src/components/NavbarTop.vue +++ b/web-src/src/components/NavbarTop.vue @@ -71,7 +71,7 @@ - +
  • @@ -35,7 +35,7 @@
  • @@ -47,7 +47,7 @@
  • diff --git a/web-src/src/pages/PageGenre.vue b/web-src/src/pages/PageGenre.vue index b9e8cb3d..0d48244f 100644 --- a/web-src/src/pages/PageGenre.vue +++ b/web-src/src/pages/PageGenre.vue @@ -106,7 +106,7 @@ export default { open_tracks() { this.show_details_modal = false this.$router.push({ - name: 'GenreTracks', + name: 'music-genre-tracks', params: { genre: this.genre.name } }) }, diff --git a/web-src/src/pages/PageGenreTracks.vue b/web-src/src/pages/PageGenreTracks.vue index 8a51ef26..f098c6ea 100644 --- a/web-src/src/pages/PageGenreTracks.vue +++ b/web-src/src/pages/PageGenreTracks.vue @@ -55,9 +55,9 @@