-
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
give some debug message regarding why export has failed #589
Conversation
@chrisndodge, thanks for trying to make the status communication better in this view. I've taking a spin through and created an error (screengrab - http://cl.ly/image/411U0f3o3y11). I'm not sure using the "alert" style UI is the best way to show this error. Perhaps a prompt UI might be better - to force a user to acknowledge that an error occurred and to have them take direct action (by clicking a button to confirm/return to try again). Also, is the technical error output what we want to display? Can we make this more into a summary sentence with more importantly a link to the Unit where the error happened (for easy correction)? @frrrances or @marcotuts, what do you guys think of the best UI shape to communicate this error? |
intent: "error", | ||
closeIcon: false | ||
}); | ||
dialog.show(); |
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.
@chrisndodge, I'm not sure we're using this method of showing alerts elsewhere (our plan on the design side was to have CSS-based classes control the visibility and animation of elements rather than relying on JQuery's .show()/.hide() methods.
It looks like you may be adding this to make the alert UI accommodate a case it was never supposed to - asynchronous error messaging (it was meant to be displayed when a page was loaded after a traditional page request).
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.
Can we get Peter Fogg or DB or Julian to wire up the notification mechanism
on the client instead of pushing it on Chris?
On Tue, Aug 6, 2013 at 9:22 AM, Brian Talbot notifications@github.comwrote:
In cms/templates/export.html:
@@ -6,6 +6,24 @@
<%block name="title">${_("Course Export")}</%block>
<%block name="bodyclass">is-signedin course tools export</%block>+<%block name="jsextra">
- % if err_msg:
- <script type='text/javascript'>
- $(document).ready(function() {
var defaultTitle = gettext('There has been an error with your export.');
var msg = "${err_msg}";
dialog = new CMS.Views.Alert.Confirmation({
title: defaultTitle,
message: msg,
intent: "error",
closeIcon: false
});
dialog.show();
@chrisndodge https://github.com/chrisndodge, I'm not sure we're using
this method of showing alerts elsewhere (our plan on the design side was to
have CSS-based classes control the visibility and animation of elements
rather than relying on JQuery's .show()/.hide() methods.It looks like you may be adding this to make the alert UI accommodate a
case it was never supposed to - asynchronous error messaging (it was meant
to be displayed when a page was loaded after a traditional page request).—
Reply to this email directly or view it on GitHubhttps://github.com/edx/edx-platform/pull/589/files#r5603493
.
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.
I believe that @chrisndodge is doing the right thing here. The .show()
and .hide()
methods on a notification view don't proxy to jQuery's show/hide JS animations, they simply inform the view whether it should be shown or hidden, and ask the view to re-render itself: code is here. The actual animation in the view is handled by the CSS classes that are being applied to the rendered HTML.
Also, @chrisndodge, is there a bug or sprint story associated with this? I want to make sure I'm reviewing based on any requirements/specifics detailed elsewhere. @talbs Looks like this is STUD-568. https://edx-wiki.atlassian.net/browse/STUD-568 (Christina) |
@@ -335,16 +336,34 @@ def generate_export_course(request, org, course, name): | |||
the course | |||
""" | |||
location = get_location_and_verify_access(request, org, course, name) | |||
|
|||
course_module = modulestore().get_item(location) |
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.
I thought you were deprecating get_item and moving to get_instance w/ the course_id as first arg
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
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.
Line still says get_item(location)
rather than get_instance(location.course_id, location)
. I don't really care, but it seems that if we're trying to deprecate get_item, we shouldn't add uses of it.
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.
Sorry, I changed a different line from get_item -> get_instance. Doing this one too.
Avoid constructing HTML in a view function, even just |
@singingwolfboy @dmitchell @talbs , thanks for all the great feedback. I did another pass tonight using the "prompt" notification and I present the user with the action to be able to go to the Edit Unit page to fix the module in error. If the error is not happening at a component level (inside a Unit), then the messaging is a bit more generic (including the raw exception message) and the user can click to go to the course overview page. Hope this addresses most of the feedback. |
} | ||
}); | ||
% else: | ||
var msg = gettext("<p>There has been a failure to export your course to XML. Unfortunately, we do not have specific enough information to assist you in identifying the failed component. It is recommended that you inspect your courseware to identify any components in error and try again.</p><p>The raw error message is:</p>"); |
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 translate HTML. You can do:
var msg = "<p>" + gettext("There has been a failure...") + "</p><p>" + gettext("The raw error message is:") + "</p>";
Looks pretty good! I just identified a few small issues; the rest looks good to me. |
@singingwolfboy thanks for the feedback, updated PR with your comments. |
👍 |
@dmitchell did change from get_item -> get_instance |
…o the edit unit page which contains the module in error. Otherwise, present the raw exception message and allow user to go to the course outline page.
Waiting for @talbs visual review, but he's having localdev troubles. Will work with him on Friday AM to try to close this out. |
👍 here - I just tweaked the copy of the two controls at the bottom of the prompt. |
…ging give some debug message regarding why export has failed
…dback-update-3 Hash Update #3: Diagnostic-Feedback
* Proversity/development (openedx#558) ENH: bulk grades api to be granular ENH: course order by ADD: harambee custom backend SSO FIX: show correct course info on instructor dashboard FIX: course re-run FIX: course date settings in studio. section release dates are no reflected and updated from the ADD: missing welsh translations FIX: invalid gettext call for translating js
* Proversity/development (#558) ENH: bulk grades api to be granular ENH: course order by ADD: harambee custom backend SSO FIX: show correct course info on instructor dashboard FIX: course re-run FIX: course date settings in studio. section release dates are no reflected and updated from the ADD: missing welsh translations FIX: invalid gettext call for translating js
BC-19_P3 opchore: Test xblocks supported for lilac/limonero.
Co-authored-by: Renovate Bot <bot@renovateapp.com>
To test:
@talbs can you look from a UI side. I reused existing components (I hope). @dmitchell can you review back-end code? Not sure how to unit test since this is a hook into the UI.