Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Feature request - 'natural' treatment of null strings in default orderBy comparator #15294

Closed
arw-travela opened this issue Oct 18, 2016 · 18 comments

Comments

@arw-travela
Copy link
Contributor

Feature request in response to #15293:

As of 1.3.7, orderBy on a collection of strings that includes null strings will sort those items with null strings as if they were the string 'null', so will place them in the middle of a sorted list. The "natural" sorting of null elements in a list is to put them at the end of the list (or front, when reverse-sorting). Note that this was the behavior pre-1.3.7.

@gkalpak
Copy link
Member

gkalpak commented Oct 19, 2016

To be clear this does not only affect lists of strings, but any values. Basically, null is treated in the exact same way as the string 'null' (as far orderBy is concerned).

It seems reasonable to treat it in a special way. Note that undefined is already put at the end of the list, because it's type 'undefined' happens to start with a u 😃 I think it makes sense to explicitly put null/undefined at the end of a sorted list.

Notes:

  1. This will affect the default, built-in comparator for orderBy, as well as custom comparators.
  2. The changes need to be clearly documented in the orderBy docs (which discusses the internal sorting algorithm).

@gitcoinbot
Copy link

gitcoinbot commented Oct 1, 2017

This issue now has a funding of 0.02 ETH (6.02 USDT) attached to it. To view or claim this funding, click here.

@frederikprijck
Copy link
Contributor

I'm working on this one, will create a PR asap.

@dntxos
Copy link

dntxos commented Oct 2, 2017

awesome @frederikprijck ... I liked this feature request and i was wanting to try gitcoin... ;-)

@owocki
Copy link

owocki commented Dec 4, 2017

hey from gitcoin.co folks -- @frederikprijck did you ever turn this around? if not, let us know so we can source someone new. if so @dntxos maybe time to pay out?

@frederikprijck
Copy link
Contributor

frederikprijck commented Dec 17, 2017

Hey @owocki / @dntxos ,

Sorry for taking so long, but the PR is up and awaiting reviewing. It looks like the gitcoin url is expired tho. I guess that makes me unable to claim it, right ? Any chance it can be refreshed ?

@owocki
Copy link

owocki commented Dec 18, 2017

@dntxos you are the bounty submitter. are you still waying to pay out this bounty? cc @frederikprijck

@dntxos
Copy link

dntxos commented Dec 18, 2017 via email

@owocki
Copy link

owocki commented Dec 18, 2017

@frederikprijck you are good to go. the bounty submitter can still pay out the bounty after the 'official' expiration

@frederikprijck
Copy link
Contributor

frederikprijck commented Jan 10, 2018

@owocki The PR is there (for a while now), so awaiting merging! :)


Poking @gkalpak for obvious reasons. 💩

@frederikprijck
Copy link
Contributor

Wohoow, it's merged! 🎊

@dntxos
Copy link

dntxos commented Jan 25, 2018

I dont know how can i change the 'expired' status of my gitcoin bounty. I think @owocki can help with this.
Anyway, tks @frederikprijck ... I was excited about the gitcoin idea and wanted to try... Its Awesome

@owocki
Copy link

owocki commented Jan 25, 2018

hey @dntxos the bounty submitter can still pay out the bounty after the 'official' expiration. so you can still accept the bounty even if it's expired :)

Just go to https://gitcoin.co/funding/details?url=https://github.com/angular/angular.js/issues/15294 and go through the accept flow.

@dntxos
Copy link

dntxos commented Jan 25, 2018

Where???

image

@dntxos
Copy link

dntxos commented Jan 25, 2018

@owocki this link just show me a 'clawback' option

@owocki
Copy link

owocki commented Jan 25, 2018

Hi @dntxos sorry for the confusion.

i didnt realize this when i left my comment earlier but.... the gitcoin team had to migrate all of the bounties from an old smart contract to a new smart contract a few months ago. there are more details here https://medium.com/gitcoin/critical-security-vulnerability-patched-2017-11-10-9472db340692 ; but the TLDR is that the new bounty doesnt exist on the new smart contract.. and that's why you're not seeing the link.

i'm very sorry for the inconvenience. im willing to payout the bounty to @frederikprijck myself to make it up to you.

@frederikprijck ill leave you a tip now.

@gitcoinbot
Copy link

⚡️ A tip worth 0.025 ETH ($26.34) has been granted to @frederikprijck for this issue from Kevin. ⚡️

The sender had the following public comments:

this is for the bounty (see comment above)

Nice work @frederikprijck, check your email for further instructions.

@frederikprijck
Copy link
Contributor

frederikprijck commented Jan 25, 2018

@owocki Thanks, amazing platform btw!

@dntxos Thanks aswell :)

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

Successfully merging a pull request may close this issue.

6 participants