feat(invideoquiz-editor): add validation for required data#76
feat(invideoquiz-editor): add validation for required data#76djoseph-apphelix merged 1 commit intorelease-ulmofrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a "Content not found" alert to the InVideoQuizEditor that displays when the parent unit is missing video or problem components. The alert informs users about missing content with specific messages and can be dismissed via a button. The implementation includes comprehensive unit tests covering various alert scenarios.
Changes:
- Added internationalized alert messages for missing video/problem content
- Implemented conditional alert display logic based on loaded state and content availability
- Created 17 unit tests to cover alert display, dismissal, and edge cases
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/editors/containers/InVideoQuizEditor/messages.ts | Added four new i18n messages for alert title, content messages, and dismiss button |
| src/editors/containers/InVideoQuizEditor/index.jsx | Implemented alert UI with custom dismiss button, conditional rendering based on content availability |
| src/editors/containers/InVideoQuizEditor/index.test.jsx | Added comprehensive test suite with 17 tests covering alert scenarios and component behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e62bef4 to
7ae42b0
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const page = ( | ||
| <div className="in-video-quiz-editor"> | ||
| {(hasNoVideos || hasNoProblems) && !contentAlertDismissed && ( | ||
| <Alert variant="danger" dismissible onClose={() => setContentAlertDismissed(true)}> |
There was a problem hiding this comment.
Consider using variant="warning" instead of variant="danger" for this alert. Based on the codebase patterns, "danger" is typically reserved for errors and validation failures that prevent functionality, while "warning" is used for informational alerts. The "Content not found" scenario is informational - the editor still functions, but the user should be aware that video or problem components are missing from the unit. This follows the pattern used in EditorContainer.tsx and other files where warnings notify users about conditions that need attention but don't break functionality.
| <Alert variant="danger" dismissible onClose={() => setContentAlertDismissed(true)}> | |
| <Alert variant="warning" dismissible onClose={() => setContentAlertDismissed(true)}> |
…roblems or videos exist in the unit.
7ae42b0 to
7131617
Compare
Description
Screenshot
Impacted user roles:
This change is in the Studio (CMS) course authoring interface — specifically the InVideoQuiz XBlock editor. The impacted roles are:
Supporting information
Jira ticket : TNL2-541
Testing instructions