Commit graph

191 commits

Author SHA1 Message Date
Juan Tejada 3343000f86 Update file uploads (see details):
- Add uploads field to Message and removes cache from FileUploadsStore
- Updates draft via session from DraftStore
  - This makes everything way cleaner
- This fixes bug when creating draft with uploads and the opening it in
  new window
- Updates specs
2016-01-28 00:33:22 -08:00
Juan Tejada ff3213f003 Rewrite tests for FileUploadStore 2016-01-27 12:33:27 -08:00
Ben Gotow 32ccaad1e7 More spec fixes 2016-01-27 10:31:54 -08:00
Ben Gotow 3b3b19a172 Spec fixes 2016-01-26 19:12:51 -08:00
Ben Gotow 820973cfa5 Fixes to the SendDraftTask 2016-01-26 16:41:49 -08:00
Ben Gotow bbe2f80320 A few other changes 2016-01-26 15:44:44 -08:00
Ben Gotow c8bd09a260 Begin cleanup of Send Task 2016-01-26 15:44:44 -08:00
Ben Gotow 0ef4911b22 Merge branch 'master' into unified-inbox
# Conflicts:
#	internal_packages/feedback/lib/feedback-button.cjsx
#	internal_packages/thread-list/lib/thread-list.cjsx
#	src/flux/stores/draft-store.coffee
2016-01-25 17:28:29 -08:00
Ben Gotow e4553ffb1e Fix drafts 2016-01-25 16:37:34 -08:00
Evan Morikawa 392753233e feat(send): Send and Archive
Summary: Send and Archive plus a new setting.

Test Plan: new tests

Reviewers: bengotow, juan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2446
2016-01-25 14:14:09 -08:00
Ben Gotow c6bf3eba01 Fix for selection update issue, delete items + scroll up issue 2016-01-25 13:44:05 -08:00
Juan Tejada 84bf7dded6 Fix NylasAPI specs and ContactStore specs 2016-01-25 12:12:16 -08:00
Ben Gotow c9e5b68f16 More database-related spec fixes 2016-01-25 11:35:23 -08:00
Ben Gotow 6a28cd8cda DatabaseTransaction / QueryBuilder spec fixes 2016-01-25 11:11:57 -08:00
Ben Gotow fcb75fbf1a CategoryPicker / PerspectiveStore spec fixes 2016-01-25 11:07:40 -08:00
Juan Tejada 01ad283754 Fix more task specs 2016-01-22 16:55:29 -08:00
Juan Tejada c5dc9544e1 Fix specs for destroy and syncback category tasks 2016-01-22 14:52:19 -08:00
Juan Tejada ad05cc05cc Fix MutliSelectSplitInteractionHandler specs 2016-01-22 13:47:54 -08:00
Ben Gotow d842428880 Rename formatResult, don't assume it's an array 2016-01-22 11:45:36 -08:00
Juan Tejada 6b144b867d Fix MultiSelectListInteractionHandlers specs 2016-01-21 17:07:57 -08:00
Juan Tejada f2acba48ee Add account switcher back to sidebar:
- 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
2016-01-19 23:42:50 -08:00
Ben Gotow 1e5b26a818 Unified inbox mailbox perspectives working (sidebar disabled atm) 2016-01-18 00:47:04 -08:00
Evan Morikawa 74e21bce16 feat(tasks): add Create, Update, Destroy tasks plus spec & lint fixes
Summary:
1. **Generic CUD Tasks**: There is now a generic `CreateModelTask`,
`UpdateModelTask`, and `DestroyModelTask`. These can either be used as-is
or trivially overridden to easily update simple objects. Hopefully all of
the boilerplate rollback, error handling, and undo logic won't have to be
re-duplicated on every task. There are also tests for these tasks. We use
them to perform mutating actions on `Metadata` objects.

1. **Failing on Promise Rejects**: Turns out that if a Promise rejected
due to an error or `Promise.reject` we were ignoring it and letting tests
pass. Now, tests will Fail if any unhandled promise rejects. This
uncovered a variety of errors throughout the test suite that had to be
fixed. The most significant one was during the `theme-manager` tests when
all packages (and their stores with async DB requests) was loaded. Long
after the `theme-manager` specs finished, those DB requests were
(somtimes) silently failing.

1. **Globally stub `DatabaseStore._query`**: All tests shouldn't actually
make queries on the database. Furthremore, the `inTransaction` block
doesn't resolve at all unless `_query` is stubbed. Instead of manually
remembering to do this in every test that touches the DB, it's now mocked
in `spec_helper`. This broke a handful of tests that needed to be manually
fixed.

1. **ESLint Fixes**: Some minor fixes to the linter config to prevent
yelling about minor ES6 things and ensuring we have the correct parser.

