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

[BUGFIX beta] Fixes computed.sort works incorrectly with empty sort properties array #13124

Closed
wants to merge 2 commits into from

Conversation

onechiporenko
Copy link

Fix for #13037

@mmun
Copy link
Member

mmun commented Mar 18, 2016

Looks good to me. Is this a regression? We may want to [BUGFIX release] :/

@@ -668,6 +668,9 @@ function normalizeSortProperties(sortProperties) {
}

function sortByNormalizedSortProperties(items, normalizedSortProperties) {
if (normalizedSortProperties.length === 0) {
Copy link
Member

Choose a reason for hiding this comment

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

lets do

function ...(_items, ...) {
  let items = _items.slice()
  ...

}

@stefanpenner
Copy link
Member

one nit-pick, otherwise I also think this looks good

@stefanpenner
Copy link
Member

After reading #13037 (comment) I think this needs slightly more thought.

I believe Im 👍 , my thoughts are here

@stefanpenner
Copy link
Member

more discussion: #13037 (comment)

I think we need someone to check what the 1.13.x behavior was

@stefanpenner
Copy link
Member

After discussion, I believe the logic we want is as follows:

Ember.A(Ember.isEmpty(sortProperties) ? inputArray.slice() : sort(inputArray));

@mmun c/d

@mmun
Copy link
Member

mmun commented Mar 18, 2016

👍

For future proofing we should assert that sortProperties is not a string or non-null object or something.

@stefanpenner
Copy link
Member

@mmun it seems like null/undefined is fine no? Just means no sort

@onechiporenko
Copy link
Author

Any updates?

@rox163
Copy link

rox163 commented May 4, 2016

Any update on this? We hit this sort issue when we upgraded our app to Ember 2.4 from 2.3

@homu
Copy link
Contributor

homu commented Sep 3, 2016

☔ The latest upstream changes (presumably #14203) made this pull request unmergeable. Please resolve the merge conflicts.

@mmun
Copy link
Member

mmun commented Sep 3, 2016

@onechiporenko Sorry for not following up. Do you mind rebasing? or I can if you don't have time.

@onechiporenko
Copy link
Author

@mmun, I would be grateful if you do.
Thanks

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.

5 participants