Removed unnecessary "Equipment" sub-heading in Market. (#11237)
* Removed unnecessary sub-heading. * Corrected the filter in the Market. Now viewOptions keeps additional info about text to be in filter. Categories array is no longer passed to filter component.
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
h2(v-once) {{ $t('filter') }}
|
||||
.form-group
|
||||
checkbox(
|
||||
v-for="category in categories",
|
||||
:key="category.identifier",
|
||||
:id="`category-${category.identifier}`",
|
||||
:checked.sync="viewOptions[category.identifier].selected",
|
||||
:text="category.text"
|
||||
v-for="viewOptionKey in Object.keys(viewOptions)",
|
||||
:key="viewOptionKey",
|
||||
:id="`category-${viewOptionKey}`",
|
||||
:checked.sync="viewOptions[viewOptionKey].selected",
|
||||
:text="viewOptions[viewOptionKey].text"
|
||||
)
|
||||
div.form-group.clearfix
|
||||
h3.float-left(v-once) {{ $t('hideLocked') }}
|
||||
@@ -27,7 +27,7 @@
|
||||
import Checkbox from 'client/components/ui/checkbox';
|
||||
import toggleSwitch from 'client/components/ui/toggleSwitch';
|
||||
export default {
|
||||
props: ['hidePinned', 'hideLocked', 'categories', 'viewOptions'],
|
||||
props: ['hidePinned', 'hideLocked', 'viewOptions'],
|
||||
components: {
|
||||
Checkbox,
|
||||
toggleSwitch,
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
.form-group
|
||||
input.form-control.input-search(type="text", v-model="searchText", :placeholder="$t('search')")
|
||||
market-filter(
|
||||
:categories="categories",
|
||||
:hideLocked.sync="hideLocked",
|
||||
:hidePinned.sync="hidePinned",
|
||||
:viewOptions="viewOptions"
|
||||
@@ -39,7 +38,7 @@
|
||||
span.text {{ $t(ctx.item.id) }}
|
||||
div(
|
||||
v-for="category in categories",
|
||||
v-if="!anyFilterSelected || viewOptions[category.identifier].selected && category.identifier !== 'equipment'"
|
||||
v-if="!anyFilterSelected || viewOptions[category.identifier].selected"
|
||||
)
|
||||
h4 {{ category.text }}
|
||||
category-row(
|
||||
@@ -197,7 +196,12 @@ export default {
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
viewOptions: {},
|
||||
viewOptions: {
|
||||
equipment: {
|
||||
selected: false,
|
||||
text: this.$t('equipment'),
|
||||
},
|
||||
},
|
||||
|
||||
searchText: null,
|
||||
searchTextThrottled: null,
|
||||
@@ -238,11 +242,6 @@ export default {
|
||||
...this.market.categories,
|
||||
];
|
||||
|
||||
categories.push({
|
||||
identifier: 'equipment',
|
||||
text: this.$t('equipment'),
|
||||
});
|
||||
|
||||
categories.push({
|
||||
identifier: 'cards',
|
||||
text: this.$t('cards'),
|
||||
@@ -291,6 +290,7 @@ export default {
|
||||
if (!this.viewOptions[category.identifier]) {
|
||||
this.$set(this.viewOptions, category.identifier, {
|
||||
selected: false,
|
||||
text: category.text,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user