From da2229c44193097f343bf7c4c845ede4112e5f83 Mon Sep 17 00:00:00 2001 From: Agate Date: Mon, 6 Jul 2020 13:21:07 +0200 Subject: [PATCH] Fix #1131: More consistent search UX on /albums, /artists, /radios and /playlists --- changes/changelog.d/1131.enhancement | 1 + front/src/components/library/Albums.vue | 39 ++++++-------------- front/src/components/library/Artists.vue | 39 ++++++-------------- front/src/components/library/Radios.vue | 35 ++++++------------ front/src/views/playlists/List.vue | 47 +++++++++--------------- 5 files changed, 55 insertions(+), 106 deletions(-) create mode 100644 changes/changelog.d/1131.enhancement diff --git a/changes/changelog.d/1131.enhancement b/changes/changelog.d/1131.enhancement new file mode 100644 index 000000000..eb2f25b0b --- /dev/null +++ b/changes/changelog.d/1131.enhancement @@ -0,0 +1 @@ +More consistent search UX on /albums, /artists, /radios and /playlists (#1131) \ No newline at end of file diff --git a/front/src/components/library/Albums.vue b/front/src/components/library/Albums.vue index 60bafe245..647e37b47 100644 --- a/front/src/components/library/Albums.vue +++ b/front/src/components/library/Albums.vue @@ -4,13 +4,18 @@

Browsing albums

-
+
- +
+ + +
@@ -40,7 +45,7 @@
-
+
Browsing artists -
+
- +
+ + +
@@ -40,7 +45,7 @@
-
+
@@ -134,7 +139,7 @@ export default { } }, methods: { - updateQueryString: _.debounce(function() { + updateQueryString: function() { history.pushState( {}, null, @@ -147,8 +152,8 @@ export default { ordering: this.getOrderingAsString() }).toString() ) - }, 500), - fetchData: _.debounce(function() { + }, + fetchData: function() { var self = this this.isLoading = true let url = FETCH_URL @@ -178,7 +183,7 @@ export default { self.result = null self.isLoading = false }) - }, 500), + }, selectPage: function(page) { this.page = page } @@ -188,26 +193,6 @@ export default { this.updateQueryString() this.fetchData() }, - paginateBy() { - this.updateQueryString() - this.fetchData() - }, - ordering() { - this.updateQueryString() - this.fetchData() - }, - orderingDirection() { - this.updateQueryString() - this.fetchData() - }, - query() { - this.updateQueryString() - this.fetchData() - }, - tags() { - this.updateQueryString() - this.fetchData() - }, "$store.state.moderation.lastUpdate": function () { this.fetchData() } diff --git a/front/src/components/library/Radios.vue b/front/src/components/library/Radios.vue index 1f5b121dc..f96c25272 100644 --- a/front/src/components/library/Radios.vue +++ b/front/src/components/library/Radios.vue @@ -25,11 +25,16 @@ Create your own radio -
+
- +
+ + +
@@ -59,7 +64,7 @@
-
+
@@ -157,7 +162,7 @@ export default { }, }, methods: { - updateQueryString: _.debounce(function() { + updateQueryString: function() { history.pushState( {}, null, @@ -169,8 +174,8 @@ export default { ordering: this.getOrderingAsString() }).toString() ) - }, 500), - fetchData: _.debounce(function() { + }, + fetchData: function() { var self = this this.isLoading = true let url = FETCH_URL @@ -186,7 +191,7 @@ export default { self.result = response.data self.isLoading = false }) - }, 500), + }, selectPage: function(page) { this.page = page } @@ -196,22 +201,6 @@ export default { this.updateQueryString() this.fetchData() }, - paginateBy() { - this.updateQueryString() - this.fetchData() - }, - ordering() { - this.updateQueryString() - this.fetchData() - }, - orderingDirection() { - this.updateQueryString() - this.fetchData() - }, - query() { - this.updateQueryString() - this.fetchData() - } } } diff --git a/front/src/views/playlists/List.vue b/front/src/views/playlists/List.vue index 237c2becc..83b29897f 100644 --- a/front/src/views/playlists/List.vue +++ b/front/src/views/playlists/List.vue @@ -2,17 +2,22 @@

Browsing playlists

-
- + +
- +
+ + +
@@ -38,7 +43,7 @@
-
+
@@ -124,7 +129,7 @@ export default { } }, methods: { - updateQueryString: _.debounce(function() { + updateQueryString: function() { history.pushState( {}, null, @@ -136,8 +141,8 @@ export default { ordering: this.getOrderingAsString() }).toString() ) - }, 250), - fetchData: _.debounce(function() { + }, + fetchData: function() { var self = this this.isLoading = true let url = FETCH_URL @@ -153,7 +158,7 @@ export default { self.result = response.data self.isLoading = false }) - }, 500), + }, selectPage: function(page) { this.page = page } @@ -163,22 +168,6 @@ export default { this.updateQueryString() this.fetchData() }, - paginateBy() { - this.updateQueryString() - this.fetchData() - }, - ordering() { - this.updateQueryString() - this.fetchData() - }, - orderingDirection() { - this.updateQueryString() - this.fetchData() - }, - query() { - this.updateQueryString() - this.fetchData() - } } }