From 1821465874a741699e7025ae5d078f624fbac0dc Mon Sep 17 00:00:00 2001 From: Umar Asghar Date: Wed, 22 Dec 2021 22:44:17 +0500 Subject: [PATCH] fix broken link to MITx Online Dashboard (#5136) --- docker-compose.selenium.yml | 2 +- micromasters/settings.py | 1 + static/js/constants.js | 7 ++++++- static/js/flow/declarations.js | 1 + static/js/global_init.js | 1 + static/js/util/courseware_test.js | 4 ++-- static/scss/_grid-settings.scss | 2 +- static/scss/page-layout.scss | 2 +- ui/views.py | 1 + ui/views_test.py | 9 +++++++++ 10 files changed, 24 insertions(+), 6 deletions(-) diff --git a/docker-compose.selenium.yml b/docker-compose.selenium.yml index d18f9f0696..5981ccb766 100644 --- a/docker-compose.selenium.yml +++ b/docker-compose.selenium.yml @@ -21,7 +21,7 @@ services: DEBUG: 'False' ELASTICSEARCH_DEFAULT_PAGE_SIZE: '5' MITXONLINE_BASE_URL: "https://fake-mitxonline.example.com/" - + MITXONLINE_URL: "https://fake-mitxonline.example.com/" # To silence ImproperlyConfigured when running tests MAILGUN_URL: http://fake.mailgun.url MAILGUN_KEY: fake_mailgun_key diff --git a/micromasters/settings.py b/micromasters/settings.py index 5f49186287..226f185e87 100644 --- a/micromasters/settings.py +++ b/micromasters/settings.py @@ -172,6 +172,7 @@ EDXORG_BASE_URL = get_string('EDXORG_BASE_URL', 'https://courses.edx.org/') MITXONLINE_BASE_URL = get_string('MITXONLINE_BASE_URL', None) +MITXONLINE_URL = get_string('MITXONLINE_URL', None) MITXONLINE_STAFF_ACCESS_TOKEN = get_string('MITXONLINE_STAFF_ACCESS_TOKEN', None) SOCIAL_AUTH_EDXORG_KEY = get_string('EDXORG_CLIENT_ID', '') SOCIAL_AUTH_EDXORG_SECRET = get_string('EDXORG_CLIENT_SECRET', '') diff --git a/static/js/constants.js b/static/js/constants.js index 27007eec92..5a5d73fe87 100644 --- a/static/js/constants.js +++ b/static/js/constants.js @@ -128,6 +128,11 @@ export const MITXONLINE_LINK_BASE = urljoin( "courses/" ) +export const MITXONLINE_DASHBOARD_LINK = urljoin( + SETTINGS.mitxonline_url, + "dashboard/" +) + export const COURSEWARE_BACKEND_EDXORG = "edxorg" export const COURSEWARE_BACKEND_MITXONLINE = "mitxonline" export const COURSEWARE_BACKEND_NAMES = { @@ -136,7 +141,7 @@ export const COURSEWARE_BACKEND_NAMES = { } export const COURSEWARE_BACKEND_BASE_URLS = { [COURSEWARE_BACKEND_EDXORG]: EDX_LINK_BASE, - [COURSEWARE_BACKEND_MITXONLINE]: MITXONLINE_LINK_BASE + [COURSEWARE_BACKEND_MITXONLINE]: MITXONLINE_DASHBOARD_LINK } export const COUPON_CONTENT_TYPE_COURSE = "course" diff --git a/static/js/flow/declarations.js b/static/js/flow/declarations.js index 944133e241..517f974f31 100644 --- a/static/js/flow/declarations.js +++ b/static/js/flow/declarations.js @@ -13,6 +13,7 @@ declare var SETTINGS: { host: string, edx_base_url: string, mitxonline_base_url: string, + mitxonline_url: string, EXAMS_SSO_CLIENT_CODE: string, EXAMS_SSO_URL: string, FEATURES: { diff --git a/static/js/global_init.js b/static/js/global_init.js index 9fd4cf2e19..c6c2d9a34a 100644 --- a/static/js/global_init.js +++ b/static/js/global_init.js @@ -17,6 +17,7 @@ const _createSettings = () => ({ }, edx_base_url: "/edx/", mitxonline_base_url: "/mitxonline/", + mitxonline_url: "/mitxonline/", search_url: "/", roles: [], support_email: "a_real_email@example.com", diff --git a/static/js/util/courseware_test.js b/static/js/util/courseware_test.js index e8b798ab5b..b2acf9da0c 100644 --- a/static/js/util/courseware_test.js +++ b/static/js/util/courseware_test.js @@ -5,7 +5,7 @@ import { coursewareBaseUrl, courseRunUrl } from "./courseware" import { makeRun } from "../factories/dashboard" import { EDX_LINK_BASE, - MITXONLINE_LINK_BASE, + MITXONLINE_DASHBOARD_LINK, COURSEWARE_BACKEND_EDXORG, COURSEWARE_BACKEND_MITXONLINE } from "../constants" @@ -19,7 +19,7 @@ describe("courseware utility functions", () => { it("should return the edxurl for mitxonline coursewaree", () => { assert.equal( coursewareBaseUrl(COURSEWARE_BACKEND_MITXONLINE), - MITXONLINE_LINK_BASE + MITXONLINE_DASHBOARD_LINK ) }) }) diff --git a/static/scss/_grid-settings.scss b/static/scss/_grid-settings.scss index fea897595f..f45494715f 100644 --- a/static/scss/_grid-settings.scss +++ b/static/scss/_grid-settings.scss @@ -5,7 +5,7 @@ $grid-columns: 12; $max-width: 1350px; $min-width: 1350px; $visual-grid: false; -$visual-grid-index: front !global; +$visual-grid-index: front; // Define your breakpoints $tablet: new-breakpoint(max-width 768px 8); diff --git a/static/scss/page-layout.scss b/static/scss/page-layout.scss index 9f9c2ff5a3..bbc8658313 100644 --- a/static/scss/page-layout.scss +++ b/static/scss/page-layout.scss @@ -1,4 +1,4 @@ -$border-box-sizing: true !global; +$border-box-sizing: true; .page-content { width: 100%; diff --git a/ui/views.py b/ui/views.py index 7ada643f20..2dd5ffaa9c 100644 --- a/ui/views.py +++ b/ui/views.py @@ -61,6 +61,7 @@ def get_context(self, request): "host": webpack_dev_server_host(request), "edx_base_url": settings.EDXORG_BASE_URL, "mitxonline_base_url": settings.MITXONLINE_BASE_URL, + "mitxonline_url": settings.MITXONLINE_URL, "roles": roles, "release_version": settings.VERSION, "environment": settings.ENVIRONMENT, diff --git a/ui/views_test.py b/ui/views_test.py index 6f5301f1e6..c0e8c32322 100644 --- a/ui/views_test.py +++ b/ui/views_test.py @@ -240,6 +240,7 @@ def test_dashboard_settings(self): react_ga_debug = FuzzyText().fuzz() edx_base_url = FuzzyText().fuzz() mitxonline_base_url = FuzzyText().fuzz() + mitxonline_url = FuzzyText().fuzz() host = FuzzyText().fuzz() email_support = FuzzyText().fuzz() open_discussions_redirect_url = FuzzyText().fuzz() @@ -248,6 +249,7 @@ def test_dashboard_settings(self): REACT_GA_DEBUG=react_ga_debug, EDXORG_BASE_URL=edx_base_url, MITXONLINE_BASE_URL=mitxonline_base_url, + MITXONLINE_URL=mitxonline_url, WEBPACK_DEV_SERVER_HOST=host, EMAIL_SUPPORT=email_support, VERSION='0.0.1', @@ -280,6 +282,7 @@ def test_dashboard_settings(self): 'host': host, 'edx_base_url': edx_base_url, "mitxonline_base_url": mitxonline_base_url, + "mitxonline_url": mitxonline_url, 'roles': [], 'search_url': reverse('search_api', kwargs={"elastic_url": ""}), 'support_email': email_support, @@ -694,6 +697,7 @@ def test_users_logged_in(self): react_ga_debug = FuzzyText().fuzz() edx_base_url = FuzzyText().fuzz() mitxonline_base_url = FuzzyText().fuzz() + mitxonline_url = FuzzyText().fuzz() host = FuzzyText().fuzz() email_support = FuzzyText().fuzz() open_discussions_redirect_url = FuzzyText().fuzz() @@ -702,6 +706,7 @@ def test_users_logged_in(self): REACT_GA_DEBUG=react_ga_debug, EDXORG_BASE_URL=edx_base_url, MITXONLINE_BASE_URL=mitxonline_base_url, + MITXONLINE_URL=mitxonline_url, WEBPACK_DEV_SERVER_HOST=host, EMAIL_SUPPORT=email_support, VERSION='0.0.1', @@ -735,6 +740,7 @@ def test_users_logged_in(self): 'host': host, 'edx_base_url': edx_base_url, "mitxonline_base_url": mitxonline_base_url, + "mitxonline_url": mitxonline_url, 'roles': [], 'search_url': reverse('search_api', kwargs={"elastic_url": ""}), 'support_email': email_support, @@ -775,6 +781,7 @@ def test_users_anonymous(self): react_ga_debug = FuzzyText().fuzz() edx_base_url = FuzzyText().fuzz() mitxonline_base_url = FuzzyText().fuzz() + mitxonline_url = FuzzyText().fuzz() host = FuzzyText().fuzz() email_support = FuzzyText().fuzz() open_discussions_redirect_url = FuzzyText().fuzz() @@ -783,6 +790,7 @@ def test_users_anonymous(self): REACT_GA_DEBUG=react_ga_debug, EDXORG_BASE_URL=edx_base_url, MITXONLINE_BASE_URL=mitxonline_base_url, + MITXONLINE_URL=mitxonline_url, WEBPACK_DEV_SERVER_HOST=host, EMAIL_SUPPORT=email_support, VERSION='0.0.1', @@ -809,6 +817,7 @@ def test_users_anonymous(self): 'host': host, 'edx_base_url': edx_base_url, "mitxonline_base_url": mitxonline_base_url, + "mitxonline_url": mitxonline_url, 'roles': [], 'search_url': reverse('search_api', kwargs={"elastic_url": ""}), 'support_email': email_support,