Skip to content
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

Merged
merged 6 commits into from
Aug 9, 2013

Conversation

chrisndodge
Copy link
Contributor

To test:

  1. create a problem
  2. muck with the XML to make it invalid
  3. go export it
  4. should see error notification with some debugging information

@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.

@talbs
Copy link
Contributor

talbs commented Aug 6, 2013

@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();
Copy link
Contributor

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).

Copy link
Contributor

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
.

Copy link
Contributor

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.

@talbs
Copy link
Contributor

talbs commented Aug 6, 2013

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)
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@singingwolfboy
Copy link
Contributor

Avoid constructing HTML in a view function, even just <br> tags -- leave that to the template. I suggest that you just pass the failed_item to the template, and let the template construct the error message using that object.

@chrisndodge
Copy link
Contributor Author

@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>");
Copy link
Contributor

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>";

@singingwolfboy
Copy link
Contributor

Looks pretty good! I just identified a few small issues; the rest looks good to me.

@chrisndodge
Copy link
Contributor Author

@singingwolfboy thanks for the feedback, updated PR with your comments.

@singingwolfboy
Copy link
Contributor

👍

@chrisndodge
Copy link
Contributor Author

@dmitchell did change from get_item -> get_instance

Chris Dodge added 5 commits August 8, 2013 21:01
@chrisndodge
Copy link
Contributor Author

Waiting for @talbs visual review, but he's having localdev troubles. Will work with him on Friday AM to try to close this out.

@talbs
Copy link
Contributor

talbs commented Aug 9, 2013

👍 here - I just tweaked the copy of the two controls at the bottom of the prompt.

chrisndodge pushed a commit that referenced this pull request Aug 9, 2013
…ging

give some debug message regarding why export has failed
@chrisndodge chrisndodge merged commit 09a83dc into master Aug 9, 2013
itsjeyd referenced this pull request in open-craft/edx-platform Dec 23, 2015
…dback-update-3

Hash Update #3: Diagnostic-Feedback
jfavellar90 pushed a commit to eduNEXT/edx-platform that referenced this pull request Apr 11, 2018
* 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
dgamanenko referenced this pull request in raccoongang/edx-platform Jun 14, 2018
* 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
mariajgrimaldi pushed a commit to eduNEXT/edx-platform that referenced this pull request Dec 17, 2021
BC-19_P3 opchore: Test xblocks supported for lilac/limonero.
Sujeet1379 pushed a commit to chandrudev/edx-platform that referenced this pull request Nov 17, 2022
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants