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

Order grid - Sort by Purchase Date Desc by default #11911

Merged
merged 1 commit into from
Nov 2, 2017

Conversation

ihor-sviziev
Copy link
Contributor

@ihor-sviziev ihor-sviziev commented Oct 31, 2017

Description

As a customer I expect to see new orders at the top of the grid, however during migration from M1 to M2 - order number length changed, as result new orders are NOT located at the top of grid.

In order to fix this issue for all cases - we're changing default sorting order to "Purchase Date" desc.

As we discussed with @okorshenko in #10185 (comment) sorting order grid by Increment is not good idea. I'm proposing change default sorting from increment_id column to created_at.

Sorting issue happens only in following cases:

  • Orders were migrated from Magento 1
  • Used prefix/suffix for order number
  • Customized order ID generation
  • Etc.

NOTE: Order grid sorting saves in ui_bookmark table, so before testing need to execute following SQL:

TRUNCATE table ui_bookmark;

Fixed Issues (if relevant)

Manual testing scenarios

  1. Create three orders as example 1000000001, 1000000002 and 1000000003
  2. Go to order grid (sorting is correct)
    capture 2017-10-02 at 17 58 47
  3. Change 1000000001 order number to 100000001 (remove one 0 in the center) to emulate that order was migrated from M1 & Go to Order grid: (last created order became NOT first)
    capture 2017-10-02 at 18 01 04
  4. Create new Order & go to order grid (latest order is not at the top)
    capture 2017-10-02 at 18 04 09

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@okorshenko
Copy link
Contributor

Hi @tkacheva
By this Pull Request, we will change default state of Orders Grid. In the current implementation, default sorting is by ID descending. But there is no guaranty that newest orders will be on top. ID may have alphanumeric symbols.

This Pull Request changes default sorting to by Purchase Date descending, so new orders will appear on the top.

Please, confirm such changes in default behavior.

@okorshenko okorshenko modified the milestones: October 2017, November 2017 Nov 1, 2017
@ihor-sviziev
Copy link
Contributor Author

Please let me know if you will accept this PR. If yes - I will prepare backport PRs to other branches and looks like we have similar issues with another sales grids.

@tkacheva
Copy link

tkacheva commented Nov 1, 2017

@ihor-sviziev thank you for the contribution, one question related to that: The default sorting order will look like this?
screen shot 2017-11-01 at 12 18 58 pm

If yes, the changes is approved.

@ihor-sviziev
Copy link
Contributor Author

@tkacheva yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants