From 7174da78d0ef19632bc526282e3f9b4cc991bcbd Mon Sep 17 00:00:00 2001
From: Nawfal Ahmed <111358247+NawfalAhmed@users.noreply.github.com>
Date: Tue, 16 May 2023 15:34:42 +0500
Subject: [PATCH] feat: subscription changes and alerts for program dashboard
and details (#32217)
* feat: subscription changes on program dashboard and details (#31909)
- add a h2 programs heading on program dashboard
- subscription ui changes on program dashboard
- subscription alerts on both pages
* feat: add subscription upsell, fix responsive layout of program dashboard (#31943)
* test: update tests for subscription changes on program dashboard (#32021)
* feat: subscription api changes on program dashboard (#32085)
* feat: add subscription segment events to program details and dashboard (#32164)
* feat: subscription changes on program dashboard and details pages (#32205)
---
lms/static/images/arrow-upright-icon.svg | 5 +-
lms/static/images/launch-icon.svg | 3 +
lms/static/images/warning-icon.svg | 5 +
.../models/program_subscription_model.js | 11 ++-
.../learner_dashboard/program_list_factory.js | 19 +++-
.../spec/collection_list_view_spec.js | 10 ++
.../spec/program_alert_list_view_spec.js | 58 +++++++++++
.../spec/program_card_view_spec.js | 25 ++++-
.../spec/program_details_sidebar_view_spec.js | 2 +-
.../spec/program_details_view_spec.js | 3 +-
.../spec/program_list_header_view_spec.js | 92 +++++++++++++++++
.../spec/sidebar_view_spec.js | 45 ++++++++-
.../views/program_alert_list_view.js | 89 +++++++++++++++++
.../views/program_card_view.js | 16 ++-
.../views/program_details_view.js | 81 +++++++++++++++
.../views/program_list_header_view.js | 98 +++++++++++++++++++
.../learner_dashboard/views/sidebar_view.js | 16 +++
.../views/subscription_upsell_view.js | 30 ++++++
lms/static/sass/views/_program-details.scss | 30 +++++-
lms/static/sass/views/_program-list.scss | 94 +++++++++++-------
.../explore_new_programs.underscore | 14 ++-
.../program_alert_list_view.underscore | 22 +++++
.../learner_dashboard/program_card.underscore | 5 +
.../program_details_sidebar.underscore | 2 +-
.../program_details_tab_view.underscore | 32 ++++--
.../program_details_view.underscore | 32 ++++--
.../program_list_header_view.underscore | 2 +
.../learner_dashboard/programs_fragment.html | 12 ++-
.../learner_dashboard/sidebar.underscore | 3 +
.../subscription_upsell_view.underscore | 14 +++
30 files changed, 774 insertions(+), 96 deletions(-)
create mode 100644 lms/static/images/launch-icon.svg
create mode 100644 lms/static/images/warning-icon.svg
create mode 100644 lms/static/js/learner_dashboard/spec/program_alert_list_view_spec.js
create mode 100644 lms/static/js/learner_dashboard/spec/program_list_header_view_spec.js
create mode 100644 lms/static/js/learner_dashboard/views/program_alert_list_view.js
create mode 100644 lms/static/js/learner_dashboard/views/program_list_header_view.js
create mode 100644 lms/static/js/learner_dashboard/views/subscription_upsell_view.js
create mode 100644 lms/templates/learner_dashboard/program_alert_list_view.underscore
create mode 100644 lms/templates/learner_dashboard/program_list_header_view.underscore
create mode 100644 lms/templates/learner_dashboard/subscription_upsell_view.underscore
diff --git a/lms/static/images/arrow-upright-icon.svg b/lms/static/images/arrow-upright-icon.svg
index 3838d3f035..e4417a13bb 100644
--- a/lms/static/images/arrow-upright-icon.svg
+++ b/lms/static/images/arrow-upright-icon.svg
@@ -1,4 +1,3 @@
-
+
+
+ <%- gettext('Explore new programs') %>
+
diff --git a/lms/templates/learner_dashboard/program_alert_list_view.underscore b/lms/templates/learner_dashboard/program_alert_list_view.underscore
new file mode 100644
index 0000000000..eeb9e2d0d1
--- /dev/null
+++ b/lms/templates/learner_dashboard/program_alert_list_view.underscore
@@ -0,0 +1,22 @@
+
+ <% _.each(alertList, function({ title, message, url, urlText }){ %>
+
+
+
+ <% // xss-lint: disable=underscore-not-escaped %>
+ <%= warningIcon %>
+
+
+
<%- title %>
+ <% // xss-lint: disable=underscore-not-escaped %>
+
<%= message %>
+
+
+ <% if (url && urlText) { %>
+
+ <%- urlText %>
+
+ <% } %>
+
+ <% }); %>
+
diff --git a/lms/templates/learner_dashboard/program_card.underscore b/lms/templates/learner_dashboard/program_card.underscore
index de98c952dd..c9364d6ca2 100644
--- a/lms/templates/learner_dashboard/program_card.underscore
+++ b/lms/templates/learner_dashboard/program_card.underscore
@@ -61,3 +61,8 @@
+<% if (isSubscribed) { %>
+
+ <%- gettext('Subscribed') %>
+
+<% } %>
diff --git a/lms/templates/learner_dashboard/program_details_sidebar.underscore b/lms/templates/learner_dashboard/program_details_sidebar.underscore
index 3146127dde..067833fdae 100644
--- a/lms/templates/learner_dashboard/program_details_sidebar.underscore
+++ b/lms/templates/learner_dashboard/program_details_sidebar.underscore
@@ -32,7 +32,7 @@
),
{
subscriptionPrice,
- a_start: HtmlUtils.HTML(``),
+ a_start: HtmlUtils.HTML(``),
a_end: HtmlUtils.HTML(''),
}
) %>
diff --git a/lms/templates/learner_dashboard/program_details_tab_view.underscore b/lms/templates/learner_dashboard/program_details_tab_view.underscore
index cb6f0fd6a2..37b5597e86 100644
--- a/lms/templates/learner_dashboard/program_details_tab_view.underscore
+++ b/lms/templates/learner_dashboard/program_details_tab_view.underscore
@@ -1,4 +1,5 @@
+
<% if (programTabViewEnabled) { %>
@@ -48,9 +49,24 @@
<% } %>
<% if (isSubscriptionEligible) { %>
-