Skip to content

fix: rename library publish button #1993

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
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: 3 additions & 1 deletion src/library-authoring/generic/status-widget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ type StatusWidgedProps = {
publishedBy: string | null;
numBlocks?: number;
onCommit?: () => void;
onCommitLabel?: string;
onRevert?: () => void;
};

Expand Down Expand Up @@ -114,6 +115,7 @@ const StatusWidget = ({
publishedBy,
numBlocks,
onCommit,
onCommitLabel,
onRevert,
}: StatusWidgedProps) => {
const intl = useIntl();
Expand Down Expand Up @@ -188,7 +190,7 @@ const StatusWidget = ({
</span>
{onCommit && (
<Button disabled={isPublished} onClick={onCommit}>
{intl.formatMessage(messages.publishButtonLabel)}
{onCommitLabel || intl.formatMessage(messages.publishButtonLabel)}
</Button>
)}
{onRevert && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const LibraryPublishStatus = () => {
<StatusWidget
{...libraryData}
onCommit={!readOnly ? commit : undefined}
onCommitLabel={intl.formatMessage(messages.publishLibraryButtonLabel)}
onRevert={!readOnly ? openConfirmModal : undefined}
/>
<DeleteModal
Expand Down
5 changes: 5 additions & 0 deletions src/library-authoring/library-info/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ const messages = defineMessages({
defaultMessage: 'Discard',
description: 'Button text for confirmation modal shown before discard library changes',
},
publishLibraryButtonLabel: {
id: 'course-authoring.library-authoring.library.publishLibraryButtonLabel',
defaultMessage: 'Publish All Changes',
description: 'Button text for publish library button',
},
});

export default messages;