Compare commits
7 Commits
master
...
open-relea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73ed886715 | ||
|
|
c41ce5d87b | ||
|
|
a98439635b | ||
|
|
141d4900ae | ||
|
|
f9eef109c1 | ||
|
|
ad25abc222 | ||
|
|
2cf6e5a23e |
1
.env
1
.env
@@ -42,3 +42,4 @@ ENABLE_NOTICES=''
|
|||||||
CAREER_LINK_URL=''
|
CAREER_LINK_URL=''
|
||||||
OPTIMIZELY_FULL_STACK_SDK_KEY=''
|
OPTIMIZELY_FULL_STACK_SDK_KEY=''
|
||||||
EXPERIMENT_08_23_VAN_PAINTED_DOOR=true
|
EXPERIMENT_08_23_VAN_PAINTED_DOOR=true
|
||||||
|
ENABLE_EDX_PERSONAL_DASHBOARD=false
|
||||||
|
|||||||
@@ -48,3 +48,4 @@ ACCOUNT_PROFILE_URL='http://localhost:1995'
|
|||||||
ENABLE_NOTICES=''
|
ENABLE_NOTICES=''
|
||||||
CAREER_LINK_URL=''
|
CAREER_LINK_URL=''
|
||||||
OPTIMIZELY_FULL_STACK_SDK_KEY=''
|
OPTIMIZELY_FULL_STACK_SDK_KEY=''
|
||||||
|
ENABLE_EDX_PERSONAL_DASHBOARD=false
|
||||||
|
|||||||
@@ -48,3 +48,4 @@ ENABLE_NOTICES=''
|
|||||||
CAREER_LINK_URL=''
|
CAREER_LINK_URL=''
|
||||||
OPTIMIZELY_FULL_STACK_SDK_KEY='SDK Key'
|
OPTIMIZELY_FULL_STACK_SDK_KEY='SDK Key'
|
||||||
EXPERIMENT_08_23_VAN_PAINTED_DOOR=true
|
EXPERIMENT_08_23_VAN_PAINTED_DOOR=true
|
||||||
|
ENABLE_EDX_PERSONAL_DASHBOARD=true
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ const configuration = {
|
|||||||
ENABLE_NOTICES: process.env.ENABLE_NOTICES || null,
|
ENABLE_NOTICES: process.env.ENABLE_NOTICES || null,
|
||||||
CAREER_LINK_URL: process.env.CAREER_LINK_URL || null,
|
CAREER_LINK_URL: process.env.CAREER_LINK_URL || null,
|
||||||
LOGO_URL: process.env.LOGO_URL,
|
LOGO_URL: process.env.LOGO_URL,
|
||||||
|
ENABLE_EDX_PERSONAL_DASHBOARD: process.env.ENABLE_EDX_PERSONAL_DASHBOARD === 'true',
|
||||||
};
|
};
|
||||||
|
|
||||||
const features = {};
|
const features = {};
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export const CollapseMenuBody = ({ isOpen }) => {
|
|||||||
<Button as="a" href="/" variant="inverse-primary">
|
<Button as="a" href="/" variant="inverse-primary">
|
||||||
{formatMessage(messages.course)}
|
{formatMessage(messages.course)}
|
||||||
</Button>
|
</Button>
|
||||||
<Button as="a" href={urls.programsUrl} variant="inverse-primary">
|
<Button as="a" href={urls.programsUrl()} variant="inverse-primary">
|
||||||
{formatMessage(messages.program)}
|
{formatMessage(messages.program)}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -29,16 +29,21 @@ export const AuthenticatedUserDropdown = () => {
|
|||||||
</span>
|
</span>
|
||||||
</Dropdown.Toggle>
|
</Dropdown.Toggle>
|
||||||
<Dropdown.Menu className="dropdown-menu-right">
|
<Dropdown.Menu className="dropdown-menu-right">
|
||||||
<Dropdown.Header>{formatMessage(messages.dashboardSwitch)}</Dropdown.Header>
|
{ getConfig().ENABLE_EDX_PERSONAL_DASHBOARD && (
|
||||||
<Dropdown.Item as="a" href="/edx-dashboard" className="active">
|
<>
|
||||||
{formatMessage(messages.dashboardPersonal)}
|
<Dropdown.Header>{formatMessage(messages.dashboardSwitch)}</Dropdown.Header>
|
||||||
</Dropdown.Item>
|
<Dropdown.Item as="a" href="/edx-dashboard" className="active">
|
||||||
{!!dashboard && (
|
{formatMessage(messages.dashboardPersonal)}
|
||||||
<Dropdown.Item as="a" href={dashboard.url} key={dashboard.label}>
|
</Dropdown.Item>
|
||||||
{dashboard.label} {formatMessage(messages.dashboard)}
|
{!!dashboard && (
|
||||||
</Dropdown.Item>
|
<Dropdown.Item as="a" href={dashboard.url} key={dashboard.label}>
|
||||||
|
{dashboard.label} {formatMessage(messages.dashboard)}
|
||||||
|
</Dropdown.Item>
|
||||||
|
)}
|
||||||
|
<Dropdown.Divider />
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
<Dropdown.Divider />
|
|
||||||
{!dashboard && getConfig().CAREER_LINK_URL && (
|
{!dashboard && getConfig().CAREER_LINK_URL && (
|
||||||
<Dropdown.Item href={`${getConfig().CAREER_LINK_URL}`}>
|
<Dropdown.Item href={`${getConfig().CAREER_LINK_URL}`}>
|
||||||
{formatMessage(messages.career)}
|
{formatMessage(messages.career)}
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ const config = {
|
|||||||
SUPPORT_URL: 'http://localhost:18000/support',
|
SUPPORT_URL: 'http://localhost:18000/support',
|
||||||
CAREER_LINK_URL: 'http://localhost:18000/career',
|
CAREER_LINK_URL: 'http://localhost:18000/career',
|
||||||
LMS_BASE_URL: 'http:/localhost:18000',
|
LMS_BASE_URL: 'http:/localhost:18000',
|
||||||
|
ENABLE_EDX_PERSONAL_DASHBOARD: true,
|
||||||
};
|
};
|
||||||
getConfig.mockReturnValue(config);
|
getConfig.mockReturnValue(config);
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export const ExpandedHeader = () => {
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
as="a"
|
as="a"
|
||||||
href={urls.programsUrl}
|
href={urls.programsUrl()}
|
||||||
variant="inverse-primary"
|
variant="inverse-primary"
|
||||||
className="p-4"
|
className="p-4"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import ExpandedHeader from '.';
|
|||||||
import { useIsCollapsed } from '../hooks';
|
import { useIsCollapsed } from '../hooks';
|
||||||
|
|
||||||
jest.mock('data/services/lms/urls', () => ({
|
jest.mock('data/services/lms/urls', () => ({
|
||||||
programsUrl: 'programsUrl',
|
programsUrl: () => 'programsUrl',
|
||||||
baseAppUrl: url => (`http://localhost:18000${url}`),
|
baseAppUrl: url => (`http://localhost:18000${url}`),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@@ -34,16 +34,16 @@ export const deleteEntitlementEnrollment = ({ uuid, isRefundable }) => client()
|
|||||||
);
|
);
|
||||||
|
|
||||||
export const updateEmailSettings = ({ courseId, enable }) => post(
|
export const updateEmailSettings = ({ courseId, enable }) => post(
|
||||||
urls.updateEmailSettings,
|
urls.updateEmailSettings(),
|
||||||
{ [apiKeys.courseId]: courseId, ...(enable && enableEmailsAction) },
|
{ [apiKeys.courseId]: courseId, ...(enable && enableEmailsAction) },
|
||||||
);
|
);
|
||||||
|
|
||||||
export const unenrollFromCourse = ({ courseId }) => post(
|
export const unenrollFromCourse = ({ courseId }) => post(
|
||||||
urls.courseUnenroll,
|
urls.courseUnenroll(),
|
||||||
{ [apiKeys.courseId]: courseId, ...unenrollmentAction },
|
{ [apiKeys.courseId]: courseId, ...unenrollmentAction },
|
||||||
);
|
);
|
||||||
|
|
||||||
export const logEvent = ({ eventName, data, courseId }) => post(urls.event, {
|
export const logEvent = ({ eventName, data, courseId }) => post(urls.event(), {
|
||||||
courserun_key: courseId,
|
courserun_key: courseId,
|
||||||
event_type: eventName,
|
event_type: eventName,
|
||||||
page: window.location.href,
|
page: window.location.href,
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ describe('lms api methods', () => {
|
|||||||
expect(
|
expect(
|
||||||
api.updateEmailSettings({ courseId, enable: false }),
|
api.updateEmailSettings({ courseId, enable: false }),
|
||||||
).toEqual(
|
).toEqual(
|
||||||
utils.post(urls.updateEmailSettings, { [apiKeys.courseId]: courseId }),
|
utils.post(urls.updateEmailSettings(), { [apiKeys.courseId]: courseId }),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -87,7 +87,7 @@ describe('lms api methods', () => {
|
|||||||
api.updateEmailSettings({ courseId, enable: true }),
|
api.updateEmailSettings({ courseId, enable: true }),
|
||||||
).toEqual(
|
).toEqual(
|
||||||
utils.post(
|
utils.post(
|
||||||
urls.updateEmailSettings,
|
urls.updateEmailSettings(),
|
||||||
{ [apiKeys.courseId]: courseId, ...enableEmailsAction },
|
{ [apiKeys.courseId]: courseId, ...enableEmailsAction },
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -100,7 +100,7 @@ describe('lms api methods', () => {
|
|||||||
api.unenrollFromCourse({ courseId }),
|
api.unenrollFromCourse({ courseId }),
|
||||||
).toEqual(
|
).toEqual(
|
||||||
utils.post(
|
utils.post(
|
||||||
urls.courseUnenroll,
|
urls.courseUnenroll(),
|
||||||
{ [apiKeys.courseId]: courseId, ...unenrollmentAction },
|
{ [apiKeys.courseId]: courseId, ...unenrollmentAction },
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -116,7 +116,7 @@ describe('lms api methods', () => {
|
|||||||
expect(
|
expect(
|
||||||
api.logEvent({ courseId, eventName, data }),
|
api.logEvent({ courseId, eventName, data }),
|
||||||
).toEqual(
|
).toEqual(
|
||||||
utils.post(urls.event, {
|
utils.post(urls.event(), {
|
||||||
courserun_key: courseId,
|
courserun_key: courseId,
|
||||||
event_type: eventName,
|
event_type: eventName,
|
||||||
page: href,
|
page: href,
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ export const getApiUrl = () => (`${getConfig().LMS_BASE_URL}/api`);
|
|||||||
|
|
||||||
const getInitApiUrl = () => (`${getApiUrl()}/learner_home/init`);
|
const getInitApiUrl = () => (`${getApiUrl()}/learner_home/init`);
|
||||||
|
|
||||||
const event = `${getBaseUrl()}/event`;
|
const event = () => `${getBaseUrl()}/event`;
|
||||||
const courseUnenroll = `${getBaseUrl()}/change_enrollment`;
|
const courseUnenroll = () => `${getBaseUrl()}/change_enrollment`;
|
||||||
const updateEmailSettings = `${getApiUrl()}/change_email_settings`;
|
const updateEmailSettings = () => `${getApiUrl()}/change_email_settings`;
|
||||||
const entitlementEnrollment = (uuid) => `${getApiUrl()}/entitlements/v1/entitlements/${uuid}/enrollments`;
|
const entitlementEnrollment = (uuid) => `${getApiUrl()}/entitlements/v1/entitlements/${uuid}/enrollments`;
|
||||||
|
|
||||||
// if url is null or absolute, return it as is
|
// if url is null or absolute, return it as is
|
||||||
@@ -22,7 +22,7 @@ export const baseAppUrl = (url) => updateUrl(getBaseUrl(), url);
|
|||||||
export const learningMfeUrl = (url) => updateUrl(getConfig().LEARNING_BASE_URL, url);
|
export const learningMfeUrl = (url) => updateUrl(getConfig().LEARNING_BASE_URL, url);
|
||||||
|
|
||||||
// static view url
|
// static view url
|
||||||
const programsUrl = baseAppUrl('/dashboard/programs');
|
const programsUrl = () => baseAppUrl('/dashboard/programs');
|
||||||
|
|
||||||
export const creditPurchaseUrl = (courseId) => `${getEcommerceUrl()}/credit/checkout/${courseId}/`;
|
export const creditPurchaseUrl = (courseId) => `${getEcommerceUrl()}/credit/checkout/${courseId}/`;
|
||||||
export const creditRequestUrl = (providerId) => `${getApiUrl()}/credit/v1/providers/${providerId}/request/`;
|
export const creditRequestUrl = (providerId) => `${getApiUrl()}/credit/v1/providers/${providerId}/request/`;
|
||||||
|
|||||||
Reference in New Issue
Block a user