File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ describe('header utils', () => {
108108 } ) ;
109109 const actualItems =
110110 renderHook ( ( ) => useSettingMenuItems ( 'course-123' ) , { wrapper : createWrapper ( ) } ) . result . current ;
111- expect ( actualItems ) . toHaveLength ( 7 ) ;
111+ expect ( actualItems ) . toHaveLength ( 6 ) ;
112112 } ) ;
113113 it ( 'when certificate page disabled should not include certificates option' , ( ) => {
114114 setConfig ( {
@@ -117,7 +117,7 @@ describe('header utils', () => {
117117 } ) ;
118118 const actualItems =
119119 renderHook ( ( ) => useSettingMenuItems ( 'course-123' ) , { wrapper : createWrapper ( ) } ) . result . current ;
120- expect ( actualItems ) . toHaveLength ( 6 ) ;
120+ expect ( actualItems ) . toHaveLength ( 5 ) ;
121121 } ) ;
122122 it ( 'when user has access to advanced settings should include advanced settings option' , ( ) => {
123123 const actualItemsTitle = renderHook ( ( ) => useSettingMenuItems ( 'course-123' ) , { wrapper : createWrapper ( ) } ) . result
Original file line number Diff line number Diff line change @@ -92,14 +92,15 @@ export const useSettingMenuItems = (courseId: string) => {
9292 href : `/course/${ courseId } /settings/grading` ,
9393 title : intl . formatMessage ( messages [ 'header.links.grading' ] ) ,
9494 } ,
95- {
96- href : `${ getConfig ( ) . ADMIN_CONSOLE_URL } /authz?scope=${ courseId } ` ,
97- title : intl . formatMessage ( messages [ 'header.links.roles.permissions' ] ) ,
98- } ,
99- {
100- href : `/course/${ courseId } /course_team` ,
101- title : intl . formatMessage ( messages [ 'header.links.courseTeam' ] ) ,
102- } ,
95+ ...( isAuthzEnabled
96+ ? [ {
97+ href : `${ getConfig ( ) . ADMIN_CONSOLE_URL } /authz?scope=${ encodeURIComponent ( courseId ) } ` ,
98+ title : intl . formatMessage ( messages [ 'header.links.roles.permissions' ] ) ,
99+ } ]
100+ : [ {
101+ href : `/course/${ courseId } /course_team` ,
102+ title : intl . formatMessage ( messages [ 'header.links.courseTeam' ] ) ,
103+ } ] ) ,
103104 {
104105 href : `/course/${ courseId } /group_configurations` ,
105106 title : intl . formatMessage ( messages [ 'header.links.groupConfigurations' ] ) ,
You can’t perform that action at this time.
0 commit comments