Skip to content

Commit

Permalink
fix: video thumbnail availability (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
ihor-romaniuk authored Nov 30, 2023
1 parent c0bc54a commit bad7635
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exports[`ThumbnailWidget snapshots snapshots: renders as expected where thumbnai
variant="light"
>
<FormattedMessage
defaultMessage="Select a video from your library to enable this feature"
defaultMessage="Select a video from your library to enable this feature (applies only to courses that run on the edx.org site)."
description="Message for unavailable thumbnail widget"
id="authoring.videoeditor.thumbnail.unavailable.message"
/>
Expand Down Expand Up @@ -167,6 +167,15 @@ exports[`ThumbnailWidget snapshots snapshots: renders as expected with a thumbna
id="authoring.videoeditor.thumbnail.error.fileSizeError"
/>
</ErrorAlert>
<Alert
variant="light"
>
<FormattedMessage
defaultMessage="Select a video from your library to enable this feature (applies only to courses that run on the edx.org site)."
description="Message for unavailable thumbnail widget"
id="authoring.videoeditor.thumbnail.unavailable.message"
/>
</Alert>
<Stack
direction="horizontal"
gap={3}
Expand Down Expand Up @@ -204,7 +213,7 @@ exports[`ThumbnailWidget snapshots snapshots: renders as expected with default p
variant="light"
>
<FormattedMessage
defaultMessage="Select a video from your library to enable this feature"
defaultMessage="Select a video from your library to enable this feature (applies only to courses that run on the edx.org site)."
description="Message for unavailable thumbnail widget"
id="authoring.videoeditor.thumbnail.unavailable.message"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const ThumbnailWidget = ({
>
<FormattedMessage {...messages.fileSizeError} />
</ErrorAlert>
{edxVideo ? null : (
{(allowThumbnailUpload && edxVideo) ? null : (
<Alert variant="light">
<FormattedMessage {...messages.unavailableMessage} />
</Alert>
Expand All @@ -90,7 +90,7 @@ export const ThumbnailWidget = ({
src={thumbnailSrc || thumbnail}
alt={intl.formatMessage(messages.thumbnailAltText)}
/>
{ (allowThumbnailUpload && edxVideo) ? (
{(allowThumbnailUpload && edxVideo) ? (
<IconButtonWithTooltip
tooltipPlacement="top"
tooltipContent={intl.formatMessage(messages.deleteThumbnail)}
Expand All @@ -115,7 +115,7 @@ export const ThumbnailWidget = ({
iconBefore={FileUpload}
onClick={fileInput.click}
variant="link"
disabled={!edxVideo}
disabled={!(allowThumbnailUpload && edxVideo)}
>
<FormattedMessage {...messages.uploadButtonLabel} />
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ const messages = defineMessages({
},
unavailableMessage: {
id: 'authoring.videoeditor.thumbnail.unavailable.message',
defaultMessage: 'Select a video from your library to enable this feature',
defaultMessage:
'Select a video from your library to enable this feature (applies only to courses that run on the edx.org site).',
description: 'Message for unavailable thumbnail widget',
},
uploadButtonLabel: {
Expand Down

0 comments on commit bad7635

Please sign in to comment.