Commit graph

1580 commits

Author SHA1 Message Date
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
mbilker
a1b9775b6d lint(*): correct eslint errors, warnings still exist
There are warnings in `spellcheck-composer-extension.es6` for the `while (true)`
loops.
2016-03-01 10:58:29 -05:00
Jackie Luo
876aea0ad9 fix(composer-emojis): Insert emoji on tab, fixes #1511 2016-02-29 20:46:30 -08:00
Ben Gotow
94badcda15 es6(*): convert 20+ source files used in example packages to ES2016
There could be a few lurking bugs. Please test!
2016-02-29 18:47:22 -08:00
Ben Gotow
3072246d8e temp(onboarding): Remove checkbox for option not yet on prod 2016-02-26 16:49:46 -08:00
Drew Regitsky
3327fc4cff fix(message-controls): add accountId to debug values copied to clipboard 2016-02-26 15:13:33 -08:00
Ben Gotow
b92e4fa07b fix(threads): Right-align the timestamps in the thread list 2016-02-26 15:00:56 -08:00
Ben Gotow
04f93bd055 💄(print): Fix #1425 2016-02-26 14:40:16 -08:00
Ben Gotow
18677e51a6 fix(config): Store cursors with sync state, avoid constant config.cson writes
Summary:
Previously we were storing sync cursors in config.cson. They were by
far the most frequently updated piece of data in config. To make things worse,
all the writing was happening in the worker window - the main window was just
seeing the changes on disk and reloading.

I believe there's an edge case which causes the main window to read the config
file when it's mid-write and empty. This causes the accounts array to become
empty in the AccountStore and lots of downstream issues. It's also then possible
for the main window to write a config change of it's own and empty the file
permanently.

Test Plan: A few new tests to make sure this is backwards compatible.

Reviewers: juan, evan

Reviewed By: juan, evan

Differential Revision: https://phab.nylas.com/D2642
2016-02-26 13:52:19 -08:00
Drew Regitsky
d3d4978dbd fix(message-controls): update email address for reporting 2016-02-26 12:29:11 -08:00
Drew Regitsky
0e522ec789 feat(message-controls): Option to copy message IDs/metadata to clipboard 2016-02-26 12:26:20 -08:00
Juan Tejada
0b5afaad71 fix(lint) 2016-02-26 11:24:00 -08:00
Juan Tejada
8e382f8c26 fix(aliases): Fix regression to properly create/update/remove aliases
- This fixes #1428
- Add specs
2016-02-26 11:01:01 -08:00
mbilker
1a5766114e lint(system-tray): code style consistent with rest of file 2016-02-26 11:37:20 -05:00
mbilker
38dce709e2 fix(system-tray): rename icon files for Windows and Linux 2016-02-26 11:23:53 -05:00
Drew Regitsky
e313da8a6b fix(metadata): update metadata version when processing deltas 2016-02-25 16:20:58 -08:00
logandavis
dded8abd7f Re-add SSL checkboxes with name ssl_required
Summary:
Now that IMAP auth without SSL is enabled,
those checkboxes that weren't doing anything can come
back.

Test Plan:
This change isn't fully tested and should be thoroughly
inspected (on staging?) before rollout. The N1 end works and sends
parameters correctly, but a 401 prevented local testing of the
interface between N1 auth and sync-engine auth.

Reviewers: bengotow, drew

Reviewed By: drew

Subscribers: kav-ya

Maniphest Tasks: T6666

Differential Revision: https://phab.nylas.com/D2632
2016-02-25 14:38:49 -08:00
Ben Gotow
1df517c4af bump(version): 0.4.9 and changelog 2016-02-25 14:10:21 -08:00
Juan Tejada
dd92c9b6ad fix(snooze): Do not display snooze buttons unless looking at inbox 2016-02-25 14:02:58 -08:00
Evan Morikawa
d97e724c1b fix(analytics): fix send later and snooze analytics 2016-02-25 14:01:15 -08:00
Ben Gotow
816596d422 perf(snooze): Don't wrap snooze label in unsafe container 2016-02-25 13:39:30 -08:00
Ben Gotow
94a8ca57d8 fix(link/open tracking): Update error messages 2016-02-25 13:32:59 -08:00
Ben Gotow
a1db17e3c9 fix(snooze): Hide N1-Snoozed from the category picker 2016-02-25 13:32:58 -08:00
Evan Morikawa
e77d658a96 fix(composer): focus on the absolute end when clicking near the bottom 2016-02-25 13:31:34 -08:00
Juan Tejada
93f43f6b4f feat(snooze): Add snooze date label to snooze threads
- Adds a new InjectedComponentSet for the role 'ThreadList:Label'.
- Adds a new label to the thread list indicating the snooze date if the
  thread has been snoozed
