Skip to content

Commit

Permalink
Merge pull request #2839 from travis-ci/release_20240617
Browse files Browse the repository at this point in the history
Release 2024 06 17
  • Loading branch information
DominikAlberski authored Jun 17, 2024
2 parents 67cf0c2 + e38ee09 commit eba5992
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions app/components/billing/authorization.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default Component.extend({
isSubscribed: reads('subscription.isSubscribed'),
isIncomplete: reads('subscription.isIncomplete'),
isComplete: not('isIncomplete'),
isExpired: or('subscription.isExpired', 'subscription.subscriptionExpiredByDate'),
cancellationRequested: reads('subscription.cancellationRequested'),
canCancelSubscription: computed('isSubscribed', 'hasSubscriptionPermissions', 'freeV2Plan', 'isTrial', 'cancellationRequested', function () {
return this.isSubscribed && this.hasSubscriptionPermissions && !this.freeV2Plan && !this.isTrial && !this.cancellationRequested;
Expand All @@ -42,9 +43,12 @@ export default Component.extend({
isLoading: or('accounts.fetchSubscriptions.isRunning', 'accounts.fetchV2Subscriptions.isRunning',
'cancelSubscriptionLoading', 'editPlan.isRunning', 'resubscribe.isRunning'),

canBuyAddons: computed('freeV2Plan', 'subscription.isCanceled', 'isTrial', function () {
return !this.freeV2Plan && !this.subscription.isCanceled && !this.isTrial;
}),
canBuyAddons: computed('freeV2Plan', 'subscription.isCanceled', 'isTrial', 'isExpired',
'cancellationRequested', 'subscription.status', function () {
return !this.freeV2Plan && !this.subscription.isCanceled &&
!this.isTrial && !this.cancellationRequested &&
this.subscription.status && !this.isExpired;
}),

handleError: reads('stripe.handleError'),
options: config.stripeOptions,
Expand Down
6 changes: 3 additions & 3 deletions app/templates/components/billing/authorization.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@
</div>
<div class='billing-subscription__buttons--addons'>
{{#if (and this.isV2Subscription this.canBuyAddons)}}
<button {{on 'click' (fn (mut this.showAddonsSelector) true)}} class='button--white-and-teal button--hover' data-test-buy-addons='true'>
Buy addons
</button>
<button {{on 'click' (fn (mut this.showAddonsSelector) true)}} class='button--white-and-teal button--hover' data-test-buy-addons='true'>
Buy addons
</button>
{{/if}}
</div>
{{#if this.canCancelSubscription}}
Expand Down

0 comments on commit eba5992

Please sign in to comment.