Commit graph

1270 commits

Author SHA1 Message Date
Juan Tejada c4749f592e fix(sidebar): Display correct keyboard shortcuts in account switcher
- Fixes #1203
2016-02-05 09:55:27 -08:00
Ben Gotow 44150fc529 perf(outbox): Only trigger when send draft tasks are present 2016-02-04 20:15:15 -08:00
Juan Tejada 682bae5e08 fix(styles): Fix less lint error 2016-02-04 18:19:26 -08:00
Juan Tejada 182f6abb25 update(sidebar): Update sidebar design + context menus
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
2016-02-04 14:58:47 -08:00
Ben Gotow 8b3f7f0578 feat(outbox): Sending status now appears beside drafts
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
2016-02-04 14:14:24 -08:00
Dakota Nelson 40cb19d122 Disallow Gmail accounts from entering IMAP flow
Summary:
The error message from D2515 is being upgraded to also disable the
continue button so that a user is unable to sync an @gmail.com account
using the IMAP flow.

Test Plan: Tested locally.

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2516
2016-02-04 09:54:01 -08:00
Bernd Verst f162353ce4 Removes the MessageListNotificationBar editable component in favor of the existing MessageListHeaders
Summary: Removes the MessageListNotificationBar editable component in favor of the existing MessageListHeaders

Test Plan: Manually built N1 and verified the MessageListNotificationBar no longer appears as editable component.

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2523
2016-02-03 18:11:23 -08:00
Jackie Luo dec0e95dc2 fix(composer-emojis): Fix bugs around null nodes and whitespace
Summary: Corrected the linting errors and changed some of the logic around tracking typed text and triggering properly.

Test Plan: Tested locally.

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2522
2016-02-03 18:10:56 -08:00
Ben Gotow 8f7795b40f fix(send-action): Make dropdown trigger secondary send actions
We can come up with a new UX for this later, but for now this is important for consistency with the Reply/Reply-All/Forward picker and others in the app that perform actions rather than changing selection. Also makes it possible to choose to "Send and Archive" /without/ making it the future default, which will be nice when there are many you may want infrequently.
2016-02-03 16:27:11 -08:00
Ben Gotow a3cd23b41c 💄(emoji): Add an icon / description to emoji package 2016-02-03 15:43:22 -08:00
Dakota Nelson 041fc24927 Warn when entering Gmail address in imap settings
Summary:
Users have been configuring their Gmail accounts using the IMAP
authentication method, which causes problems. Attempting to do so will
now create an error message.

Test Plan: Tested locally.

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: mg, emfree

Maniphest Tasks: T6621

Differential Revision: https://phab.nylas.com/D2515
2016-02-03 15:14:02 -08:00
Evan Morikawa d4db0737cf feat(error): improve error reporting. Now NylasEnv.reportError
Summary:
The goal is to let us see what plugins are throwing errors on Sentry.

We are using a Sentry `tag` to identify and group plugins and their
errors.

