Commit graph

1316 commits

Author SHA1 Message Date
Ben Gotow c76582194a rm(autolinker): Use our own very simple autolinker
Summary:
Autolinker is a great open source project but it attempts to parse HTML with regexp, is quite slow, and hangs on specific emails https://github.com/nylas/N1/issues/1540

This is super bad, and also super unnecessary. I think this should do the trick.

Note: I changed the urlRegex in our Utils to be much more liberal. It now matches anything that looks like a URL, not just things with the http:// and https:// prefixes. It's used in the LinkEditor and onboarding screen (detecting auth errors with urls) and I think it should be ok?

Test Plan: Need to write some tests

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2725
2016-03-14 12:30:54 -07:00
Juan Tejada 1e765a6b62 fix(acct-menu): Add option to add account from context menu 2016-03-14 11:22:52 -07:00
Ben Gotow 96c70368c4 fix(spellcheck): Enables spellcheck menu for basic inputs (#1600)
Summary: Just moves some code so we can easily attach spelling menus to the basic inputs.

Test Plan: Updated existing tests

Reviewers: juan, drew

Reviewed By: drew

Differential Revision: https://phab.nylas.com/D2721
2016-03-14 10:23:57 -07:00
Ben Gotow 53037b9918 Merge pull request #1648 from Eldorado234/patch-2
Fixed text overflow in phishing detection indicator
2016-03-14 10:09:21 -07:00
Jackie Luo 6e9384792a 🎨(themes): Fixes Windows button UI issues in #1649 2016-03-12 11:43:49 -08:00
Evan Morikawa 9cbe002a8b fix(sidebar): keep trying on 202s
Also fixed a bug where the email could come back with different
capitalization causing a cache miss
2016-03-11 16:27:04 -05:00
Simon Seyer 9b14c551e2 Fixed text overflow in phishing detection indicator 2016-03-11 20:33:06 +01:00
Jackie Luo f7f39e74ce fix(themes): Add quick fixes for Ubuntu 2016-03-11 11:02:02 -08:00
Jackie Luo ea912f5690 Merge pull request #1629 from ahmedlhanafy/master
Added Ubuntu theme to the internal packages
2016-03-11 10:59:30 -08:00
Simon Seyer 6d85e1785b Fixed alignment of message headers
like the phishing indicator.

Before this change: http://pasteboard.co/2bUg8PU9.png
After: http://pasteboard.co/2bUj2Bmz.png
2016-03-11 19:07:52 +01:00
Drew Regitsky 6efaf6220a fix(templates): fix a null check bug in template contentedtable ext 2016-03-10 19:06:15 -08:00
Ahmed Magdy cad18a0d98 Added Ubuntu theme to the internal packages 2016-03-11 03:50:19 +02:00
Juan Tejada 533ffd683e fix(snooze): Fix getter for inbox category in when moving to snooze 2016-03-10 17:46:23 -08:00
Ben Gotow 7c2fd2a91b fix(labels): Do not re-use mail labels if they're removable 2016-03-10 17:08:42 -08:00
Jackie Luo d28c79fc75 🎨(theme-picker): Order internal themes and update theme names 2016-03-10 16:37:06 -08:00
Ben Gotow 038032d68e fix(bodies): Message with empty string body showed loading forever 2016-03-10 16:13:17 -08:00
Ben Gotow c296e2e1d4 fix(sync): Do not paginate /metadata unless pluginsSupported 2016-03-10 16:03:36 -08:00
Evan Morikawa a69d918c0f fix(sidebar): return valid person to prevent cache miss 2016-03-10 18:49:00 -05:00
Evan Morikawa ea98cb8388 fix(sidebar): change optional bit in package 2016-03-10 18:40:26 -05:00
Evan Morikawa 69d1b10508 fix(sidebar): don't show nulled profiles 2016-03-10 18:32:37 -05:00
Ben Gotow 04492c06c7 fix(messages): Replace calc with margin to make plugin styling easier 2016-03-10 15:31:05 -08:00
Ben Gotow 3888c0c510 fix(labels): Labels should not show "X" in wide mode 2016-03-10 15:31:05 -08:00
Jackie Luo 688582bf57 🎨(theme-picker): Adjust styles 2016-03-10 15:18:57 -08:00
Evan Morikawa 5dbef230a3 fix(sidebar): explicitly detect 202 and cache null people 2016-03-10 18:16:32 -05:00
Ben Gotow e8e4761e45 fix(github): Correct minor issue during ES6 conversion 2016-03-10 14:31:50 -08:00
Ben Gotow 0fb6d4c401 fix(remove-from-view): Missing invocation for non-Gmail 2016-03-10 14:25:28 -08:00
Jackie Luo 4d7f515090 feat(plugins): Move uninstall from theme picker to plugins tab
Summary: Move uninstall functionality to the plugins tab in preferences.

Test Plan: Tested locally.

Reviewers: bengotow, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2716
2016-03-10 14:16:07 -08:00
Juan Tejada f12896d54f fix(gmail-labels): Constraint so threads always belong to all,spam or trash
Summary:
- In Gmail all threads /must/ belong to either All Mail, Trash and Spam, and
  they are mutually exclusive, so we need to make sure that any add/remove
  label operation still guarantees that constraint
- Update ChangeLabelsTask to modify the set of labels to add and remove
  based on this rule
- Update tasksFor archiving, moving to trash and moving to spam so they
  don't affect any other labels in the thread, as gmail does.
- Removing from view /will/ remove any current labels, but will also
  move between all mail and trash as needed
- Remove Inbox, Trash and Spam from the CategoryPicker, as Gmail does

Test Plan: - Unit tests

Reviewers: drew, evan, bengotow

Reviewed By: drew, evan, bengotow

Differential Revision: https://phab.nylas.com/D2715
2016-03-10 14:13:31 -08:00
Ben Gotow b8485eaee5 fix(onboarding): We should accept IPs for servers during auth 2016-03-10 12:08:05 -08:00
Ben Gotow a1a5aaddbb fix(onboarding): Make links in error messages clickable 2016-03-10 12:08:05 -08:00
Evan Morikawa d9d9d1a474 fix(sidebar): design tweaks to sidebar 2016-03-10 15:06:59 -05:00
Evan Morikawa dade20a148 fix(sidebar): minor sidebar style and padding tweaks 2016-03-10 15:06:59 -05:00
Jackie Luo 73e01dabb4 fix(themes): Fix linter issues and relink images 2016-03-10 11:54:05 -08:00
Ben Gotow 263c3a152e 💄(sidebar): Replace icon with person 2016-03-10 11:15:52 -08:00
Jackie Luo 7e7835095d 🎨(themes): Move notification heading below toolbar 2016-03-10 11:14:02 -08:00
Jackie Luo 07d0655c55 Merge pull request #1621 from jamiewilson/master
Adding ui-darkside to internal packages
2016-03-10 11:11:15 -08:00
Evan Morikawa fe5b9c3258 fix(sidebar): use http basic auth to pass token 2016-03-10 14:06:48 -05:00
Ben Gotow 2bd03dc44f fix(sync): Pull down and associate metadata during initial sync
Summary:
Snooze should wait for categories on all accounts

Fix authPlugin to rembmer `plugin+accountId`, not pluginId, add specs

categories() returned [], categories(acctId) returned {}

dry up sync worker, fetch metadata before anything else

Test Plan: Run tests

Reviewers: drew, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2693
2016-03-10 11:06:06 -08:00
Ben Gotow 4fefec0b52 patch(save): Only save drafts when necessary, avoid sync-engine issues
Summary:
Previously, we have saved drafts back to the user's provider through the sync engine. There are a handful of very serious edge case issues we're working to solve that are creating a bad user experience. (#933, #1175, #1504, #1237)

For now, we're going to change the behavior of N1 to mitagate these issues.

- If you create a draft in N1, we will not sync it to other mail clients while you're working on it.
- If you enable send later, we'll start syncing the draft to the server as before.
- If you created the draft in another client, we'll sync the draft to the server as before.

Fix specs

Test Plan: Run specs

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2706
2016-03-10 11:03:38 -08:00
Jamie Wilson cf6fa6d93f adding ui-darkside to internal packages 2016-03-10 12:18:32 -06:00
Ben Gotow 6d7cfa50f2 fix(bodies): MBP should cache "" so that it updates when new body arrives 2016-03-09 19:14:54 -08:00
Ben Gotow 7a31da9fc9 fix(bodies): Move loading into component, add retry, loading spinner 2016-03-09 19:14:54 -08:00
Evan Morikawa a53f2ade75 Revert "fix(sidebar): use n1_id to verify edgehill server"
This reverts commit 2e1bf03700.
2016-03-09 21:11:53 -05:00
Evan Morikawa 614865c439 fix(sidebar): fix ordering and add hover state 2016-03-09 20:57:13 -05:00
Evan Morikawa 2e1bf03700 fix(sidebar): use n1_id to verify edgehill server 2016-03-09 20:27:31 -05:00
Jackie Luo 6823b31e21 🎨(plugins): Add install button in preferences 2016-03-09 16:54:29 -08:00
Jackie Luo 94580240ba 🎨(plugins): Switch to switches 2016-03-09 16:54:09 -08:00
Jackie Luo 4792193bd4 🎨(themes): Tweak UI for consistency 2016-03-09 16:20:33 -08:00
Juan Tejada ee95640f2e fix(snooze-button): Change div to button 2016-03-09 16:10:15 -08:00
Jackie Luo 997e1bb5ad fix(themes): Move Taiga into directory 2016-03-09 15:52:22 -08:00
Noah Buscher 82e7e153b7 Added Taiga! 2016-03-09 17:44:01 -06:00
Ben Gotow 26888f9287 Revert "fix(autolinker): PR accepted into 0.24.1, fixes #839"
This reverts commit fb4fe3fd5f.
2016-03-09 15:21:27 -08:00
Ben Gotow 5e360b41cd fix(sync): Paginate /threads, etc. slightly slower to aleviate backend load 2016-03-09 15:21:27 -08:00
Evan Morikawa 19682d8095 fix(search): search perf and fix css issues 2016-03-09 18:12:06 -05:00
Evan Morikawa 51906bd085 fix(spec): fix message timestamp spec 2016-03-09 16:44:44 -05:00
Evan Morikawa 89323b05db feat(sidebar): add timestamps to related messages 2016-03-09 16:17:20 -05:00
Evan Morikawa 8475afbbfb fix(sidebar): ui tweaks to narrow sidebar 2016-03-09 15:46:10 -05:00
Juan Tejada a0a3247815 fix(warning): Remove unused Popover require 2016-03-09 12:11:16 -08:00
Juan Tejada 69a99c914d fix(signatures): Correct regex to properly replace existing signature
- Fixes #1561
- Add more specs
2016-03-09 12:06:27 -08:00
Ben Gotow 9c07a1a15e 💄(onboarding): Minor style changes to account choose page 2016-03-09 11:40:56 -08:00
Ben Gotow aac3198971 fix(sent): Sort sent view by most recent sent message, not received 2016-03-09 11:40:56 -08:00
Evan Morikawa d4ef6a20e5 feat(sidebar): Add thread list of currently selected participants
Summary:
WIP. I added a collection index to make displaying the threads of a
currently selected participant on the sidebar easy and fast.

The problem is that the `participants` of a thread, while a collection of
`Contact` objects, have no "ids" for those contact objects.

One idea was to create the join table but access contacts by email instead
of id. This required a minor change to the way the data is entered in the
join table.

This means the sidebar can now simply do:

`DatabaseStore.findAll(Thread).where(Thread.attributes.participants.contains('foo@bar.com'))`

While I didn't for this initial test, we could also/instead create the
`Message-Contact` join table. The trick about a Message-Contact table is
that I believe we'd have to create additional columns further specifying
which field we're interested in.

The following two queries:

`DatabaseStore.findAll(Message).where(Message.attributes.to.contains('foo@bar.com'))`

`DatabaseStore.findAll(Message).where(Message.attributes.from.contains('foo@bar.com'))`

would require additional columns in the `Message-Contact` join table
because currently the only columns are `id` and `value`.

In the case of the sidebar use case, I think the Thread participants is
what you want to see anyway.

Unfortunately an email-centric scheme can't distinguish between
`noreply@phab.com <Evan>` and `noreply@phab.com <Juan>`. I actually think
this may be a good thing since I think most people think in terms of email
address as the unique key anyway and for the use case of showing related
emails in the sidebar I'd rather overshow than undershow.

This solution seems to be working pretty well in initial testing, but I
want to see if you guys can think of anything this may subtly screw up
down the line, or if you can think of a simpler way to do this.

Test Plan: todo

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2687
2016-03-09 14:33:31 -05:00
Juan Tejada c6acca8ca3 remove(popover): Remove Popover in favor of FixedPopover
Summary:
- FixedPopover now correctly adjusts itself when overflowing outside
  window, in all directions
  - Updates styles
  - Adds specs
- Remove Popover and popover.less, and refactor all code that used it in
  favor of the new FixedPopover

Test Plan: Unit tests

Reviewers: drew, evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2697
2016-03-09 10:05:46 -08:00
Jackie Luo ea5744d0ed fix(theme-picker): Fix linter issues for ES6 2016-03-08 17:41:22 -08:00
Jackie Luo e94dbbdca1 fix(theme-picker): Move launch command to activate() 2016-03-08 17:32:23 -08:00
Jackie Luo ba5cba3181 feat(theme-picker): Uninstall themes on click
Summary: Themes can now be uninstalled by clicking a button in the theme picker, instead of going to `~/.nylas/packages` to delete the directory.

Test Plan: Tested locally.

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2700
2016-03-08 17:08:35 -08:00
Drew Regitsky 6a4b081707 fix(sync-errors): Handle account deltas indicating sync issues
Summary:
Changes the delta code to handle new deltas on the Account object,
which are triggered by changes in sync state indicating various backend
issues. Saves the sync state in a new field on the Account object, which
is persisited in `config.cson`.

Includes several UI changes to display more information when an account has
backend sync issues. Adds better messages and new actions the user can take
based on the type of sync issue.

Additionally, fixes bug in action bridge that was preventing multi-arg global
actions from working.

Test Plan:
Manual, by testing different sync state values and triggering deltas from the
backend

Reviewers: juan, evan, bengotow

Reviewed By: evan, bengotow

Subscribers: khamidou

Differential Revision: https://phab.nylas.com/D2696
2016-03-08 16:06:04 -08:00
Ben Gotow df9e3b7464 fix(body-processor): Observe the db to clear cache. Fixes #1133
Summary:

Test Plan:

Reviewers:

Subscribers:
2016-03-08 13:14:06 -08:00
Ben Gotow fb4fe3fd5f fix(autolinker): PR accepted into 0.24.1, fixes #839 2016-03-08 10:22:08 -08:00
Evan Morikawa 388fd455ea fix(lint): fix linter issues 2016-03-08 13:02:10 -05:00
Drew Regitsky 1bd3fc74e9 test(plugins): Add specs, refactor/fixes for open and link tracking
Summary:
Add specs to test the components of open tracking and link
tracking. Notably does not test the overall functionality, which
still needs specs.

Test Plan: adds specs

Reviewers: juan, evan, bengotow

Reviewed By: evan, bengotow

Differential Revision: https://phab.nylas.com/D2667
2016-03-07 20:54:43 -08:00
Drew Regitsky e35b37441b fix(send): make send/syncback draft tasks cooperate, fix task ordering tracking
Summary:
Fixes an issue with sending where certain conditions could result in a
duplicated message.

Fixes task dependency logic for draft syncback and send. Changes `createdAt`
on tasks to instead be `sequentialId`, assigned when the task is queued, to
track order of enqueueing. Renames `isDependentTask` => `isDependentOnTask`
and adds comments for clarity.

Test Plan:
Specs updated. Might be good to add some later to test this particular
edge case.

Reviewers: juan, evan, bengotow

Reviewed By: evan, bengotow

Differential Revision: https://phab.nylas.com/D2681
2016-03-07 20:14:58 -08:00
Drew Regitsky eaf831efb4 fix(msg-ctrls): reorder hidden options to reduce accidental error reports 2016-03-07 18:24:31 -08:00
Ben Gotow 6d43c9623c fix(autoload-images): Bar disappears when you choose to load images 2016-03-07 18:19:17 -08:00
Ben Gotow 9bb181ef3e 💄(search): Show focus around search input 2016-03-07 18:19:17 -08:00
Juan Tejada 0d15c6cea6 fix(remove-from-view): Fix logic for delete/remove-from-view behavior:
Summary:
- Separate gmail's remove-from-view and delete behaviors and write logic
  for each of those
  - Remove MailboxPerspective::{canArchiveThreads, canTrashThreads,
    removeThreads} and some unecessary code in TaskFactory
  - Instead, add MailboxPerspective::tasksForRemovingFromPerspective (I
    know its a bit of a mouthful)
  - I initially tried to put all of the logic for each execution path
    inside the TaskFactory by checking perspective types, but it made
    more sense to use the polymorphism already in place for the different
    perspective types.
  - There is a default delete/remove-from-view behavior which is
    configurable via simple ruleset objects. The gmail behavior is
    configured in this way.
- Update swipe css classes based on destination of threads
- Fixes #1460:
  - Update logic to display archive/trash buttons and context menu options correctly
    when selected threads can be archived/trashed (not based on
    perspective)
  - Same for swiping
- Add a bunch of specs
- Convert some code to ES6
- TODO write some docs for new functions

Test Plan: Unit tests

Reviewers: drew, evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2682
2016-03-07 18:16:37 -08:00
Juan Tejada 1fe51ef586 fix(date-utils): Add localization to date formats
Summary:
- Setting the locale in moment was not sufficient to actually use the
  correct localized formats.
- Moment provides localized format via the formats : 'L', 'LL', 'll',
  etc. See: http://momentjs.com/docs/#/displaying/format/
- Updates to set our date formats based on localized formats:
  - Unfortunately, localized formats always contain the year, so I
    manually removed the year from our short format.
- Actually fixes: #1515
- Fixes bug where setting nextWeek or thisWeekend returned incorrect
  date if the current day was saturday or sunday
- Add specs

Test Plan: Unit tests

Reviewers: evan, drew, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2688
2016-03-07 16:44:54 -08:00
Jackie Luo f21e561317 spec(theme-picker): Remove filter for theme picker spec 2016-03-06 16:37:36 -08:00
Jackie Luo 62007cfbb1 🎨(theme-picker): Add inline style to close button 2016-03-06 16:36:28 -08:00
Jackie Luo 86133a150a fix(theme-picker): Fix linter issue 2016-03-06 15:25:52 -08:00
Jackie Luo 02cdc5d38a fix(theme-picker): Update spec to work with iFrame rewriting function 2016-03-05 11:24:37 -08:00
Jackie Luo c67e2a24ea feat(theme-picker): Add visual theme picker to menu
Summary: Adds a new visual theme picker to the menu that allows users to select different themes based on color palettes and then change their themes live.

Test Plan: Test included.

Reviewers: evan, bengotow

Reviewed By: evan, bengotow

Differential Revision: https://phab.nylas.com/D2669
2016-03-04 15:34:48 -08:00
Evan Morikawa 66c84383ff feat(onboarding): update account-choose page 2016-03-04 16:53:26 -05:00
Evan Morikawa bc4123a045 feat(onboarding): restyle step 3 2016-03-04 16:48:16 -05:00
Evan Morikawa 7cfe045b6d feat(onboarding): style page 2 2016-03-04 16:48:16 -05:00
Evan Morikawa 2f0630b0e8 feat(onboarding): style page 1 2016-03-04 16:48:16 -05:00
Ben Gotow a1867ead6b fix(auth): re-enable ssl_required checkbox with backend support 2016-03-04 13:29:18 -08:00
Ben Gotow 092fb99a17 fix(phishing): Tie to MessageStore so it works when msgs aren't ready 2016-03-03 14:39:15 -08:00
Ben Gotow 84b92af0e7 💄(bars): No email address overflowing phising / autoload images bars 2016-03-03 14:16:54 -08:00
Mehdi Rejraji 19d3c416fc Match only valid URLs for link tracking
As of now, link-tracking creates link tracking for every <a> tag, no matter the href attribute. This commit only creates link tracking for valid URLs.
The reason I wrote a new regex instead of rewriting linkTagRegex is that this regex is used by message-list.
https://regex101.com/r/jD5zC7/3 vs https://regex101.com/r/cK0zD8/2

Resolves: #1525
2016-03-03 13:46:41 -08:00
Juan Tejada 4900df4768 fix(lint): Fix linter error in specs 2016-03-03 13:45:28 -08:00
Juan Tejada f46502ad3e test(plugins): Add snooze and send later specs
Summary:
- Also refactors the code a bit for testability and maintainability
- Fixes #1515

Test Plan: - Unit tests

Reviewers: evan, drew, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2651
2016-03-03 12:38:42 -08:00
Ben Gotow 9b54d9cf31 fix(MessageContainer): Fix state, prevent from getting different messages. #1175
Summary:
This fixes a serious issue where drafts could appear to be sending if
they were located in the same index of the message list as a draft which was
previously sending.

Under the hood this was due to two bad programming choices:

1) State based on props in MessageContainer requires correct implementation of
   componentWillReceiveProps. This is definitely an anti-pattern.

2) Using item index rather than clientId as the key for items in the MessageList
   caused containers to be given a different message prop when one was inserted,
   rather than just shifting the existing ones down and inserting a new one.

