mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
fix(admin): don't auto calculate Gem cap
also fixes .eslintrc to stop down prop mutations from error level
This commit is contained in:
@@ -14,6 +14,10 @@ module.exports = {
|
|||||||
// TODO find a way to let eslint understand webpack aliases
|
// TODO find a way to let eslint understand webpack aliases
|
||||||
'import/no-unresolved': 'off',
|
'import/no-unresolved': 'off',
|
||||||
'import/extensions': 'off',
|
'import/extensions': 'off',
|
||||||
|
'vue/component-tags-order': ['warn', {
|
||||||
|
order: [ 'template', 'style', 'script' ],
|
||||||
|
}],
|
||||||
|
'vue/no-mutating-props': 'warn',
|
||||||
'vue/no-v-html': 'off',
|
'vue/no-v-html': 'off',
|
||||||
'vue/html-self-closing': ['error', {
|
'vue/html-self-closing': ['error', {
|
||||||
html: {
|
html: {
|
||||||
|
|||||||
@@ -43,42 +43,55 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
Months until renewal:
|
Perk offset months:
|
||||||
<strong>{{ hero.purchased.plan.consecutive.offset }}</strong>
|
<strong>{{ hero.purchased.plan.consecutive.offset }}</strong>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
Next Mystic Hourglass:
|
Next Mystic Hourglass:
|
||||||
<strong>{{ nextHourglassDate }}</strong>
|
<strong>{{ nextHourglassDate }}</strong>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
<label>
|
<label>
|
||||||
Mystic Hourglasses:
|
Mystic Hourglasses:
|
||||||
<input
|
<input
|
||||||
v-model="hero.purchased.plan.consecutive.trinkets"
|
v-model="hero.purchased.plan.consecutive.trinkets"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="number"
|
type="number"
|
||||||
min="0"
|
min="0"
|
||||||
step="1"
|
step="1"
|
||||||
>
|
>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div class="form-inline">
|
||||||
Gem cap:
|
<label>
|
||||||
<strong>{{ hero.purchased.plan.consecutive.gemCapExtra + 25 }}</strong>
|
Gem cap increase:
|
||||||
</div>
|
<input
|
||||||
<div class="form-inline">
|
v-model="hero.purchased.plan.consecutive.gemCapExtra"
|
||||||
<label>
|
class="form-control"
|
||||||
Gems bought this month:
|
type="number"
|
||||||
<input
|
min="0"
|
||||||
v-model="hero.purchased.plan.gemsBought"
|
max="25"
|
||||||
class="form-control"
|
step="5"
|
||||||
type="number"
|
>
|
||||||
min="0"
|
</label>
|
||||||
:max="hero.purchased.plan.consecutive.gemCapExtra + 25"
|
</div>
|
||||||
step="1"
|
<div>
|
||||||
>
|
Total Gem cap:
|
||||||
</label>
|
<strong>{{ Number(hero.purchased.plan.consecutive.gemCapExtra) + 25 }}</strong>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-inline">
|
||||||
|
<label>
|
||||||
|
Gems bought this month:
|
||||||
|
<input
|
||||||
|
v-model="hero.purchased.plan.gemsBought"
|
||||||
|
class="form-control"
|
||||||
|
type="number"
|
||||||
|
min="0"
|
||||||
|
:max="hero.purchased.plan.consecutive.gemCapExtra + 25"
|
||||||
|
step="1"
|
||||||
|
>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
v-if="hero.purchased.plan.extraMonths > 0"
|
v-if="hero.purchased.plan.extraMonths > 0"
|
||||||
>
|
>
|
||||||
@@ -139,13 +152,6 @@ export default {
|
|||||||
return currentPlanContext.nextHourglassDate.format('MMMM');
|
return currentPlanContext.nextHourglassDate.format('MMMM');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
|
||||||
'hero.purchased.plan.consecutive.count' () { // eslint-disable-line object-shorthand
|
|
||||||
this.hero.purchased.plan.consecutive.gemCapExtra = Math.min(
|
|
||||||
Math.floor(this.hero.purchased.plan.consecutive.count / 3) * 5, 25,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
dateFormat (date) {
|
dateFormat (date) {
|
||||||
return moment(date).format('YYYY/MM/DD');
|
return moment(date).format('YYYY/MM/DD');
|
||||||
|
|||||||
Reference in New Issue
Block a user