Along the way, I cleaned up the error catching and reporting system. There
was a lot of duplicate error logic (that wasn't always right) and some
legacy Atom error handling.

Now, if you catch an error that we should report (like when handling
extensions), call `NylasEnv.reportError`. This used to be called
`emitError` but I changed it to `reportError` to be consistent with the
ErrorReporter and be a bit more indicative of what it does.

In the production version, the `ErrorLogger` will forward the request to
the `nylas-private-error-reporter` which will report to Sentry.

The `reportError` function also now inspects the stack to determine which
plugin(s) it came from. These are passed along to Sentry.

I also cleaned up the `console.log` and `console.error` code. We were
logging errors multiple times making the console confusing to read. Worse
is that we were logging the `error` object, which would print not the
stack of the actual error, but rather the stack of where the console.error
was logged from. Printing `error.stack` instead shows much more accurate
stack traces.

See changes in the Edgehill repo here: 8c4a86eb7e

Test Plan: Manual

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2509
2016-02-03 18:06:52 -05:00
Jackie Luo 5c6b4adf9a feat(composer-emojis): Add emojis to composer
Summary:
Emojis can now be added in the composer window with colons and the emoji names (referenced by the same names used on Slack/GitHub/etc.).

When using the correct syntax, if there are emojis that match the text typed, they appear in a dropdown floating toolbar.

Selection works with either mouse clicks or arrow keys (plus `Enter`).

Currently, the toolbar won't trigger if the colon is adjacent to a non-whitespace character.

Test Plan: TODO: Will write tests soon!

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2505
2016-02-03 15:05:36 -08:00
Bernd Verst 90b1a109b0 Use vertical layout for MessageListHeaders, MessageListNotificationBar, Draft:Footer
Test Plan: No new tests. Visual verification.

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2514
2016-02-03 14:51:46 -08:00
Juan Tejada 97e9637068 fix(message): Limit number of collapsed recipients in message
Summary:
- `from` participants now have their own line
- `to` participants in collapsed mode merge `to`, `cc`, `bcc` as in
  gmail, and start in separate line from `from`
- number of `to` participants in collapsed mode is limited, and also overflows
  with an ellipsis with css in case its too long
- /some/ cleanup
- Unsuccessfully tried to update the css for the message item header to convert to a flexbox. Wrapping the `from` address when the text is too long is still a TODO
- Fixes #1113

Test Plan: - Manual

Reviewers: bengotow, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2507
2016-02-03 11:24:29 -08:00
Ben Gotow b481f15492 lint(tray): Fix "new Number" not allowed 2016-02-03 09:20:40 -08:00
Evan Morikawa 5561462568 feat(metadata): add cloudState that sync with Metadata service
Summary:
Now all plugins get passed a `cloudState` object to their `activate`
method.

The `cloudState` object is an instance of `CloudState` and acts like a
key-value store backed by the yet-to-be-implemented Metadata service.

It has a `get`, `getAll`, and `observe` method. The `observe` method
returns a new `Rx.Observable` for the given key.

It has a `set`, and `unset` method that doesn't actually mutate state, but
rather dispatches new `Task`s to Create, Update, and Delete `Metadata`
objects.

The whole object is backed by `Metadata` objects. Since these are standard
Database Objects that will appear on the delta sync streaming API, any
updates from the server will automatically propagate down to listening
views via the `Rx.Observable`s.

Additionally, there is a new `N1-Send-Later` stub plugin that demonstrates
how to use the `cloudState`.

There are few other minor refactors included in this diff:

**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.

**New `boundProps` for `InjectedComponents`**: When making the
`N1-Send_later` plugin, I realized that the injected component needed to
get the `cloudState` somehow. Traditionally components would require
Stores and load data that way, but these are setup at `require`-time. Now
that `cloudState` only is available on `activate` we needed a way to get
the data to the components. There's now the concept of `boundProps` which
will be props added to the Component when it gets injected. This required
changing the return signature of `findComponentMatching`, which got
renamed to `findComponentDataMatching`.

**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.

**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.

**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: drew, bengotow, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2419
2016-02-02 15:28:06 -05:00
Ben Gotow 3b421edd96 fix(tray): Order of operations causing exception 2016-02-02 12:24:59 -08:00
Ben Gotow f66122fe2a 💄(tray): Use locale string so unread count uses comma notation 2016-02-02 12:18:37 -08:00
Ben Gotow 77c6026650 💄(composer): Account dropdown aliases styling 2016-02-02 11:33:08 -08:00
Ben Gotow b784dcc3e7 💄(thread-list): Correct top border on selected threads. Fixes #1189 2016-02-02 11:12:28 -08:00
Juan Tejada 4fc9c74362 fix(sidebar):Correctly update sidebar by listening to FocusedPerspective
-  Clean up AccountSwitcher a bit
2016-02-02 10:59:44 -08:00
Juan Tejada ae039a6752 Revert "fix(sidebar): Correctly update sidebar when a notif is selected"
This reverts commit 0828badb921c81a9779b2e52ab4829bf0db07410.
2016-02-02 10:58:24 -08:00
Juan Tejada cd2d8f0629 fix(sidebar): Correctly update sidebar when a notif is selected
- Clean up AccountSwitcher a bit
2016-02-02 10:44:18 -08:00
Ben Gotow 001ccfff43 fix(composer): Attachment check ignores uploads. Fixes #1190 2016-02-02 10:15:20 -08:00
Juan Tejada 7a8e10af0d fix(lint): Fix new eslint rule introduced with babel-eslint upgrade.
See https://phabricator.babeljs.io/T6925
2016-02-01 20:07:36 -08:00
Ben Gotow e5c6036bda fix(contact): Converge on displayName(), don't show account label in ThreadList. Fixes #1157 2016-02-01 19:12:06 -08:00
Ben Gotow ea5e8e0b9e rm(Nilas-contact-elements): Remove unused package 2016-02-01 19:12:06 -08:00
Juan Tejada 06062fdfe8 fix(prefs): Fix selector for default account for send 2016-02-01 18:34:42 -08:00
Juan Tejada 65a29a250c fix(default-alias):Show correct list of accounts and aliases in composer 2016-02-01 18:34:42 -08:00
Juan Tejada a5383d492f fix(remove-from-view): Update remove from view (shortcut) behavior
Summary:
- Now behaves exactly like in Gmail:
  - If viewing inbox, it will archive or trash, depending on setting
  - If viewing starred, will unstar
  - If viewing trash, will move to inbox
  - If viewing label, will remove label (no folder support)
  - No op otherwise
- Updates TaskFactory helpers and adds some helper methods
- Updates specs

Test Plan: - Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2492
2016-02-01 17:40:42 -08:00
Ben Gotow fecd8c9541 fix(send-and-archive): Was disabling signatures due to name collision 2016-02-01 17:33:18 -08:00
Ben Gotow 0fb109aeee feat(reorder): Re-order mail rules (#1074) and accounts (#631)
Summary:
This implements EditableList re-ordering via a new prop callback.
You can drag and drop items in the mail rules list and the accounts list.
Note that you can't drag between lists - right now this is just to enable
re-ordering.

Test Plan: No new specs yet

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2495
2016-02-01 14:06:54 -08:00
Juan Tejada 0cfa9848e7 fix(alias-list): Editable list wont create empty items
- Update alias coercion to include name by default
2016-02-01 12:45:52 -08:00
Juan Tejada 4861c3e2ab fix(shortcuts): Add shortcut to mark as spam, fixes #765
- Minor cleanup + docs
2016-02-01 12:21:42 -08:00
Ben Gotow 49e13eba33 fix(thread-list): Remove dup accountIds to avoid extra work 2016-01-30 15:00:20 -08:00
Ben Gotow 685fa625a5 fix(send+archive): Update to use focused perspective 2016-01-29 19:01:47 -08:00
Ben Gotow fde868a62e fix(thread-list): AccountId resolution for items outside loaded range 2016-01-29 17:56:57 -08:00
Evan Morikawa 0d0cd0c58d fix(pref): check for mounting on async launch service 2016-01-29 17:11:54 -08:00
Ben Gotow 00c1645300 feat(screenshot-mode): Minor fix to unmount method 2016-01-29 16:59:51 -08:00
Ben Gotow 89a30a058f feat(screenshot-mode): Tiny feature for removing PII when taking debug screenshots 2016-01-29 16:39:07 -08:00
Ben Gotow 459eb26d4f fix(activity): "Long Polling" => "Delta Streaming" because we don't really poll. 2016-01-29 16:06:33 -08:00
Ben Gotow 12f3ca4f3b fix(dropdown): Open up or down depending on position 2016-01-29 15:52:40 -08:00
Ben Gotow 10a8defc40 fix(uploads): Consolidate logic, use Promisify, path.join 2016-01-29 14:45:53 -08:00
Juan Tejada ced31d7f5d fix(electron): Update api usage to require('electron') 2016-01-29 14:24:33 -08:00
Ben Gotow be818e9ac4 fix(focus): Don't clear when item is scrolled out of retained range 2016-01-29 12:34:58 -08:00
Juan Tejada 6ead7feea0 fix(styles): Actually fix styles for faded recipient list 2016-01-29 11:18:28 -08:00
Juan Tejada 96d72c1006 fix(styles): Fix styles for faded recipient list 2016-01-29 11:13:25 -08:00
Juan Tejada 2955ce7dee fix(styles): Cleanup less files for account sidebar and switcher 2016-01-29 11:03:52 -08:00
Ben Gotow 422d5f8d8f fix(notifs): Categories inside Threads need accountId. Fixes #1155 2016-01-29 10:49:45 -08:00
Juan Tejada 223f7fdde4 fix(sidebar): Update sidebar correctly when an account added or removed 2016-01-29 10:21:49 -08:00
Ben Gotow 179626dc20 fix(config): observe fires immediately, causing re-renders 2016-01-29 00:31:10 -08:00
Juan Tejada e7a70d9bf7 fix(account-switcher): Don't display "All Accounts" when only 1 account 2016-01-28 19:53:12 -08:00
Evan Morikawa f0b0f35433 fix(message): fix truncation of messages
It would seem the document.documentElement.scrollHeight can return 0 when
the document.body.scrollHeight reliably returns the correct height.
Changed to fallback to various height checking mechanisms.

Fixes #425
Fixes #1102
Fixes #1153
2016-01-28 18:07:43 -08:00
Ben Gotow 9dab8d6335 fix(labels): Never show labels UX for threads split across folders 2016-01-28 16:57:24 -08:00
Ben Gotow 12b60e4360 fix(important): Hide important in message column of unified unless Gmail 2016-01-28 16:57:24 -08:00
Ben Gotow db06df0902 fix(account-sidebar): onToggleCollapsed => onCollapseToggled 2016-01-28 16:57:24 -08:00
Juan Tejada 0c3ca4b6e4 fix(sidebar): Prevent editing items in OutlineView when not allowed
- Fix check in OutlineViewItem
2016-01-28 16:21:21 -08:00
Ben Gotow de489368e6 fix(unified): Add a unified icon. designer gets back tues. 2016-01-28 16:01:22 -08:00
Juan Tejada 10a6b76fb7 add(docs): Add docs for OutlineView and OutlineViewItem
- Renames some stuff
2016-01-28 15:28:15 -08:00
Ben Gotow e27c9eaca5 fix(important): Fix bugs in "important" label categorization 2016-01-28 15:27:03 -08:00
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
Drew Regitsky e1631db435 fix(templates): small CSS fix in preferences page 2016-01-28 14:51:31 -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
Ben Gotow 46b339d334 fix(message-list): Spec fixes, all stubs need accountId 2016-01-28 11:14:04 -08:00
Ben Gotow da68b393a2 fix(message-list): Only display labels when usesLabels() 2016-01-28 10:46: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 08ec481739 Fix ComposerView specs 2016-01-27 13:49:34 -08:00
Ben Gotow 53390fbd5c Basic fixes for drag and drop 2016-01-27 11:45:02 -08:00
Ben Gotow 470fbae6a3 Fix sidebar when an account doesn't have a standard category 2016-01-27 11:14:11 -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
Juan Tejada 7c71576192 Misc fixes for FileUploadStore 2016-01-26 16:58:20 -08:00
Juan Tejada dcb08932c0 Refactor FileUploadStore and composer attachments - WIP 2016-01-26 15:36:38 -08:00
Juan Tejada 1435904f3c Fix when checking if draft is a reply when getting accounts for send 2016-01-26 13:55:26 -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 205ec50b98 Fix AccountStore.current() references in private packages 2016-01-25 18:02:56 -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 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 cffb3ad4a2 Fix for search bar issue with threads not appearing 2016-01-25 13:47:41 -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
Ben Gotow a2c901559e DatabaseTransaction / QueryBuilder spec fixes 2016-01-25 11:11:57 -08:00
Ben Gotow 9fc11512ad CategoryPicker / PerspectiveStore spec fixes 2016-01-25 11:07:40 -08:00
Evan Morikawa d15d39abdf fix(keymap): the remove and go to prev/next keys were reversed
Fixes #924
2016-01-22 15:33:49 -08:00
Juan Tejada 901ce1bcbd Show window when switching accounts if it isnt visible 2016-01-22 11:58:24 -08:00
Ben Gotow e887722e4a Rebuild SearchSuggestionStore to fix errors, appearing after search committed 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
Juan Tejada e8583abb01 Update default collapsed value for sidebar items in unified inbox view 2016-01-20 19:22:33 -08:00
Ben Gotow 8b8a505b20 fix(onboarding): Minor style changes, headers for EAS 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
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
Ben Gotow 1d55f1ac11 Change the sidebar to use Flexbox for container 2016-01-20 13:04:06 -08:00
Ben Gotow 353be64e10 rm(tooltip): Tooltip package no longer in use 2016-01-20 11:30:57 -08:00
Ben Gotow 45403131f1 rm(intercom): Point feedback to support.nylas, shrink button 2016-01-20 11:26:14 -08:00
Ben Gotow 3c40b3496c fix(auth): Increase timeout to 60s for Exchange auth 2016-01-20 10:49:27 -08:00
Drew Regitsky 9641ac0e6e fix(templates): fix when the "no templates" message is displayed 2016-01-20 10:24:45 -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 5c26340965 Merge pull request #966 from cllns/standardize-am-and-pm-capitalization
Standardize capitalization to am/pm, for message-list
2016-01-19 16:45:02 -08:00
Jackie Luo 1f0751c026 fix(message): Message time no longer selectable
Summary: Closes #910.

Test Plan: Manual. Tested locally.

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2453
2016-01-19 16:32:03 -08:00
Sean Collins 1f0ebfca78 Standardize message-list capitalization to AM/PM, 2016-01-19 15:54:44 -07:00
Ben Gotow cf39491240 Merge pull request #1029 from mbilker/phishing-detection
Set Phishing Detection package name to the correct value
2016-01-19 13:51:57 -08:00
Juan Tejada 38590139bc Fix collapsing behavior for non perspective sidebar items
- Assign unique id for sheet and draft sidebar items
2016-01-19 10:51:52 -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
Juan Tejada 81bd78fb09 Fix merge errors 2016-01-18 11:56:52 -08:00
Juan Tejada e1084708b8 Minor fixes and style updates 2016-01-18 11:48:34 -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 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
Drew Regitsky fc20b60b61 fix(mail-rules): tiny CSS fix to "+" button in mail rules 2016-01-15 11:01:59 -08:00
mbilker efc9950ead fix(phishing): set the package name to the correct value 2016-01-14 22:43:40 -05: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 3a8a38b8bc Merge branch 'master' into unified-inbox
# Conflicts:
#	spec/stores/file-download-store-spec.coffee
2016-01-13 17:20:34 -08:00
Drew Regitsky f469fd29d8 fix(templates): rewritten "welcome" file / example template 2016-01-13 12:08:41 -08:00
Ben Gotow fb41a8184e fix(specs): Spec fixes for 37e1f6bb 2016-01-12 19:11:47 -08:00
Ben Gotow e8997b0944 fix(spellcheck): Unwrap nodes with simpler code with less side effects 2016-01-12 19:03:04 -08:00
Juan Tejada 0dd87c80d7 fix(warnings): Don't issue a warning for attachments when word attach in
signature

- Fixes #912
2016-01-12 18:45:27 -08:00
Evan Morikawa ef8759dd62 fix(lint): fix linter issues in template store 2016-01-12 18:33:01 -05:00
Drew Regitsky 6cc0e6ca0d fix(templates): insert template no longer overwrites signature 2016-01-12 14:09:37 -08:00
Ben Gotow 5a12dde49c fix(drag): Drag and drop files with illegial path characters 2016-01-12 13:52:01 -08:00
Ben Gotow 97d49256bd fix(packages): Default icon for third-party packages 2016-01-12 13:52:01 -08:00
Juan Tejada 646785e182 fix(styles): Add bottom margin to templates plugin message 2016-01-12 13:46:50 -08:00
Drew Regitsky c91a0c6062 fix(templates): fix several bugs in templates plugin
Fixes behavior when there are no template files, prevents renaming/creating
with an empty name, fixes yet another way to accidentally make yellow text,
misc small style fixes
2016-01-12 12:44:38 -08:00
Juan Tejada 57aee26256 fix(composer): Fix focus behavior when signature present and when
clicking outside:

- When focusing the composer via click inside the contenteditable region or via
tabbing, last text node before the signature (or blockquotes) will be focused.
- When focusing composer by clicking outside contenteditable region, it
  will default to default contenteditable focus behavior via new method:
  `nativeFocus`
2016-01-12 12:36:19 -08:00
Ben Gotow c7ebbb189b fix(indicators): Remove duplicate description key 2016-01-12 10:28:34 -08:00
Juan Tejada cec3b38d1d Update names to use perspective instead of view 2016-01-12 09:49:56 -08:00
Ben Gotow 13870fecd5 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
Ben Gotow b6d20ce88c fix(composer): Fix tabbing from body to subject 2016-01-11 18:13:42 -08:00
Juan Tejada 8db220cbb9 Fix issues in AccountSidebarStore and MailboxPerpective#isEqual 2016-01-11 17:54:40 -08:00
Ben Gotow fa01a31631 fix(composer): 30px area would focus wrap instead of contenteditable. Fixes #935 2016-01-11 17:44:55 -08:00
Ben Gotow 893e26dfc6 fix(composer): Focus last element, not just text node 2016-01-11 17:44:17 -08:00
Ben Gotow d06b235edf fix(spellcheck): Redo node creation each time, optimize findSimilarNodes
findSimilarNodes was taking 20% of total execution time because my test email was a jenkins error report with thousands of text nodes.
2016-01-11 17:31:03 -08:00
Juan Tejada b1d1889f28 Fix SuggestioStore -- update to use NylasStore 2016-01-11 16:32:25 -08:00
Ben Gotow df124e1472 Fix search suggestions using old-style store 2016-01-11 16:26:41 -08:00
Ben Gotow 9ee1d83fcd Remove query formatting that used to match ElasticSearch 2016-01-11 16:16:35 -08:00
Juan Tejada 813598d536 Fix more specs:
- SearchBar
- EventRSVPTask
- ContactStore
2016-01-11 16:14:21 -08:00
Ben Gotow 212adcdf84 Search bar fixes 2016-01-11 15:58:10 -08:00
Drew Regitsky f212752c1c fix(templates): fix two bugs breaking templates plugin rename and search 2016-01-11 15:28:31 -08:00
Juan Tejada a1a5cd7fb9 Fix tests for AccountSidebarStore
- 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
2016-01-11 15:16:50 -08:00
Ben Gotow 7b6f122119 AccountStore no longer tracks index, Actions.selectAccount gone 2016-01-11 14:11:48 -08:00
Ben Gotow 651ea8c1c5 More spec fixes 2016-01-11 13:40:42 -08:00
Juan Tejada 162872fc82 Remove fdescribe 2016-01-11 13:39:25 -08:00
Juan Tejada 4978e61d91 Fix AccountSwitcher specs 2016-01-11 13:38:44 -08:00
Juan Tejada db8b9bae23 Fix ThreadListParticipants spec 2016-01-11 13:31:35 -08:00
Juan Tejada e97ca2b606 Fix CategoryPicker specs
- Add NylasUtils.mockObservable helper
2016-01-11 13:23:59 -08:00
Ben Gotow a352e40af7 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 356365dc42 fix(rsvp): Check that you are a participant, support aliases. Fixes #962 2016-01-11 12:20:26 -08:00
Juan Tejada 29601a7d57 Fix misc errors that made the app crash 2016-01-11 11:39:14 -08:00
Ben Gotow db7bc9e81c fix(quoted-text): Fix + test case for Sentry 8323, body el is quoted text 2016-01-11 11:14:34 -08:00
Ben Gotow 65ee221bc9 fix(notifications): Fix notification removal [Sentry 8957] 2016-01-11 10:56:17 -08:00
Ben Gotow b3841d79e6 fix(composer): Temporary patch for broken focus
Long term, we need to refactor this so that it's either entirely controlled or uncontrolled. Potentially use focusin?
2016-01-08 18:45:26 -08:00
Juan Tejada b5fa97bc7a 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 14d6cec669 Rename MailViewFilter => MailboxPerspective 2016-01-08 14:58:31 -08:00
Ben Gotow d3f62d4bb0 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 34f68dcc0d 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
Ben Gotow cd3aea9885 style(message-list): Correct alignment of dropdown. Fixes #659 2016-01-08 11:48:14 -08:00
Ben Gotow a258ba4613 feat(zoom): Allow users to override interface zoom. Fixes #699 2016-01-08 11:32:32 -08:00
Ben Gotow 3b6fdd3a53 fix(specs): Minor change to templates package for Travis 2016-01-08 10:52:37 -08:00
Ben Gotow 506ada3a59 fix(lint): Fix linter issues in template package 2016-01-08 10:47:41 -08:00
Drew Regitsky 2a5c1383f8 fix(templates): disable outdated tests in templates plugin for now
TODO: update and rewrite tests for templates plugin
2016-01-07 21:13:07 -08:00
Ben Gotow 3a86c34883 feat(newsletter): Manage subscription directly from N1 2016-01-07 18:44:40 -08:00
Ben Gotow ed50039b00 rename(templates): Use "Quick Replies" name in plugins screen 2016-01-07 15:23:54 -08:00
Ben Gotow 460a715e4d fix(examples): examples => packages, move away from installing them 2016-01-07 14:56:34 -08:00
Ben Gotow cca6b70223 fix(keymaps): Display composer keymaps, fix Apple Mail 2016-01-06 11:44:20 -08:00
Colin King 1db98f80b6 Reordered archive and trash icons 2016-01-06 14:22:41 -05:00
Ben Gotow 188e637236 fix(rules): Overflow in the prefrences sidebar. Fixes #908 2016-01-06 09:51:42 -08:00
Ben Gotow 1d94fcaaf9 fix(sig): Remove selectEnd, place cursor before sig
Summary: When focusing the composer, select the end of the last text block above any signatures / quoted text (which can be visible by default in Fwd:).

Test Plan: Run tests

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2411
2016-01-05 14:31:55 -08:00
Ben Gotow 7f80cc8038 fix(focus): Minor changes to composer focus logic to focus new drafts
Summary:
Remove FocusTrackingRegion—all CommandRegions should be focusable, and nesting the two creates varying behavior based on which is the parent

Calling focus() on an injected / unsafe component should always do /something/. Try the inner React method, inner DOM method, or call on ourselves

Rename contentEditable._focusEditor to "focus" since it intends to replace default focus behavior

In ComposerView, always change focus via setState, never by calling focus() directly. Rather than tracking `_lastFocusedField`, just focus whenever the activeElement isnt within the focusedField. Make body initial focus when draft is pristine...

...(ensures new drafts are focused)

Test Plan: Run tests

Reviewers: evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D2406
2016-01-05 11:34:26 -08:00
Colin King 6d557961db Moved all quick actions within flexbox from injectable component
Fixed linting issues

Moved away from ComponentRegistry towards InjectComponentSet children
2016-01-04 20:25:59 -05:00
Ben Gotow f2f7edea26 fix(spec): Participant tests breaking on Travis 2015-12-30 18:09:16 -08:00
Juan Tejada ebf9185fb0 fix(specs): Fix extension test 2015-12-30 18:08:33 -05:00
Evan Morikawa 11b731891f feat(extension): async extensions
Summary:
WIP:

This is a quick patch for Drew to make extensions async

We'll need to think through the upgrade/deprecation plan to roll out async
extensions across all of our APIs.

Test Plan: TODO

Reviewers: drew, evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2392
2015-12-30 18:04:52 -05:00
Juan Tejada b452be933a feat(column-width): Store column width state in the app
Summary:
- Fixes #833
- Allows column widths to be persisted between sessions

Test Plan: - Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2401
2015-12-30 15:18:38 -05:00
Juan Tejada 6315bc9d80 fix(extension-adapter): Update adapter to support all versions of extension api we've used
Summary:
- Rewrites composer extension adpater to support all versions of the
  ComposerExtension API we've ever declared. This will allow old plugins (or
  plugins that haven't been reinstalled after update) to keep functioning
  without breaking N1
- Adds specs

Test Plan: - Unit tests

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2399
2015-12-30 15:11:37 -05:00
Drew Regitsky 4628643195 fix(signatures-tests): actually fix the signatures tests 2015-12-29 18:31:10 -08:00
Juan Tejada 73f76de7fc fix(composer-focus): Fix focus behavior + update InjectedComponent props
Summary:
- Fixes bug with Composer focus caused by injected component. The composer body
  was being focused, but the cursor remained at the beginning of the content
  instead of at the end. This was caused because the focus method was being
  called before the content had actually been rendered to the dom.
  - Adds a callback to check when injected comp was actually rendered, and uses
    that to focus the body at the correct time.
  - Updates specs
- Updates behavior of focusing composer body when selecting threads in split
  mode --  resolves #T3444
  - It will focus the body when a thread is selcted via a click
  - It wont focus the body when a thread is selected via arrow keys
  - It will focus the body when a new inline reply is created
  - Updates specs

Test Plan: - Unit tests

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2393
2015-12-29 21:28:15 -05:00
Drew Regitsky 0f58618e2a fix(signatures-tests): update tests for new signatures code 2015-12-29 18:00:18 -08:00
Drew Regitsky da15d4598c fix(signatures): Wrap signature in a nylas-n1-signature div to allow easy detection
Summary:
Changes the internal signatures plugin to wrap the signature in a
`<div class="nylas-n1-signature">` block, to make it easier to detect and handle
signatures from within other plugins.

Also:
- Fixes the QuickSchedule plugin to place the scheduling block above the signature.
- Fixes a small syntax error in Translate plugin

Test Plan: manual

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2383
2015-12-29 15:33:49 -08:00
Ben Gotow 9dfb03727d lint(mail-rules): Fix build failure from linter issue 2015-12-29 14:41:30 -08:00
Ben Gotow 55e4dd14b9 fix(uploads): Don't allow dragging of uploading images (Fixes #366) 2015-12-29 14:21:42 -08:00
Ben Gotow e349062835 fix(regex): Chop leading '/" off emails if they are wrapped in quotes 2015-12-28 18:39:06 -08:00
Ben Gotow a573b70895 fix(mail-rules): Catch and disable mail rules building bad actions 2015-12-28 18:39:06 -08:00
Ben Gotow c379353553 fix(autoload-images): Watch for images declared in more attrs
Fixes #739
2015-12-28 14:59:07 -08:00
Ben Gotow c88efcacd8 fix(search): Switching accounts while searching no longer breaks app
Fixes #850
2015-12-28 12:16:56 -08:00
Juan Tejada d8e437662a fix(styles): Fix border styles for subject input in composer
- Fixes #825
2015-12-23 22:05:43 -08:00
Ben Gotow af67597f0b feat(mail-rules): Per-account mail rules filter incoming, existing mail
Summary:
Originally, this was going to be a totally independent package, but
I wasn't able to isolate the functionality and get it tied in to
the delta-stream consumption. Here's how it currently works:

- The preferences package has a new tab which allows you to edit
  mail filters. Filters are saved in a new core store, and a new
  stock component (ScenarioEditor) renders the editor. The editor
  takes a set of templates that define a value space, and outputs
  a valid set of values.

- A new MailFilterProcessor takes messages and creates tasks to
  apply the actions from the MailFiltersStore.

- The worker-sync package now uses the MailFilterProcessor to
  apply filters /before/ it calls didPassivelyReceiveNewModels,
  so filtrs are applied before any notifications are created.

- A new task, ReprocessMailFiltersTask allows you to run filters
  on all of your existing mail. It leverages the existing TaskQueue
  architecture to: a) resume where it left off if you quit midway,
  b) be queryable (for status) from all windows and c) cancelable.
  The TaskQueue is a bit strange because it runs performLocal and
  performRemote very differently, and I had to use `performRemote`.
  (todo refactor soon.)

