Compare commits

...

5 Commits

Author SHA1 Message Date
nsprenkle
94dd9e1cdd test: update snapshots 2023-03-07 18:10:13 -05:00
nsprenkle
9f8249ef50 fix: update menu item link for variant header 2023-03-07 18:09:35 -05:00
nsprenkle
dab11db684 test: update snapshots 2023-03-07 17:29:52 -05:00
nsprenkle
315ca34121 fix: add environment variables for new URLs 2023-03-07 17:21:03 -05:00
nsprenkle
496a1c7de5 fix: update menu item link for account and profile 2023-03-07 17:14:18 -05:00
9 changed files with 28 additions and 12 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

@@ -5,6 +5,7 @@ import { useIntl } from '@edx/frontend-platform/i18n';
import { AppContext } from '@edx/frontend-platform/react';
import { AvatarButton, Dropdown } from '@edx/paragon';
import urls from 'data/services/lms/urls';
import { reduxHooks } from 'hooks';
import messages from '../messages';
@@ -39,10 +40,10 @@ export const AuthenticatedUserDropdown = () => {
</Dropdown.Item>
)}
<Dropdown.Divider />
<Dropdown.Item href={`${getConfig().LMS_BASE_URL}/u/${authenticatedUser.username}`}>
<Dropdown.Item href={urls.profileUrl(authenticatedUser.username)}>
{formatMessage(messages.profile)}
</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

@@ -43,12 +43,12 @@ 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>
<Dropdown.Item
href="http://localhost:18000/account/settings"
href="http://localhost:1997/"
>
Account
</Dropdown.Item>
@@ -94,12 +94,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,
});