- Coerces MailLabel to achieve this. This is a temporary hack, we should
  design a better view to display snooze date information
2016-02-25 13:12:40 -08:00
Ben Gotow
fe27fb161f fix(link/open tracking): Remove intermediate metadata states, extra db lookup, dead code 2016-02-25 12:54:18 -08:00
Evan Morikawa
274131863f feat(analytics): add analytics to send later, snooze, tracking 2016-02-25 12:34:09 -08:00
Drew Regitsky
d5ba162e82 fix(composer-buttons): Fix broken icons on overflow, make buttons wrap 2016-02-25 12:30:20 -08:00
Evan Morikawa
cc15d35848 fix(plugin): better errors if plugins are malformed
Fixed read assets
2016-02-25 11:55:11 -08:00
Juan Tejada
57d7057161 💄(composer): Properly align 'X more' token 2016-02-25 11:42:38 -08:00
Ben Gotow
bb99f95d2c sp(translate): Transalate => Translate 2016-02-25 11:05:07 -08:00
Juan Tejada
58833b39e8 feat(snooze): Update message in toast when snoozing
- Adds new arg to ChangeLabelTask and ChangeFolderTask to override
  default description
- Adds custom description to task when snoozing
2016-02-25 10:42:21 -08:00
Juan Tejada
2a757f332e fix(plugins): Add headers for composer popover + Fix in snooze popover 2016-02-25 10:24:29 -08:00
Evan Morikawa
407498057c fix(composer): minor padding fix in composer 2016-02-25 10:06:17 -08:00
Ben Gotow
296110d177 fix(swipe): Make it easier to close snooze-confirm swipe state, fix double-popover issue 2016-02-24 21:01:23 -08:00
Jackie Luo
5a480031f0 fix(composer-emojis): Adjust width for overflower 2016-02-24 20:41:54 -08:00
Ben Gotow
9d0ebe9423 fix(snooze): A few minor popover adjustments. See desc.
- Rather than have a `showing` prop on the fixed popover, I just remove it and put a span in it's place when it's gone. This means we always get componentDidMount when the popover appears and simplifies when to focus it's content.
- The fixed popover implements esc and blur behaviors itself
- The fixed popover uses the background-secondary color and works in dark mode
- The snooze items have hover and active states
2016-02-24 20:05:21 -08:00
Ben Gotow
030b60d27d fix(star): Bulk star icon has never shown current state(?!) 2016-02-24 20:05:21 -08:00
Juan Tejada
dea8318e13 💄(plugins): Add error messages back to plugin dialogs 2016-02-24 18:22:54 -08:00
Ben Gotow
21b1cd4e19 fix(build): Don't delete plugin package.json files, restore ellipsis (@sdw consulted HIG!) 2016-02-24 18:15:55 -08:00
Drew Regitsky
db5c822ccf fix(snooze): options text capitalization: title case => sentence case 2016-02-24 17:56:52 -08:00
Juan Tejada
8e26c8574f fix(lint): Fix lint errors 2016-02-24 17:53:31 -08:00
Drew Regitsky
d58f8567b5 fix(send-later): options text capitalization: title case => sentence case 2016-02-24 17:45:14 -08:00
Juan Tejada
9fa64c38e2 fix(plugins): Several minor fixes:
- Fixes styling for snooze quick action button when thread selected
- Fixes snooze popover input debouncing
- Other interaction fixes
2016-02-24 17:34:18 -08:00
Drew Regitsky
cffa9c723c fix(open-tracking): quick CSS fix to thread list icon 2016-02-24 16:55:17 -08:00
Evan Morikawa
829facd6dc fix(snooze): look at allCategories instead of userCategories 2016-02-24 16:51:34 -08:00
Ben Gotow
f083818c92 💄(snooze): Fix swipe-to-snooze animation 2016-02-24 16:44:16 -08:00
Drew Regitsky
fb335c332b fix(plugins): Change server URLs for open/link tracking to final values 2016-02-24 16:29:12 -08:00
Evan Morikawa
17ea99d2ff fix(error-handling): handle offline for link tracking & read-receipts
Fix offline error handling of link tracking and read receipts

Fix ellipses for tooltips

Allow you to change the title in the error box
2016-02-24 16:06:08 -08:00
Juan Tejada
d866679737 fix(snooze): Fix quick action button, remove italic from popover 2016-02-24 15:33:57 -08:00
Evan Morikawa
3790f15732 fix(read-receipt): message status updates live 2016-02-24 15:25:11 -08:00
Juan Tejada
f86d984355 fix(snooze): Close popover on error 2016-02-24 15:11:03 -08:00
Juan Tejada
7f5c225d40 fix(snooze): Close popover when opening a new one 2016-02-24 15:08:53 -08:00
Juan Tejada
defbbbe3c7 fix(snooze): Only allow snooze from inbox 2016-02-24 15:06:06 -08:00
Juan Tejada
9c2a05ba3f fix(fixed-popover): Reposition when overflowing on left direction
- This is a temporary solution
2016-02-24 15:02:42 -08:00
Evan Morikawa
9ad088f899 feat(tracking): sticky tracking state and consolidate component 2016-02-24 14:46:09 -08:00
Ben Gotow
afa22729aa fix(feedback): Remove feedback btn, update "N1 Help" in menu bar 2016-02-24 13:49:15 -08:00
Ben Gotow
1f29cb3cea 💄(send-later): Minor draft list styling changes 2016-02-24 13:44:56 -08:00
Ben Gotow
9d52cb1124 fix(snooze/send-later): Change chrono config to always prefer dates in future 2016-02-24 13:16:53 -08:00
Evan Morikawa
d04ee7ef3a fix(read-receipts): fix padding and styles under selection 2016-02-24 13:16:35 -08:00
Drew Regitsky
fb8f8b78ac fix(read-receipts): threadlist icon vert align and placeholder when missing 2016-02-24 13:02:18 -08:00
Evan Morikawa
02600786c2 fix(tracking): tracking pixel won't register if it's from you 2016-02-24 12:55:00 -08:00
Evan Morikawa
0d7d5489c6 fix(lint): fix less and js linter issues 2016-02-24 12:31:56 -08:00
Evan Morikawa
6144f83834 fix(tracking): fix link tracking and read receipt plugins
Fix broken links in link tracking and read receipts

Fix bug in email frame where it wouldn't adjust the height even when
content changed

MessageItem bodies automatically clear the MessageBodyProcessor cache when
the message contents (including metadata) change.

Remove unused Account stuff from nylas-observables

Plugins appIds properly read if there's an environment set
2016-02-24 12:30:12 -08:00
Ben Gotow
7526fd8684 fix(send-later): Resolves a variety of small bugs from QA 2016-02-24 12:26:56 -08:00
Drew Regitsky
29f751e1ce fix(plugins): more fixes to open/link tracking urls 2016-02-24 12:17:39 -08:00
Drew Regitsky
feabd96f86 fix(plugins): fix open tracking and link tracking URLs 2016-02-24 12:00:40 -08:00
Juan Tejada
aebbaec639 💄 (send-later): Update placeholder copy, again 2016-02-24 11:50:43 -08:00
Juan Tejada
4de7948500 fix(sidebar): Prevent error in snooze item when category doesnt exist
- Add Snooze category to locked and hidden categories to prevent from
  directly moving stuff to it and showing up in the user categories
  section
2016-02-24 11:45:47 -08:00
Jackie Luo
4459fad47b 🎨(composer-emojis): Remove pointer and adjust styling
Summary: The floating toolbar now takes an optional boolean to decide whether it shows the pointer.

Test Plan: Tested locally.

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2628
2016-02-24 11:31:32 -08:00
Juan Tejada
ab181305b3 💄 (popover): Properly apply styles to input inside popover
- Fix tabindex in send later popover
- Update placeholder copy
2016-02-24 11:22:54 -08:00
Juan Tejada
1eb7515ff6 feat(snooze): Add snooze item to sidebar 2016-02-24 10:50:21 -08:00
Juan Tejada
f5c18d1b34 💄 (snooze): Add quotes to popover placeholder 2016-02-24 10:28:08 -08:00
Juan Tejada
194aa84f44 fix(snooze): Close all popover types when submitting date with enter 2016-02-24 10:27:16 -08:00
Jackie Luo
f04449d67a 🎨(composer-emojis): Fix styles in emoji picker
Summary: Adjust sizing, padding, etc., to fit better with overall app design.

Test Plan: Tested locally.

Differential Revision: https://phab.nylas.com/D2627
2016-02-24 10:12:38 -08:00
Ben Gotow
7bc335c28b fix(*): misc fixes for warnings, appearance of PL indicators 2016-02-24 01:04:57 -08:00
Juan Tejada
579d4ad71b fix(signature): Update signature when account is changed in composer
Summary:
- Fixes #1239
- Adds action in composer view to indicate when draft partcipants have
  changed. This seemed like the simplest way to listen for this change without
  adding another extension point
- Updates signature plugin to listen to this action and update signature
  accordingly
- Adds test

Test Plan: - Unit tests

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2614
2016-02-24 00:19:55 -08:00
Juan Tejada
57fb1919ee fix(system-tray): Move Tray to main process
Summary:
- Fixes #1223
- Still uses a package in the renderer process to listen to changes in
  the unread count and have access to the canvas api.
- Renderer process will write icon to disk and inform main process that
  it should update the icon

Test Plan: - Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2613
2016-02-23 23:26:06 -08:00
Juan Tejada
0c8ecc5829 💄 (plugins): Clean up constants in plugins
- Fix some eslint issues
2016-02-23 22:55:47 -08:00
Juan Tejada
d930abcea6 fix(snooze): Fix react component warnings 2016-02-23 22:39:18 -08:00
Ben Gotow
9b32ac4719 fix(metadata-plugins): Add production app ids 2016-02-23 22:29:49 -08:00
Juan Tejada
e82278ab25 feat(snooze): Adds initial design pass and update snooze popover
Summary:
- Add FixedPopover, an absolutely positioned popover component to use for swipe snoozing:
  - This component needs to be finished, as its current behavior is primarily for the snooze plugin
- Updates popover.cjsx to properly render pointer for thesnooze popover for the `down` direction
- Adds new design assets
- Adds date input to snooze popover

Test Plan: - TODO

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2624
2016-02-23 20:03:42 -08:00
Drew Regitsky
4289e09651 fix(metadata-plugins): update all appIds and URLs for staging 2016-02-23 19:19:43 -08:00
Evan Morikawa
393156c55c fix(link-tracking): fixes in link-tracking 2016-02-23 18:58:07 -08:00
Evan Morikawa
6e48af0c90 fix(read-receipts): Style fixes to link tracking and read receipts 2016-02-23 18:58:07 -08:00
Evan Morikawa
f3d8ddda21 feat(read-receipts): show status on MessageItem 2016-02-23 18:58:07 -08:00
Ben Gotow
29a0da36a3 fix(auth-failure): Warn of disconnect on 403s, fix logic 2016-02-23 18:35:24 -08:00
Ben Gotow
5e78a9b2c6 💄(plugins): Updated assets and a bit of error handling 2016-02-23 17:51:10 -08:00
Ben Gotow
40274cfc77 fix(composer): Redo toolbar styling with theme variables + minor fixes 2016-02-23 15:40:44 -08:00
Ben Gotow
6efd513608 💄(snooze): Quick action styling, draft pencil alignment 2016-02-23 14:37:10 -08:00
Ben Gotow
5f38c9dfb1 fix(send-later): Re-order so send later always appears beside send 2016-02-23 14:37:10 -08:00
Evan Morikawa
e450e10c66 fix(linter): fix less linter error 2016-02-23 14:18:49 -08:00
Evan Morikawa
e6b285f504 fix(inbox-zero): don't show inbox zero when syncing 2016-02-23 14:17:11 -08:00
Evan Morikawa
2dc88f3fe2 fix(img): png-crush images 2016-02-23 14:12:02 -08:00
Evan Morikawa
eedf84792d fix(composer): fix styles in popout composer 2016-02-23 13:55:31 -08:00
Ben Gotow
39265572bc 💄(send-later): Lots of styling of send-later 2016-02-23 13:52:18 -08:00
Evan Morikawa
481dc28585 feat(composer): new composer footer and icon design 2016-02-23 13:42:10 -08:00
Evan Morikawa
97b15a5ace feat(inbox-zero): add minimal graphic to inbox when no threads 2016-02-23 10:50:08 -08:00
Ben Gotow
66986ff00a 💄(onboarding): Incorrect button padding during onboarding 2016-02-23 10:48:36 -08:00
Ben Gotow
34da43c42a 💄(icon): A delightful seafoam green icon 2016-02-23 10:35:08 -08:00
Ben Gotow
2e1cb643dc fix(swipe): Better animation, callback for action completion 2016-02-22 16:08:10 -08:00
Ben Gotow
d3641d2703 💄 Minor visual tweaks to win32 + dark mode 2016-02-22 13:30:12 -08:00
Ben Gotow
7a873cac58 fix(drag): Patch for crash on dragging threads 2016-02-22 10:57:22 -08:00
Ben Gotow
3049e9869c 💄(search): Fix clear button positioning 2016-02-22 10:14:34 -08:00
Ben Gotow
8168838101 fix(compose): More defensive check when switching from address, see description
This fixes #1341, but is more restrictive:

- You cannot switch From: accounts if the draft was retrieved from the sync engine (authored via Gmail or via another copy of N1. The sync-engine gives drafts a non-null threadId)

- You cannot switch From: accounts if the draft is a forward from an existing thread.

These two restrictions are unfortunately necessary to ensure that we don't have to download attachments we don't have to re-upload them to another account on the sync-engine. We could write code for this in the future but it's going to be gross.
2016-02-19 19:19:43 -08:00
Ben Gotow
99441ebd35 fix(print): Add print button to preview, don't print immediately (Fixes #1352) 2016-02-19 19:07:22 -08:00
Ben Gotow
7a760ff766 fix(compose): Enable esc-to-cancel from Cannot Send dialog (Fixes #1383) 2016-02-19 18:59:17 -08:00
Ben Gotow
825d2ef8be 💄: Experimental app icon, fix for merge conflict 2016-02-19 18:52:49 -08:00
Ben Gotow
f63b7e66e4 feat(swipe-to-*): Gesture support and animation in thread list
Summary:
This diff does two things:
- It adds a new SwipeContainer that makes it easy to implement swipe gestures. This is built into listTabular, so you can create a list and define onSwipeLeft/Right to enable gestures.

- It adds support for basic add/remove animations to the thread list. This works by adding a CSS transition to `top` and also leaving removed rows around for a specified time. (these times need to match.) Pretty much just cloned the core idea from TimeoutTransitionGroup.

Test Plan: No tests yet

Reviewers: evan, juan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2581
2016-02-19 18:22:28 -08:00
Evan Morikawa
3b8cc984d0 feat(menu): add right click menu
Summary:
Adds a right click menu to the thread list
Moving to folders and labels #TODO

Test Plan: TODO

Reviewers: bengotow, juan

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2609
2016-02-19 18:35:48 -05:00
Ben Gotow
0559e92dc3 fix(sending): Tiny fix for strange vertical space when sending 2016-02-19 15:31:51 -08:00
Drew Regitsky
fe7a894e51 feat(new-plugins): add open tracking and link tracking plugins
Summary:
Adds two (very similar) plugins - Open Tracking and Link Tracking.
Both can be enabled via a button in the composer. Open tracking
inserts a tracking pixel right before send, and link tracking replaces
all links with tracked redirects. Both plugins use the new Metadata
service to store their open/click counts, and have backend servers to
respectively serve the pixel image or handle the redirects. Requests
also trigger a metadata update to increment the open/click counters.

Test Plan: Manual for now

Reviewers: evan, bengotow, drew

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2583
2016-02-19 12:42:56 -08:00
Ben Gotow
a0484d13c1 lint(emoji): Fix lint failure from spacing 2016-02-19 11:29:31 -08:00
Karim Hamidou
3aa4b16b44 [auth] Change a Google OAuth parameter
Summary:
Some of our users who reauth are getting weird errors from Google — it seems that in some cases Google OAuth doesn’t pass us a `refresh_token`, even though we ask for one by passing `approval_prompt=force` (I’ve landed a commit to log more details about this in edgehill-server —- 6e984ffa26 — but this won’t fix the problem).

Apparently, Google recently « soft-deprecated » `approval_prompt` in favor of a new parameter called `prompt`, which does mostly the same thing (https://developers.google.com/identity/protocols/OAuth2WebServer#formingtheurl)

This diff replaces `approval_prompt` by `prompt`.

Test Plan: Tested by authing a Gmail account and checking that it worked.

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: emfree

Differential Revision: https://phab.nylas.com/D2557
2016-02-19 11:20:36 -08:00
Ben Gotow
e5bf37cf9e fix(participants): Update specs to reflect that spacing is now in CSS 2016-02-19 10:28:02 -08:00
Ben Gotow
298eb06548 💄: White buttons, dropdown / popover cleanup, hairline dividers 2016-02-18 15:21:42 -08:00
Juan Tejada
e798a1a02d fix(draft-list): Display , separated participants list 2016-02-18 12:14:18 -08:00
Juan Tejada
1f25a37971 🎨(composer): Fix show-more token style in collapsed participants 2016-02-18 12:06:29 -08:00
Juan Tejada
ba1a305485 fix(snooze): Check if snooze category is defined when creating 2016-02-18 10:44:03 -08:00
Juan Tejada
76bda1dbe4 feat(snooze/send-later): Add snooze and send later plugins
Summary:
- Add initial version of snooze and send later plugins
- Tests are missing since this will probably heavily change before we are done with them

Test Plan: - TODO

Reviewers: drew, bengotow, evan

Reviewed By: bengotow, evan

Differential Revision: https://phab.nylas.com/D2578
2016-02-18 10:06:21 -08:00
Ben Gotow
fa34fc303f fix(onboarding): Missing require for Actions, bad CSS 2016-02-17 22:21:23 -08:00
Juan Tejada
1ba3a64785 feat(metadata): Switch to storing metadata on models
Summary:
 - Adds a class ModelWithMetadata which models can now extend from
 - Instances of this class can query metadata for a plugin via
   `obj.metadataForPluginId(pluginId)`
 - To observe changes on metadata it is sufficient to observe database changes on
   the model. e.g.:
   `DatabaseStore.findAll(Thread,
   [Thread.attributes.pluginMetadata.contains(pluginId)])`
 - To set metadata a new action has been created: Actions.setMetadata
 - Adds a helper observable in nylas-observables to query for models with
   metadata
 - Merges CreateModelTask and UpdateModelTask into SyncbackModelTask
 - Update SendDraftTask ans SynbackDraftTask to handle metadata changes

Test Plan: - Unit tests

Reviewers: drew, evan, bengotow

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2575
2016-02-17 15:00:33 -08:00
Juan Tejada
ddb661ed37 fix(account-prefs): Update account save logic to prevent incorrect saves
- This fixes #1354 and #1235
- This issue was caused because the account details preferences
  component was keeping as state all of the account object fields. `setState` works
  like `extend`, so when the account changed, state was set to the new set of account fields,
  but the old values were only removed if they were overriden, and remained the
  same if the field did not exist in the new state object.
  Specifically, when a new account was added, setState was called with
  `{..., defaultAlias: undefined}` which did /not/ remove the  the defaultAlias
  from the previous state.
- Switched to managing state with a top level key `account`
2016-02-16 18:03:22 -08:00
Ben Gotow
e6044d8b33 fix(important): Remove todo, reference to usesImportantFlag. Fixes #1331 2016-02-16 11:41:15 -08:00
Evan Morikawa
2658a01e40 fix(composer): fix dissapearing participant bug w/ multiple composers
If you had multiple composers on a single thread, all but the last
composer would lose its participants. This was because once it loaded the
participants would blur and trigger a request to set the participants to
blank. That request was async so by the time it was resolved the draft was
loaded and the request erroneously went through
2016-02-15 18:12:41 -05:00
Evan Morikawa
55687d3d9f fix(onboarding): remove ssl-enabled checkbox
Until it's implemented in the backend
2016-02-15 16:51:02 -05:00
Evan Morikawa
7edfe3853f fix(messages): fix jumping message list on draft focus
We were erroneously jumping to an individual message when you focused on
it.
2016-02-15 16:34:23 -05:00
Evan Morikawa
e24e0f99f5 fix(message): fix collapse unset when new thread delta
The minification bit was erroneously getting reset when a new thread
update delta came in due to an object equality check instead of an id
check.
2016-02-15 15:46:33 -05:00
Jackie Luo
ecac59f1c3 fix(composer-emojis): Add spec, allow adjacent emojis, fix toolbar positioning bug
Summary:
Adds tests to the emoji picker.

The emoji picker should also now be able to add emojis consecutively (without spaces).

Finally, the toolbar positioning bug (emoji picker appearing in front of typed text, the toolbar manager appearing in the upper left corner when empty lines are selected) should be fixed so that the toolbar appears directly above/below the selection area.

Test Plan: Tests included in diff.

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2551
2016-02-12 11:42:11 -08:00
Evan Morikawa
280015b5c0 fix(analytics): delay closing of onboarding window 2016-02-12 10:56:36 -08:00
Evan Morikawa
0f9475cc91 fix(analytics): add onboarding welcome event 2016-02-12 10:25:28 -08:00
Ben Gotow
d7aacc3cf8 fix(search): Compile immediately to avoid truncating. Fixes #1307 2016-02-11 17:18:24 -08:00
Ben Gotow
92abf1f441 🎨: Fixes, labels in narrow thread view, better label wrap 2016-02-11 15:25:24 -08:00
Juan Tejada
76cbb97c2b 🎨(popover): Remove hardcoded width from code -> move to stylesheet 2016-02-11 13:15:59 -08:00
Ben Gotow
ef40e73108 fix(min-height): Reduce minimum window size to 250px. Fixes #1293 2016-02-10 12:39:13 -08:00
Ben Gotow
fa0438ea9f fix(build): LESS lint issue 2016-02-10 09:38:10 -08:00
Ben Gotow
8a8170eb0e 🎨: Smaller buttons, smaller toolbar, smaller text
This should not be considered final, but we do plan to shrink the size of the entire UI slightly to match platform conventions.
2016-02-09 19:45:24 -08:00
Ben Gotow
fbb7a4b40c bump(*): Electron 0.36.7, version to 0.4.6 2016-02-08 18:35:23 -08:00
Ben Gotow
f4e3137b5b fix(readme): Force github to refresh cache of screenshot 2016-02-08 14:52:07 -08:00
Ben Gotow
399f83bccc fix(tray): Do not show count on Mac OS X when 0. Fixes #1233 2016-02-08 10:31:13 -08:00
Ben Gotow
12f4142d84 fix(system-start): Do not continue when checkAvailability returns false 2016-02-06 11:35:01 -08:00
Ben Gotow
1bd41a84e9 fix(undo): Ensure undo bar dismisses after re-appearing 2016-02-05 19:11:27 -08:00
Ben Gotow
1b3c4cf594 fix(messages): Field label was always "To" 2016-02-05 18:42:29 -08:00
Ben Gotow
7406e2a5a3 feat(perspective): Restore through NylasEnv.savedState 2016-02-05 18:36:48 -08:00
Ben Gotow
fc2a179c6c fix(message): Allow height to be 0, remove 150px min height 2016-02-05 15:33:07 -08:00
Ben Gotow
205f3ba6ab fix(tray): Fix accidental conversion to NaN 2016-02-05 14:37:55 -08:00
Juan Tejada
78665c5fec fix(sidebar): Handle edge cases for sidebar shortcuts
Summary:
- Update menus and shortcuts correclt when accounts change or focused
  accounts change
- Move menu logic into SidebarCommands to remove duplicated logic
- Make `Window` menu also contain checkboxes

Test Plan: - Manual

Reviewers: evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2534
2016-02-05 14:25:07 -08:00
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