Commit graph

1031 commits

Author SHA1 Message Date
Ben Gotow 09a2096690 fix(linter): Switching between Coffee + ES6 is hard... 2016-01-28 14:59:17 -08:00
Ben Gotow 3869b9c214 fix(contact-search): Keep only ranked contacts, query for others. Massive perf boost. 2016-01-28 14:56:15 -08:00
Juan Tejada 89f431edec add(specs): Add specs for MailboxPerspective
- Renames canApplyToThreads -> canReceiveThreads and applyToThreads ->
  receiveThreads
- Add initial specs and better documentation for
  MailboxPerspective.canReceiveThreads.
2016-01-28 14:11:50 -08:00
Juan Tejada 8237e3742c fix(perspective): Update MailboxPerspective.canApplyToThreads
- 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
2016-01-28 13:30:08 -08:00
Evan Morikawa 55aedef697 feat(startup): new option to launch on system start
Summary:
adds new option to launch on system start

Also adds the `--background` flag to launch N1 in the background (aka not
show the main window).

Test Plan: Manual

Reviewers: bengotow, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2474
2016-01-28 12:02:08 -08:00
Juan Tejada 2dedd20eb8 fix(count): Fix unread count for badge and tray icon in mac 2016-01-28 11:10:05 -08:00
Ben Gotow da68b393a2 fix(message-list): Only display labels when usesLabels() 2016-01-28 10:46:33 -08:00
Ben Gotow 4edbe7652c Remove indexes which used accountId as the first param... not faster 2016-01-28 10:03:32 -08:00
Juan Tejada 1e6b857437 Prevent creation of context menu twice for nested items of OutlineView 2016-01-28 01:35:29 -08:00
Juan Tejada b9cfb18244 Fix in upload store when deleting draft 2016-01-28 01:29:33 -08:00
Juan Tejada 19edb34599 Increment max width for sidebar 2016-01-28 01:29:18 -08:00
Juan Tejada 9a86ce06ed 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 8bd387e8b2 Update OutlineViewItem to focus end of input when editing 2016-01-28 00:02:55 -08:00
Juan Tejada aa4de82625 Add folder/label renames
- 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
2016-01-27 23:16:17 -08:00
Juan Tejada 1d8f56e7f8 Misc fixes for FileUploadStore 2016-01-27 15:38:01 -08:00
Juan Tejada 7b6267e0b2 Rewrite tests for FileUploadStore 2016-01-27 12:33:27 -08:00
Ben Gotow 7f59ff5494 Fix problem with * a shortcut 2016-01-27 11:55:19 -08:00
Ben Gotow 53390fbd5c Basic fixes for drag and drop 2016-01-27 11:45:02 -08:00
Ben Gotow 1fb57d2cda Fix exception "Cannot read property 'replaceModel' of null" 2016-01-27 11:13:58 -08:00
Ben Gotow ddb31f6bf3 Optimize QueryResultSet so offset lookups are O[1] after initial scan 2016-01-27 11:13:39 -08:00
Ben Gotow f4ca355bf4 Spec fixes 2016-01-26 19:12:51 -08:00
Juan Tejada 63d36a78c3 Inits FileUploadStore from current state in the filesystem
- Removes uploads when draft is deleted
- Misc fixes and renaming
2016-01-26 18:48:58 -08:00
Ben Gotow 752a749da7 More sending fixes - attachments working! 2016-01-26 18:03:01 -08:00
Ben Gotow b97e0664db More fixes to send draft task 2016-01-26 17:33:09 -08:00
Juan Tejada e615eece3a Fix progress var instantiation in send-draft task 2016-01-26 17:21:52 -08:00
Juan Tejada 7c71576192 Misc fixes for FileUploadStore 2016-01-26 16:58:20 -08:00
Ben Gotow a05f6c449c Fixes to the SendDraftTask 2016-01-26 16:41:49 -08:00
Ben Gotow ddbd36fe2e A few other changes 2016-01-26 15:44:44 -08:00
Ben Gotow 2783045c3e Begin cleanup of Send Task 2016-01-26 15:44:44 -08:00
Juan Tejada 7f37e8f56b Fix in FileUploadsStore 2016-01-26 15:44:27 -08:00
Juan Tejada dcb08932c0 Refactor FileUploadStore and composer attachments - WIP 2016-01-26 15:36:38 -08:00
Ben Gotow 889264d777 Fix the message that appears when upgrading the mailbox 2016-01-26 14:49:05 -08:00
Ben Gotow 3bcbec4118 Fix for bad @props 2016-01-25 19:07:28 -08:00
Juan Tejada 324123731a Add ability to select account to send from
- Adds settings option to select default account to send from
2016-01-25 18:20:54 -08:00
Ben Gotow e2234bf58e 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 68d55fb662 Clean up action bars, random exceptions 2016-01-25 17:08:38 -08:00
Ben Gotow 22121f9f18 Fix drafts 2016-01-25 16:37:34 -08:00
Evan Morikawa c33dff65f1 fix(composer): disable plugins during composition events 2016-01-25 14:54:54 -08:00
Juan Tejada 0fd94c1e1e Fix FocusedAccountStore: remove unnecessary accountstore listener 2016-01-25 14:43:50 -08:00
Evan Morikawa ecbadaf01e 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 4643fdad25 Fix for selection update issue, delete items + scroll up issue 2016-01-25 13:44:05 -08:00
Juan Tejada 1f68a574d3 Fix NylasAPI specs and ContactStore specs 2016-01-25 12:12:16 -08:00
Ben Gotow 18b9a1a9a0 More spec fixes 2016-01-25 11:42:39 -08:00
Ben Gotow 2bb9ce3591 More database-related spec fixes 2016-01-25 11:35:23 -08:00
Juan Tejada ac34f4410b add(exports): Add Rx to nylas-exports 2016-01-25 10:40:41 -08:00
Juan Tejada 84ef0e97bf Fix more task specs 2016-01-22 16:55:29 -08:00
Evan Morikawa cc0d636381 fix(link): auto populate urls. Fix links across nodes
Fixes #1116
Also fixes an issue where links wouldn't create properly across multiple
nodes

This was due to a bug in the `select` method. We use the DOM Range API to
more robustly select a node.
2016-01-22 16:30:28 -08:00
Juan Tejada 877dd6ebde Fix specs for destroy and syncback category tasks 2016-01-22 14:52:19 -08:00
Ben Gotow 50eac609fb Rename formatResult, don't assume it's an array 2016-01-22 11:45:36 -08:00
Evan Morikawa ede5d49280 fix(composer): list creation edge case fixes and tests
Fixes #1064
2016-01-22 10:36:15 -08:00
Jackie Luo d4f9c5d43c Merge branch 'master' of github.com:nylas/N1 2016-01-21 18:03:30 -08:00
Jackie Luo 4aab47ec98 Add Reflux 2016-01-21 18:03:18 -08:00
Ben Gotow 1af9a05075 ContactStore always searches all contacts 2016-01-21 16:00:18 -08:00
Ben Gotow c2ebc4cb32 _version was conflicting with superclass property 2016-01-21 16:00:18 -08:00
Juan Tejada 2380e1eefa Update sidebar to hold state for selected account
- Ensures that it displays the correct set of sidebar items even when
  the perspective changes
- Also sets up hotkeys to switch currently focused accounts
2016-01-21 14:13:48 -08:00
Ben Gotow 8f7f63af3a TaskFactory now returns N tasks for performing standard actions, undo uses arrays 2016-01-21 13:46:04 -08:00
Ben Gotow 42f8d29a89 Merge pull request #988 from mbilker/allow-custom-sync-engines
Allow custom Sync Engine specified in `config.cson`
2016-01-21 10:31:05 -08:00
Evan Morikawa 88ccbf97d3 fix(link): allow links with no closest method to open 2016-01-21 10:15:22 -08:00
mbilker a424fd52d1 fix(nylas-api): namespace the custom sync engine to syncEngine 2016-01-21 00:16:43 -05:00
Evan Morikawa ecea0feb5f fix(console): rm console trace 2016-01-20 21:09:50 -08:00
Evan Morikawa 3195ba5d51 fix(link): fix link focus and UX issues
Fix FloatingToolbar position

Fix link-editor to refresh on new props

Fix link content changed

Fix link width
2016-01-20 20:56:56 -08:00
Ben Gotow a3b1f77d45 Disable SELECT DISTINCT unless we know we need it 2016-01-20 17:40:18 -08:00
Ben Gotow ffb5e0dfda Optimize offsetOfId, shouldn't throw if models contains undefined 2016-01-20 17:27:06 -08:00
Ben Gotow ba606fff21 fix(newsletter): Don't make API request if email is the same 2016-01-20 17:09:15 -08:00
Ben Gotow 2ce24bd4af fix(onboarding): Loosen RegExp so a.com and a.b.c.d.com are valid 2016-01-20 17:09:15 -08:00
Juan Tejada 6c559ddb7e Add collapse capabilities to OutlineView
- Make user category sections collapsible when in unified view
- Get rid of dumb CategoryHelpers class
2016-01-20 17:09:05 -08:00
Drew Regitsky 2d51f92f17 feat(plugin-auth): add plugin auth function in NylasAPI
Summary:
Adds two new functions in NylasAPI to allow auth and unauth of
plugin backends. The `authPlugin` function should be called within
plugins before taking any action that requires offline account access
from the plugin's backend server. The `unauthPlugin` function will be
used by N1 internally to revoke offline account access for plugins.

Test Plan: manual for now

Reviewers: bengotow, evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D2440
2016-01-20 16:43:11 -08:00
Evan Morikawa c7a685630d refactor(toolbar): allow toolbar extensions in contenteditable
Summary:
This is a refactor of the toolbar in the contenteditable. Goals of this
are:

1. Allow developers to add new buttons to the toolbar
2. Allow developers to add other component types to the floating toolbar (like the LinkEditor)
3. Make the toolbar declaratively defined instead of imperatively set
4. Separate out logical units of the toolbar into individual sections
5. Clean up `innerState` of the Contenteditable

The Floating Toolbar used to be an imperative mess. Doing simple
functionality additions required re-understanding a very complex set of
logic to hide and show the toolbar and delecately manage focus states.
There also was no real capacity for any developer to extend the toolbar.

It also used to be completely outside of our `atomicEdit` system and was a
legacy of having raw access to contenteditable controls (since it all used
to be directly inside of the contenteditable)

Finally it was difficult to declaratively define things because the
`innerState` of the Contenteditable was inconsistently used and its
lifecycle not properly thought through. This fixed several lifecycle bugs
with that.

Along the way several of the DOMUtils methods were also subtly not
functional and fixed.

The Toolbar is now broken apart into separate logical units.

There are now `ContentedtiableExtension`s that declare what should be
displayed in the toolbar at any given moment.

They define a method called `toolbarComponentData`. This is a pure
function of the state of the `Contenteditable`. If selection and content
conditions look correct, then that method will return a component to
render. This is how we declaratively define whether a toolbar should be
visible or not instead of manually setting `hide` & `show` bits.

There is also a `toolbarButtons` method that declaratively defines buttons
that can go in the new `<ToolbarButtons>` component.

The `ToolbarButtonManager` takes care of extracting these and binding the
correct editorAPI context.

Now the `<LinkEditor>` is a separate component from the `<ToolbarButtons>`
instead of being smashed together.

The `LinkManager` takes care of declaring when the `LinkEditor` should be
displayed and has properly bound methods to update the `contenteditable`
through the standard `atomicEdit` interface.

If users have additional contenteditable popup plugins (like displaying
extra info on a name or some content in the composer), they can now
implement the `toolbarComponentData` api and declaratively define that
information based on the state of the contenteditable.

Test Plan: TODO

Reviewers: bengotow, juan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2442
2016-01-20 14:35:20 -08:00
Juan Tejada 5dd334bffc Fix Category require 2016-01-20 13:14:34 -08:00
Ben Gotow 45403131f1 rm(intercom): Point feedback to support.nylas, shrink button 2016-01-20 11:26:14 -08:00
Juan Tejada b538ec050c 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 f73a732666 Don't wait for all requests to succeed before displaying results 2016-01-19 00:00:08 -08:00
Ben Gotow 50e03946dd Show the important icon whenever any account in the perspective supports it 2016-01-19 00:00:08 -08:00
Juan Tejada 866805f835 More account sidebar refactor + sections for 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
2016-01-18 23:22:46 -08:00
Ben Gotow 864f808823 Update SearchSubscription to support basic multiaccount search... seems to work? 2016-01-18 22:37:49 -08:00
Juan Tejada e1084708b8 Minor fixes and style updates 2016-01-18 11:48:34 -08:00
Ben Gotow ec7aa08f10 Fix for broken thread serialization. We now coerce folders/labels => categories and never go back. 2016-01-18 01:47:09 -08:00
Ben Gotow 00ff8269da Make a few changes to AccountSidebar - needs to use accountIds? 2016-01-18 01:31:54 -08:00
Ben Gotow 99854add72 Remove current()? references, use Perspectiv.forNothing instead 2016-01-18 01:31:35 -08:00
Ben Gotow f1b4a23897 Merge branch 'unified-inbox-bg' into unified-inbox
# Conflicts:
#	internal_packages/account-sidebar/lib/account-sidebar-store.coffee
#	internal_packages/account-sidebar/lib/main.coffee
#	internal_packages/category-picker/lib/category-picker.cjsx
#	spec/stores/focused-perspective-store-spec.coffee
#	src/flux/stores/focused-perspective-store.coffee
#	src/mailbox-perspective.coffee
2016-01-18 00:53:03 -08:00
Ben Gotow 96f429ff39 Unified inbox mailbox perspectives working (sidebar disabled atm) 2016-01-18 00:47:04 -08:00
Juan Tejada ebb9c9735f AccountSidebar package refactor:
- 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.
2016-01-15 16:55:21 -08:00
Ben Gotow 31f808ef35 WIP 2016-01-15 15:39:32 -08:00
Ben Gotow 774562dbc1 Clean up the MultiselectList implementation a bit 2016-01-15 14:26:07 -08:00
Evan Morikawa 6695de4187 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
Karim Hamidou da54fa7e29 [N1] Validate input in the signup dialog
Summary:
This diff bundles a number of small usability fixes to the "Create account" window. It notably:
- forces users to enter required fields before moving on to the next step
- validates email addresses and domain names

Test Plan: Tested manually by going through all the possible auth flows.

Reviewers: evan, juan, bengotow

Reviewed By: bengotow

Subscribers: bengotow

Projects: #edgehill

Differential Revision: https://phab.nylas.com/D2377
2016-01-15 11:27:14 -08:00
Ben Gotow 8957c560f5 More renaming of view => data source 2016-01-14 15:04:17 -08:00
Ben Gotow d78e61839d Some basic thread list cleanup 2016-01-14 14:04:51 -08:00
Ben Gotow ff01c3a502 DataView => ListDataSource 2016-01-14 12:26:54 -08:00
Ben Gotow c52e4bcd19 New QueryRange specs, fixes 2016-01-14 12:03:06 -08:00
Ben Gotow dc3c07014f New MutableQueyResultSet specs, fixes 2016-01-14 11:25:52 -08:00
Ben Gotow 3a8a38b8bc Merge branch 'master' into unified-inbox
# Conflicts:
#	spec/stores/file-download-store-spec.coffee
2016-01-13 17:20:34 -08:00
Juan Tejada 6590848f35 Fix CategoryStore sorting:
- Also fix Category model specs
2016-01-13 14:20:44 -08:00
Ben Gotow 70c3c18ca5 fix(newsletter): Checkbox refreshes properly when switching accounts 2016-01-13 11:45:48 -08:00
mbilker c6a4d8f130 fix(nylas-api): allow custom Sync Engine specified in config.cson 2016-01-13 10:46:54 -05:00
Ben Gotow d78db0169c fix(contenteditable): exportedSelection isn't always an inst of ExportedSelection
This is a temporary fix that makes this function more robust to @innerState.exportedSelection not being an ExportedSelection instance.
2016-01-12 19:09:57 -08:00
Ben Gotow 5ad35cf4d0 fix(unread): Mark as read twice without visiting another unread thread 2016-01-12 17:14:17 -08:00
Evan Morikawa 2f5a4f93bf fix(squirrel): remove apm from path 2016-01-12 18:36:44 -05:00
Evan Morikawa 9726618069 fix(squirrel): fix win32 update to enable restart and launch from path 2016-01-12 18:17:30 -05:00
Juan Tejada c10d22f163 fix(fullscreen): Restore fullscreen if app was closed in fullscreen
Fixes #671
2016-01-12 15:12:43 -08:00