Test Plan: Not sure how to test this really...

Reviewers: drew, juan

Differential Revision: https://phab.nylas.com/D2673
2016-03-03 12:10:03 -08:00
Jackie Luo 83fa692bb5 Bump version for node-emoji 2016-03-02 18:58:07 -08:00
Evan Morikawa 572498aa68 fix(composer): fix minor spacing issue on popout composer 2016-03-02 16:06:40 -08:00
Evan Morikawa b727fe374d fix(find-in-thread): minor rename fixes 2016-03-02 15:00:01 -08:00
Evan Morikawa 10e0fcc965 feat(find-in-thread): add the ability to find in a thread
Summary: Find in thread

Test Plan: todo

Reviewers: bengotow, juan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2660
2016-03-02 14:46:27 -08:00
Ben Gotow a53e72f542 fix(hidden-messages): Address diff feedback from @jstejada 2016-03-02 10:28:32 -08:00
Ben Gotow f5ee557e2e feat(hidden-messages): Filter trash/spam messages. Fixes #1135
Summary:
By default, the messages in a thread are now filtered to exclude
ones moved to trash or spam. You can choose to view those messages by clicking
the new bar in the message list.

When you view your spam or trash, we only show the messages on those threads
that have been marked as spam/trash.

Test Plan: Run a couple new tests

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2662
2016-03-02 10:05:17 -08:00
Evan Morikawa 66d1fe67e8 fix(account): re-add token if a new one comes in
Summary: fix(account): allow users to reconnect accounts if auth has failed

Test Plan: manual

Reviewers: bengotow, juan

Differential Revision: https://phab.nylas.com/D2663
2016-03-01 16:02:20 -08:00