diff --git a/.env.development b/.env.development index 9c59d0b86..ec20aa0d2 100644 --- a/.env.development +++ b/.env.development @@ -17,6 +17,7 @@ SEGMENT_KEY=null SITE_NAME=Open edX USER_INFO_COOKIE_NAME=edx-user-info LOGO_URL=https://edx-cdn.org/v3/default/logo.svg +LOGO_DESTINATION=http://localhost:18000/dashboard LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico diff --git a/README.rst b/README.rst index ab9e4db72..e0d12c353 100644 --- a/README.rst +++ b/README.rst @@ -45,6 +45,7 @@ Environment Variables * ``SITE_NAME`` - The user-facing name of the site, used as `alt` text on the logo in the header. Defaults to "localhost" in development. * ``LOGO_URL`` - The URL of the site's logo. This logo is displayed in the header. +* ``LOGO_DESTINATION`` - The URL of where the site's logo should point to. * ``ORDER_HISTORY_URL`` - The URL of the order history page. * ``ACCOUNT_PROFILE_URL`` - The URL of the account profile page. * ``ACCOUNT_SETTINGS_URL`` - The URL of the account settings page. diff --git a/src/Header.jsx b/src/Header.jsx index c0db257c7..7502e06d6 100644 --- a/src/Header.jsx +++ b/src/Header.jsx @@ -21,6 +21,7 @@ ensureConfig([ 'LOGIN_URL', 'SITE_NAME', 'LOGO_URL', + 'LOGO_DESTINATION', 'ORDER_HISTORY_URL', ], 'Header component'); @@ -91,7 +92,7 @@ const Header = ({ intl }) => { const props = { logo: config.LOGO_URL, logoAltText: config.SITE_NAME, - logoDestination: `${config.LMS_BASE_URL}/dashboard`, + logoDestination: config.LOGO_DESTINATION || `${config.LMS_BASE_URL}/dashboard`, loggedIn: authenticatedUser !== null, username: authenticatedUser !== null ? authenticatedUser.username : null, avatar: authenticatedUser !== null ? authenticatedUser.avatar : null, diff --git a/src/Header.test.jsx b/src/Header.test.jsx index 51fef2089..51691cd06 100644 --- a/src/Header.test.jsx +++ b/src/Header.test.jsx @@ -29,6 +29,7 @@ describe('
', () => { LOGIN_URL: process.env.LOGIN_URL, LOGOUT_URL: process.env.LOGOUT_URL, LOGO_URL: process.env.LOGO_URL, + LOGO_DESTINATION: process.env.LOGO_DESTINATION, }, }; const component = ; @@ -52,6 +53,7 @@ describe('
', () => { LOGIN_URL: process.env.LOGIN_URL, LOGOUT_URL: process.env.LOGOUT_URL, LOGO_URL: process.env.LOGO_URL, + LOGO_DESTINATION: process.env.LOGO_DESTINATION, }, }; const component = ; @@ -70,6 +72,7 @@ describe('
', () => { LOGIN_URL: process.env.LOGIN_URL, LOGOUT_URL: process.env.LOGOUT_URL, LOGO_URL: process.env.LOGO_URL, + LOGO_DESTINATION: process.env.LOGO_DESTINATION, }, }; const component = ; @@ -93,6 +96,7 @@ describe('
', () => { LOGIN_URL: process.env.LOGIN_URL, LOGOUT_URL: process.env.LOGOUT_URL, LOGO_URL: process.env.LOGO_URL, + LOGO_DESTINATION: process.env.LOGO_DESTINATION, }, }; const component = ; diff --git a/src/learning-header/LearningHeader.jsx b/src/learning-header/LearningHeader.jsx index 373001d19..9a3d74e41 100644 --- a/src/learning-header/LearningHeader.jsx +++ b/src/learning-header/LearningHeader.jsx @@ -33,7 +33,7 @@ const LearningHeader = ({ const headerLogo = ( diff --git a/src/setupTest.js b/src/setupTest.js index 95e0e5866..967fff1b7 100644 --- a/src/setupTest.js +++ b/src/setupTest.js @@ -35,6 +35,7 @@ process.env.SEGMENT_KEY = 'segment_whoa'; process.env.SITE_NAME = 'edX'; process.env.USER_INFO_COOKIE_NAME = 'edx-user-info'; process.env.LOGO_URL = 'https://edx-cdn.org/v3/default/logo.svg'; +process.env.LOGO_DESTINATION = `${process.env.LMS_BASE_URL}/dashboard`; process.env.LOGO_TRADEMARK_URL = 'https://edx-cdn.org/v3/default/logo-trademark.svg'; process.env.LOGO_WHITE_URL = 'https://edx-cdn.org/v3/default/logo-white.svg'; process.env.FAVICON_URL = 'https://edx-cdn.org/v3/default/favicon.ico'; @@ -65,6 +66,7 @@ export function initializeMockApp() { ACCESS_TOKEN_COOKIE_NAME: process.env.ACCESS_TOKEN_COOKIE_NAME || null, CSRF_TOKEN_API_PATH: process.env.CSRF_TOKEN_API_PATH || null, LOGO_URL: process.env.LOGO_URL || null, + LOGO_DESTINATION: process.env.LOGO_DESTINATION || `${process.env.LMS_BASE_URL}/dashboard`, SITE_NAME: process.env.SITE_NAME || null, authenticatedUser: { diff --git a/src/studio-header/StudioHeader.jsx b/src/studio-header/StudioHeader.jsx index 886ad8411..cf2324723 100644 --- a/src/studio-header/StudioHeader.jsx +++ b/src/studio-header/StudioHeader.jsx @@ -13,6 +13,7 @@ ensureConfig([ 'LOGOUT_URL', 'LOGIN_URL', 'LOGO_URL', + 'LOGO_DESTINATION', ], 'Studio Header component'); const StudioHeader = ({ @@ -21,6 +22,7 @@ const StudioHeader = ({ const { authenticatedUser, config } = useContext(AppContext); const props = { logo: config.LOGO_URL, + logoDestination: config.LOGO_DESTINATION, logoAltText: `Studio ${config.SITE_NAME}`, number, org, diff --git a/src/studio-header/StudioHeader.test.jsx b/src/studio-header/StudioHeader.test.jsx index 263cac2f7..607c2cfc1 100644 --- a/src/studio-header/StudioHeader.test.jsx +++ b/src/studio-header/StudioHeader.test.jsx @@ -31,6 +31,7 @@ const RootWrapper = ({ config: { LOGOUT_URL: process.env.LOGOUT_URL, LOGO_URL: process.env.LOGO_URL, + LOGO_DESTINATION: process.env.LOGO_DESTINATION, SITE_NAME: process.env.SITE_NAME, STUDIO_BASE_URL: process.env.STUDIO_BASE_URL, LOGIN_URL: process.env.LOGIN_URL,