File tree Expand file tree Collapse file tree
generic/library-reference-card Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ export const OutlineSidebarProvider = ({ children }: { children?: React.ReactNod
133133 const setCurrentPageKey = useCallback ( ( pageKey : OutlineSidebarPageKeys ) => {
134134 setCurrentPageKeyState ( pageKey ) ;
135135 // Reset tab
136- setCurrentTabKey ( undefined )
136+ setCurrentTabKey ( undefined ) ;
137137 stopCurrentFlow ( ) ;
138138 open ( ) ;
139139 } , [ open , stopCurrentFlow ] ) ;
Original file line number Diff line number Diff line change @@ -50,7 +50,6 @@ export const SectionSidebar = () => {
5050 } , [ currentTabKey , setCurrentTabKey ] ) ;
5151 const { sectionId = '' , index } = selectedContainerState ?? { } ;
5252 const { data : sectionData , isLoading } = useCourseItemData ( sectionId ) ;
53-
5453
5554 const handlePublish = ( ) => {
5655 if ( sectionData ?. hasChanges ) {
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export const SubsectionSidebar = () => {
3535 const { subsectionId = '' , index } = selectedContainerState ?? { } ;
3636
3737 const { data : subsectionData , isLoading } = useCourseItemData ( subsectionId ) ;
38-
38+
3939 const availableTabs = {
4040 info : 'info' ,
4141 settings : 'settings' ,
Original file line number Diff line number Diff line change @@ -94,7 +94,6 @@ export const UnitSidebar = () => {
9494 }
9595 } , [ currentTabKey , setCurrentTabKey ] ) ;
9696
97-
9897 const { data : section } = useCourseItemData < XBlock > ( selectedContainerState ?. sectionId ) ;
9998 const { data : subsection } = useCourseItemData < XBlock > ( selectedContainerState ?. subsectionId ) ;
10099 const { getUnitUrl, courseId, openUnlinkModal } = useCourseAuthoringContext ( ) ;
Original file line number Diff line number Diff line change @@ -183,7 +183,8 @@ const SectionCard = ({
183183 }
184184 const subsections = section . childInfo ?. children ?? [ ] ;
185185 const isScrollTargetInSection = subsections . some (
186- ( sub ) => sub . id === scrollState . id
186+ ( sub ) =>
187+ sub . id === scrollState . id
187188 || sub . childInfo ?. children ?. some ( ( unit ) => unit . id === scrollState . id ) ,
188189 ) ;
189190 if ( isScrollTargetInSection ) {
Original file line number Diff line number Diff line change @@ -264,4 +264,4 @@ describe('<UnitInfoSidebar /> - menu behavior', () => {
264264
265265 expect ( screen . getByText ( 'Delete' ) ) . toBeInTheDocument ( ) ;
266266 } ) ;
267- } ) ;
267+ } ) ;
Original file line number Diff line number Diff line change @@ -61,14 +61,11 @@ const UnitInfoDetails = () => {
6161
6262 return (
6363 < SidebarContent >
64- { isVertical && (
65- < PublishControls blockId = { blockId } hideCopyButton />
66- ) }
64+ { isVertical && < PublishControls blockId = { blockId } hideCopyButton /> }
6765 < SidebarSection
6866 title = { isVertical
6967 ? intl . formatMessage ( messages . sidebarSectionSummary )
70- : intl . formatMessage ( messages . sidebarSectionSummaryDefault )
71- }
68+ : intl . formatMessage ( messages . sidebarSectionSummaryDefault ) }
7269 icon = { getItemIcon ( 'unit' ) }
7370 >
7471 { componentData && < ComponentCountSnippet componentData = { componentData } /> }
Original file line number Diff line number Diff line change @@ -227,9 +227,11 @@ describe('LibraryReferenceCard', () => {
227227 /> ,
228228 ) ;
229229 // Broken link text should NOT appear
230- expect ( await screen . findByText (
231- `${ itemData . displayName } was reused as part of a section.` ,
232- ) ) . toBeInTheDocument ( ) ;
230+ expect (
231+ await screen . findByText (
232+ `${ itemData . displayName } was reused as part of a section.` ,
233+ ) ,
234+ ) . toBeInTheDocument ( ) ;
233235 expect ( screen . queryByText ( / b r o k e n l i n k / i) ) . not . toBeInTheDocument ( ) ;
234236 expect ( screen . queryByRole ( 'button' , { name : 'Unlink section' } ) ) . not . toBeInTheDocument ( ) ;
235237 } ) ;
Original file line number Diff line number Diff line change @@ -87,15 +87,17 @@ export const ComponentPicker = ({
8787
8888 const restrictToLibrary = ! ! libraryId ;
8989
90- const componentPickerProviderProps = componentPickerMode === 'single' ? {
91- componentPickerMode,
92- onComponentSelected,
93- restrictToLibrary,
94- } : {
95- componentPickerMode,
96- onChangeComponentSelection,
97- restrictToLibrary,
98- } ;
90+ const componentPickerProviderProps = componentPickerMode === 'single' ?
91+ {
92+ componentPickerMode,
93+ onComponentSelected,
94+ restrictToLibrary,
95+ } :
96+ {
97+ componentPickerMode,
98+ onChangeComponentSelection,
99+ restrictToLibrary,
100+ } ;
99101
100102 return (
101103 < PublishedFilterContextProvider showOnlyPublished = { calcShowOnlyPublished } >
Original file line number Diff line number Diff line change @@ -96,4 +96,4 @@ describe('<SidebarFilters />', () => {
9696 await user . click ( screen . getByRole ( 'button' , { name : 'Clear filters' } ) ) ;
9797 expect ( mockSetSelectedCollections ) . toHaveBeenCalledWith ( [ ] ) ;
9898 } ) ;
99- } ) ;
99+ } ) ;
You can’t perform that action at this time.
0 commit comments