diff --git a/src/components/AudioResultsList.vue b/src/components/AudioResultsList.vue index 432d5ceebd0..fb9838b80a7 100644 --- a/src/components/AudioResultsList.vue +++ b/src/components/AudioResultsList.vue @@ -92,7 +92,7 @@ export default { }, methods: { ...mapActions({ - fetchMedia: `${FETCH_MEDIA}`, + fetchMedia: FETCH_MEDIA, }), onLoadMoreAudios() { const searchParams = { diff --git a/src/components/Filters/FilterChecklist.vue b/src/components/Filters/FilterChecklist.vue index 679321f11fb..6aec4131e46 100644 --- a/src/components/Filters/FilterChecklist.vue +++ b/src/components/Filters/FilterChecklist.vue @@ -81,7 +81,7 @@ export default { LicenseIcons, LicenseExplanationTooltip, }, - props: ['options', 'title', 'filterType'], + props: ['options', 'title', 'filterType', 'disabled'], data() { return { filtersVisible: false, @@ -133,27 +133,29 @@ export default { hideLicenseExplanationVisibility() { this.licenseExplanationVisible = false }, - isDisabled(e) { - const licenses = this.$store.state.filters.licenses + getFilterTypeValue(filterKey, val) { + return this.$store.state.filters[filterKey].filter((item) => + item.code.includes(val) + ) + }, + isDisabled(item) { if (this.$props.filterType === 'licenseTypes') { - const nc = licenses.filter((item) => item.code.includes('nc')) - const nd = licenses.filter((item) => item.code.includes('nd')) + const nc = this.getFilterTypeValue('licenses', 'nc') + const nd = this.getFilterTypeValue('licenses', 'nd') return ( - (e.code === 'commercial' && nc.some((li) => li.checked)) || - (e.code === 'modification' && nd.some((li) => li.checked)) + (item.code === 'commercial' && nc.some((li) => li.checked)) || + (item.code === 'modification' && nd.some((li) => li.checked)) ) } - const licenseTypes = this.$store.state.filters.licenseTypes if (this.$props.filterType === 'licenses') { - const commercial = licenseTypes.find( - (item) => item.code === 'commercial' - ) - const modification = licenseTypes.find( - (item) => item.code === 'modification' + const commercial = this.getFilterTypeValue('licenseTypes', 'commercial') + const modification = this.getFilterTypeValue( + 'licenseTypes', + 'modification' ) return ( - (commercial.checked && e.code.includes('nc')) || - (modification.checked && e.code.includes('nd')) + (commercial.checked && item.code.includes('nc')) || + (modification.checked && item.code.includes('nd')) ) } return this.$props.disabled diff --git a/src/components/Filters/FilterDisplay.vue b/src/components/Filters/FilterDisplay.vue index 1c6094f9df2..b44dfbe4588 100644 --- a/src/components/Filters/FilterDisplay.vue +++ b/src/components/Filters/FilterDisplay.vue @@ -22,10 +22,7 @@ export default { name: 'FilterDisplay', components: { FilterTag }, computed: { - ...mapGetters([ - 'appliedFilterTags', - 'isAnyFilterApplied', - ]), + ...mapGetters(['appliedFilterTags', 'isAnyFilterApplied']), }, methods: { onUpdateFilter({ code, filterType }) { diff --git a/src/components/Filters/SearchGridFilter.vue b/src/components/Filters/SearchGridFilter.vue index 1116c0e5993..4e7b9a89f29 100644 --- a/src/components/Filters/SearchGridFilter.vue +++ b/src/components/Filters/SearchGridFilter.vue @@ -36,11 +36,11 @@ export default { }, methods: { ...mapActions({ - toggleFilter: `${TOGGLE_FILTER}`, + toggleFilter: TOGGLE_FILTER, }), ...mapMutations({ - setFilterVisible: `${SET_FILTER_IS_VISIBLE}`, - clearFilters: `${CLEAR_FILTERS}`, + setFilterVisible: SET_FILTER_IS_VISIBLE, + clearFilters: CLEAR_FILTERS, }), onUpdateFilter({ code, filterType }) { this.toggleFilter({ code, filterType }) diff --git a/src/components/HomeLicenseFilter.vue b/src/components/HomeLicenseFilter.vue index a545e3082f8..dc2761f8cac 100644 --- a/src/components/HomeLicenseFilter.vue +++ b/src/components/HomeLicenseFilter.vue @@ -31,7 +31,7 @@ export default { }), }, methods: { - ...mapActions({ toggleFilter: `${TOGGLE_FILTER}` }), + ...mapActions({ toggleFilter: TOGGLE_FILTER }), onFilterChanged(code) { this.toggleFilter({ code, diff --git a/src/components/NotificationBanner.vue b/src/components/NotificationBanner.vue index c178d570687..85439d43bea 100644 --- a/src/components/NotificationBanner.vue +++ b/src/components/NotificationBanner.vue @@ -1,21 +1,21 @@