-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support editing assignment from launch error dialog #5163
Conversation
We discussed the UI design in Slack and have consensus to add an "Edit assignment" button to this dialog, which is always present if the user is an instructor. This should
|
6d82f48
to
bd39ff3
Compare
Following some discussion, the UI has been changed to expose the option to edit an assignment via a link at the bottom of the dialog, which is always available. This makes the behavior more predictable, regardless of what error occurred. To test the dialog, you can either configure a new assignment with an invalid configuration (eg. pick an empty group set) or apply the diff below to trigger the dialog on any assignment launch: diff --git a/lms/static/scripts/frontend_apps/components/BasicLTILaunchApp.tsx b/lms/static/scripts/frontend_apps/components/BasicLTILaunchApp.tsx
index ae14a625..3e06b9f3 100644
--- a/lms/static/scripts/frontend_apps/components/BasicLTILaunchApp.tsx
+++ b/lms/static/scripts/frontend_apps/components/BasicLTILaunchApp.tsx
@@ -177,6 +177,9 @@ export default function BasicLTILaunchApp() {
* Fetch the URL of the content to display in the iframe
*/
const fetchContentURL = useCallback(async () => {
+ setErrorState('error-fetching');
+ return false;
+
if (!viaAPICallInfo) {
// If no "callback" URL was supplied for the frontend to use to fetch
// the URL, then the backend must have provided the Via URL in the |
This UI is looking better to me! Perhaps underline the "Edit assignment"? |
cd750b7
to
b6f7f1f
Compare
This can be used to add additional actions beyond "Cancel" and "Try again" to the dialog.
If the current user is an instructor, and the LMS supports it, show an action to edit the assignment on the LTI launch error screen. This is useful for cases where an instructor can fix the assignment by changing its configuration.
b6f7f1f
to
c8d4eac
Compare
/** | ||
* Content of the dialog. This should be a human-readable explanation of the | ||
* problem that occurred and may include hints on how to fix it. | ||
*/ | ||
children?: ComponentChildren; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added comment is unrelated to the other changes in this PR.
@@ -78,6 +92,7 @@ export default function ErrorModal({ | |||
{cancelLabel} | |||
</Button> | |||
)} | |||
{extraActions} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extraActions
here is rendered, when present, after any cancel button, when present. Are there situations in which we could end up with:
<cancel button> [Edit assignment] <retry button>
or
<cancel button> [Edit assignment]
? Perhaps extraActions
could come first? Also perhaps you have already thought through these cases...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the current use case in LaunchErrorDialog
, there is no Cancel option, so the issue doesn't arise. I am not sure which will make the most sense for future use cases. When "Edit assignment" had a more button-like appearance it seemed sensible to put it next to the primary action. With the revised link-like appearance, that makes less sense. I'll move it to the left of "Cancel" for now, but I expect we might need to revisit in future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but it's worth addressing Lyza's comment, I think: https://github.com/hypothesis/lms/pull/5163/files#r1137071669
Following discussion in [1], we think putting additional actions to the left of OK/Cancel makes sense currently, although for the use case of the initial use in `LaunchErrorDialog` there is no Cancel button in any case. [1] #5163 (comment)
Thanks for the feedback. I have moved |
@robertknight yes! Go for it |
Add an "Edit assignment" link to the launch error dialog, if the user is an instructor and assignment editing is enabled. This makes it possible to fix certain errors by editing the assignment, when previously it would have required re-creating the assignment.
See #5163 (comment) for testing notes.