Skip to content

Commit

Permalink
[Quince backport] refactor: hide switch dashboard option behind flag (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
arbrandes authored Dec 8, 2023
2 parents f9eef10 + 141d490 commit a984396
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 9 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ ENABLE_NOTICES=''
CAREER_LINK_URL=''
OPTIMIZELY_FULL_STACK_SDK_KEY=''
EXPERIMENT_08_23_VAN_PAINTED_DOOR=true
ENABLE_EDX_PERSONAL_DASHBOARD=false
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ ACCOUNT_PROFILE_URL='http://localhost:1995'
ENABLE_NOTICES=''
CAREER_LINK_URL=''
OPTIMIZELY_FULL_STACK_SDK_KEY=''
ENABLE_EDX_PERSONAL_DASHBOARD=false
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ ENABLE_NOTICES=''
CAREER_LINK_URL=''
OPTIMIZELY_FULL_STACK_SDK_KEY='SDK Key'
EXPERIMENT_08_23_VAN_PAINTED_DOOR=true
ENABLE_EDX_PERSONAL_DASHBOARD=true
1 change: 1 addition & 0 deletions src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const configuration = {
ENABLE_NOTICES: process.env.ENABLE_NOTICES || null,
CAREER_LINK_URL: process.env.CAREER_LINK_URL || null,
LOGO_URL: process.env.LOGO_URL,
ENABLE_EDX_PERSONAL_DASHBOARD: process.env.ENABLE_EDX_PERSONAL_DASHBOARD === 'true',
};

const features = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,21 @@ export const AuthenticatedUserDropdown = () => {
</span>
</Dropdown.Toggle>
<Dropdown.Menu className="dropdown-menu-right">
<Dropdown.Header>{formatMessage(messages.dashboardSwitch)}</Dropdown.Header>
<Dropdown.Item as="a" href="/edx-dashboard" className="active">
{formatMessage(messages.dashboardPersonal)}
</Dropdown.Item>
{!!dashboard && (
<Dropdown.Item as="a" href={dashboard.url} key={dashboard.label}>
{dashboard.label} {formatMessage(messages.dashboard)}
</Dropdown.Item>
{ getConfig().ENABLE_EDX_PERSONAL_DASHBOARD && (
<>
<Dropdown.Header>{formatMessage(messages.dashboardSwitch)}</Dropdown.Header>
<Dropdown.Item as="a" href="/edx-dashboard" className="active">
{formatMessage(messages.dashboardPersonal)}
</Dropdown.Item>
{!!dashboard && (
<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 && (
<Dropdown.Item href={`${getConfig().CAREER_LINK_URL}`}>
{formatMessage(messages.career)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const config = {
SUPPORT_URL: 'http://localhost:18000/support',
CAREER_LINK_URL: 'http://localhost:18000/career',
LMS_BASE_URL: 'http:/localhost:18000',
ENABLE_EDX_PERSONAL_DASHBOARD: true,
};
getConfig.mockReturnValue(config);

Expand Down

0 comments on commit a984396

Please sign in to comment.