File tree Expand file tree Collapse file tree 6 files changed +12
-2
lines changed Expand file tree Collapse file tree 6 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -41,3 +41,4 @@ ENABLE_NOTICES=''
41
41
CAREER_LINK_URL = ' '
42
42
ENABLE_EDX_PERSONAL_DASHBOARD = false
43
43
ENABLE_PROGRAMS = false
44
+ NON_BROWSABLE_COURSES = false
Original file line number Diff line number Diff line change @@ -47,3 +47,4 @@ ENABLE_NOTICES=''
47
47
CAREER_LINK_URL = ' '
48
48
ENABLE_EDX_PERSONAL_DASHBOARD = false
49
49
ENABLE_PROGRAMS = false
50
+ NON_BROWSABLE_COURSES = false
Original file line number Diff line number Diff line change @@ -46,3 +46,4 @@ ENABLE_NOTICES=''
46
46
CAREER_LINK_URL = ' '
47
47
ENABLE_EDX_PERSONAL_DASHBOARD = true
48
48
ENABLE_PROGRAMS = false
49
+ NON_BROWSABLE_COURSES = false
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ const configuration = {
19
19
ENABLE_EDX_PERSONAL_DASHBOARD : process . env . ENABLE_EDX_PERSONAL_DASHBOARD === 'true' ,
20
20
SEARCH_CATALOG_URL : process . env . SEARCH_CATALOG_URL || null ,
21
21
ENABLE_PROGRAMS : process . env . ENABLE_PROGRAMS === 'true' ,
22
+ NON_BROWSABLE_COURSES : process . env . NON_BROWSABLE_COURSES === 'true' ,
22
23
} ;
23
24
24
25
const features = { } ;
Original file line number Diff line number Diff line change @@ -22,14 +22,15 @@ const getLearnerHeaderMenu = (
22
22
href : `${ urls . programsUrl ( ) } ` ,
23
23
content : formatMessage ( messages . program ) ,
24
24
} ] : [ ] ) ,
25
- {
25
+ ... ( ! getConfig ( ) . NON_BROWSABLE_COURSES ? [ {
26
26
type : 'item' ,
27
27
href : `${ urls . baseAppUrl ( courseSearchUrl ) } ` ,
28
28
content : formatMessage ( messages . discoverNew ) ,
29
29
onClick : ( e ) => {
30
30
exploreCoursesClick ( e ) ;
31
31
} ,
32
- } ,
32
+ } ]
33
+ : [ ] ) ,
33
34
] ,
34
35
secondaryMenu : [
35
36
...( getConfig ( ) . SUPPORT_URL ? [ {
Original file line number Diff line number Diff line change @@ -44,4 +44,9 @@ describe('LearnerDashboardHeader', () => {
44
44
const wrapper = shallow ( < LearnerDashboardHeader /> ) ;
45
45
expect ( wrapper . instance . findByType ( Header ) [ 0 ] . props . mainMenuItems . length ) . toBe ( 3 ) ;
46
46
} ) ;
47
+ test ( 'should not display Discover New tab if it is disabled by configuration' , ( ) => {
48
+ mergeConfig ( { NON_BROWSABLE_COURSES : true } ) ;
49
+ const wrapper = shallow ( < LearnerDashboardHeader /> ) ;
50
+ expect ( wrapper . instance . findByType ( Header ) [ 0 ] . props . mainMenuItems . length ) . toBe ( 2 ) ;
51
+ } ) ;
47
52
} ) ;
You can’t perform that action at this time.
0 commit comments