This diff also changes the EditableList a bit to behave like a
controlled component and render focused / unfocused states.

Test Plan: Run tests, only for actual filter processing atm.

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2379
2015-12-23 02:19:32 -05:00
Juan Tejada 64ae82a7e2 fix(prefs): Prevent main key commands from being fired to thread list while on prefs page
Summary:
- When the preferences sheet is open, any commands triggered through key presses were being received by the thread-list, producing unexpected
(and unseen) results
- This is a partial/temporary solution and should go away when we do the Keymap/Commands/Menu refactor

Test Plan: - Manaul

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2380
2015-12-22 09:38:56 -08:00
Juan Tejada 9060d1642c refactor(tray): Update main file for tray package 2015-12-21 20:18:17 -08:00
Evan Morikawa d18642fb3e refactor(contenteditable): new ContenteditableExtension API
Summary:
This provides a new API for `ContenteditableExtension`s. Instead of
manually manipulating the raw DOM and `Selection` objects, there's a new
`Editor` interface that encapsulates it and provides helper methods.

You can now do:

      editor.select(someNode).createLink("foo").collapseToEnd()

Now raw methods like `execCommand` ONLY show up in the `Editor` interface
as well as most of the raw `Selection` APIs.

There are also more integration tests :)

Another major goal was cleaning up the contenteditable file itself. To
that end:

1. The DOMNormalizer got pulled out into its own extension
1. The TabManager is now its own extension
1. Url wrangling got moved into the FloatingToolbar control
1. There is now the concept of a `ContenteditableService`, which are
tightly-couple blocks of code separated out into logical units. These are
dependent on the core state, innerState, and props and are not full
extensions.
1. `MouseService` now handles all the click event logic
1. `ClipboardService` was modified to the new service architecture

Test Plan: script/grunt run-integration-tests

Reviewers: drew, juan, bengotow

Reviewed By: juan, bengotow

Differential Revision: https://phab.nylas.com/D2367
2015-12-21 19:58:01 -08:00
Juan Tejada faf86631aa update(tray): Show 'Open Inbox' tray menu option and option to disable
tray  on Mac and Linux

- Resolves #673
- Resolves #762
- Resolves #594
2015-12-20 21:32:59 -08:00
Juan Tejada 96da7ccb2d feat(editor-region): Add support to register components as editors
Summary:
- The main purpose of this is to be able to properly register the editor for the markdown plugin (and any other plugins to come)

- Refactors ComposerView and Contenteditable ->
  - Replaces Contenteditable with an InjectedComponent for a new region role:
    "Composer:Editor"
  - Creates a new component called ComposerEditor, which is the one that is
    being registered by default as "Composer:Editor"
  - I used this class to try to standardize the props that should be
    passed to any would be editor Component:
    - Renamed a bunch of the props which (I think) had a bit of
      confusing names
    - Added a bunch of docs for these in the source file, although
      I feel like those docs should live elsewhere, like in the
      ComponentRegion docs.
  - In the process, I ended up pulling some stuff out of ComposerView and
    some stuff out of the Contenteditable, namely:
    - The scrolling logic to ensure that the composer is visible while
      typing was moved outside of the Contenteditable -- this feels more
      like the ComposerEditor's responsibility, especially since the
      Contenteditable is meant to be used in other contexts as well.
    - The ComposerExtensions state; it feels less awkward for me if this
      is inside the ComposerEditor because 1) ComposerView does less
      things, 2) these are actually just being passed to the
      Contenteditable, 3) I feel like other plugins shouldn't need to
      mess around with ComposerExtensions, so we shouldn't pass them to the
      editor. If you register an editor different from our default one,
      any other ComposerExtension callbacks will be disabled, which
      I feel is expected behavior.
  - I think there is still some more refactoring to be done, and I left some TODOS
    here and there, but I think this diff is already big enough and its a minimal
    set of changes to get the markdown editor working in a not so duck
    tapish way.
- New props for InjectedComponent:
  - `requiredMethods`: allows you to define a collection of methods that
    should be implemented by any Component that registers for your
    desired region.
    - It will throw an error if these are not implemented
    - It will automatically pass calls made on the InjectedComponent to these methods
      down to the instance of the actual registered component
    - Would love some comments on this approach and impl
  - `fallback`: allows you to define a default component to use if none were
    registered through the ComponentRegistry
- Misc:
  - Added a new test case for the QuotedHTMLTransformer
- Tests:
  - They were minimally updated so that they don't break, but a big TODO
    is to properly refactor them. I plan to do that in an upcoming
    diff.

Test Plan: - Unit tests

Reviewers: bengotow, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2372
2015-12-18 11:06:44 -08:00
Ben Gotow ea76b7c442 feat(transactions): Explicit (and faster) database transactions
Summary:
Until now, we've been hiding transactions beneath the surface. When you call persistModel, you're implicitly creating a transaction.
You could explicitly create them with `atomically`..., but there were several critical problems that are fixed in this diff:

- Calling persistModel / unpersistModel within a transaction could cause the DatabaseStore to trigger. This could result in other parts of the app making queries /during/
  the transaction, potentially before the COMMIT occurred and saved the changes. The new, explicit inTransaction syntax holds all changes until after COMMIT and then triggers.

- Calling atomically and then calling persistModel inside that resulted in us having to check whether a transaction was present and was gross.

- Many parts of the code ran extensive logic inside a promise chained within `atomically`:

  BAD:

```
  DatabaseStore.atomically =>
   DatabaseStore.persistModel(draft) =>
     GoMakeANetworkRequestThatReturnsAPromise
```

OVERWHELMINGLY BETTER:

```
  DatabaseStore.inTransaction (t) =>
     t.persistModel(draft)
  .then =>
    GoMakeANetworkRequestThatReturnsAPromise
```

Having explicit transactions also puts us on equal footing with Sequelize and other ORMs. Note that you /have/ to call DatabaseStore.inTransaction (t) =>. There is no other way to access the methods that let you alter the database. :-)

Other changes:
- This diff removes Message.labels and the Message-Labels table. We weren't using Message-level labels anywhere, and the table could grow very large.
- This diff changes the page size during initial sync from 250 => 200 in an effort to make transactions a bit faster.

Test Plan: Run tests!

Reviewers: juan, evan

Reviewed By: juan, evan

Differential Revision: https://phab.nylas.com/D2353
2015-12-17 11:46:05 -08:00
Ben Gotow 9fee3c4cf1 Merge pull request #728 from francois2metz/fix_unused_require
Harmonize require and remove unused ones.
2015-12-17 11:19:09 -08:00
François de Metz efefe0dae7 Harmonize require and remove unused ones. 2015-12-17 00:02:37 +01:00
Ben Gotow 411204be70 fix(aliases): Add note that aliases may need to be setup 2015-12-15 11:56:31 -08:00
Juan Tejada b3bf4ad65d feat(theme-selector): Add theme selector to preferences page
Summary:
- Adds a couple of helper methods to theme manager and updates how
a theme package is enabled to be consistent with how we actually want to
activate themes.
- Adds small select component to choose a theme or install a new one.

Test Plan: - Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2355
2015-12-15 10:29:58 -08:00
Juan Tejada 832d0b8dcf feat(default-alias): Add functionality to select a default alias
Summary:
- Update Account model witha default alias and DraftStore methods that
construct new messages to use default alias if available.
- Update AccountDetails page and add selector to select default alias

Test Plan: - Unit tests

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2352
2015-12-14 14:35:26 -08:00
Juan Tejada f0cc7afb54 fix(editable-list): Prevent empty selection on esc pressed + other fixes
- When prop specified to not allow empty selection it should also
prevent it from being cleared when pressing Esc while focusing the list
- Adds a default value to the edit item input
- Updates specs
- Updates styles
2015-12-14 14:29:45 -08:00
Juan Tejada 7275336665 fix(shortcuts): Fix shortcut handlers for marking as read/unread
- Marking as read/unread did not work when selecting multiple threads
2015-12-14 10:32:45 -08:00
Juan Tejada 0eb163fdbd fix(specs): Fix composer view specs for enabling 'from:' field based on
aliases

- Will show from field when account has at least one alias
2015-12-14 00:02:30 -08:00
Ben Gotow 64d0d60f8b fix(aliases): Show from field whenever aliases are present 2015-12-11 19:04:14 -08:00
Ben Gotow 02fcd8e9be fix(thread-list): Initialize database view immediately 2015-12-11 12:15:38 -08:00
Juan Tejada 0a2ee7be91 fix(docs): Update ES6 comment docs to use JSDoc 3 format 2015-12-11 10:01:13 -08:00
Juan Tejada b68a8d6bc9 fix(warning): Remove implicit return from event handler to remove react
warning
2015-12-10 18:19:13 -08:00
Juan Tejada e936c5a5b4 add(docs):Add documentation to EditableList and PreferencesAccountDetails 2015-12-10 17:59:16 -08:00
Juan Tejada 415d612458 feat(account-prefs): Adds new page for Account in preferences
Summary:
Adds the new Account preferences page. This consists of two major React components,
PreferencesAccountList and PreferencesAccountDetails, both of which use EditableList.

I added a bunch of fixes and updated the API for EditableList, plus a bit of
refactoring for PreferencesAccount component, and a bunch of CSS so its a big diff.

The detailed changelog:

Updates to EditableList:
  - Fix bug updating selection state when arrows pressed to move selection
  - Add new props:
    - allowEmptySelection to allow the list to have no selection
    - createInputProps to pass aditional props to the createInput
  - Add scroll region for list items
  - Update styles and refactor render methods

Other Updates:
- Updates Account model to hold aliases and a label
  - Adds getter for label to default to email
- Update accountswitcher to display label, update styles and spec

- Refactor PreferencesAccounts component:
  - Splits it into smaller components,
  - Removes unused code
- Splits preferences styelsheets into smaller separate stylesheet for
  account page. Adds some updates and fixes (scroll-region padding)
- Update AccountStore to be able to perform updates on an account.
- Adds new Action to update account, and an action to remove account to
  be consistent with Action usage
- Adds components for Account list and Aliases list using EditableList

Test Plan: - All specs pass, but need to write new tests!

Reviewers: bengotow, evan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2332
2015-12-10 15:27:29 -08:00
Evan Morikawa 3f258b8cf8 fix(composer): focus on text box when clicking in margins 2015-12-10 16:52:18 -05:00
Ben Gotow 6f580f8e99 fix(drafts): Refresh view when draft becomes message 2015-12-10 13:43:27 -08:00
sriraman c0d8118707 Update README.md
Fix typo
2015-12-10 12:33:10 +05:30
Evan Morikawa aef0c8a681 fix(spellcheck): check for existing languages and add tests 2015-12-09 18:10:55 -05:00
Ben Gotow cc7b457bdd polish(quick-schedule): Use calendar icon in the composer 2015-12-09 10:55:08 -08:00
Ben Gotow 64fdccd1b0 fix(composer): Change state.focusedField when clicking fields—see details
Clicking participant fields to type in them did not cause state.focusedField to change, because no onFocus events were bound to the ParticipantTextFields. Since setState was not called, the focus would appear to change but revert as soon as you touched state.

This diff also renames `onChangeEnabledFields` to `onAdjustEnabledFields` making it more clear that unlike the other handlers, it does not take a new value, it takes a set of changes. I also noticed that we /always/ focus fields when showing them, so I removed the separate focus param from it and made it adjust focus at the composer-view level only.

I also consolidated everywhere that touches `state.focusedField` so that we can keep the `_lastFocusedParticipantField` value in sync with it more easily.
2015-12-08 17:44:20 -08:00
Ben Gotow 8ecf3bba3f fix(auth): Log first account creation 2015-12-08 17:05:59 -08:00
Ben Gotow b52abbe9f6 fix(auth): Track authentication success / failure rates by provider 2015-12-08 16:39:38 -08:00
Juan Tejada 8525717ff9 fix(composer): Pass in onFocus handler correctly to contenteditable
- Fixes issue where body lost focus when typing and focus switched to to
field
- Now passes the onFocus handler as part of a `ContenteditableExtension`
2015-12-08 11:00:33 -08:00
Ben Gotow 3931a0b948 fix(expand-all): Fixes for dark theme, don't show expand when one message 2015-12-07 18:01:06 -08:00
Ben Gotow 62fab52f7b feat(observables): Implementation of observables to replace some stores
Summary:
Add concept of "final" to Query, clean up internals

Tiny bug fixes

RxJs Observables!

WIP

Test Plan: Run tests

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2319
2015-12-07 16:52:46 -08:00
Ben Gotow b00e5439e5 feat(paste): Paste accepts more HTML, paste and match style now available
Summary:
Related to #320, #494, #515, #553

Ignore newlines and returns in HTML, they can be inside tags

Allow all attributes so that paste from excel looks nice

Never let someone paste a `contenteditable` attribute

Update specs

Test Plan: Run new specs

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2309
2015-12-07 15:34:03 -08:00
Ben Gotow 47b46ac5b3 fix(theme): Dark mode styling for undo/redo component 2015-12-07 15:11:11 -08:00
Ben Gotow b153eb38da fix(theme): Dark mode styling of the from field, "More contacts" button
Fixes #607
2015-12-07 15:05:44 -08:00
Ben Gotow f8169273b8 fix(downloads): Improve inline attachment handling
- Show downloading state for inline attachments
- Ensure that the UI updates /after/ the download has completed
- Don't delete finished downloads (previously we were forgetting that a file was downloaded and checking again and again)

Fixes #462
2015-12-07 15:00:25 -08:00
Juan Tejada 7a5be0e7a7 fix(important): Fixes keymap handlers for mark as important/unimportant
- Updates to bind handlers inside thread list
- Fixes typo in event name
- Updates config path for showImportant
2015-12-07 12:05:40 -08:00
Ben Gotow 7f87ffbe17 fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
Yoeri Stessens 11bbd5bf0c Merge branch 'master' of github.com:nylas/N1 2015-12-07 12:04:41 +01:00
Yoeri Stessens 0c908376de Add remove fallback for archiving messages 2015-12-07 11:29:31 +01:00
Ben Gotow 5b9f368b7a fix(keymaps): Listen to atom commands instead of DOM events
Using `addEventListener` only works when the command is triggered by the atom keymaps manager, NOT when the command is triggered by the command registry (NylasEnv.commands.dispatch). Odds are, when you subscribe to key commands you /really/ mean to subscribe to the command, no matter how it's invoked.

This fixes #556, in which the down / up arrows in the message list weren't working.
2015-12-04 18:27:11 -08:00
Juan Tejada 931a93af4e feat(print): Add functionality to print currently focused thread
Summary:
- Adds button inside the message list to print the thread
- Adds cmdctrl-p binding to print thread
- Adds new action and new internal_package to listen to this action.
- Creates a standalone browser window with current thread html, and removes all
collapsed messsages from the print view

Test Plan: - Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2310
2015-12-04 18:12:06 -08:00
Ben Gotow d5bf5e47b7 fix(signatures): Make the entire signature box clickable
Fixes #580
2015-12-04 17:06:12 -08:00
Ben Gotow 0dbf0f65ad fix(unread-icon): Show the correct icon for the action 2015-12-04 16:38:26 -08:00
Juan Tejada e45a7526db feat(messages): Add button to expand/collapse all messages in thread
Summary:
- Works like Gmail does
- Adds specs

Test Plan: - Unit tests

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2301
2015-12-03 11:57:48 -08:00
Ben Gotow 04d0b213b0 docs(notifs): On linux, display a note about Zenity in prefs 2015-12-03 11:36:54 -08:00
Ben Gotow 859333a1d5 fix(autoload-images): Catch images with no extension, add tests 2015-12-03 11:25:26 -08:00
Evan Morikawa 73e7c1c52e feat(tests): add integration tests
comment

Adding test harness

Using key strokes in main window test

Tests work now

Clean up argument variables

Rename list manager and get rid of old spec-helper methods

Extract out time overrides from spec-helper

Spectron test for contenteditable

fix spec exit codes and boot mode

fix(spec): cleanup N1.sh and make specs fail with exit code 1

Revert tests and get it working in window

Move to spec_integration and add window load tester

Specs pass. Console logs still in

Remove console logs

Extract N1 Launcher ready method

Make integrated unit test runner

feat(tests): adding integration tests

Summary:
The /spectron folder got moved to /spec_integration

There are now unit tests (the old ones) run via the renamed
`script/grunt run-unit-tests`

There are now integration tests run via the command `script/grunt
run-integration-tests`.

There are two types of integration tests:
1. Tests that operate on the whole app via Selenium/Chromedriver. These
tests have access to Spectron APIs but do NOT have access to any JS object
running inside the application. See the `app-boot-spec.es6` for an example
of these tests. This is tricky because we want to test the Main window,
but Spectron may latch onto any other of our loading windows. Code in
`integration-helper` give us an API that finds and loads the main window
so we can test it

