From 5204ee6981d2bf82ce2b12ff80c712ee176dd746 Mon Sep 17 00:00:00 2001 From: Nawfal Ahmed <111358247+NawfalAhmed@users.noreply.github.com> Date: Wed, 14 Jun 2023 16:28:49 +0500 Subject: [PATCH] feat: handle edge cases for purchased courses in a subscription program (#32438) --- .../js/learner_dashboard/views/program_details_view.js | 1 + .../learner_dashboard/program_details_tab_view.underscore | 6 +++++- .../learner_dashboard/program_details_view.underscore | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lms/static/js/learner_dashboard/views/program_details_view.js b/lms/static/js/learner_dashboard/views/program_details_view.js index 365493afef..1ff64f81b1 100644 --- a/lms/static/js/learner_dashboard/views/program_details_view.js +++ b/lms/static/js/learner_dashboard/views/program_details_view.js @@ -200,6 +200,7 @@ class ProgramDetailsView extends Backbone.View { )); const programPurchasedWithoutSubscription = ( this.subscriptionModel.get('subscriptionState') !== 'active' + && this.subscriptionModel.get('subscriptionState') !== 'inactive' && !isSomeCoursePurchasable && this.remainingCourseCollection.length === 0 ); diff --git a/lms/templates/learner_dashboard/program_details_tab_view.underscore b/lms/templates/learner_dashboard/program_details_tab_view.underscore index 1a970ae3bb..a9f721a891 100644 --- a/lms/templates/learner_dashboard/program_details_tab_view.underscore +++ b/lms/templates/learner_dashboard/program_details_tab_view.underscore @@ -48,7 +48,11 @@ <% } %> - <% if (isSubscriptionEligible) { %> + <% if (isSubscriptionEligible && ( + completedCount !== totalCount + || subscriptionState === 'active' + ) + ) { %>
<% } %> - <% if (isSubscriptionEligible) { %> + <% if (isSubscriptionEligible && ( + completedCount !== totalCount + || subscriptionState === 'active' + ) + ) { %>