Commit graph

1999 commits

Author SHA1 Message Date
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
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
Ben Gotow e56608c254 fix(drafts): Increase syncback delay to 10s 2016-01-29 14:43:52 -08:00
Juan Tejada ced31d7f5d fix(electron): Update api usage to require('electron') 2016-01-29 14:24:33 -08:00
Juan Tejada f35aa79bde fix(electron): Update beforeunload event handler (see details):
- This fixes unresponsive draft items in the draft list, i.e. draft
  windows would not reopen after opening them the first time.
- The `beforeunload` handler will no longer hide a window before its
  actually closed. To reduce visible latency when closing, we moved
  saving window state to the `unload` event handler.
- Before unload was hiding the window before actually closing it. A
  hidden window causes chromium to throttle its renderer process for
  performance, even though `pageVisibility` was set to true (see
  https://github.com/atom/electron/issues/3225 for more detils).

  NylasEnv.finishUnload is used in this context: When a `beforeunload`
  callback prevents the window from closing, it can close it at some point
  in the future using finishUnload. NylasEnv.finishUnload uses _.defer to make
  sure we don't call `close` inside the `beforeunload` call stack so the
  window doesn't go crazy.

  However, since _.defer was being called in the renderer process of a
  hidden window, the deferred callback execution could end up delayed by
  a second or more, which effectively delayed closing the window by a
  second.

  If we tried to reopen a window with the same window props, e.g. a
  draft window, before it was actually closed, the app would go crazy
  and wouldn't open it.

  So now we just don't hide windows on beforeunload
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
Ben Gotow 1309ebb716 fix(mail-rules): Preserve through db version change until cloud metadata service is ready 2016-01-29 11:56:53 -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