From f364b3c06fe70a5c781e488bfbef272d03a8caed Mon Sep 17 00:00:00 2001 From: SabreCat Date: Wed, 31 Aug 2022 16:09:20 -0500 Subject: [PATCH] feat(admin): consecutive months editable field and automatic calcs --- .../admin-panel/user-support/cronAndAuth.vue | 24 ++++--- .../user-support/subscriptionAndPerks.vue | 69 +++++++++++++++---- website/server/controllers/api-v3/hall.js | 9 ++- 3 files changed, 75 insertions(+), 27 deletions(-) diff --git a/website/client/src/components/admin-panel/user-support/cronAndAuth.vue b/website/client/src/components/admin-panel/user-support/cronAndAuth.vue index 260bc46177..8b107ebf21 100644 --- a/website/client/src/components/admin-panel/user-support/cronAndAuth.vue +++ b/website/client/src/components/admin-panel/user-support/cronAndAuth.vue @@ -22,11 +22,6 @@ Account created: {{ hero.auth.timestamps.created | formatDate }} -
- Most recent cron: - {{ hero.auth.timestamps.loggedin | formatDate }} - ("auth.timestamps.loggedin") -
"lastCron" value: {{ hero.lastCron | formatDate }} @@ -36,12 +31,19 @@ ("auth.timestamps.loggedin" and "lastCron" dates are different).
- +
+
+ Most recent cron: + {{ hero.auth.timestamps.loggedin | formatDate }} + ("auth.timestamps.loggedin") +
+ +
Time zone: {{ hero.preferences.timezoneOffset | formatTimeZone }} diff --git a/website/client/src/components/admin-panel/user-support/subscriptionAndPerks.vue b/website/client/src/components/admin-panel/user-support/subscriptionAndPerks.vue index 61abb08294..05856a31c5 100644 --- a/website/client/src/components/admin-panel/user-support/subscriptionAndPerks.vue +++ b/website/client/src/components/admin-panel/user-support/subscriptionAndPerks.vue @@ -8,7 +8,7 @@ Subscription, Monthly Perks
-
+
Payment method: {{ hero.purchased.plan.paymentMethod }} @@ -30,9 +30,20 @@ None
-
- Consecutive months: - {{ hero.purchased.plan.consecutive.count }} +
+ + + Updates Hourglasses and Gem cap automatically. Next Mystic Hourglass updates on save. +
Months until renewal: @@ -59,16 +70,16 @@ {{ hero.purchased.plan.consecutive.gemCapExtra + 25 }}
-
diff --git a/website/server/controllers/api-v3/hall.js b/website/server/controllers/api-v3/hall.js index e3f950b08a..6473f30ab0 100644 --- a/website/server/controllers/api-v3/hall.js +++ b/website/server/controllers/api-v3/hall.js @@ -277,8 +277,13 @@ api.updateHero = { if (updateData.purchased.plan.gemsBought) { hero.purchased.plan.gemsBought = updateData.purchased.plan.gemsBought; } - if (updateData.purchased.plan.consecutive && updateData.purchased.plan.consecutive.trinkets) { - hero.purchased.plan.consecutive.trinkets = updateData.purchased.plan.consecutive.trinkets; + if (updateData.purchased.plan.consecutive) { + if (updateData.purchased.plan.consecutive.trinkets) { + hero.purchased.plan.consecutive.trinkets = updateData.purchased.plan.consecutive.trinkets; + } + if (updateData.purchased.plan.consecutive.gemCapExtra) { + hero.purchased.plan.consecutive.gemCapExtra = updateData.purchased.plan.consecutive.gemCapExtra; // eslint-disable-line max-len + } } }