Implement search filter changed indicator (#1257)
* ! Fix app unable to load due to missing `getLocale` in `mapActions` * Implement search filter changed indicator
This commit is contained in:
parent
70aa159bb8
commit
3bce276564
|
@ -42,6 +42,15 @@ export default Vue.extend({
|
||||||
return this.$store.getters.getSearchSettings
|
return this.$store.getters.getSearchSettings
|
||||||
},
|
},
|
||||||
|
|
||||||
|
filterValueChanged: function() {
|
||||||
|
return [
|
||||||
|
this.$refs.sortByRadio.selectedValue !== this.sortByValues[0],
|
||||||
|
this.$refs.timeRadio.selectedValue !== this.timeValues[0],
|
||||||
|
this.$refs.typeRadio.selectedValue !== this.typeValues[0],
|
||||||
|
this.$refs.durationRadio.selectedValue !== this.durationValues[0]
|
||||||
|
].some((bool) => bool === true)
|
||||||
|
},
|
||||||
|
|
||||||
sortByLabels: function () {
|
sortByLabels: function () {
|
||||||
return [
|
return [
|
||||||
this.$t('Search Filters.Sort By.Most Relevant'),
|
this.$t('Search Filters.Sort By.Most Relevant'),
|
||||||
|
@ -82,6 +91,7 @@ export default Vue.extend({
|
||||||
methods: {
|
methods: {
|
||||||
updateSortBy: function (value) {
|
updateSortBy: function (value) {
|
||||||
this.$store.commit('setSearchSortBy', value)
|
this.$store.commit('setSearchSortBy', value)
|
||||||
|
this.$emit('filterValueUpdated', this.filterValueChanged)
|
||||||
},
|
},
|
||||||
|
|
||||||
updateTime: function (value) {
|
updateTime: function (value) {
|
||||||
|
@ -91,6 +101,7 @@ export default Vue.extend({
|
||||||
this.$store.commit('setSearchType', 'all')
|
this.$store.commit('setSearchType', 'all')
|
||||||
}
|
}
|
||||||
this.$store.commit('setSearchTime', value)
|
this.$store.commit('setSearchTime', value)
|
||||||
|
this.$emit('filterValueUpdated', this.filterValueChanged)
|
||||||
},
|
},
|
||||||
|
|
||||||
updateType: function (value) {
|
updateType: function (value) {
|
||||||
|
@ -103,6 +114,7 @@ export default Vue.extend({
|
||||||
this.$store.commit('setSearchDuration', '')
|
this.$store.commit('setSearchDuration', '')
|
||||||
}
|
}
|
||||||
this.$store.commit('setSearchType', value)
|
this.$store.commit('setSearchType', value)
|
||||||
|
this.$emit('filterValueUpdated', this.filterValueChanged)
|
||||||
},
|
},
|
||||||
|
|
||||||
updateDuration: function (value) {
|
updateDuration: function (value) {
|
||||||
|
@ -112,6 +124,7 @@ export default Vue.extend({
|
||||||
this.updateType('all')
|
this.updateType('all')
|
||||||
}
|
}
|
||||||
this.$store.commit('setSearchDuration', value)
|
this.$store.commit('setSearchDuration', value)
|
||||||
|
this.$emit('filterValueUpdated', this.filterValueChanged)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -19,6 +19,7 @@ export default Vue.extend({
|
||||||
component: this,
|
component: this,
|
||||||
windowWidth: 0,
|
windowWidth: 0,
|
||||||
showFilters: false,
|
showFilters: false,
|
||||||
|
searchFilterValueChanged: false,
|
||||||
searchSuggestionsDataList: []
|
searchSuggestionsDataList: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -245,6 +246,10 @@ export default Vue.extend({
|
||||||
this.showFilters = false
|
this.showFilters = false
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleSearchFilterValueChanged: function(filterValueChanged) {
|
||||||
|
this.searchFilterValueChanged = filterValueChanged
|
||||||
|
},
|
||||||
|
|
||||||
historyBack: function () {
|
historyBack: function () {
|
||||||
window.history.back()
|
window.history.back()
|
||||||
},
|
},
|
||||||
|
|
|
@ -55,6 +55,17 @@
|
||||||
@include top-nav-is-colored
|
@include top-nav-is-colored
|
||||||
background-color: var(--primary-color-active)
|
background-color: var(--primary-color-active)
|
||||||
|
|
||||||
|
.navFilterIcon // Filter icon
|
||||||
|
$effect-distance: 10px
|
||||||
|
|
||||||
|
margin-left: $effect-distance
|
||||||
|
|
||||||
|
&.filterChanged // When filter value changed from default
|
||||||
|
box-shadow: 0 0 $effect-distance var(--primary-color)
|
||||||
|
|
||||||
|
@include top-nav-is-colored
|
||||||
|
box-shadow: 0 0 $effect-distance var(--text-with-main-color)
|
||||||
|
|
||||||
.side // parts of the top nav either side of the search bar
|
.side // parts of the top nav either side of the search bar
|
||||||
display: flex
|
display: flex
|
||||||
align-items: center
|
align-items: center
|
||||||
|
|
|
@ -66,6 +66,7 @@
|
||||||
/>
|
/>
|
||||||
<font-awesome-icon
|
<font-awesome-icon
|
||||||
class="navFilterIcon navIcon"
|
class="navFilterIcon navIcon"
|
||||||
|
:class="{ filterChanged: searchFilterValueChanged }"
|
||||||
icon="filter"
|
icon="filter"
|
||||||
role="button"
|
role="button"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
|
@ -77,6 +78,7 @@
|
||||||
v-show="showFilters"
|
v-show="showFilters"
|
||||||
class="searchFilters"
|
class="searchFilters"
|
||||||
:class="{ expand: !isSideNavOpen }"
|
:class="{ expand: !isSideNavOpen }"
|
||||||
|
@filterValueUpdated="handleSearchFilterValueChanged"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<ft-profile-selector class="side profiles" />
|
<ft-profile-selector class="side profiles" />
|
||||||
|
|
Loading…
Reference in New Issue