Commit graph

2061 commits

Author SHA1 Message Date
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 3b49e132ab fix(errors): onerror contains an error.. 2016-02-03 18:03:11 -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
Ben Gotow c18e081af7 fix(draft-store): Don't require plugins to implement finalizeSession 2016-02-03 15:41:28 -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
Ben Gotow 521e2bdc61 bump(version): 0.4.2 2016-02-03 14:55:48 -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
Ben Gotow ee96339fed build(*): Add travis reporting to Slack 2016-02-03 14:36:02 -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 dc83e44088 fix(warnings): Warnings due to props not provided before React.cloneElement
See https://github.com/facebook/react/issues/4494
2016-02-02 11:39:53 -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
Ben Gotow 9974d24487 bump(version): 0.4.1 Beta 2016-02-01 18:31:04 -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
Ben Gotow 7612ecc8cd feat(rules): Add "Starred" as an available mail rule filter (#1074) 2016-02-01 13:18:16 -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 3d3f7fa315 fix(mailto): test case / parsing for url encoded To field 2016-02-01 11:22:23 -08:00
Ben Gotow cbfe310521 fix(eslint): Avoid eslint/eslint/issues/5125 by specifying escope version 2016-02-01 11:08:15 -08:00
Ben Gotow 9fb5be752c fix(zoom): Don't zoom the onboarding window 2016-02-01 10:49:34 -08:00
Ben Gotow 21695e5920 bump(spellcheck): Fixes #1168, #895, #855, #1158
https://github.com/atom/node-spellchecker/issues/30
2016-02-01 10:01:17 -08:00
Evan Morikawa 0a16ce1b4b Merge pull request #1177 from mbilker/update-csslint
Bump grunt-contrib-csslint to to ~0.5.0
2016-02-01 11:31:05 -05:00
mbilker 9458df3a9c bump(grunt-contrib-csslint): update to ~0.5.0 2016-02-01 10:10:12 -05:00
Ben Gotow 49e13eba33 fix(thread-list): Remove dup accountIds to avoid extra work 2016-01-30 15:00:20 -08:00
Ben Gotow c9cb887b57 security(*): Disable eval in all windows (#1159) 2016-01-29 19:25:31 -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