-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
XBlock Reporting: Display a popup after requesting a report #18244
Conversation
Thanks for the pull request, @akovari! I've created OSPR-2433 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will still be done via the GitHub pull request interface. As a reminder, our process documentation is here. If you like, you can add yourself to the AUTHORS file for this repo, though that isn't required. Please see the CONTRIBUTING file for more information. |
@@ -32,6 +32,7 @@ export default class Main extends React.Component { | |||
<BlockBrowserContainer onSelectBlock={(blockId) => { | |||
this.hideDropdown(); | |||
onSelectBlock(blockId); | |||
blockIdChanged(blockId); |
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.
There is already a redux event for this, so prefer loose coupling and listen to that event instead.
|
||
export default combineReducers({ | ||
problemReport, | ||
}); |
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 reducer is doing nothing.
inProgress: action.inProgress, | ||
succeeded: action.succeeded, | ||
reportPath: action.reportPath | ||
}; |
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.
The success action here will not clear out the error message, you should add error: null
or similar here.
reportPath: action.reportPath | ||
}; | ||
case problemResponsesPopupActions.ERROR: | ||
return {...state, error: action.error}; |
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.
Like the above, this should clear out succeeded
.
courseId: PropTypes.string.isRequired, | ||
excludeBlockTypes: PropTypes.arrayOf(PropTypes.string).isRequired, | ||
endpoint: PropTypes.string.isRequired | ||
}; |
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 isn't needed if you listen to the redux event.
} else if (this.props.message != null) { | ||
msg = ( | ||
<div | ||
className={`msg ${this.props.succeeded ? "msg-success" : "msg-warning"}`}>{this.props.message}</div> |
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.
Use the classnames
library here.
{msg} | ||
<p> | ||
Once it's ready, you can view or download it using the buttons below. You can also close this popup | ||
now, and download the report later, from the "Reports Available for Download" area below. |
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 needs to be translatable as well.
window.open(`/media/${this.props.reportPath}`, '_blank'); | ||
} | ||
|
||
render() { |
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.
You can break this method down into getButtons
, getBody
, getProgress
etc.
credentials: 'same-origin', | ||
method: 'get', | ||
headers: HEADERS | ||
}); |
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.
Don't hardcode this URL either, pass it in like you did with "endpoint".
inProgress: PropTypes.bool.isRequired, | ||
succeeded: PropTypes.bool.isRequired, | ||
reportPath: PropTypes.string, | ||
}; |
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 can be a static functional component.
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.
done
@edx/educator-product Could you take a look at the UI and language for this PR? Thanks |
|
||
export default combineReducers({ | ||
task, | ||
}); |
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.
You don't need this since there is a single reducer :-)
4e1bae4
to
3a5bf36
Compare
jenkins run all |
e63420e
to
4dd91f0
Compare
4dd91f0
to
dcaa4ac
Compare
}/> | ||
); | ||
|
||
const buttons = (reportPath === null && !error) |
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.
Shouldn't this be (reportPath !== null && !error)
? i.e. Doesn't reportPath
get set once the report is available?
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.
Yup, sorry. I think I made an amended commit for this but forgot to push it.
dcaa4ac
to
900d73d
Compare
1c09600
to
65fcf58
Compare
65fcf58
to
f65bc4a
Compare
Co-authored-by: Adam Kovari <adam@opencraft.com> Co-authored-by: Eugeny Kolpakov <eugeny.kolpakov@gmail.com> Co-authored-by: Kshitij Sobti <kshitij@sobti.in>
f65bc4a
to
b6dae78
Compare
jenkins run bokchoy |
Your PR has finished running tests. The following contexts failed:
|
@mduboseedx Just checking in to see if this could get a rough review of the UI and language (as you suggested above) so we can make any adjustments. |
@xitij2000 I'm checking with product. Sorry for the delay here. |
Hello @xitij2000 Can I ask why this is implemented as a modal / pop-up instead of improving the task list / queue currently rendered at the bottom of the reports / certificates /emails page? 1.) My preference would be to make improvements to this management view for asynchronous reports / requests so that then the value would be rippled across multiple places. I'm not comfortable initially incorporating this modal / blocking approach for conveying report status. Look forward to your thoughts on this. In its current form, I don't think this is something we'd like to merge into the core experience. |
@marcotuts Really quickly: the list at the bottom often has dozens and dozens of reports with long and confusing names (and small font), and it may include reports requested by other users. So it can be hard and slow to find the one you want in the list. By making this a popup that only shows the report you just requested, there's no work required to hunt and find your report in the list, check that it's ready, then download it. It's right in your face. I think this makes it far, far easier to use from a user's perspective. I expect users would leave this open in a spare tab on their browser until they see that it's complete, so it wouldn't be "blocking" work anymore than leaving the report page open and continuously reviewing the list of reports would be. Option 2 sounds great, but we don't have any budget to make either of those other things happen at this point. |
@bradenmacdonald - Is there a path to making that first report in the bottom grouped / rendered differently to show you "your reports" by default and have a toggle to view "all report"? We could make that area far more useful for all users without hopefully introducing another modal UI pattern for the reports workflow. I can try to suggest / how we might visually bridge the gap between the new modal you are proposing and how that simplified view might look if incorporated into an updated "Reports Queue" area that improves on the current one. Totally understood that option 2 isn't reasonable necessarily within the scope here. |
@marcotuts As @bradenmacdonald mentioned above, while this is a modal, it doesn't really block users from using another tab, or even just navigating away. Perhaps that is something that can be made even clearer in the language on the modal? Currently I think it's pretty clear that you can dismiss the popup and find the report later. Or perhaps the popup can not darken the background? I don't think the user who requested the report is currently tracked, so a your-reports vs all-reports toggle would need a bigger change than is in scope here. |
As proposed I'm not comfortable adding this modal on top of the current patterns / views. I'm marking this closed and we can revisit other cleanups to this hopefully soon, but it sounds like not in scope for the current effort. |
@marcotuts We had shown that modal to Shelby in March and she was fine with it, which is why we implemented it as shown. Hopefully the meetings and other process changes you've discussed with me and Gabriel can help avoid these sort of situations :/ Since at this point, we won't have any budget to follow up on this or re-implement it: is this report generation workflow UI something edX might be able to improve before the next named release? |
@marcotuts Sorry for the delay here, but I had an alternative proposal for the UI, which would be more inline rather than a popup. It would work as follows:
Would a UI like the above fit in better? |
Ah, apologies for missing this. If we could avoid the use of the modal interrupt but provide improved visibility into the report's download progress that would be great. At a high level your proposal for changes @xitij2000 sounds great, and if that isn't too much effort to change that would be great! Let us know when this would be ready for engineering review, or if after review the changes you described prove to be much larger than expected. Thanks! |
Ah I can't reopen this branch as it was deleted, it looks like this would need to be separately reopened - @xitij2000 . |
I will create a new PR for this with the approach I outlined above. |
This feature implements a popup for generating / downloading the xblock report. It will poll for the generation task status and after it's completed, it will show a button to download the report directly in the modal window.
Dependencies: https://github.com/edx/edx-platform/pull/18170
Screenshots:
Sandbox URL: TBD - sandbox is being provisioned.
Merge deadline: None
Testing instructions:
ENABLE_GRADE_DOWNLOADS
is enabled in lms/djangoapps/instructor/settings/common.pyReviewers