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
4 changes: 2 additions & 2 deletions src/course-unit/CourseUnit.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2542,7 +2542,7 @@ describe('<CourseUnit />', () => {
});
await executeThunk(fetchCourseSectionVerticalData(courseId), store.dispatch);

expect(screen.getByText(/this unit can only be edited from the \./i)).toBeInTheDocument();
expect(screen.getByText(messages.alertLibraryUnitReadOnlyLinkText.defaultMessage)).toBeInTheDocument();

// Edit button should be enabled even for library imported units
const unitHeaderTitle = screen.getByTestId('unit-header-title');
Expand Down Expand Up @@ -3446,7 +3446,7 @@ describe('<CourseUnit />', () => {
});
await executeThunk(fetchCourseSectionVerticalData(courseId), store.dispatch);

expect(screen.getByText(/this unit can only be edited from the \./i)).toBeInTheDocument();
expect(screen.getByText(messages.alertLibraryUnitReadOnlyLinkText.defaultMessage)).toBeInTheDocument();

// Does not render the "Add Components" section
expect(screen.queryByText(addComponentMessages.title.defaultMessage)).not.toBeInTheDocument();
Expand Down
7 changes: 7 additions & 0 deletions src/course-unit/CourseUnit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import { UnitSidebarProvider } from './unit-sidebar/UnitSidebarContext';
import { UnitSidebarPagesProvider } from './unit-sidebar/UnitSidebarPagesContext';
import { UNIT_VISIBILITY_STATES } from './constants';
import { isUnitPageNewDesignEnabled } from './utils';
import { useHelpUrls } from '@src/help-urls/hooks';

const StatusBar = ({ courseUnit }: { courseUnit: any; }) => {
const { selectedPartitionIndex, selectedGroupsLabel } = courseUnit.userPartitionInfo ?? {};
Expand Down Expand Up @@ -164,6 +165,7 @@ const CourseUnit = () => {
const intl = useIntl();
const { blockId } = useParams();
const { courseId } = useCourseAuthoringContext();
const urls = useHelpUrls(['syncLibraryUpdates']);

if (courseId === undefined) {
// istanbul ignore next - This shouldn't be possible; it's just here to satisfy the type checker.
Expand Down Expand Up @@ -283,6 +285,11 @@ const CourseUnit = () => {
<FormattedMessage {...messages.alertLibraryUnitReadOnlyLinkText} />
</Alert.Link>
),
learnMore: (
<Alert.Link href={urls['syncLibraryUpdates']}>
<FormattedMessage {...messages.alertLibraryUnitReadOnlyLearnMoreText} />
</Alert.Link>
),
},
)}
variant="info"
Expand Down
9 changes: 7 additions & 2 deletions src/course-unit/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,19 @@ const messages = defineMessages({
},
alertLibraryUnitReadOnlyText: {
id: 'course-authoring.course-unit.alert.read-only.text',
defaultMessage: 'This unit can only be edited from the {link}.',
defaultMessage: 'Only certain edits are possible for {link}. {learnMore}',
description: 'Text of the alert when the unit is read only because is a library unit',
},
alertLibraryUnitReadOnlyLinkText: {
id: 'course-authoring.course-unit.alert.read-only.link.text',
defaultMessage: 'library',
defaultMessage: 'library content',
description: 'Text of the link in the alert when the unit is read only because is a library unit',
},
alertLibraryUnitReadOnlyLearnMoreText: {
id: 'course-authoring.course-unit.alert.read-only.learn-more.text',
defaultMessage: 'Learn More',
description: 'Text of the learn more link in the alert when the unit is read only because is a library unit',
},
statusBarDraftChangesBadge: {
id: 'course-authoring.course-unit.status-bar.publish-status.draft-changes',
defaultMessage: 'Unpublished changes',
Expand Down
1 change: 1 addition & 0 deletions src/help-urls/data/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export interface HelpUrls {
register: string;
schedule: string;
socialSharing: string;
syncLibraryUpdates: string;
teamCourse: string;
teamLibrary: string;
textbooks: string;
Expand Down
2 changes: 1 addition & 1 deletion src/library-authoring/import-course/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ const messages = defineMessages({
},
importCourseAnalysisCompleteAllContentBody: {
id: 'library-authoring.import-course.review-details.analysis-complete.100.body',
defaultMessage: 'All course content will imported into a collection in your library called {courseName}. See details below.',
defaultMessage: 'All course content will be imported into a collection in your library called {courseName}. See details below.',
description: 'Body of the info card when course import analysis is complete and all data can be imported.',
},
importCourseAnalysisCompleteSomeContentTitle: {
Expand Down