Closed
Bug 1106499
Opened 10 years ago
Closed 10 years ago
RoomsDB: Filter by user and then sort.
Categories
(Firefox OS Graveyard :: Gaia::Loop, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: frsela, Assigned: frsela)
References
Details
Attachments
(1 file)
This is a follow-up bug of #1101490
The objective is to allow multi-user database so getAll method shall filter by logged user and then sort items.
Currently only sort or filter is allowed. Landed code is sorting, this change will filter:
diff --git a/app/js/helpers/rooms_db.js b/app/js/helpers/rooms_db.js
index 8295336..041845c 100644
--- a/app/js/helpers/rooms_db.js
+++ b/app/js/helpers/rooms_db.js
@@ -191,6 +191,10 @@
aFilter.sortedBy = field;
}
aFilter.prev = (sorting === 'DESC' ? 'prev' : null);
+ aFilter.index = {
+ name: 'user',
+ value: Controller.identity
+ };
return new Promise(function(resolve, reject) {
_dbHelper.getList(function(error, cursor) {
if (error) {
Updated•10 years ago
|
Assignee | ||
Comment 1•10 years ago
|
||
This is a proof of concept. It can be optimized :)
Attachment #8531188 -
Flags: feedback?(crdlc)
Attachment #8531188 -
Flags: feedback?(borja.bugzilla)
Comment 2•10 years ago
|
||
Comment on attachment 8531188 [details] [review]
Github pull request
I really don't see that implementation. I have in my mind something like this http://pastebin.com/PnjmqeYJ. What do you think?
Attachment #8531188 -
Flags: feedback?(crdlc)
Updated•10 years ago
|
Assignee: nobody → frsela
Status: NEW → ASSIGNED
Assignee | ||
Updated•10 years ago
|
Attachment #8531188 -
Flags: feedback?(borja.bugzilla) → review?(crdlc)
Comment 3•10 years ago
|
||
Comment on attachment 8531188 [details] [review]
Github pull request
Excellent work!! Many thanks!
Attachment #8531188 -
Attachment description: Proof of concept → Github pull request
Attachment #8531188 -
Flags: review?(crdlc) → review+
Assignee | ||
Comment 4•10 years ago
|
||
Landed: https://github.com/mozilla-b2g/firefoxos-loop-client/commit/3f9f1d6767b65271ba1ce5ad4ade5c8dfd6cfb37
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•