From 384a3751d7c9733b2b6fcecd0fe0d1350daa2b14 Mon Sep 17 00:00:00 2001 From: julianajlk Date: Wed, 7 Aug 2024 15:50:30 -0400 Subject: [PATCH 1/2] fix: Remove dashboard Program details Subscriptions portal CTA --- .../program_details_tab_view.underscore | 59 +------------------ .../program_details_view.underscore | 59 +------------------ 2 files changed, 2 insertions(+), 116 deletions(-) diff --git a/lms/templates/learner_dashboard/program_details_tab_view.underscore b/lms/templates/learner_dashboard/program_details_tab_view.underscore index f15265119d8a..37691cca55c5 100644 --- a/lms/templates/learner_dashboard/program_details_tab_view.underscore +++ b/lms/templates/learner_dashboard/program_details_tab_view.underscore @@ -46,64 +46,7 @@ <% } %> - <% if (isSubscriptionEligible && ( - completedCount !== totalCount - || subscriptionState === 'active' - ) - ) { %> -
- - target="_blank" - rel="noopener noreferrer" - <% } %> - > - <% if (subscriptionState === 'active') { %> -
- <%- gettext('Manage my subscription') %> -
- <% // xss-lint: disable=underscore-not-escaped %> - <%= launchIcon %> -
-
- <% } else if (subscriptionState === 'inactive') { %> -
-
- <% // xss-lint: disable=underscore-not-escaped %> - <%= restartIcon %> -
- <%- gettext('Restart my subscription') %> -
- <% } else { %> - <%- StringUtils.interpolate( - gettext('Start {trialLength}-day free trial'), - { trialLength } - ) %> - <% } %> -
- - <%- 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, - } - ) %> - -
- <% } else if ( + <% if ( !isSubscriptionEligible && is_learner_eligible_for_one_click_purchase && (typeof is_mobile_only === 'undefined' || is_mobile_only === false) diff --git a/lms/templates/learner_dashboard/program_details_view.underscore b/lms/templates/learner_dashboard/program_details_view.underscore index c2bdca897edc..25f1cd5b883b 100644 --- a/lms/templates/learner_dashboard/program_details_view.underscore +++ b/lms/templates/learner_dashboard/program_details_view.underscore @@ -21,64 +21,7 @@ <% } %> - <% if (isSubscriptionEligible && ( - completedCount !== totalCount - || subscriptionState === 'active' - ) - ) { %> -
- - target="_blank" - rel="noopener noreferrer" - <% } %> - > - <% if (subscriptionState === 'active') { %> -
- <%- gettext('Manage my subscription') %> -
- <% // xss-lint: disable=underscore-not-escaped %> - <%= launchIcon %> -
-
- <% } else if (subscriptionState === 'inactive') { %> -
-
- <% // xss-lint: disable=underscore-not-escaped %> - <%= restartIcon %> -
- <%- gettext('Restart my subscription') %> -
- <% } else { %> - <%- StringUtils.interpolate( - gettext('Start {trialLength}-day free trial'), - { trialLength } - ) %> - <% } %> -
- - <%- 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, - } - ) %> - -
- <% } else if ( + <% if ( !isSubscriptionEligible && is_learner_eligible_for_one_click_purchase && (typeof is_mobile_only === 'undefined' || is_mobile_only === false) From 8ab71e29b35576cf0f9f792043ee66d7df634b1f Mon Sep 17 00:00:00 2001 From: julianajlk Date: Thu, 8 Aug 2024 11:22:32 -0400 Subject: [PATCH 2/2] test: Update Subscriptions tests --- .../learner_dashboard/spec/program_details_view_spec.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lms/static/js/learner_dashboard/spec/program_details_view_spec.js b/lms/static/js/learner_dashboard/spec/program_details_view_spec.js index 2387ade00b9e..feaf72526192 100644 --- a/lms/static/js/learner_dashboard/spec/program_details_view_spec.js +++ b/lms/static/js/learner_dashboard/spec/program_details_view_spec.js @@ -739,8 +739,8 @@ 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', @@ -748,8 +748,8 @@ describe('Program Details View', () => { ); }); - 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',