@@ -11,7 +11,8 @@ import {
1111 getConfig ,
1212 subscribe ,
1313} from '@edx/frontend-platform' ;
14- import { useEnterpriseConfig } from '@edx/frontend-enterprise-utils' ;
14+ import { useEnterpriseConfig , isEnterpriseUser } from '@edx/frontend-enterprise-utils' ;
15+ import './index.scss' ;
1516
1617import PropTypes from 'prop-types' ;
1718import DesktopHeader from './DesktopHeader' ;
@@ -35,6 +36,7 @@ subscribe(APP_CONFIG_INITIALIZED, () => {
3536 mergeConfig ( {
3637 MINIMAL_HEADER : ! ! process . env . MINIMAL_HEADER ,
3738 ENTERPRISE_LEARNER_PORTAL_HOSTNAME : process . env . ENTERPRISE_LEARNER_PORTAL_HOSTNAME ,
39+ ENABLE_EDX_PERSONAL_DASHBOARD : process . env . ENABLE_EDX_PERSONAL_DASHBOARD ,
3840 AUTHN_MINIMAL_HEADER : ! ! process . env . AUTHN_MINIMAL_HEADER ,
3941 ACCOUNT_SETTINGS_URL : process . env . ACCOUNT_SETTINGS_URL ,
4042 NOTIFICATION_FEEDBACK_URL : process . env . NOTIFICATION_FEEDBACK_URL ,
@@ -64,12 +66,14 @@ const Header = ({
6466 enterpriseLearnerPortalLink,
6567 enterpriseCustomerBrandingConfig,
6668 } = useEnterpriseConfig ( authenticatedUser , config . ENTERPRISE_LEARNER_PORTAL_HOSTNAME , config . LMS_BASE_URL ) ;
69+ const hasEnterpriseAccount = isEnterpriseUser ( authenticatedUser ) ;
6770
6871 const defaultMainMenu = [
6972 {
7073 type : 'item' ,
7174 href : `${ config . LMS_BASE_URL } /dashboard` ,
7275 content : intl . formatMessage ( messages [ 'header.links.courses' ] ) ,
76+ isActive : document . title . includes ( 'Learner Home' ) ,
7377 } ,
7478 {
7579 type : 'item' ,
@@ -89,11 +93,11 @@ const Header = ({
8993 } ,
9094 ] ;
9195
92- const dashboardMenuItem = {
93- type : 'item' ,
94- href : `${ config . LMS_BASE_URL } /dashboard` ,
95- content : intl . formatMessage ( messages [ 'header.user.menu.dashboard' ] ) ,
96- } ;
96+ // const dashboardMenuItem = {
97+ // type: 'item',
98+ // href: `${config.LMS_BASE_URL}/dashboard`,
99+ // content: intl.formatMessage(messages['header.user.menu.dashboard']),
100+ // };
97101
98102 const logoutMenuItem = {
99103 type : 'item' ,
@@ -102,19 +106,27 @@ const Header = ({
102106 } ;
103107
104108 // If there is an Enterprise LP link, use that instead of the B2C Dashboard
105- let baseUserMenuDashboardLinks = [ ] ;
106- if ( enterpriseLearnerPortalLink ) {
107- baseUserMenuDashboardLinks = [ enterpriseLearnerPortalLink ] ;
108- } else {
109- baseUserMenuDashboardLinks = [ dashboardMenuItem ] ;
110- }
109+ // let baseUserMenuDashboardLinks = [];
110+ // if (enterpriseLearnerPortalLink) {
111+ // baseUserMenuDashboardLinks = [enterpriseLearnerPortalLink];
112+ // } else {
113+ // baseUserMenuDashboardLinks = [dashboardMenuItem];
114+ // }
115+
116+ const defaultSecondaryMenu = [
117+ ...( getConfig ( ) . SUPPORT_URL ? [ {
118+ type : 'item' ,
119+ href : `${ getConfig ( ) . SUPPORT_URL } ` ,
120+ content : intl . formatMessage ( messages [ 'header.links.help' ] ) ,
121+ } ] : [ ] ) ,
122+ ] ;
111123
112124 const careerItemContent = < > { intl . formatMessage ( messages [ 'header.user.menu.career' ] ) } < Badge className = "px-2 mx-2" variant = "warning" > { intl . formatMessage ( messages [ 'header.user.menu.newAlert' ] ) } </ Badge > </ > ;
113125 const defaultUserMenu = authenticatedUser === null ? [ ] : [ {
114126 heading : '' ,
115127 items : [
116- ...baseUserMenuDashboardLinks ,
117- {
128+ // ...baseUserMenuDashboardLinks,
129+ ... ( ! enterpriseLearnerPortalLink ? [ {
118130 type : 'item' ,
119131 href : 'https://careers.edx.org/' ,
120132 content : careerItemContent ,
@@ -124,16 +136,18 @@ const Header = ({
124136 { category : 'header' , label : 'header' } ,
125137 ) ;
126138 } ,
127- } ,
139+ } ] : [ ] ) ,
128140 {
129141 type : 'item' ,
130142 href : `${ config . ACCOUNT_PROFILE_URL } /u/${ authenticatedUser . username } ` ,
131143 content : intl . formatMessage ( messages [ 'header.user.menu.profile' ] ) ,
144+ isActive : document . title . includes ( 'Profile' ) ,
132145 } ,
133146 {
134147 type : 'item' ,
135148 href : config . ACCOUNT_SETTINGS_URL ,
136149 content : intl . formatMessage ( messages [ 'header.user.menu.account.settings' ] ) ,
150+ isActive : document . title . includes ( 'Account' ) ,
137151 } ,
138152 // Users should only see Order History if they do not have an available
139153 // learner portal and have a ORDER_HISTORY_URL define in the environment,
@@ -150,14 +164,14 @@ const Header = ({
150164 } ] ;
151165
152166 const mainMenu = mainMenuItems || defaultMainMenu ;
153- const secondaryMenu = secondaryMenuItems || [ ] ;
167+ const secondaryMenu = secondaryMenuItems || defaultSecondaryMenu ;
154168 let userMenu = authenticatedUser === null ? [ ] : userMenuItems || defaultUserMenu ;
155169
156170 if ( getConfig ( ) . MINIMAL_HEADER && authenticatedUser !== null ) {
157171 userMenu = [ {
158172 heading : '' ,
159173 items : [
160- dashboardMenuItem ,
174+ // dashboardMenuItem,
161175 logoutMenuItem ,
162176 ] ,
163177 } ] ;
@@ -190,6 +204,7 @@ const Header = ({
190204 userMenu : getConfig ( ) . AUTHN_MINIMAL_HEADER ? [ ] : userMenu ,
191205 loggedOutItems : getConfig ( ) . AUTHN_MINIMAL_HEADER ? [ ] : loggedOutItems ,
192206 studioBaseUrl : config . STUDIO_BASE_URL ,
207+ hasEnterpriseAccount,
193208 } ;
194209
195210 if ( enterpriseCustomerBrandingConfig ) {
0 commit comments