fix: update menu item link for account and profile (#119)

This commit is contained in:
Nathan Sprenkle
2023-03-07 17:48:34 -05:00
committed by GitHub
parent 3c7be4c65c
commit 19d7aa3e33
7 changed files with 21 additions and 6 deletions

2
.env
View File

@@ -35,3 +35,5 @@ ZENDESK_KEY=''
HOTJAR_APP_ID=''
HOTJAR_VERSION='6'
HOTJAR_DEBUG=''
ACCOUNT_MICROFRONTEND_URL=''
PROFILE_MICROFRONTEND_URL=''

View File

@@ -42,3 +42,6 @@ ZENDESK_KEY=''
HOTJAR_APP_ID=''
HOTJAR_VERSION='6'
HOTJAR_DEBUG=''
// Microfrontends
ACCOUNT_MICROFRONTEND_URL='http://localhost:1997/'
PROFILE_MICROFRONTEND_URL='http://localhost:1995/u/'

View File

@@ -41,3 +41,6 @@ ZENDESK_KEY='test-zendesk-key'
HOTJAR_APP_ID='hot-jar-app-id'
HOTJAR_VERSION='6'
HOTJAR_DEBUG=''
// Microfrontends
ACCOUNT_MICROFRONTEND_URL='http://localhost:1997/'
PROFILE_MICROFRONTEND_URL='http://localhost:1995/u/'

View File

@@ -13,6 +13,9 @@ const configuration = {
SESSION_COOKIE_DOMAIN: process.env.SESSION_COOKIE_DOMAIN || '',
ZENDESK_KEY: process.env.ZENDESK_KEY,
SUPPORT_URL: process.env.SUPPORT_URL || null,
// Microfrontends
ACCOUNT_MICROFRONTEND_URL: process.env.ACCOUNT_MICROFRONTEND_URL,
PROFILE_MICROFRONTEND_URL: process.env.PROFILE_MICROFRONTEND_URL,
};
const features = {};

View File

@@ -45,7 +45,7 @@ export const AuthenticatedUserDropdown = ({ username }) => {
</Dropdown.Item>
)}
<Dropdown.Divider />
<Dropdown.Item href={`${getConfig().LMS_BASE_URL}/u/${username}`}>
<Dropdown.Item href={urls.profileUrl(username)}>
{formatMessage(messages.profile)}
</Dropdown.Item>
{isCollapsed && (
@@ -58,7 +58,7 @@ export const AuthenticatedUserDropdown = ({ username }) => {
</Dropdown.Item>
</>
)}
<Dropdown.Item href={`${getConfig().LMS_BASE_URL}/account/settings`}>
<Dropdown.Item href={urls.accountUrl}>
{formatMessage(messages.account)}
</Dropdown.Item>
{getConfig().ORDER_HISTORY_URL && (

View File

@@ -41,7 +41,7 @@ exports[`AuthenticatedUserDropdown snapshots with enterprise dashboard 1`] = `
</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item
href="http://localhost:18000/u/username"
href="http://localhost:1995/u/username"
>
Profile
</Dropdown.Item>
@@ -57,7 +57,7 @@ exports[`AuthenticatedUserDropdown snapshots with enterprise dashboard 1`] = `
Explore courses
</Dropdown.Item>
<Dropdown.Item
href="http://localhost:18000/account/settings"
href="http://localhost:1997/"
>
Account
</Dropdown.Item>
@@ -108,12 +108,12 @@ exports[`AuthenticatedUserDropdown snapshots without enterprise dashboard and ex
</Dropdown.Item>
<Dropdown.Divider />
<Dropdown.Item
href="http://localhost:18000/u/username"
href="http://localhost:1995/u/username"
>
Profile
</Dropdown.Item>
<Dropdown.Item
href="http://localhost:18000/account/settings"
href="http://localhost:1997/"
>
Account
</Dropdown.Item>

View File

@@ -3,6 +3,8 @@ import { configuration } from 'config';
const baseUrl = `${configuration.LMS_BASE_URL}`;
export const ecommerceUrl = `${configuration.ECOMMERCE_PUBLIC_URL_ROOT}`;
export const accountUrl = `${configuration.ACCOUNT_MICROFRONTEND_URL}`;
export const profileUrl = (username) => `${configuration.PROFILE_MICROFRONTEND_URL}${username}`;
export const api = `${baseUrl}/api`;
@@ -27,6 +29,7 @@ export const creditPurchaseUrl = (courseId) => `${ecommerceUrl}/credit/checkout/
export const creditRequestUrl = (providerId) => `${api}/credit/v1/providers/${providerId}/request`;
export default StrictDict({
accountUrl,
api,
baseAppUrl,
courseUnenroll,
@@ -36,6 +39,7 @@ export default StrictDict({
event,
init,
learningMfeUrl,
profileUrl,
programsUrl,
updateEmailSettings,
});