Test Plan: new tests

Reviewers: bengotow, juan, drew

Differential Revision: https://phab.nylas.com/D2419

Remove cloudState and N1-Send-Later
2016-01-15 15:16:21 -05:00
Ben Gotow 273679a861 DataView => ListDataSource 2016-01-14 12:26:54 -08:00
Ben Gotow 88b901d8a5 New QueryRange specs, fixes 2016-01-14 12:03:06 -08:00
Ben Gotow 9814d80d5a New MutableQueyResultSet specs, fixes 2016-01-14 11:25:52 -08:00
Ben Gotow cb5f2985ef Merge branch 'master' into unified-inbox
# Conflicts:
#	spec/stores/file-download-store-spec.coffee
2016-01-13 17:20:34 -08:00
Juan Tejada c5d4b10c7d Fix CategoryStore sorting:
- Also fix Category model specs
2016-01-13 14:20:44 -08:00
Ben Gotow 760c8769b3 fix(accounts): Spec fixes for a03e8f70 2016-01-12 15:16:59 -08:00
Ben Gotow 619c753cf3 fix(downloads): Escape all illegial path chars, don't make regex from path.sep 2016-01-12 13:52:01 -08:00
Ben Gotow 5c491d16af Merge branch 'master' into unified-inbox
# Conflicts:
#	internal_packages/events/lib/event-header.cjsx
#	spec/stores/file-download-store-spec.coffee
#	spec/tasks/event-rsvp-spec.coffee
#	src/flux/tasks/event-rsvp.coffee
2016-01-12 08:20:55 -08:00
Juan Tejada 7f2c8481ff Fix more specs:
- SearchBar
- EventRSVPTask
- ContactStore
2016-01-11 16:14:21 -08:00
Ben Gotow 10cb195226 Search bar fixes 2016-01-11 15:58:10 -08:00
Ben Gotow a8c563f09d Updated QuerySubscription specs 2016-01-11 15:24:46 -08:00
Ben Gotow 04c6be4dfe AccountStore no longer tracks index, Actions.selectAccount gone 2016-01-11 14:11:48 -08:00
Juan Tejada 53d26b38a8 Fix Contact and Thread specs 2016-01-11 13:58:22 -08:00
Ben Gotow e62ddf5d63 Fix ModelViewSelection specs 2016-01-11 13:47:39 -08:00
Juan Tejada e803b66a1a Wrap FileDownloadStore in describe block 2016-01-11 13:44:54 -08:00
Ben Gotow a4d33be4f2 More spec fixes 2016-01-11 13:40:42 -08:00
Juan Tejada 9847e58b7f Fix CategoryPicker specs
- Add NylasUtils.mockObservable helper
2016-01-11 13:23:59 -08:00
Ben Gotow 2c74b38323 fixes for draft store specs, contact.isMe now returns true if it matches any account 2016-01-11 13:23:35 -08:00
Ben Gotow 6a735da033 fix(rsvp): Check that you are a participant, support aliases. Fixes #962 2016-01-11 12:20:26 -08:00
Ben Gotow f3464c7db3 fix(downloads): Replace path.sep when saving files - Sentry 8749 2016-01-11 11:49:05 -08:00
Evan Morikawa 1de3a47077 feat(composer): can outdent blockquotes allowing you to reply inline
Summary:
You can now break up blockquotes (as in quoted text areas) by pressing
"delete" at the start of a line. This allows you to reply inline.

Test Plan: new tests

Reviewers: bengotow, juan

Reviewed By: bengotow, juan

Differential Revision: https://phab.nylas.com/D2421
2016-01-11 14:46:20 -05:00
Ben Gotow 55f1c537e2 fix(quoted-text): Fix + test case for Sentry 8323, body el is quoted text 2016-01-11 11:14:34 -08:00
Juan Tejada d265bf1248 fix(category-store): Fix issue with observables in CategoryStore
- Removes use of observables from category store and keeps a big cache
  of categories per account
- Upates Category Observables with new helper observables
- Updates CategoryPicker and AccountSidebarStore to use observables
- Misc fixes
2016-01-08 18:03:18 -08:00
Ben Gotow 2ddafe7154 Rename MailViewFilter => MailboxPerspective 2016-01-08 14:58:31 -08:00
Ben Gotow f026974bae Merging in new observables for thread list
commit 7a67c1fd349c575a91b162024cc03050e86574c9
Author: Ben Gotow <bengotow@gmail.com>
Date:   Fri Jan 8 11:14:07 2016 -0800

    WIP

commit 891f23487827a447ec95406ef26f1473a0c07de6
Author: Ben Gotow <bengotow@gmail.com>
Date:   Wed Jan 6 15:25:09 2016 -0800

    WIP

commit 3c323cd4beb2df2fae2439a556d3129404d942cc
Author: Ben Gotow <bengotow@gmail.com>
Date:   Mon Jan 4 17:46:11 2016 -0800

    WIP

commit ec7090ea9e1969fea2ea583f80a9a2ac41e6c8b0
Author: Ben Gotow <bengotow@gmail.com>
Date:   Mon Jan 4 17:22:07 2016 -0800

    Remove unused LRUCache

commit e10c3919559d3c364cb7bb94d19094a2444c10f3
Author: Ben Gotow <bengotow@gmail.com>
Date:   Mon Jan 4 16:21:37 2016 -0800

    rm(database-view): Performance refactor of thread-list

    Summary:
    This diff removes the old DatabaseView class, which included lots of gross optimizations that have since been duplicated in QuerySubscription and makes the thread list use the QuerySubscription class.

    This diff also substantially replaces the QuerySubscription class. The new implementation actually makes more queries but is less gross and more straightforward. It leverages a couple findings from database profiling:

    - Because of the sqlite page cache, asking for ids you've previously asked for is very fast.
        + Don't bother sorting in memory to avoid a query, just ask for ids again and fill in any missing objects.
    - Loading and inflating models is 4x+ slower than just grabbing ids

    I've also added more convenience classes around database queries:
    - QueryRange: Represents {offset, limit}, and can do boolean intersections
    - QueryResultSet: Better than passing an array of 50 items when you really mean items 150-200. Also tries hard to be immutable.

    This diff doesn't fully remove the concept of a "ModelView" because it's used /everywhere/ in the multiselect list source. There's a small shim that we can remove when we refactor that code. Ideally, I think we should rename ModelView to "MultiselectListDataSource" to follow iOS conventions (eg UITableViewDataSource). RIP 80char lines?

    Test Plan: They've gone to hell. WIP.

    Reviewers: evan, juan

    Differential Revision: https://phab.nylas.com/D2408

commit 32607eee8aafb7fa98b866347bdd2c0b963a602c
Author: Ben Gotow <bengotow@gmail.com>
Date:   Mon Jan 4 09:56:34 2016 -0800

    WIP

commit 5ab5fe74e94db6904bd77d224720ad9fc69fe6a7
Author: Ben Gotow <bengotow@gmail.com>
Date:   Wed Dec 30 22:56:46 2015 -0800

    redo scrollbars to not require counts

commit 361bb192d072dc8a69fd3ef143cad7bed214ebdc
Author: Ben Gotow <bengotow@gmail.com>
Date:   Wed Dec 30 17:50:57 2015 -0800

    wip

commit 079394de1cc3344fb6568efe00a52d7fc97fbd27
Author: Ben Gotow <bengotow@gmail.com>
Date:   Wed Dec 30 13:49:11 2015 -0800

    wip

commit 65142be03c27c653fe1147fdde6c2f9b046ade22
Author: Ben Gotow <bengotow@gmail.com>
Date:   Wed Dec 30 01:23:20 2015 -0800

    wip

commit 5d412ec276be1104175ad0f43c9d54e1cea857bf
Author: Ben Gotow <bengotow@gmail.com>
Date:   Tue Dec 29 22:49:58 2015 -0800

    Refactor start

commit d2b6eea884fcd2bd81ebe3985f2b2636a510c493
Author: Ben Gotow <bengotow@gmail.com>
Date:   Tue Dec 29 18:51:53 2015 -0800

    RIP DatabaseView
2016-01-08 14:31:33 -08:00
Juan Tejada 9f998d1964 refactor(rip-current-account): Rips out AccountStore.current
Summary:
- WIP: Need to fix tests and some errors!
- Refactors Category class to hold information about its type
- Refactors CategoryStore to rely on observables instead of local caches
- Adds and updates Observables and helpers
- Refactors ContactStore to hold entire cache of contacts instead of per
  current account
  - Same for ContactRankingStore and other stores
- Refactors method names for AccountStore + some helpers
- Updates MailViewFilter to hold an account
  - Adds basic Unified filter
- Replaces AccountStore.current calls with either:
  - The account of the currently focused MailViewFilter
  - The account associated with a thread, message, file, etc...
  - A parameter to be passed in
  - Arbitrarily, the first account in the AccountsStore

Test Plan: - Unit tests

Reviewers: evan, bengotow

Differential Revision: https://phab.nylas.com/D2423
2016-01-08 14:22:13 -08:00
Evan Morikawa e5efa80216 test(draft): new tests for promise chain in send draft 2016-01-08 10:57:48 -08:00