Skip to content

Commit

Permalink
fix: Remove Program details Subscriptions portal CTA (#35249)
Browse files Browse the repository at this point in the history
REV-4003
  • Loading branch information
julianajlk authored Aug 8, 2024
1 parent aa952c9 commit eb5bef0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 120 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -739,17 +739,17 @@ describe('Program Details View', () => {
);
});

it('should render appropriate subscription text when subscription is active with trial', () => {
testSubscriptionState(
it('should not render appropriate subscription text when subscription is active with trial', () => {
testSubscriptionSunsetting(
'active',
'Manage my subscription',
'Trial ends',
true,
);
});

it('should render appropriate subscription text when subscription is active', () => {
testSubscriptionState(
it('should not render appropriate subscription text when subscription is active', () => {
testSubscriptionSunsetting(
'active',
'Manage my subscription',
'Your next billing date is',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,64 +46,7 @@
</div>
</div>
<% } %>
<% if (isSubscriptionEligible && (
completedCount !== totalCount
|| subscriptionState === 'active'
)
) { %>
<div class="d-flex flex-column align-items-start flex-xl-row align-items-xl-center upgrade-subscription">
<a
href="<%- subscriptionUrl %>"
class="js-subscription-cta btn-brand btn cta-primary upgrade-button"
<% if (subscriptionState === 'active') { %>
target="_blank"
rel="noopener noreferrer"
<% } %>
>
<% if (subscriptionState === 'active') { %>
<div class="d-flex align-items-center">
<span><%- gettext('Manage my subscription') %></span>
<div class="subscription-icon-launch">
<% // xss-lint: disable=underscore-not-escaped %>
<%= launchIcon %>
</div>
</div>
<% } else if (subscriptionState === 'inactive') { %>
<div class="d-flex align-items-center">
<div class="subscription-icon-restart">
<% // xss-lint: disable=underscore-not-escaped %>
<%= restartIcon %>
</div>
<span><%- gettext('Restart my subscription') %></span>
</div>
<% } else { %>
<%- StringUtils.interpolate(
gettext('Start {trialLength}-day free trial'),
{ trialLength }
) %>
<% } %>
</a>
<span class="subscription-info-brief">
<%- StringUtils.interpolate(
(
hasActiveTrial
? gettext('Trial ends {trialEndDate} at {trialEndTime}')
: subscriptionState === 'active'
? gettext('Your next billing date is {currentPeriodEnd}')
: subscriptionState === 'inactive'
? gettext('{subscriptionPrice} subscription. Cancel anytime.')
: gettext('{subscriptionPrice} subscription after trial ends. Cancel anytime.')
),
{
subscriptionPrice,
currentPeriodEnd,
trialEndDate,
trialEndTime,
}
) %>
</span>
</div>
<% } else if (
<% if (
!isSubscriptionEligible
&& is_learner_eligible_for_one_click_purchase
&& (typeof is_mobile_only === 'undefined' || is_mobile_only === false)
Expand Down
59 changes: 1 addition & 58 deletions lms/templates/learner_dashboard/program_details_view.underscore
Original file line number Diff line number Diff line change
Expand Up @@ -21,64 +21,7 @@
</div>
</div>
<% } %>
<% if (isSubscriptionEligible && (
completedCount !== totalCount
|| subscriptionState === 'active'
)
) { %>
<div class="d-flex flex-column align-items-start flex-xl-row align-items-xl-center upgrade-subscription">
<a
href="<%- subscriptionUrl %>"
class="js-subscription-cta btn-brand btn cta-primary upgrade-button"
<% if (subscriptionState === 'active') { %>
target="_blank"
rel="noopener noreferrer"
<% } %>
>
<% if (subscriptionState === 'active') { %>
<div class="d-flex align-items-center">
<span><%- gettext('Manage my subscription') %></span>
<div class="subscription-icon-launch">
<% // xss-lint: disable=underscore-not-escaped %>
<%= launchIcon %>
</div>
</div>
<% } else if (subscriptionState === 'inactive') { %>
<div class="d-flex align-items-center">
<div class="subscription-icon-restart">
<% // xss-lint: disable=underscore-not-escaped %>
<%= restartIcon %>
</div>
<span><%- gettext('Restart my subscription') %></span>
</div>
<% } else { %>
<%- StringUtils.interpolate(
gettext('Start {trialLength}-day free trial'),
{ trialLength }
) %>
<% } %>
</a>
<span class="subscription-info-brief">
<%- StringUtils.interpolate(
(
hasActiveTrial
? gettext('Trial ends {trialEndDate} at {trialEndTime}')
: subscriptionState === 'active'
? gettext('Your next billing date is {currentPeriodEnd}')
: subscriptionState === 'inactive'
? gettext('{subscriptionPrice} subscription. Cancel anytime.')
: gettext('{subscriptionPrice} subscription after trial ends. Cancel anytime.')
),
{
subscriptionPrice,
currentPeriodEnd,
trialEndDate,
trialEndTime,
}
) %>
</span>
</div>
<% } else if (
<% if (
!isSubscriptionEligible
&& is_learner_eligible_for_one_click_purchase
&& (typeof is_mobile_only === 'undefined' || is_mobile_only === false)
Expand Down

0 comments on commit eb5bef0

Please sign in to comment.