diff --git a/package-lock.json b/package-lock.json index 1e8fa64224..227295a879 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "habitica", - "version": "4.249.0", + "version": "4.249.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 807f5552c8..abd7e3d727 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "habitica", "description": "A habit tracker app which treats your goals like a Role Playing Game.", - "version": "4.249.0", + "version": "4.249.3", "main": "./website/server/index.js", "dependencies": { "@babel/core": "^7.19.6", diff --git a/test/api/unit/libs/payments/apple.test.js b/test/api/unit/libs/payments/apple.test.js index 32f662d22d..e11c3bd86f 100644 --- a/test/api/unit/libs/payments/apple.test.js +++ b/test/api/unit/libs/payments/apple.test.js @@ -417,6 +417,7 @@ describe('Apple Payments', () => { it('errors when a user is using the same subscription', async () => { user = new User(); + user.purchased.plan.dateUpdated = moment().subtract(1, 'hours').toDate(); await user.save(); payments.createSubscription.restore(); @@ -430,6 +431,8 @@ describe('Apple Payments', () => { }]); await applePayments.subscribe(sku, user, receipt, headers, nextPaymentProcessing); + user.purchased.plan.dateUpdated = moment().subtract(1, 'hours').toDate(); + await user.save(); await expect(applePayments.subscribe(sku, user, receipt, headers, nextPaymentProcessing)) .to.eventually.be.rejected.and.to.eql({ diff --git a/test/api/unit/libs/payments/payments.test.js b/test/api/unit/libs/payments/payments.test.js index 84475e4b0e..16af9e6e15 100644 --- a/test/api/unit/libs/payments/payments.test.js +++ b/test/api/unit/libs/payments/payments.test.js @@ -370,6 +370,10 @@ describe('payments/index', () => { }); context('Purchasing a subscription for self', () => { + beforeEach(() => { + data.user.purchased.plan.dateUpdated = moment().subtract(1, 'hours').toDate(); + }); + it('creates a subscription', async () => { expect(user.purchased.plan.planId).to.not.exist; @@ -396,6 +400,7 @@ describe('payments/index', () => { user.purchased.plan = plan; user.purchased.plan.dateTerminated = moment(new Date()).add(2, 'months'); expect(user.purchased.plan.extraMonths).to.eql(0); + data.user.purchased.plan.dateUpdated = moment().subtract(1, 'hours').toDate(); await api.createSubscription(data); @@ -406,6 +411,7 @@ describe('payments/index', () => { user.purchased.plan = plan; user.purchased.plan.dateTerminated = moment(new Date()).subtract(2, 'months'); expect(user.purchased.plan.extraMonths).to.eql(0); + data.user.purchased.plan.dateUpdated = moment().subtract(1, 'hours').toDate(); await api.createSubscription(data); @@ -415,6 +421,7 @@ describe('payments/index', () => { it('does not reset Gold-to-Gems cap on additional subscription', async () => { user.purchased.plan = plan; user.purchased.plan.gemsBought = 10; + data.user.purchased.plan.dateUpdated = moment().subtract(1, 'hours').toDate(); await api.createSubscription(data); @@ -551,6 +558,10 @@ describe('payments/index', () => { }); context('Block subscription perks', () => { + beforeEach(() => { + data.user.purchased.plan.dateUpdated = moment().subtract(1, 'hours').toDate(); + }); + it('adds block months to plan.consecutive.offset', async () => { await api.createSubscription(data); @@ -587,6 +598,7 @@ describe('payments/index', () => { data.sub.key = 'basic_12mo'; await api.createSubscription(data); + data.user.purchased.plan.dateUpdated = moment().subtract(1, 'hours').toDate(); await api.createSubscription(data); expect(user.purchased.plan.consecutive.gemCapExtra).to.eql(25); @@ -753,6 +765,7 @@ describe('payments/index', () => { now: mayMysteryItemTimeframe, toFake: ['Date'], }); + data.user.purchased.plan.dateUpdated = moment().subtract(1, 'hours').toDate(); }); afterEach(() => { diff --git a/website/client/src/assets/svg/gem-red.svg b/website/client/src/assets/svg/gem-red.svg new file mode 100644 index 0000000000..aa1504893d --- /dev/null +++ b/website/client/src/assets/svg/gem-red.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website/client/src/assets/svg/hourglass-red.svg b/website/client/src/assets/svg/hourglass-red.svg new file mode 100644 index 0000000000..7a7a9e0d32 --- /dev/null +++ b/website/client/src/assets/svg/hourglass-red.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website/client/src/components/admin-panel/user-support/index.vue b/website/client/src/components/admin-panel/user-support/index.vue index 8d156077f2..91be09e8b6 100644 --- a/website/client/src/components/admin-panel/user-support/index.vue +++ b/website/client/src/components/admin-panel/user-support/index.vue @@ -49,6 +49,7 @@ -
-
-

{{ $t('gemTransactions') }}

- {{ $t('noGemTransactions') }} - - +
+
+
- - - - -
- {{ entry.createdAt | timeAgo }} - - - {{ entry.amount * 4 }} - - {{ transactionTypeText(entry.transactionType) }} - - -
-
-
-

{{ $t('hourglassTransactions') }}

- {{ $t('noHourglassTransactions') }} - - + - - - - -
- {{ entry.createdAt | timeAgo }} - - - {{ entry.amount }} - - {{ transactionTypeText(entry.transactionType) }} - - -
+ {{ $t('mysticHourglass', { amount: ''}) }} + +
+ +
+
+ + {{ $t('noGemTransactions') }} + + + + + + + + + + + + + + +
+ {{ $t('timestamp')}} + + {{ $t('amount')}} + + {{ $t('action')}} + + {{ $t('note')}} +
+ {{ entry.createdAt | timeAgo }} + +
+ + {{ entry.amount * 4 }} +
+ + +
+ {{ $t('remainingBalance') }}: + + {{ entry.currentAmount * 4 }} +
+
+
+ + + + + @{{ entry.referenceText }} + + + + + + + + + + + ({{entry.reference}}) + +
+
+
+ + {{ $t('noHourglassTransactions') }} + + + + + + + + + + + + + + +
+ {{ $t('timestamp')}} + + {{ $t('amount')}} + + {{ $t('action')}} + + {{ $t('note')}} +
+ {{ entry.createdAt | timeAgo }} + +
+ + {{ entry.amount }} +
+ + +
+ {{ $t('remainingBalance') }}: + + {{ entry.currentAmount }} +
+
+
+ + + +
+
+
+ - @@ -107,9 +310,15 @@