Skip to content

Commit

Permalink
fix: propTypes validation warning on Toast content string
Browse files Browse the repository at this point in the history
  • Loading branch information
bradenmacdonald committed Sep 11, 2024
1 parent bb051e6 commit be9d01b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ exports[`TextEditor snapshots block failed to load, Toast is shown 1`] = `
onClose={[MockFunction hooks.nullMethod]}
show={true}
>
<FormattedMessage
defaultMessage="Error: Could Not Load Text Content"
description="Error Message Dispayed When HTML content fails to Load"
id="authoring.texteditor.load.error"
/>
Error: Could Not Load Text Content
</Toast>
<TinyMceWidget
disabled={false}
Expand Down Expand Up @@ -81,11 +77,7 @@ exports[`TextEditor snapshots loaded, raw editor 1`] = `
onClose={[MockFunction hooks.nullMethod]}
show={false}
>
<FormattedMessage
defaultMessage="Error: Could Not Load Text Content"
description="Error Message Dispayed When HTML content fails to Load"
id="authoring.texteditor.load.error"
/>
Error: Could Not Load Text Content
</Toast>
<RawEditor
content={
Expand Down Expand Up @@ -132,11 +124,7 @@ exports[`TextEditor snapshots not yet loaded, Spinner appears 1`] = `
onClose={[MockFunction hooks.nullMethod]}
show={false}
>
<FormattedMessage
defaultMessage="Error: Could Not Load Text Content"
description="Error Message Dispayed When HTML content fails to Load"
id="authoring.texteditor.load.error"
/>
Error: Could Not Load Text Content
</Toast>
<div
className="text-center p-6"
Expand Down Expand Up @@ -175,11 +163,7 @@ exports[`TextEditor snapshots renders as expected with default behavior 1`] = `
onClose={[MockFunction hooks.nullMethod]}
show={false}
>
<FormattedMessage
defaultMessage="Error: Could Not Load Text Content"
description="Error Message Dispayed When HTML content fails to Load"
id="authoring.texteditor.load.error"
/>
Error: Could Not Load Text Content
</Toast>
<TinyMceWidget
disabled={false}
Expand Down Expand Up @@ -232,11 +216,7 @@ exports[`TextEditor snapshots renders static images with relative paths 1`] = `
onClose={[MockFunction hooks.nullMethod]}
show={false}
>
<FormattedMessage
defaultMessage="Error: Could Not Load Text Content"
description="Error Message Dispayed When HTML content fails to Load"
id="authoring.texteditor.load.error"
/>
Error: Could Not Load Text Content
</Toast>
<TinyMceWidget
disabled={false}
Expand Down
4 changes: 2 additions & 2 deletions src/editors/containers/TextEditor/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Spinner,
Toast,
} from '@openedx/paragon';
import { FormattedMessage, injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';

import { actions, selectors } from '../../data/redux';
import { RequestKeys } from '../../data/constants/requests';
Expand Down Expand Up @@ -78,7 +78,7 @@ const TextEditor = ({
>
<div className="editor-body h-75 overflow-auto">
<Toast show={blockFailed} onClose={hooks.nullMethod}>
<FormattedMessage {...messages.couldNotLoadTextContext} />
{ intl.formatMessage(messages.couldNotLoadTextContext) }
</Toast>

{(!blockFinished)
Expand Down

0 comments on commit be9d01b

Please sign in to comment.