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

Peter fogg/explicit course settings #301

Merged
merged 8 commits into from
Jul 11, 2013

Conversation

peter-fogg
Copy link
Contributor

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 called model.save, we now call model.set and pop up a confirmation. Settings are all reverted when the user hits the cancel button on said bar.

@@ -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):
Copy link

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.

@cahrens
Copy link

cahrens commented Jun 30, 2013

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.

@cahrens
Copy link

cahrens commented Jun 30, 2013

"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')
Copy link

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?

@cahrens
Copy link

cahrens commented Jun 30, 2013

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});
Copy link

Choose a reason for hiding this comment

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

The clear was unnecessary?

Copy link
Contributor Author

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)

Copy link
Contributor

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.

Copy link
Contributor Author

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?

@cahrens cahrens closed this Jun 30, 2013
@cahrens
Copy link

cahrens commented Jun 30, 2013

Oops, didn't mean to close the pull request.

@cahrens cahrens reopened this Jun 30, 2013
@@ -100,9 +109,10 @@ CMS.Views.Settings.Grading = CMS.Views.ValidatingView.extend({
break;

default:
this.saveIfChanged(event);
this.setField(event);
break;
Copy link

Choose a reason for hiding this comment

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

Indent.

@cahrens
Copy link

cahrens commented Jun 30, 2013

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,

  1. Notification while save is in progress. Does not actually state we want the confirmation at the top.
  2. Show confirmation dialog on delete of assignment type.

@cahrens
Copy link

cahrens commented Jun 30, 2013

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

@peter-fogg
Copy link
Contributor Author

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

@cahrens
Copy link

cahrens commented Jul 9, 2013

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)
CMS.Views.SystemFeedback.close button sends a .hide() message

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

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.

@cahrens
Copy link

cahrens commented Jul 9, 2013

Just found a validation issue.

  1. Change Homework weight to something else (for instance, 16)
  2. Save changes
  3. Delete the 6 (do this quickly, ideally while the "sliding" up is still happening
  4. You get a validation error on Homework that "There's already another assignment type with this name."

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() {
Copy link

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.

Peter Fogg added 6 commits July 11, 2013 09:11
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.
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"),
Copy link

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

@cahrens
Copy link

cahrens commented Jul 11, 2013

👍

peter-fogg pushed a commit that referenced this pull request Jul 11, 2013
@peter-fogg peter-fogg merged commit 5b4524d into master Jul 11, 2013
@peter-fogg peter-fogg deleted the peter-fogg/explicit-course-settings branch July 11, 2013 21:09
Kelketek referenced this pull request in open-craft/edx-platform Nov 6, 2014
changes from master to release
yokose-ks added a commit to nttks/edx-platform that referenced this pull request Oct 2, 2015
yokose-ks added a commit to nttks/edx-platform that referenced this pull request Oct 2, 2015
yokose-ks added a commit to nttks/edx-platform that referenced this pull request Oct 7, 2015
yokose-ks added a commit to nttks/edx-platform that referenced this pull request Oct 7, 2015
…ssage-for-required-fields

Move a message for required fields to more noticeable position (openedx#301)
CrewS pushed a commit to CrewS/edx-platform-1 that referenced this pull request Feb 18, 2019
Sujeet1379 pushed a commit to chandrudev/edx-platform that referenced this pull request Nov 17, 2022
…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.
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.

3 participants