2. Tests that run in the unit test suite that need Spectron to perform
integration-like behavior. These are the contentedtiable specs. The
Spectron server is accessed from the app and can be used to trigger
actions on the running app, from the app. These tests use the
windowed-test runner so Spectron can identify whether the tests have
completed, passed, or failed. Unfortunately Spectron can't access the logs
, nor the exit code of the test script thereby forcing us to parse the
HTML DOM. (Note this is still a WIP)

I also revamped the `N1.sh` file when getting the launch arguments to work
properly. It's much cleaner. We didn't need most of the data.

Test Plan: new tests

Reviewers: juan, bengotow

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

Fix composer specs

Tests can properly detect when Spectron is in the environment

Report plain text output in specs

fixing contenteditable specs

Testing slow keymaps on contenteditable specs

Move to DOm mutation

Spell as `subtree` not `subTree`
2015-12-02 13:41:14 -08:00
Ben Gotow bc839fb541 fix(labels): Allow user to label as spam or trash from the dropdown
Also fixes the sort ordering of standard labels in the category picker. Fixes #555
2015-12-02 11:43:37 -08:00
Yoeri Stessens c54131ad96 Alter the text to a more general approach and run tests
The text is now more in line with other mail clients to minimalize possible confusion between users of multiple mail clients and/or platforms.
2015-12-02 08:23:03 +01:00
Ben Gotow 092956b379 feat(keybindings): Show all keybindings in prefs 2015-12-01 18:31:19 -08:00
Evan Morikawa f3d58aaede refactor(contenteditable): use DOM mutation observers
Summary: This uses DOM mutation observers instead of `onInput`

Test Plan: manual and new integration tests

Reviewers: bengotow, juan

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

feat(contenteditable): add bold, underline, etc keymaps

Moving button extensions out of toolbar

Extracted floating toolbar buttons

Convert ContenteditableExtension to new spec

Update packages to use new callback signature

Fix specs
2015-12-01 15:31:03 -08:00
Ben Gotow b4dda021b1 fix(tray): On Win32 / Linux click should open main window if closed 2015-12-01 14:46:08 -08:00
Yoeri Stessens ceec7f625d Change backspace behavior
There is a setting so that the backspace can delete messages instead of archiving.
I think that backspace must delete the message, but like many other clients, you have the choice.
2015-12-01 17:07:46 +01:00
Juan Tejada e804dbf69f feat(shortcuts): Add listeners for unread/important keyboard shortcuts
Summary:
- Adds KeyCommandRegions to hook up missing listeners for marking as unread and
  important keyboard shortcuts
- Updates specs

Test Plan: - All tests pass

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2300
2015-11-30 18:29:45 -08:00
Ben Gotow 864e19d6b0 feat(rsvp): "Quick RSVP" to events recongized by the API 2015-11-30 17:12:45 -08:00
Juan Tejada cfdc401c54 update(extensions): Rename DraftStoreExtension and MessageStoreExtension
Summary:
- Rename DraftStoreExtension to ComposerExtension
- Rename MessageStoreExtension to MessageViewExtension
- Rename ContenteditablePlugin to ContenteditableExtension
  - Update Contenteditable to use new naming convention
  - Adds support for extension handlers as props
- Add ExtensionRegistry to register extensions:
  - ContenteditableExtensions will not be registered through the
    ExtensionRegistry. They are meant for internal use, or if anyone wants
    to use our Contenteditable component directly in their plugins.
  - Adds specs
- Refactors internal_packages and src to use new names and new ExtensionRegistry api
- Adds deprecation util function and deprecation notices for old api methods:
  - DraftStore.{registerExtension, unregisterExtension}
  - MessageStore.{registerExtension, unregisterExtension}
  - DraftStoreExtension.{onMouseUp, onTabDown}
  - MessageStoreExtension
- Adds and updates docs

Test Plan: - Unit tests

Reviewers: bengotow, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2293
2015-11-30 16:08:05 -08:00
Ben Gotow c2055907f3 fix(signatures): Monospace font, nested scrolling fix 2015-11-30 14:26:11 -08:00
Evan Morikawa 8292a6ff68 feat(signatures): add raw signature support 2015-11-30 14:02:58 -08:00
Ben Gotow 25d4f6cd31 fix(signatures): Display signatures tab, blur after prefs changes 2015-11-30 13:39:42 -08:00
Evan Morikawa f9dd31b94c feat(signatures): add signature support
Summary:
Add signatures back in.

Extract contenteditable css to its own file instead of being bundled with
the composer.

Test Plan: manual

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2295
2015-11-30 11:48:24 -08:00
Ben Gotow d7d5ed2832 feat(prefs): Allow tabs with an accounts submenu
Summary:
This diff:
- Improves the styling of the tabs in the preferences sidebar.
- Adds an optional param to section cofnig that puts an "account" submenu beneath the tab item.
- Renames preferences "sections" => "tabs", and renames the PreferencesSectionStore to PreferencesUIStore. I think we should include "UI" in more of our stores, and I think "tabs" is a good idea because it's unambigious—there's no way you could confuse it for a "section" of the NylasEnv.config tree or think it deals with actually saving prefs.

Test Plan: Inspect visually

Reviewers: evan, juan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2296
2015-11-30 11:43:49 -08:00
Juan Tejada 10f291eb4e fix(prefs): Focus main window when open prefs and prevent dupe sheets
- Fixes #498
- Fixes #484
2015-11-28 09:08:45 -08:00
Ben Gotow 79413e7c45 fix(autolinker): Add title attr to all links in emails to display href
Fixes GitHub Issues #479 and #335
2015-11-25 18:29:59 -08:00
Ben Gotow 0a413a1598 fix(sidebar): selected is not actually a required prop
Fixes #476
2015-11-25 16:30:01 -08:00
Ben Gotow eeb976167e fix(license): Mark a few additional packages as GPLv3 2015-11-25 14:41:10 -08:00
Ben Gotow 5bb417c66c Merge pull request #453 from dcposch/fix-license
Internal package.json license: GPLv3
2015-11-25 14:37:54 -08:00
Ben Gotow cb756f4f07 fix(composer): Don't pass a callback to dialog API, update changelog 2015-11-25 14:13:21 -08:00
Ben Gotow a82ebba618 fix(attachments): Only preview images up to 5MB, not 10MB 2015-11-24 16:27:07 -08:00
Juan aa27692b03 Merge pull request #449 from mbilker/travis-linux-testing
Travis Linux Testing
2015-11-24 12:48:31 -08:00
Juan Tejada ff341fcf84 fix(lint): Fix linter issues on account-sidebar-section.cjsx 2015-11-24 12:44:06 -08:00
Juan Tejada f48875d681 fix(sidebar): Add minor tweaks to sidebar behavior:
- Add default prop to DisclosureTriangle to eliminate warning
- Prevent from firing a new DestroyCategoryTask if category already is
deleted
- Update onBlur event to not close input if I click on the add button
2015-11-24 11:09:00 -08:00
DC e53270f843 Internal package.json license: GPLv3
Changed from 'Propietary' to 'GPLv3' to match LICENSE.md
2015-11-24 09:09:33 -08:00
Ben Gotow 528c8850ce bump(electron): 0.34.3 => 0.35.1
Electron 0.35.1 includes the tray fixes we contributed last week but also includes API restructuring and improvements. Most importantly, modules from electron are now imported via `require('electron')`
2015-11-23 22:09:17 -08:00
Ben Gotow 5ee8ffabbc fix(prefs): Minor tweaks, see description
- Make the keymaps panel less wide
- <select>'s now populate their current value properly
- Items should blur after being interacted with so that `esc` still moves you back to parent sheet
2015-11-23 20:34:04 -08:00
mbilker 35f7c54376 fix(spec): use correct modifier key based on process.platform 2015-11-23 23:31:37 -05:00
Ben Gotow e72d522b2b fix(account-sidebar): Fix specs to match new unread counts 2015-11-23 20:26:18 -08:00
Ben Gotow afa6968dc4 fix(dark-mode): Adjust email CSS immediately upon switching themes
Fixes #145
2015-11-23 20:20:06 -08:00
Ben Gotow 010b089511 fix(sidebar): Swap out + image, tweak CSS for unread 2015-11-23 20:08:10 -08:00
Juan Tejada 524028e257 feat(sidebar): Add sidebar controls to add and remove categories
Summary:
- Refactors account-sidebar internal package:
  - Separates into smaller react components
  - Makes DisclosureTriangle its own independent component
  - Adds data to AccountSidebarStore to allow removal or addition of items for a
    specific section of the sidebar
