Summary:
This diff centralizes logic for creating common tasks for things like moving to trash, archive, etc. TaskFactory exposes a set of convenience methods and hides the whole "and also remove the current label" business from the user.
This diff also formally separates the concept of "moving to trash" and "archiving" so that "remove" isn't used in an unclear way.
I also refactored where selection is managed. Previously you'd fire some action like archiveSelection and it'd clear the selection, but if you selected some items and used another method to archive a few, they were still selected. The selection is now bound to the ModelView as intended, so if items are removed from the modelView, they are removed from it's attached selection. This means that it shouldn't /technically/ be possible to have selected items which are not in view.
I haven't refactored the tests yet. They are likely broken...
Fix next/prev logic
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D2157
Summary:
write tests for adding/removing existing labels and popover closing
add more tests
address code review comments
fix the tests
add test for creating label
add test for creating label and queueing change label task
add test for creating a folder
add syncback category task spec
make the rest of the tests pass
remove unnecessary parens
add a few more tests
add last test
Test Plan: added some tests. all tests green
Reviewers: bengotow, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D2010
Summary:
This diff fixes T3389 and makes it possible to define mail views which are not based on a category and focus them in the app.
I think that we need to create a new index on the starred attribute to make sure the query runs fast.
More tests WIP
Test Plan: Run tests, more coming soon!
Reviewers: dillon, evan
Reviewed By: evan
Maniphest Tasks: T3389
Differential Revision: https://phab.nylas.com/D1979
Summary:
This diff replaces the Namespace object with the Account object, and changes all references to namespace_id => account_id, etc. The endpoints are now `/threads` instead of `/n/<id>/threads`.
This diff also adds preliminary support for multiple accounts. When you log in, we now log you in to all the attached accounts on edgehill server. From the preferences panel, you can auth with / unlink additional accounts. Shockingly, this all seems to pretty much work.
When replying to a thread, you cannot switch from addresses. However, when creating a new message in a popout composer, you can change the from address and the SaveDraftTask will delete/re-root the draft on the new account.
Search bar doesn't need to do full refresh on clear if it never committed
Allow drafts to be switched to a different account when not in reply to an existing thread
Fix edge case where ChangeMailTask throws exception if no models are modified during performLocal
Show many dots for many accounts in long polling status bar
add/remove accounts from prefs
Spec fixes!
Test Plan: Run tests, none broken!
Reviewers: evan, dillon
Reviewed By: evan, dillon
Differential Revision: https://phab.nylas.com/D1928
Summary:
Consolidate the smarts from ChangeFolderTask into a generic ChangeMailTask
ChangeMailTask:
- only makes requests for threads / messages that actually changed
- handles incrementing / decrementing locks
- writes changes to the database in a single pass, and only writes modified models
- encapsulates the undo state that was built into ChangeFolderTask
This change means that ChangeLabelsTask enjoys the same "smarts" as ChangeFolderTask. Label changes resulting in no-ops do not create web requests, you can undo label changes and they go back to the correct previous state.
Replace "UpdateThreadsTask" and "UpdateNylasObjectsTask" with subclasses based on the same code used for folder/labels
This means that the naming and parameter sets are consistent for all thread/message changing tasks. It also means that starring/marking as use the same (tested) business logic and starring 999 already-starred threads doesn't create 999 requests.
Go away DraftCountStore - nobody wants you in secondary windows
Add "Debug query plans" option which prints out the steps the database is taking. Look for "SCAN" to now you're having a bad time.
Make "version" field queryable, when we receive deltas/API response, find all versions of existing models in a single query without loading or parsing the objects
Contact: Add index for lookup by email
Label: add index for lookup by name
Message: Add index for message body join table
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1840
Summary:
fix(undo-redo): UndoRedoComponent does not take props
fix(category-picker):
- Use Actions.queueTask like the rest of the app so UndoRedoStore can see it. Can change this in the future but it's currently the only place in the app we directly queue tasks.
- Stop subscribing to the FocusedContentStore / FocusedCategoryStore (which are not used in setState?) since we receive threads as props
- Rename categoryDatum to item because it's not a category. (Was super confused that categories were becoming JSON in `_extendCategoryWithDisplayData`) Give item a category property so that tasks can specify items and not IDs (allows for better descriptions like "Moved one thread to Archive"
Add simple shouldComponentUpdate to retina-img
Test Plan: Run tests
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D1832
Summary:
The new, styled folder and label picker!
Some highlights:
- Folder picker has custom icons and a divider
- Label picker has checkboxes with off, checked, and intermediate state
- Extracted LabelColorizer out of mail-label
- Search will bold the results it found
- Fixes to Tooltip to prevent it displaying at invalid moments
- Keyboard UX improvements to Menu
Test Plan: coming soon
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D1790
Summary:
This is the initial diff for the label picker UI. This is all of the
functionality and none of the CSS.
Test Plan: todo
Reviewers: bengotow
Reviewed By: bengotow
Subscribers: sdw
Differential Revision: https://phab.nylas.com/D1761