Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove Program details Subscriptions portal CTA #35249

Merged
merged 2 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading