The default bug view has changed. See this FAQ.

Contacts API: multiple sorting fields

RESOLVED FIXED in mozilla15

Status

()

Core
DOM: Device Interfaces
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: gwagner, Assigned: gwagner)

Tracking

unspecified
mozilla15
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

5 years ago
We currently only sort by either first or family name. If 2 entries have the same familyName for example we want to continue sorting based on the first name.
(Assignee)

Comment 1

5 years ago
Created attachment 624514 [details] [diff] [review]
patch
Assignee: nobody → anygregor
(Assignee)

Comment 2

5 years ago
Created attachment 624516 [details] [diff] [review]
patch
Attachment #624514 - Attachment is obsolete: true
(Assignee)

Updated

5 years ago
Attachment #624516 - Flags: review?(fabrice)
(Assignee)

Comment 3

5 years ago
Created attachment 625799 [details] [diff] [review]
patch

There was a bug in the first version. Entries can be undefined.
Attachment #624516 - Attachment is obsolete: true
Attachment #624516 - Flags: review?(fabrice)
Attachment #625799 - Flags: review?(fabrice)
Comment on attachment 625799 [details] [diff] [review]
patch

Review of attachment 625799 [details] [diff] [review]:
-----------------------------------------------------------------

r=me with comments addressed

::: dom/contacts/fallback/ContactService.jsm
@@ +89,5 @@
> +      }
> +
> +      if (sortByNameSet) {
> +        result = x.localeCompare(y);
> +      }

nit: add blank line

@@ +106,1 @@
>        return msg.findOptions.sortOrder == 'ascending' ? result : -result;

Do a |let sortOrder = msg.findOptions.sortOrder| like for sortBy and reuse it.
Attachment #625799 - Flags: review?(fabrice) → review+
(Assignee)

Comment 5

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/d529197a47f0
https://hg.mozilla.org/mozilla-central/rev/d529197a47f0
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
You need to log in before you can comment on or make changes to this bug.