diff --git a/.env.development b/.env.development index e7560ffed..9c59d0b86 100644 --- a/.env.development +++ b/.env.development @@ -1,4 +1,6 @@ ACCESS_TOKEN_COOKIE_NAME=edx-jwt-cookie-header-payload +ACCOUNT_PROFILE_URL=http://localhost:1995 +ACCOUNT_SETTINGS_URL=http://localhost:1997 BASE_URL=localhost:8080 CREDENTIALS_BASE_URL=http://localhost:18150 CSRF_TOKEN_API_PATH=/csrf/api/v1/token diff --git a/README.rst b/README.rst index f5326771e..76550fd26 100644 --- a/README.rst +++ b/README.rst @@ -26,6 +26,8 @@ Environment Variables Defaults to "localhost" in development. * ``LOGO_URL`` - The URL of the site's logo. This logo is displayed in the header. * ``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. * ``AUTHN_MINIMAL_HEADER`` - A boolean flag which hides the main menu, user menu, and logged-out menu items when truthy. This is intended to be used in micro-frontends like frontend-app-authentication in which these menus are considered distractions from the user's task. diff --git a/src/Header.jsx b/src/Header.jsx index 9e1165d6c..f8ec602cc 100644 --- a/src/Header.jsx +++ b/src/Header.jsx @@ -55,12 +55,12 @@ function Header({ intl }) { }, { type: 'item', - href: `${config.LMS_BASE_URL}/u/${authenticatedUser.username}`, + href: `${config.ACCOUNT_PROFILE_URL}/u/${authenticatedUser.username}`, content: intl.formatMessage(messages['header.user.menu.profile']), }, { type: 'item', - href: `${config.LMS_BASE_URL}/account/settings`, + href: config.ACCOUNT_SETTINGS_URL, content: intl.formatMessage(messages['header.user.menu.account.settings']), }, { diff --git a/src/learning-header/AuthenticatedUserDropdown.jsx b/src/learning-header/AuthenticatedUserDropdown.jsx index b049cc073..c66f181c3 100644 --- a/src/learning-header/AuthenticatedUserDropdown.jsx +++ b/src/learning-header/AuthenticatedUserDropdown.jsx @@ -29,10 +29,10 @@ function AuthenticatedUserDropdown({ intl, username }) { {dashboardMenuItem} - + {intl.formatMessage(messages.profile)} - + {intl.formatMessage(messages.account)} { getConfig().ORDER_HISTORY_URL && ( diff --git a/src/setupTest.js b/src/setupTest.js index 37125d1fe..9916e8ebb 100644 --- a/src/setupTest.js +++ b/src/setupTest.js @@ -22,6 +22,8 @@ Enzyme.configure({ adapter: new Adapter() }); // These configuration values are usually set in webpack's EnvironmentPlugin however // Jest does not use webpack so we need to set these so for testing process.env.ACCESS_TOKEN_COOKIE_NAME = 'edx-jwt-cookie-header-payload'; +process.env.ACCOUNT_PROFILE_URL = 'http://localhost:1995'; +process.env.ACCOUNT_SETTINGS_URL = 'http://localhost:1997'; process.env.BASE_URL = 'localhost:1995'; process.env.CREDENTIALS_BASE_URL = 'http://localhost:18150'; process.env.CSRF_TOKEN_API_PATH = '/csrf/api/v1/token';