diff --git a/.env b/.env index e2d830fc..303ed329 100644 --- a/.env +++ b/.env @@ -15,3 +15,4 @@ SEGMENT_KEY=null SITE_NAME=null USER_INFO_COOKIE_NAME=null LOGISTRATION_MINIMAL_HEADER=true +LOGIN_ISSUE_SUPPORT_LINK=null diff --git a/.env.development b/.env.development index a9ae648c..74798706 100644 --- a/.env.development +++ b/.env.development @@ -20,3 +20,4 @@ SEGMENT_KEY=null SITE_NAME='edX' USER_INFO_COOKIE_NAME='edx-user-info' LOGISTRATION_MINIMAL_HEADER=true +LOGIN_ISSUE_SUPPORT_LINK='' diff --git a/.env.test b/.env.test index c99e1b99..b222ed5a 100644 --- a/.env.test +++ b/.env.test @@ -17,3 +17,4 @@ REFRESH_ACCESS_TOKEN_ENDPOINT='http://localhost:18000/login_refresh' SEGMENT_KEY=null SITE_NAME='edX' USER_INFO_COOKIE_NAME='edx-user-info' +LOGIN_ISSUE_SUPPORT_LINK='https://login-issue-support-url.com' diff --git a/src/index.jsx b/src/index.jsx index 9eb021be..8a1fc8f7 100755 --- a/src/index.jsx +++ b/src/index.jsx @@ -1,7 +1,7 @@ import 'babel-polyfill'; import { - APP_INIT_ERROR, APP_READY, subscribe, initialize, + APP_INIT_ERROR, APP_READY, subscribe, initialize, mergeConfig, } from '@edx/frontend-platform'; import { AppProvider, ErrorPage } from '@edx/frontend-platform/react'; import React from 'react'; @@ -52,6 +52,13 @@ subscribe(APP_INIT_ERROR, (error) => { }); initialize({ + handlers: { + config: () => { + mergeConfig({ + LOGIN_ISSUE_SUPPORT_LINK: process.env.LOGIN_ISSUE_SUPPORT_LINK || null, + }); + }, + }, messages: [ appMessages, headerMessages, diff --git a/src/logistration/LoginHelpLinks.jsx b/src/logistration/LoginHelpLinks.jsx index 6f90d8f7..f513fee5 100644 --- a/src/logistration/LoginHelpLinks.jsx +++ b/src/logistration/LoginHelpLinks.jsx @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCaretDown, faCaretRight } from '@fortawesome/free-solid-svg-icons'; import { injectIntl, intlShape } from '@edx/frontend-platform/i18n'; +import { getConfig } from '@edx/frontend-platform'; import SwitchContent from './SwitchContent'; import { @@ -33,6 +34,14 @@ const LoginHelpLinks = (props) => { ); + const loginIssueSupportURL = (config) => (config.LOGIN_ISSUE_SUPPORT_LINK + ? ( + + {intl.formatMessage(messages['logistration.other.sign.in.issues'])} + + ) + : null); + const getHelpButtonMessage = () => { let mid = 'logistration.need.other.help.signing.in.collapsible.menu'; if (page === LOGIN_PAGE) { @@ -44,10 +53,8 @@ const LoginHelpLinks = (props) => { const renderLoginHelp = () => (