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

Improved promotions form #1509

Merged
merged 2 commits into from
Feb 3, 2017
Merged

Conversation

jhawthorn
Copy link
Contributor

@jhawthorn jhawthorn commented Oct 7, 2016

I think it is universally agreed that the promotions form is too complicated and confusing.

Existing form:

I felt that one of the biggest problems with this form is that it is difficult for an inexperienced user (and even users with years of spree/solidus experience) to know how to create a new promotion that activates when they want it.

A user needs to know

  • What "Apply Automatically" means (that it will be applied to all orders)
  • What "Path" means (probably not used by most stores)
  • To get a single promotion code (a very common use case) "Number of codes" must be set to 1 and then "base code" can be used as the desired promotion code.
  • How the promotion code generator works and how to download the codes when specifying multiple codes.

To make this easier to use, I've created a set of radio buttons to help guide a user to their desired behaviour without knowing the meanings behind all these magic fields.

These radio buttons are only used by JS and aren't persisted.

Redesigned page

Designing things is usually not my forte, but I think this is an improvement. I started by splitting the fields into three sections, with the last one being the new radio buttons.

Radio buttons

Work to do:

@jhawthorn jhawthorn added UI changelog:solidus_backend Changes to the solidus_backend gem labels Oct 7, 2016
@gmacdougall
Copy link
Member

Thanks for working on this John. I feel it is an improvement.

@jordan-brough
Copy link
Contributor

Very 👍 on this! If we merge #1524 we'll want to take that into account also yeah?

@Mandily
Copy link
Contributor

Mandily commented Oct 14, 2016

This is awesome! 👍 Way better than what we have now. With regards to the questions in your "work to do" section:

  • Multiple activation types could mean we use checkboxes instead of radio buttons if we want to allow a user to make any combination of options. If we wanted to restrict them to certain combinations, it might be better to make that combination a new radio button option.
  • Tooltips: the new bootstrap layouts will allow for substantial helpful information to be added to the sidebar, so we might want to just make a note of what we'd like on the page for the time being and then add that information when we switch this page over to the bootstrap layout in the future.

@jrochkind
Copy link
Contributor

jrochkind commented Oct 14, 2016

Definite huge improvement.

Whether part of one PR or not, I think the "view" and "edit" screens for existing Promotion need attention too. Might make sense to make part of same PR for 'edit' at least, since that's actually the same partial I think, if you don't attend to it it could make it even worse.

One of the problems with "edit" screen is it is currently, is that it's not possible to show actual base code for multi-code promotions, since it's not preserved. Current edit screen just picks the first code in the database, and labels it 'base code' in the UI, which isn't right. PR #1410 would make promotions remember their base code, which could allow view/edit on an existing promotion to make more sense.

@jhawthorn
Copy link
Contributor Author

Multiple activation types could mean we use checkboxes instead of radio buttons if we want to allow a user to make any combination of options. If we wanted to restrict them to certain combinations, it might be better to make that combination a new radio button option.

Though we do allow combinations in the data-model (both a code and a path, for example), I think it's an uncommon use case that we might as well just hide in the UI for simplicity.

Tooltips: the new bootstrap layouts will allow for substantial helpful information to be added to the sidebar, so we might want to just make a note of what we'd like on the page for the time being and then add that information when we switch this page over to the bootstrap layout in the future.

Sounds good.

Copy link
Contributor

@mamhoff mamhoff left a comment

Choose a reason for hiding this comment

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

I've left a completely minor nit, but am fine with the UI changes and like the new code better (like splitting up the Coffeescript by calculator).

</div>
</div>

<div id="expiry_fields" class="three columns omega">
<%= f.field_container :overall_usage_limit do %>
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a super-nit. Should we be mixing old- and new-style Hash syntax in the same line? I feel like if we touch the line anyways, we could just switch it over to new if nothing stands against it.

@jhawthorn jhawthorn force-pushed the promotions_redesign branch 3 times, most recently from 48d85ce to 708d915 Compare February 2, 2017 20:48
@jhawthorn jhawthorn removed the WIP label Feb 2, 2017
@jhawthorn jhawthorn changed the title [RFC] Improved promotions form Improved promotions form Feb 2, 2017
@jhawthorn jhawthorn force-pushed the promotions_redesign branch from 708d915 to d3d4a53 Compare February 2, 2017 21:33
This should be slightly nicer than seeing an error after a round trip to
the server. Disabled elements are skipped for HTML validations, so this
works with the hidden elements.
@jhawthorn jhawthorn force-pushed the promotions_redesign branch from d3d4a53 to 6b9b720 Compare February 2, 2017 22:01
@jhawthorn
Copy link
Contributor Author

I have rewritten this to work after the changes in #1524.

I've gone with a very simple solution for the "edit" action, and I'd like to make further improvements in a separate PR.

We didn't previously allow editing codes on existing promotions. The code field was marked readonly and the controller didn't support it. I've made this (hopefully) more clear by just printing the code as text.

This is ready for review

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Great improvement. I created a follow up for further improvements #1702

@jhawthorn jhawthorn merged commit bf04986 into solidusio:master Feb 3, 2017
@jhawthorn jhawthorn deleted the promotions_redesign branch February 3, 2017 20:03
@isaacfreeman
Copy link

This is a big usability improvement from a small change. 👍

Could we provide some additional indication to users that clicking a radio button will reveal further controls? Most radio buttons don't do that, and the initial state has no controls to the right, so it might not be obvious. This could be as simple as adding an ellipsis ... after the labels for those radio buttons that bring up other fields.

Beyond the scope of this pull request, I feel like these four radio buttons are conceptually closer to being Promotion Rules than attributes of the overall Promotion. They're all conditions under which the promotion will be activated. I appreciate that would entail a significant change to the code, but I wonder whether promotions would be easier to understand if we could push more features down into Rules.

@@ -0,0 +1,66 @@
<% activation_type = params[:activation_type] || 'single_code' %>
<div class="row" id="js_promotion_activation">
Copy link
Member

Choose a reason for hiding this comment

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

@jhawthorn why you are not using dash but underscores to separate words for all elements ids?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_backend Changes to the solidus_backend gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants