11import { useState , useEffect , useCallback } from 'react' ;
22import { useIntl } from '@edx/frontend-platform/i18n' ;
3+ import { getConfig } from '@edx/frontend-platform' ;
34import {
45 Container ,
56 Layout ,
67 Row ,
78 TransitionReplace ,
89 Toast ,
910 StandardModal ,
11+ Button ,
12+ ActionRow ,
1013} from '@openedx/paragon' ;
1114import { Helmet } from 'react-helmet' ;
12- import { CheckCircle as CheckCircleIcon } from '@openedx/paragon/icons' ;
15+ import { CheckCircle as CheckCircleIcon , CloseFullscreen , OpenInFull } from '@openedx/paragon/icons' ;
1316import { useSelector } from 'react-redux' ;
1417import {
1518 arrayMove ,
@@ -44,7 +47,6 @@ import {
4447 getTimedExamsFlag ,
4548} from './data/selectors' ;
4649import { COURSE_BLOCK_NAMES } from './constants' ;
47- import StatusBar from './status-bar/StatusBar' ;
4850import EnableHighlightsModal from './enable-highlights-modal/EnableHighlightsModal' ;
4951import SectionCard from './section-card/SectionCard' ;
5052import SubsectionCard from './subsection-card/SubsectionCard' ;
@@ -61,8 +63,11 @@ import {
6163} from './drag-helper/utils' ;
6264import { useCourseOutline } from './hooks' ;
6365import messages from './messages' ;
66+ import headerMessages from './header-navigations/messages' ;
6467import { getTagsExportFile } from './data/api' ;
6568import OutlineAddChildButtons from './OutlineAddChildButtons' ;
69+ import { StatusBar } from './status-bar/StatusBar' ;
70+ import { LegacyStatusBar } from './status-bar/LegacyStatusBar' ;
6671
6772const CourseOutline = ( ) => {
6873 const intl = useIntl ( ) ;
@@ -141,6 +146,9 @@ const CourseOutline = () => {
141146 resetScrollState,
142147 } = useCourseOutline ( { courseId } ) ;
143148
149+ // Show the new actions bar if it is enabled in the configuration.
150+ // This is a temporary flag until the new design feature is fully implemented.
151+ const showNewActionsBar = getConfig ( ) . ENABLE_COURSE_OUTLINE_NEW_DESIGN ?. toString ( ) . toLowerCase ( ) === 'true' ;
144152 // Use `setToastMessage` to show the toast.
145153 const [ toastMessage , setToastMessage ] = useState < string | null > ( null ) ;
146154
@@ -314,8 +322,9 @@ const CourseOutline = () => {
314322 ) : null }
315323 </ TransitionReplace >
316324 < SubHeader
317- title = { intl . formatMessage ( messages . headingTitle ) }
325+ title = { courseName }
318326 subtitle = { intl . formatMessage ( messages . headingSubtitle ) }
327+ hideBorder
319328 headerActions = { (
320329 < CourseOutlineHeaderActionsSlot
321330 isReIndexShow = { isReIndexShow }
@@ -329,6 +338,23 @@ const CourseOutline = () => {
329338 />
330339 ) }
331340 />
341+ { showNewActionsBar
342+ ? (
343+ < StatusBar
344+ courseId = { courseId }
345+ isLoading = { isLoading }
346+ statusBarData = { statusBarData }
347+ />
348+ ) : (
349+ < LegacyStatusBar
350+ courseId = { courseId }
351+ isLoading = { isLoading }
352+ statusBarData = { statusBarData }
353+ openEnableHighlightsModal = { openEnableHighlightsModal }
354+ handleVideoSharingOptionChange = { handleVideoSharingOptionChange }
355+ />
356+ ) }
357+ < hr className = "mt-4 mb-0 w-100 text-light-400" />
332358 < Layout
333359 lg = { [ { span : 9 } , { span : 3 } ] }
334360 md = { [ { span : 9 } , { span : 3 } ] }
@@ -339,14 +365,24 @@ const CourseOutline = () => {
339365 < Layout . Element >
340366 < article >
341367 < div >
368+ { showNewActionsBar && (
369+ < ActionRow className = "mt-3" >
370+ { Boolean ( sectionsList . length ) && (
371+ < Button
372+ variant = "outline-primary"
373+ id = "expand-collapse-all-button"
374+ data-testid = "expand-collapse-all-button"
375+ iconBefore = { isSectionsExpanded ? CloseFullscreen : OpenInFull }
376+ onClick = { headerNavigationsActions . handleExpandAll }
377+ >
378+ { isSectionsExpanded
379+ ? intl . formatMessage ( headerMessages . collapseAllButton )
380+ : intl . formatMessage ( headerMessages . expandAllButton ) }
381+ </ Button >
382+ ) }
383+ </ ActionRow >
384+ ) }
342385 < section className = "course-outline-section" >
343- < StatusBar
344- courseId = { courseId }
345- isLoading = { isLoading }
346- statusBarData = { statusBarData }
347- openEnableHighlightsModal = { openEnableHighlightsModal }
348- handleVideoSharingOptionChange = { handleVideoSharingOptionChange }
349- />
350386 { ! errors ?. outlineIndexApi && (
351387 < div className = "pt-4" >
352388 { sections . length ? (
0 commit comments