Skip to content

Commit

Permalink
Improve error displayed in URLPicker when YouTube is not enabled (#5597)
Browse files Browse the repository at this point in the history
  • Loading branch information
acelaya committed Jul 26, 2023
1 parent 217348a commit e8fed64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lms/static/scripts/frontend_apps/components/URLPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ export default function URLPicker({
setError('Please use a URL that starts with "http" or "https"');
}
} else if (isYouTubeURL(rawInputValue)) {
// TODO If YouTube is enabled, take the user to the right content picker instead of displaying an error
// instructing how to do it manually
setError(
youtubeEnabled
? 'To annotate a video, go back and choose the YouTube option.'
: 'Annotating YouTube videos is not yet supported. This feature is coming soon.'
: 'Annotating YouTube videos has been disabled at your organisation.'
);
} else {
onSelectURL(input.current!.value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('URLPicker', () => {
{
youtubeEnabled: false,
expectedError:
'Annotating YouTube videos is not yet supported. This feature is coming soon.',
'Annotating YouTube videos has been disabled at your organisation.',
},
].forEach(({ youtubeEnabled, expectedError }) => {
it('does not invoke `onSelectURL` if URL is for a YouTube video', () => {
Expand Down

0 comments on commit e8fed64

Please sign in to comment.