Skip to content

Commit dd731a0

Browse files
authored
fix: rename library publish button (#2015)
1 parent 976dfca commit dd731a0

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/library-authoring/generic/status-widget/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ type StatusWidgedProps = {
8585
publishedBy: string | null;
8686
numBlocks?: number;
8787
onCommit?: () => void;
88+
onCommitLabel?: string;
8889
onRevert?: () => void;
8990
};
9091

@@ -114,6 +115,7 @@ const StatusWidget = ({
114115
publishedBy,
115116
numBlocks,
116117
onCommit,
118+
onCommitLabel,
117119
onRevert,
118120
}: StatusWidgedProps) => {
119121
const intl = useIntl();
@@ -188,7 +190,7 @@ const StatusWidget = ({
188190
</span>
189191
{onCommit && (
190192
<Button disabled={isPublished} onClick={onCommit}>
191-
{intl.formatMessage(messages.publishButtonLabel)}
193+
{onCommitLabel || intl.formatMessage(messages.publishButtonLabel)}
192194
</Button>
193195
)}
194196
{onRevert && (

src/library-authoring/library-info/LibraryPublishStatus.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const LibraryPublishStatus = () => {
5151
<StatusWidget
5252
{...libraryData}
5353
onCommit={!readOnly ? commit : undefined}
54+
onCommitLabel={intl.formatMessage(messages.publishLibraryButtonLabel)}
5455
onRevert={!readOnly ? openConfirmModal : undefined}
5556
/>
5657
<DeleteModal

src/library-authoring/library-info/messages.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ const messages = defineMessages({
7676
defaultMessage: 'Discard',
7777
description: 'Button text for confirmation modal shown before discard library changes',
7878
},
79+
publishLibraryButtonLabel: {
80+
id: 'course-authoring.library-authoring.library.publishLibraryButtonLabel',
81+
defaultMessage: 'Publish All',
82+
description: 'Button text for publish library button',
83+
},
7984
});
8085

8186
export default messages;

0 commit comments

Comments
 (0)