Commit graph

21 commits

Author SHA1 Message Date
Ben Gotow
466bca813b fix(syncback): Bidirectional transforms, ready-to-send saved state
Summary:
This diff replaces "finalizeSessionBeforeSending" with a
plugin hook that is bidirectional and allows us to put the draft in
the "ready to send" state every time we save it, and restore it to
the "ready to edit" state every time a draft session is created to
edit it.

This diff also significantly restructures the draft tasks:

1. SyncbackDraftUploadsTask:
   - ensures that `uploads` are converted to `files` and that any
     existing files on the draft are part of the correct account.

1. SyncbackDraftTask:
   - saves the draft, nothing else.

3. SendDraftTask
   - sends the draft, nothing else.
   - deletes the entire uploads directory for the draft

Test Plan: WIP

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2753
2016-03-16 19:27:12 -07:00
Evan Morikawa
388fd455ea fix(lint): fix linter issues 2016-03-08 13:02:10 -05:00
Drew Regitsky
1bd3fc74e9 test(plugins): Add specs, refactor/fixes for open and link tracking
Summary:
Add specs to test the components of open tracking and link
tracking. Notably does not test the overall functionality, which
still needs specs.

Test Plan: adds specs

Reviewers: juan, evan, bengotow

Reviewed By: evan, bengotow

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

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

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

Reviewers: juan, evan, bengotow

Reviewed By: evan, bengotow

Differential Revision: https://phab.nylas.com/D2681
2016-03-07 20:14:58 -08:00
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
Ben Gotow
94a8ca57d8 fix(link/open tracking): Update error messages 2016-02-25 13:32:59 -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
Juan Tejada
dea8318e13 💄(plugins): Add error messages back to plugin dialogs 2016-02-24 18:22:54 -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
Evan Morikawa
9ad088f899 feat(tracking): sticky tracking state and consolidate component 2016-02-24 14:46:09 -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
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
0c8ecc5829 💄 (plugins): Clean up constants in plugins
- Fix some eslint issues
2016-02-23 22:55:47 -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
Ben Gotow
5e78a9b2c6 💄(plugins): Updated assets and a bit of error handling 2016-02-23 17:51:10 -08:00
Evan Morikawa
481dc28585 feat(composer): new composer footer and icon design 2016-02-23 13:42:10 -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