From 761306114d2c0353ea692cb6557999bff722cdf6 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 3 Dec 2020 17:41:06 -0500 Subject: [PATCH] New LOGIN_ISSUE_SUPPORT_LINK setting The login page had a hard-coded support.edx.org URL. This changes it to a configurable setting. BTR-32. --- cms/envs/common.py | 1 + cms/envs/test.py | 1 + lms/envs/common.py | 1 + lms/envs/production.py | 5 ++--- lms/envs/test.py | 1 + lms/static/js/student_account/views/FormView.js | 3 ++- lms/templates/student_account/form_field.underscore | 8 ++++++-- openedx/core/djangoapps/user_api/helpers.py | 4 +++- openedx/core/djangoapps/user_api/tests/test_helpers.py | 3 ++- .../core/djangoapps/user_authn/views/tests/test_login.py | 2 ++ .../user_authn/views/tests/test_reset_password.py | 1 + 11 files changed, 22 insertions(+), 8 deletions(-) diff --git a/cms/envs/common.py b/cms/envs/common.py index 356fb2d7ff..cddcc7b73a 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -1533,6 +1533,7 @@ SUPPORT_SITE_LINK = '' ID_VERIFICATION_SUPPORT_LINK = '' PASSWORD_RESET_SUPPORT_LINK = '' ACTIVATION_EMAIL_SUPPORT_LINK = '' +LOGIN_ISSUE_SUPPORT_LINK = '' ############################## EVENT TRACKING ################################# diff --git a/cms/envs/test.py b/cms/envs/test.py index 579ad6e597..c854f19ad8 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -33,6 +33,7 @@ from lms.envs.test import ( # pylint: disable=wrong-import-order ECOMMERCE_API_URL, ENABLE_COMPREHENSIVE_THEMING, JWT_AUTH, + LOGIN_ISSUE_SUPPORT_LINK, MEDIA_ROOT, MEDIA_URL, PLATFORM_DESCRIPTION, diff --git a/lms/envs/common.py b/lms/envs/common.py index 7dfd0fd638..0ee96897ca 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -2805,6 +2805,7 @@ SUPPORT_SITE_LINK = '' ID_VERIFICATION_SUPPORT_LINK = '' PASSWORD_RESET_SUPPORT_LINK = '' ACTIVATION_EMAIL_SUPPORT_LINK = '' +LOGIN_ISSUE_SUPPORT_LINK = '' # Days before the expired date that we warn the user ENTITLEMENT_EXPIRED_ALERT_PERIOD = 90 diff --git a/lms/envs/production.py b/lms/envs/production.py index 2cb1d13608..4aaf20a098 100644 --- a/lms/envs/production.py +++ b/lms/envs/production.py @@ -308,9 +308,8 @@ MKTG_URL_OVERRIDES.update(ENV_TOKENS.get('MKTG_URL_OVERRIDES', MKTG_URL_OVERRIDE # Intentional defaults. ID_VERIFICATION_SUPPORT_LINK = ENV_TOKENS.get('ID_VERIFICATION_SUPPORT_LINK', SUPPORT_SITE_LINK) PASSWORD_RESET_SUPPORT_LINK = ENV_TOKENS.get('PASSWORD_RESET_SUPPORT_LINK', SUPPORT_SITE_LINK) -ACTIVATION_EMAIL_SUPPORT_LINK = ENV_TOKENS.get( - 'ACTIVATION_EMAIL_SUPPORT_LINK', SUPPORT_SITE_LINK -) +ACTIVATION_EMAIL_SUPPORT_LINK = ENV_TOKENS.get('ACTIVATION_EMAIL_SUPPORT_LINK', SUPPORT_SITE_LINK) +LOGIN_ISSUE_SUPPORT_LINK = ENV_TOKENS.get('LOGIN_ISSUE_SUPPORT_LINK', SUPPORT_SITE_LINK) # Timezone overrides TIME_ZONE = ENV_TOKENS.get('CELERY_TIMEZONE', CELERY_TIMEZONE) diff --git a/lms/envs/test.py b/lms/envs/test.py index 3b71ef3545..3f26b8dee2 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -311,6 +311,7 @@ MKTG_URL_LINK_MAP = { SUPPORT_SITE_LINK = 'https://example.support.edx.org' PASSWORD_RESET_SUPPORT_LINK = 'https://support.example.com/password-reset-help.html' ACTIVATION_EMAIL_SUPPORT_LINK = 'https://support.example.com/activation-email-help.html' +LOGIN_ISSUE_SUPPORT_LINK = 'https://support.example.com/login-issue-help.html' ENTERPRISE_MARKETING_FOOTER_QUERY_PARAMS = OrderedDict([ ("utm_campaign", "edX.org Referral"), ("utm_source", "edX.org"), diff --git a/lms/static/js/student_account/views/FormView.js b/lms/static/js/student_account/views/FormView.js index 676816b763..154d714c02 100644 --- a/lms/static/js/student_account/views/FormView.js +++ b/lms/static/js/student_account/views/FormView.js @@ -94,7 +94,8 @@ requiredStr: this.requiredStr, optionalStr: this.optionalStr, supplementalText: data[i].supplementalText || '', - supplementalLink: data[i].supplementalLink || '' + supplementalLink: data[i].supplementalLink || '', + loginIssueSupportLink: data[i].loginIssueSupportLink || '' }))); } diff --git a/lms/templates/student_account/form_field.underscore b/lms/templates/student_account/form_field.underscore index b30daba18d..49d80c3f72 100644 --- a/lms/templates/student_account/form_field.underscore +++ b/lms/templates/student_account/form_field.underscore @@ -136,7 +136,9 @@ <% } %> @@ -144,7 +146,9 @@ <% } %> diff --git a/openedx/core/djangoapps/user_api/helpers.py b/openedx/core/djangoapps/user_api/helpers.py index 8b077625df..3232e2cf30 100644 --- a/openedx/core/djangoapps/user_api/helpers.py +++ b/openedx/core/djangoapps/user_api/helpers.py @@ -12,6 +12,7 @@ from functools import wraps import six from django import forms +from django.conf import settings from django.core.serializers.json import DjangoJSONEncoder from django.utils.encoding import force_text from django.utils.functional import Promise @@ -206,7 +207,8 @@ class FormDescription(object): "restrictions": {}, "errorMessages": {}, "supplementalLink": supplementalLink, - "supplementalText": supplementalText + "supplementalText": supplementalText, + "loginIssueSupportLink": settings.LOGIN_ISSUE_SUPPORT_LINK, } field_override = self._field_overrides.get(name, {}) diff --git a/openedx/core/djangoapps/user_api/tests/test_helpers.py b/openedx/core/djangoapps/user_api/tests/test_helpers.py index 09753599e7..d0c2472b0f 100644 --- a/openedx/core/djangoapps/user_api/tests/test_helpers.py +++ b/openedx/core/djangoapps/user_api/tests/test_helpers.py @@ -128,7 +128,8 @@ class FormDescriptionTest(TestCase): "required": "You must provide a value!" }, "supplementalLink": "", - "supplementalText": "" + "supplementalText": "", + "loginIssueSupportLink": "https://support.example.com/login-issue-help.html", } ] })) diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_login.py b/openedx/core/djangoapps/user_authn/views/tests/test_login.py index 91233681ac..72840863dd 100644 --- a/openedx/core/djangoapps/user_authn/views/tests/test_login.py +++ b/openedx/core/djangoapps/user_authn/views/tests/test_login.py @@ -847,6 +847,7 @@ class LoginSessionViewTest(ApiTestCase): "errorMessages": {}, "supplementalText": "", "supplementalLink": "", + "loginIssueSupportLink": "https://support.example.com/login-issue-help.html", }, { "name": "password", @@ -862,6 +863,7 @@ class LoginSessionViewTest(ApiTestCase): "errorMessages": {}, "supplementalText": "", "supplementalLink": "", + "loginIssueSupportLink": "https://support.example.com/login-issue-help.html", }, ]) diff --git a/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py b/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py index e882545cb8..c3fd6e2e35 100644 --- a/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py +++ b/openedx/core/djangoapps/user_authn/views/tests/test_reset_password.py @@ -672,6 +672,7 @@ class PasswordResetViewTest(UserAPITestCase): "errorMessages": {}, "supplementalText": "", "supplementalLink": "", + "loginIssueSupportLink": "https://support.example.com/login-issue-help.html", } ])