- Adds button and input and css styles to create categories
- Adds context menu to destroy a category
- Adds new method to CategoryStore to get the icon name for the categories of
  the current account
- Removes some unused code

Test Plan: Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2283
2015-11-23 19:43:56 -08:00
Ben Gotow 33d8b22d58 fix(theme): Improve styling of popout composer in dark mode 2015-11-23 18:28:30 -08:00
Ben Gotow 46a01de651 fix(copy): Call split / list modes "Single Panel / Two Panel"
Fixes T5907
2015-11-23 17:34:56 -08:00
Ben Gotow e1882ab61a feat(counts): Unread counts for all folders and labels across all accounts
Summary:
This diff replaces the UnreadCountStore with a better approach that is able to track unread counts for all folders/labels without continuous (and cripplingly slow) SELECT COUNT(*) queries.

When models are written to the database, we currently don't send out notifications with the "previous" state of those objects in the database. This makes it hard to determine how to update counters. (In the future, we may need to do this for live queries). Unfortunately, getting the "previous" state is going to be very hard, because multiple windows write to the database and the "previous" state we have might be outdated. We'd almost have to run a "SELECT" right before every "REPLACE INTO".

I created an API that allows you to register observers around persistModel and unpersistModel. With this API, you can run queries before and after the database changes are made and pluck just the "before" state you're interested in.

The `ThreadCountsStore` uses this API to determine the impact of persisting a set of threads on the unread counts of different labels. Before the threads are saved, it says "how much do these thread IDs contribute to unread counts currently?". After the write is complete it looks at the models and computes the difference between the old count impact and the new count impact, and updates the counters.

I decided not to attach the unread count to the Label objects themselves because 1) they update frequently and 2) most things observing the DatabaseStore for categories do not care about counts, so they would be updating unnecessarily.

The AccountSidebar now listens to the ThreadCountsStore as well as the CategoryStore, and there's a new preference in the General tab for turning off the counts.

Test Plan: Tests are a work in progress, want to get feedback first!

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2232
2015-11-23 17:12:22 -08:00
Ben Gotow 78dd69290d fix(prefs): Move to a sheet rather than a window, use configSchema
Summary:
This diff moves the preferences interface to a sheet in the main window, with the following benefits:
- We can put any sort of React control in it (no ReactRemote)
- It's not strange for the interface to scroll
- Since it can scroll, it's safe to auto-generate preferences for plugins based on their package config schema.

The general tab is now mostly based on the config schema, with the exception of the "Workspace" and "Layout" bits.

The other tabs are still manual, and should be polished more.

Test Plan: No new tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2278
2015-11-23 12:20:51 -08:00
Juan Tejada 8ac340cbb4 fix(tray): Prevent duplicate trays on preference changes 2015-11-23 09:53:05 -08:00
Juan Tejada cc536c1268 fix(tray): Prevent system tray from being initialized more than once
- Makes sure the tray is deactivated before activating
2015-11-23 09:31:10 -08:00
Ben Gotow 5d4c1b96a9 feat(dark-mode): Double invert filter for nice dark HTML bodies 2015-11-20 18:53:34 -08:00
Juan Tejada 98bc9dc958 feat(sidebar): Add behavior to persist collapsed state of sidebar items
Summary:  - Updates account sidebar to persist collapsed state to the the config

Test Plan:  - manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2276
2015-11-19 15:48:44 -08:00
Juan Tejada 338dc5284f fix(specs): Update composer-view-spec to use renamed functions 2015-11-18 15:51:48 -08:00
Juan Tejada 02deba38c4 fix(composer): Fix several composer issues and refactor Contenteditable
Summary:
  - Fixes T5819 issues
  - Adds ContenteditbalePlugin mechanism to allow extension of Contenteditable
    functionality, and completely removes lifecycleCallbacks from Contenteditable
  - Refactors list functionality outside of Contenteditable and into a plugin
  - Updates ComposerView to apply DraftStoreExtensions through a ContentEditablePlugin
  - Moves spell checking logic outside of Contenteditable into the spellcheck package

Fixes T5824 (atom.assert)
Fixes T5951 (shift-tabbing) bullets

Test Plan: - Unit tests and manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Maniphest Tasks: T5951, T5824, T5819

Differential Revision: https://phab.nylas.com/D2261
2015-11-18 15:22:31 -08:00
Ben Gotow b9954b764d fix(search): Execute search for subject, autoselect first item
Fixes T5899, but we may want to iterate on it more later.
2015-11-18 12:35:19 -08:00
Evan Morikawa 0c93cb856f fix(draft): fix showing of incorrect body when pending send
Summary: Fixes T3712

Test Plan: new tests

Reviewers: juan, bengotow

Reviewed By: bengotow

Maniphest Tasks: T3712

Differential Revision: https://phab.nylas.com/D2273
2015-11-18 12:32:07 -08:00
Ben Gotow 1d70cfae39 fix(specs): Ternary operator in jasmine-helper was valid coffee... 2015-11-17 17:48:32 -08:00
Ben Gotow 0068e7d4a7 fix(specs): Update specs following 0.29.2 > 0.34.3 move 2015-11-17 17:40:06 -08:00
Evan Morikawa 488dff0f90 refactor(env): new NylasEnv global
Converted all references of global atom to NylasEnv

Temporary rename atom.io

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.io/temporaryAtomIoReplacement/g'

atom.config to NylasEnv.config

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.config/NylasEnv.config/g'

atom.packages -> NylasEnv.packages

atom.commands -> NylasEnv.commands atom.getLoadSettings

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.commands/NylasEnv.commands/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getLoadSettings/NylasEnv.getLoadSettings/g'

More common atom methods

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.styles/NylasEnv.styles/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.emitError/NylasEnv.emitError/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.inSpecMode/NylasEnv.inSpecMode/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.inDevMode/NylasEnv.inDevMode/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getWindowType/NylasEnv.getWindowType/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.displayWindow/NylasEnv.displayWindow/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.quit/NylasEnv.quit/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.close/NylasEnv.close/g'

More atom method changes

find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.keymaps/NylasEnv.keymaps/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.hide/NylasEnv.hide/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getCurrentWindow/NylasEnv.getCurrentWindow/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.menu/NylasEnv.menu/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getConfigDirPath/NylasEnv.getConfigDirPath/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.isMainWindow/NylasEnv.isMainWindow/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.finishUnload/NylasEnv.finishUnload/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.isWorkWindow/NylasEnv.isWorkWindow/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.showSaveDialog/NylasEnv.showSaveDialog/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.append/NylasEnv.append/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.confirm/NylasEnv.confirm/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.clipboard/NylasEnv.clipboard/g'
find -E . -regex ".*\.(coffee|cjsx|js|md|cmd|es6)" -print0 | xargs -0 sed
-i "" 's/atom.getVersion/NylasEnv.getVersion/g'

More atom renaming

Rename atom methods

More atom methods

Fix grunt config variable

Change atom.cmd to N1.cmd

Rename atom.coffee and atom.js to nylas-env.coffee nylas-env.js

Fix atom global reference in specs manually

Fix atom requires

Change engine from atom to nylas

got rid of global/nylas-env

rename to nylas-win-bootup

Fix onWindowPropsChanged to onWindowPropsReceived

fix nylas-workspace

atom-text-editor to nylas-theme-wrap

atom-text-editor -> nylas-theme-wrap

Replacing atom keyword

AtomWindow -> NylasWindow

Replace Atom -> N1

Rename atom items

nylas.asar -> atom.asar

Remove more atom references

Remove 6to5 references

Remove license exception for atom
2015-11-17 16:41:20 -08:00
Evan Morikawa bab3c18bd4 fix(docs): fix docs so they compile properly. 2015-11-17 15:48:59 -08:00