Summary:
- Separate gmail's remove-from-view and delete behaviors and write logic
for each of those
- Remove MailboxPerspective::{canArchiveThreads, canTrashThreads,
removeThreads} and some unecessary code in TaskFactory
- Instead, add MailboxPerspective::tasksForRemovingFromPerspective (I
know its a bit of a mouthful)
- I initially tried to put all of the logic for each execution path
inside the TaskFactory by checking perspective types, but it made
more sense to use the polymorphism already in place for the different
perspective types.
- There is a default delete/remove-from-view behavior which is
configurable via simple ruleset objects. The gmail behavior is
configured in this way.
- Update swipe css classes based on destination of threads
- Fixes#1460:
- Update logic to display archive/trash buttons and context menu options correctly
when selected threads can be archived/trashed (not based on
perspective)
- Same for swiping
- Add a bunch of specs
- Convert some code to ES6
- TODO write some docs for new functions
Test Plan: Unit tests
Reviewers: drew, evan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2682
Summary:
- Update menus and shortcuts correclt when accounts change or focused
accounts change
- Move menu logic into SidebarCommands to remove duplicated logic
- Make `Window` menu also contain checkboxes
Test Plan: - Manual
Reviewers: evan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2534
Summary:
- Removes account switcher almost entirely
- Update context menu to edit and delete sidebar items
- Gross hardcoded position and size for the switcher icon -- will likely update with later redesign
Test Plan: - Visual
Reviewers: evan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2527
Summary:
This diff adds an "OutboxStore" which reflects the TaskQueue and
adds a progress bar / cancel button to drafts which are currently sending.
- Sending state is different from things like Send later because drafts
which are sending shouldn't be editable. You should have to stop them
from sending before editing. I think we can implement "Send Later"
indicators, etc. with a simple InjectedComponentSet on the draft list
rows, but the OutboxStore is woven into the DraftList query subscription
so every draft has a `uploadTaskId`.
- The TaskQueue now saves periodically (every one second) when there are
"Processing" tasks. This is not really necessary, but makes it super
easy for tasks to expose "progress", because they're essentially
serialized and propagated to all windows every one second with the
current progress value. Kind of questionable, but super convenient.
- I also cleaned up ListTabular and MultiselectList a bit because they
applied the className prop to an inner element and not the top one.
- If a DestroyDraft task is created for a draft without a server id, it
ends with Task.Status.Continue and not Failed.
- The SendDraftTask doesn't delete uploads until the send actually goes
through, in case the app crashes and it forgets the file IDs it created.
Test Plan: Tests coming soon
Reviewers: juan, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D2524
- Checks if the account ids of the threads that want to be applied are
contained inside the perspectives account ids. E.g.:
- I can move thread from account A to unified inbox or inbox A, but
not to inbox B.
- I can move threads from account A to a folder in account A but not a
folder in account B
- Update data transferred in drag + other minor updates
- Updates OutlineView to reuse OutlineViewItem for creating new items
- Adds ability to edit outline view items via double click or right
click
- Cleans up css and code and sidebar item
- Updates SyncbackCategoryTask to update categories as well
- Adds 405 to permanent api error codes
- Ensures that it displays the correct set of sidebar items even when
the perspective changes
- Also sets up hotkeys to switch currently focused accounts
- Account switcher can now switch between all accounts and each account
- Updates FocusedPerspectiveStore and Actions.focusDefaultMailboxPerspectiveForAccounts
to focus a perspective for accountIds instead of for a single account,
and updates methods
- Adds helpers to CategoryStore and MailboxPerspective
- Updates key commands to allow switch to unified inbox
- Refactors some of the old code which was 💩
- Makes SidbarSection a factory for different types of items for the
OutlineView
- Decided not to create a OutlineViewItem.Model class since the only
purpose it would serve would be to validate getters for props or for
documentation, both of which are already done via React.PropTypes.
- Adds sections when looking at unified inbox and integrates with new
mailbox perspecitve interface
- Updates OutlineViewItem a bit + styles
- Tests missing
- Creates OutlineView generic component and uses that instead of custom
code
- Refactors AccountSidebarStore:
- Split the generation of the state tree into smaller functions
- Adds different types of account sidebar items and sections, which contain
logic and props necessary to be rendered as OutlineViewItems, and
removes that logic from the store
- Removes WorkspaceStore.SidebarItem and removes the ability to register
new sidebar items. If people want to add something to the sidebar they
can just register a Component via the component registry and use the
OutlineView component
- Removes the DraftListSidebarItem, which was basically duplicated code
for an item but with a different data source. This is now handled
generically by the account sidebar by rendering OutlineViewItems with
different props and handlers
- Clean ups here and there:
- TODO
- Add AccountSwitcher
- Revisit calculation and generation of the state tree. Should the
parent store contain and update the entire state all the time.
Should separate items inside the tree have their own data sources?
- This would avoid having the AccountSidebarStore listen to a bunch of
different other stores, and the specific logic wold be contained
inside each item type.
- Switches to using CategoryStore to reduce complexity
- Update CategoryStore.categories to retun all categories when account
is null
- Inits AccountSidebarStore._account based on the currently focused
MailboxPerspective