mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
Miscellaneous lint fixes: move watch & mounted properties; apply automatic fixes (#12791)
* commit lint's automatic fixes * move watch and mounted properties as advised in lint warnings
This commit is contained in:
@@ -384,16 +384,6 @@ export default {
|
|||||||
memberResults: [],
|
memberResults: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
'challenge.name': {
|
|
||||||
handler (newVal) {
|
|
||||||
this.$store.dispatch('common:setTitle', {
|
|
||||||
section: this.$t('challenge'),
|
|
||||||
subSection: newVal.name,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({ user: 'user.data' }),
|
...mapState({ user: 'user.data' }),
|
||||||
isMember () {
|
isMember () {
|
||||||
@@ -410,6 +400,16 @@ export default {
|
|||||||
return !this.isMember;
|
return !this.isMember;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
'challenge.name': {
|
||||||
|
handler (newVal) {
|
||||||
|
this.$store.dispatch('common:setTitle', {
|
||||||
|
section: this.$t('challenge'),
|
||||||
|
subSection: newVal.name,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
if (!this.searchId) this.searchId = this.challengeId;
|
if (!this.searchId) this.searchId = this.challengeId;
|
||||||
if (!this.challenge._id) this.loadChallenge();
|
if (!this.challenge._id) this.loadChallenge();
|
||||||
|
|||||||
@@ -56,8 +56,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</filter-group>
|
</filter-group>
|
||||||
<filter-group :title="$t('membership')"
|
<filter-group
|
||||||
v-if="$route.name !== 'findChallenges'"
|
v-if="$route.name !== 'findChallenges'"
|
||||||
|
:title="$t('membership')"
|
||||||
class="form-group"
|
class="form-group"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -496,17 +496,17 @@ export default {
|
|||||||
return this.groups.some(g => g.selected);
|
return this.groups.some(g => g.selected);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
searchText: throttle(function throttleSearch () {
|
||||||
|
this.searchTextThrottled = this.searchText.toLowerCase();
|
||||||
|
}, 250),
|
||||||
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.$store.dispatch('common:setTitle', {
|
this.$store.dispatch('common:setTitle', {
|
||||||
subSection: this.$t('items'),
|
subSection: this.$t('items'),
|
||||||
section: this.$t('inventory'),
|
section: this.$t('inventory'),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
searchText: throttle(function throttleSearch () {
|
|
||||||
this.searchTextThrottled = this.searchText.toLowerCase();
|
|
||||||
}, 250),
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
userHasPet (potionKey, eggKey) {
|
userHasPet (potionKey, eggKey) {
|
||||||
const animalKey = `${eggKey}-${potionKey}`;
|
const animalKey = `${eggKey}-${potionKey}`;
|
||||||
|
|||||||
@@ -645,12 +645,6 @@ export default {
|
|||||||
return Object.values(this.viewOptions).some(g => g.selected);
|
return Object.values(this.viewOptions).some(g => g.selected);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted () {
|
|
||||||
this.$store.dispatch('common:setTitle', {
|
|
||||||
subSection: this.$t('stable'),
|
|
||||||
section: this.$t('inventory'),
|
|
||||||
});
|
|
||||||
},
|
|
||||||
watch: {
|
watch: {
|
||||||
searchText: _throttle(function throttleSearch () {
|
searchText: _throttle(function throttleSearch () {
|
||||||
const search = this.searchText.toLowerCase();
|
const search = this.searchText.toLowerCase();
|
||||||
@@ -662,6 +656,12 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mounted () {
|
||||||
|
this.$store.dispatch('common:setTitle', {
|
||||||
|
subSection: this.$t('stable'),
|
||||||
|
section: this.$t('inventory'),
|
||||||
|
});
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setShowMore (key) {
|
setShowMore (key) {
|
||||||
this.$_openedItemRows_toggleByType(key, !this.$_openedItemRows_isToggled(key));
|
this.$_openedItemRows_toggleByType(key, !this.$_openedItemRows_isToggled(key));
|
||||||
|
|||||||
@@ -1,37 +1,38 @@
|
|||||||
<template>
|
<template>
|
||||||
<filter-sidebar>
|
<filter-sidebar>
|
||||||
<filter-group>
|
<filter-group>
|
||||||
<checkbox :checked.sync="viewOptionEntry.selected"
|
<checkbox
|
||||||
:id="`category-${viewOptionKey}`"
|
v-for="(viewOptionEntry, viewOptionKey) in viewOptions"
|
||||||
:key="viewOptionKey"
|
:id="`category-${viewOptionKey}`"
|
||||||
:text="viewOptionEntry.text"
|
:key="viewOptionKey"
|
||||||
v-for="(viewOptionEntry, viewOptionKey) in viewOptions"
|
:checked.sync="viewOptionEntry.selected"
|
||||||
|
:text="viewOptionEntry.text"
|
||||||
/>
|
/>
|
||||||
</filter-group>
|
</filter-group>
|
||||||
<div class="form-group clearfix">
|
<div class="form-group clearfix">
|
||||||
<h3
|
<h3
|
||||||
class="float-left"
|
v-once
|
||||||
v-once
|
class="float-left"
|
||||||
>
|
>
|
||||||
{{ $t('hideLocked') }}
|
{{ $t('hideLocked') }}
|
||||||
</h3>
|
</h3>
|
||||||
<toggle-switch
|
<toggle-switch
|
||||||
@change="$emit('update:hideLocked', $event)"
|
v-model="lockedChecked"
|
||||||
class="float-right"
|
class="float-right"
|
||||||
v-model="lockedChecked"
|
@change="$emit('update:hideLocked', $event)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group clearfix">
|
<div class="form-group clearfix">
|
||||||
<h3
|
<h3
|
||||||
class="float-left"
|
v-once
|
||||||
v-once
|
class="float-left"
|
||||||
>
|
>
|
||||||
{{ $t('hidePinned') }}
|
{{ $t('hidePinned') }}
|
||||||
</h3>
|
</h3>
|
||||||
<toggle-switch
|
<toggle-switch
|
||||||
@change="$emit('update:hidePinned', $event)"
|
v-model="pinnedChecked"
|
||||||
class="float-right"
|
class="float-right"
|
||||||
v-model="pinnedChecked"
|
@change="$emit('update:hidePinned', $event)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</filter-sidebar>
|
</filter-sidebar>
|
||||||
|
|||||||
@@ -123,12 +123,12 @@
|
|||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<span class="dropdown-label">{{ $t('sortBy') }}</span>
|
<span class="dropdown-label">{{ $t('sortBy') }}</span>
|
||||||
<select-translated-array
|
<select-translated-array
|
||||||
:right="true"
|
:right="true"
|
||||||
:value="selectedSortItemsBy"
|
:value="selectedSortItemsBy"
|
||||||
:items="sortItemsBy"
|
:items="sortItemsBy"
|
||||||
:inline-dropdown="false"
|
:inline-dropdown="false"
|
||||||
class="inline"
|
class="inline"
|
||||||
@select="selectedSortItemsBy = $event"
|
@select="selectedSortItemsBy = $event"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -74,12 +74,12 @@
|
|||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<span class="dropdown-label">{{ $t('sortBy') }}</span>
|
<span class="dropdown-label">{{ $t('sortBy') }}</span>
|
||||||
<select-translated-array
|
<select-translated-array
|
||||||
:right="true"
|
:right="true"
|
||||||
:value="selectedSortItemsBy"
|
:value="selectedSortItemsBy"
|
||||||
:items="sortItemsBy"
|
:items="sortItemsBy"
|
||||||
:inline-dropdown="false"
|
:inline-dropdown="false"
|
||||||
class="inline"
|
class="inline"
|
||||||
@select="selectedSortItemsBy = $event"
|
@select="selectedSortItemsBy = $event"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -491,16 +491,16 @@ export default {
|
|||||||
return tagsByType;
|
return tagsByType;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted () {
|
|
||||||
this.$store.dispatch('common:setTitle', {
|
|
||||||
section: this.$t('tasks'),
|
|
||||||
});
|
|
||||||
},
|
|
||||||
watch: {
|
watch: {
|
||||||
searchText: throttle(function throttleSearch () {
|
searchText: throttle(function throttleSearch () {
|
||||||
this.searchTextThrottled = this.searchText.toLowerCase();
|
this.searchTextThrottled = this.searchText.toLowerCase();
|
||||||
}, 250),
|
}, 250),
|
||||||
},
|
},
|
||||||
|
mounted () {
|
||||||
|
this.$store.dispatch('common:setTitle', {
|
||||||
|
section: this.$t('tasks'),
|
||||||
|
});
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions({ setUser: 'user:set' }),
|
...mapActions({ setUser: 'user:set' }),
|
||||||
checkMouseOver: throttle(function throttleSearch () {
|
checkMouseOver: throttle(function throttleSearch () {
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<span>
|
<span>
|
||||||
<span class="dropdown-label">{{ label }}</span>
|
<span class="dropdown-label">{{ label }}</span>
|
||||||
<select-list :items="items"
|
<select-list
|
||||||
:value="selectedItem"
|
:items="items"
|
||||||
class="array-select inline"
|
:value="selectedItem"
|
||||||
:right="true"
|
class="array-select inline"
|
||||||
key-prop="id"
|
:right="true"
|
||||||
:hide-icon="false"
|
key-prop="id"
|
||||||
:inline-dropdown="false"
|
:hide-icon="false"
|
||||||
@select="selectItem($event)">
|
:inline-dropdown="false"
|
||||||
|
@select="selectItem($event)"
|
||||||
|
>
|
||||||
<template v-slot:item="{ item }">
|
<template v-slot:item="{ item }">
|
||||||
<span :class="{'dropdown-icon-item': withIcon}">
|
<span :class="{'dropdown-icon-item': withIcon}">
|
||||||
<slot
|
<slot
|
||||||
name="item"
|
name="item"
|
||||||
:item="item"
|
:item="item"
|
||||||
></slot>
|
></slot>
|
||||||
|
|||||||
Reference in New Issue
Block a user