-
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
Peter fogg/explicit course settings #301
Conversation
@@ -54,6 +56,42 @@ def i_press_the_category_delete_icon(_step, category): | |||
def i_have_opened_a_new_course(_step): | |||
open_new_course() | |||
|
|||
@step(u'I press the "([^"]*)" notification button$') | |||
def press_the_notification_button(step, name): |
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 "save_clicked" helper method was written specifically around what happens when you press Save in Advanced Settings. Since it is only looking for either an error message to appear or the notification-warning to disappear, it might be fine as a general method for pressing a Save or Cancel button on a notification bar. But if we are making this a generic library method, the name of the helper method "save_clicked" and the comments around it should be modified.
Assuming we stick with the current model, you need to scroll-to-top to show the "changes saved" notification. And you need to dismiss that when a new change is made, like we did in Advanced Settings. However, I suggest talking to @talbs to see if we can show the "changes saved" notification at the bottom like you did for assets page. Then it could be auto-dismissing, which would also address the "shift up" issue that I didn't like in Advanced Settings (when you type, field suddenly shifts up because the confirmation message disappears). Mark wants to QA the branch, but we should get the confirmation interaction right first. |
"New Assignment Type" on Course Settings/Grading does not work. Make sure to add a test for it when fixing the bug. I'm also concerned about the fact that the notification does not appear until you move OUT of the field you are typing in (for input fields). This is something we talked about briefly with Don and DB. I'd like you to consider a way to get the notification to appear immediately, as it does in Advanced Settings and in the course overview editor. |
ele._element.send_keys(Keys.ENTER) | ||
|
||
|
||
@step('I reset the database') |
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 recommend some documentation, and/or a clearer name for this method. I wasn't sure what resetting the database would do-- would it clear the database but not log you out, or do a full log out?
If there is a validation error, I don't think we should allow the user to press Save. For example, try making the video id "foo bar". You get the validation error, but you can still press Save. And on Save, it claims your changes were saved, though they were not (refresh). Should also add a test for this case. |
var self = this; | ||
this.model.deleteKeys = []; | ||
this.model.clear({silent : true}); |
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 clear was unnecessary?
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 model is getting fetched anyway, so clearing it doesn't make a difference.
As for deleteKeys
, I'm noticing that it doesn't look like it's needed anymore -- should I take it out of the model? (@dmitchell might weigh in too)
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.
Yes, take it out. It was from a previous version where the user typed in keys as well as values b/c we had no fixed set of keys provided by the server. Definitely out of date.
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.
@dmitchell It looks like all the logic of the advanced model is based around the delete keys. Does it make sense to replace this with CMS.Models.Settings.Advanced = Backbone.Model.extend({});
, or just do away with the advanced model entirely in favor of using a vanilla backbone model?
Oops, didn't mean to close the pull request. |
@@ -100,9 +109,10 @@ CMS.Views.Settings.Grading = CMS.Views.ValidatingView.extend({ | |||
break; | |||
|
|||
default: | |||
this.saveIfChanged(event); | |||
this.setField(event); | |||
break; |
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.
Indent.
Reviewing the relevant columns in the table below, it appears that some of the interactions may not be what @talbs wanted. You should clarify with him. https://edx-wiki.atlassian.net/wiki/pages/viewpage.action?pageId=6783773 In particular,
|
I also ran across this more explicit description of what should happen if validation fails-- "If a user chooses to save their changes, their values are validated and if valid saved. The view is refreshed with the submitted values and a confirmation alert letting the user know that their changes have been saved (type: Alert - Confirmation (with close) - Saved Changes). If a user chooses to save their changes, their values are validated and if not valid are not saved. The view is refreshed with the submitted values and a confirmation alert letting the user know that there are errors with their edits (type: Alert - Error - Submission)." |
@cahrens Finally in a state for more review -- addresses comments on the last iteration, fixing bugs, and UX changes. You may want to pull the branch as new, it's been rebased onto master since the last push. |
When there is a validation error, I am still able to press the Save button (and there is no feedback about the fact that the save did not occur). For example, choose an enrollment start date after the course start date. Also, there is a failing test on the last build: Test Result (1 failure / +1) I'll hold off on reviewing the code again until these are fixed. |
@@ -59,6 +60,8 @@ def change_assignment_name(step, old_name, new_name): | |||
for count in range(len(old_name)): | |||
f._element.send_keys(Keys.END, Keys.BACK_SPACE) | |||
f._element.send_keys(new_name) | |||
# Without this, the "you've made changes" notification won't pop up | |||
f._element.send_keys(Keys.ENTER) |
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 no longer need these ENTERs, right? Now the notification comes up on type events.
Just found a validation issue.
If it doesn't reproduce, refresh and start again. I was able to reproduce it about 5 times, though it doesn't happen every time. |
|
||
this.showNotificationBar(this.save_message, | ||
_.bind(this.saveView, this), | ||
_.bind(this.revertView, this)); | ||
}, | ||
|
||
removeSyllabus: function() { |
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.
Let's remove this syllabus code. It's not used.
When all settings require an explicit save, this functionality will be shared between each view (with slight changes, e.g. click handlers.)
Rather than asynchronously saving when a setting is updated, we now prompt the user to confirm their changes and only persist the data if they hit the save button. Lettuce tests are updated to expect this behavior and some new ones are added.
… and reliable reverting of changes.
save_title: gettext("You've made some changes"), | ||
save_message: gettext("Your changes will not take effect until you save your progress."), | ||
error_title: gettext("You've made some changes, but there are some errors"), | ||
error_message: gettext("Please address the errors on this page first, and then save your progress"), |
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.
Add period on end (consistent with save_message).
👍 |
Peter fogg/explicit course settings
changes from master to release
…ssage-for-required-fields Move a message for required fields to more noticeable position (openedx#301)
remove useless text
…te (openedx#301) Learners were having questions when we would continue showing them the 'Verify Now' button if they had a submitted a verification attempt already.
Change the save model for all settings pages from an asynchronous save
onBlur
to an explicit save with notifications. There's a bit of refactoring around this new model -- where we previously calledmodel.save
, we now callmodel.set
and pop up a confirmation. Settings are all reverted when the user hits the cancel button on said bar.