Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/container-comparison/CompareContainersWidget.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ describe('CompareContainersWidget', () => {
expect(await screen.findByRole('button', { name: 'subsection block 0' })).toBeInTheDocument();

// Back breadcrumb
const backbtns = await screen.findAllByRole('button', { name: 'Back' });
const backbtns = await screen.findAllByRole('button', { name: 'Back' });
expect(backbtns.length).toEqual(2);

// Go back
Expand Down
5 changes: 2 additions & 3 deletions src/container-comparison/CompareContainersWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Alert,
Breadcrumb, Button, Card, Icon, Stack,
} from '@openedx/paragon';
import { ArrowBack, Add, Delete } from '@openedx/paragon/icons';
import { Add, Delete } from '@openedx/paragon/icons';
import { FormattedMessage, useIntl } from '@edx/frontend-platform/i18n';

import { ContainerType, getBlockType } from '@src/generic/key-utils';
Expand Down Expand Up @@ -152,8 +152,7 @@ const CompareContainersWidgetInner = ({
ariaLabel={intl.formatMessage(messages.breadcrumbAriaLabel)}
links={[
{
// This raises failed prop-type error as label expects a string but it works without any issues
label: <Stack direction="horizontal" gap={1}><Icon size="xs" src={ArrowBack} />Back</Stack>,
label: `← ${intl.formatMessage(messages.breadcrumbBackLabel)}`,
onClick: onBackBtnClick,
variant: 'link',
className: 'px-0 text-gray-900',
Expand Down
9 changes: 7 additions & 2 deletions src/container-comparison/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ const messages = defineMessages({
},
breadcrumbAriaLabel: {
id: 'course-authoring.container-comparison.diff.breadcrumb.ariaLabel',
defaultMessage: 'Title breadcrumb',
description: 'Aria label text for breadcrumb in diff preview',
defaultMessage: 'Location',
description: 'Accessible label for the breadcrumbs which display the location of the unit, e.g. Section 1 > Unit 4',
},
breadcrumbBackLabel: {
id: 'course-authoring.container-comparison.diff.breadcrumb.backLabel',
defaultMessage: 'Back',
description: 'Link to go back to the parent section/subsection',
},
diffBeforeTitle: {
id: 'course-authoring.container-comparison.diff.before.title',
Expand Down
2 changes: 1 addition & 1 deletion src/course-unit/move-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const MoveModal: FC<IUseMoveModalParams> = ({
{ label: breadcrumb, 'data-parent-index': index }
))}
activeLabel={breadcrumbs[breadcrumbs.length - 1]}
clickHandler={({ target }) => handleBreadcrumbsClick(target.dataset.parentIndex)}
clickHandler={({ currentTarget }) => handleBreadcrumbsClick(currentTarget.dataset.parentIndex)}
/>
), [isExtraSmall, breadcrumbs, handleBreadcrumbsClick]);

Expand Down