Summary:
Pass in more details on sending errors, so that they can be viewed
more easily by clicking "Show Details", rather than having to check
the worker window console.
Test Plan: tested locally
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D3505
On mac, you can now preview an attachment by clicking on the new preview
icon, or by pressing space bar when an attachment is focused.
This commit also updates the styling for attachment items and adds the
ability to focus attachment items. We don't keep any focused state, just
the browser's, which means you can focus attachments by clicking, or
tabbing/shift-tabbing
Summary:
The attachment components were the only React Components which used
inheritance between components, which is an anti-pattern in react. I
deleted these components in favor of new purely functional/dumb
components exposed via the component-kit: Attachment Item and
ImageAttachmentItem. These are defined in the same file to reuse some
smaller components between them, like the progress-bar, etc.
The attachments pacakage still remains, and only registers a single component to
a new are called MessageAttachments. This InjectedComponent role is
shared by the Composer and MessageItem, and is the only reason this
exists as an injected component in a separate package.
MessageAttachments renders all image and non image attachments for a
message or draft, and binds the appropriate actions for removal, downloading, etc.
The composer still used FileUpload and ImageUpload components for rendering
uploads in the Composer (i.e. when you add an attachment (these are
different from files because they aren't saved until the draft is
sent)). These 2 components were pretty much copied and pasted from the
ones in the attachments package, with subtle differences-- I got rid of
these as well in favor of the new AttachmentItem and ImageAttachmentItem
Also convert more coffee to ES6!
Test Plan: Unit tests
Reviewers: bengotow, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D3381
Summary:
Add ability to undo send. We decided to make undo send completely client side for a couple of reasons. If we rely on send-later for undo-send, we would be giving /all/ send load to our send-later backend. If this increases the send-later load too much, it might cause delays in the regular send-later functionality and potentially other plugins like snooze that run under the same service. We would also need to rely on the network to be able to cancel a send, which would make it unusable offline or hard to debug if that specific request fails for any given reason.
This commit also refactors the way `ComposerExtension.sendActionConfig` works. The method has been renamed and now must return an array of send actions. Also, all of the business logic to handle different send actions registered by extensions has been pieced apart from the SendActionButton and into a new SendActionStore. This also enables undo send to undo custom send actions registered by extensions.
Along the way, this also fixes a pending TODO to show all registered custom send actions in the preferences for choosing the preferred send action for sending.
Undo send works via a task, so in case N1 closes before send goes through, it will still be persisted to the task queue and restored when opened again. Undoing a send means dequeuing this task.
Test Plan: Manual
Reviewers: jackie, bengotow, halla, evan
Reviewed By: bengotow, halla, evan
Differential Revision: https://phab.nylas.com/D3361
Summary:
Threads can now be opened in separate windows. This can be done via the popout
icon next to the print icon, or by double-clicking the thread when in double-
pane mode. Note that the single-click action is still fired, which is why
double-clicking does not work in single-pane mode. The popout icon changes to a
pop-in icon while in the popout window, to allow users to collapse it back into
the main window.
Test Plan: Tested locally
Reviewers: evan, juan
Reviewed By: juan
Subscribers: sdw
Differential Revision: https://phab.nylas.com/D3332
Change padding, margins, and borders to allow you to click on the left
margin of to, cc, bcc, from, subject fields as well as the composer
margins both above, left, and to the right of the composer.
Ensured attachments and other assets show up in correct spots
Ensure subject looks correct for mail merge
Add prefix search. Previously, if searching for a thread with a specific
subject, you had to type the entire subject. Searching for just a prefix
wouldn't return the result.
This should not affect any of the current search results, only add more results
Summary: Initial support for inline images. Tests still forthcoming!
Test Plan: WIP
Reviewers: mark, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3295
Summary:
fix(subject-field): Fix subject text field focus
Before, if you clicked a mailto link, once the composer loaded, the subject field (which was focused in composer-preload) blurred. This was not ideal as users would want to type once the popout loaded and instead they would have to click first. We identified that this was coming from the composer header _renderSubject injected component. We fixed the focus within mail merge subject text field and additionally added the onComponentDidChange method to injected component. This allowed us to only update the component when the header field changed.
Test Plan: tested on my machine for mailto links
Reviewers: juan
Reviewed By: juan
Subscribers: juan
Differential Revision: https://phab.nylas.com/D3150
Summary: When you would click outside the contenteditable in the composer, it would focus to the absolute end. Not ideal. I added a check if the click is above the top of the content editable -- if you click the top padding of it -- then focus at the beginning.
Test Plan: is this something i should test?
Reviewers: juan
Reviewed By: juan
Subscribers: juan
Differential Revision: https://phab.nylas.com/D3139
Summary: We used to parse the quoted text on each keystroke in the composer for a reply so that we could continue to determine what was quoted text. However, that resulted in dramatically slow typing for replies to complex HTML emails. Now, the quoted text isn't a part of the reply until `prepareDraftForSyncback`, after all of the extensions have run their transformations—we use a marker to determine whether quoted text should be appended or not. The quoted text control is now a one-way operation—you can't hide the quoted text after showing it (Gmail-style).
Test Plan: Tested locally (but didn't run unit tests because they won't run on my machine...)
Reviewers: bengotow, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3106
Summary:
Refactored signature preferences page to allow more signatures than the previous 1-1 mapping for signatures and accounts. Created a multi select dropdown of the accounts for which a certain signature is set as default for. Added a button into the draft header From field to toggle between saved signatures.
refactor(signatures): Add basic add/remove capabilities to static
refactor(signatures): Hooked up signature actions and signature store for basic functionality
fix(signatures): Cleaned up signature store and started on multiselectdropdown
fix(signatures): Add multi signature toggle select to multiselect dropdown
build(signatures): Built framework for multiselect dropdown
build(signatures): Toggle button functionality for dropdown
build(signatures): Build multi select from components and add debounce
refactor(signatures): Move signature actions and signature store into flux
fix(signatures): Styled composer signatures button/dropdown and fixed preferences checkmarks
build(signatures): Finish main functionality, about to refactor composer signature button into injected component
fix(signatures): Changed position styles
fix(signatures): Fixed background color for dropdown button when blurred
build(signatures): Began to write tests for signatures store, preferences and dropdown
Test Plan: Wrote tests for preferences signatures, signature store, signature composer dropdown and refactored tests for signature composer extension. For signature composer extension I removed applyTransformsToDraft and unapplyTransformsToDraft and tested by sending emails with signatures to different providers to make sure the <signature> tag caused problems.
Reviewers: bengotow, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3073
Summary:
This diff introduces several updates to mail merge to improve the procedure for sending a list of drafts.
Specifically, sending mass email will now:
- Clear mail merge metadata on the drafts that will actually be sent
- Upload attached files only /once/, and reuse those files on the drafts that will actually be sent
- Minimize database writes for new drafts being created
- Will queue a SendManyDraftsTask that will subsequently queue the necessary SendDraftTasks and keep track of them, and notify of any failed tasks
TODO:
- Add state to MailMerge plugin for failed sends and ability to attempt to re send them
Test Plan: - TODO
Reviewers: evan, bengotow, jackie
Reviewed By: bengotow, jackie
Subscribers: jackie
Differential Revision: https://phab.nylas.com/D2973
Summary:
SEE ASSOCIATED SUBMODULE DIFF
This enables rich React components (like the Scheduler's `NewEventCard`)
to be used in contenteditables.
We introduce the concept of an "Overlaid Component". These are rendered
React components that are absolutely positioned on top of an equivalent
"Anchor" in a contenteditable.
Inside the contenteditable are special `<img />` tags that have an
id corresponding to a particular rich overlaid component. This way, even
if those img tags are cut and pasted or moved, they'll have a mapping to a
particular component stored in the `OverlaidComponentStore`. Img tags
are fairly well handled natively by contenteditable and allow you to
maniuplate these overlaid components as normal text elements.
The `OverlaidComponentStore` is responsible for listening to and managing
the state of the Anchors and their equivalent OverlaidComponents.
We use a decorator called `ListenToChanges` that allows us to wrap
components to update their corresponding anchor. Since we need to know
about ALL changes that could affect rendered height and width, we need to
use a `MuatationListener` instead of the React render cycle.
This is only the initial diff. There are several TODOs here:
https://paper.dropbox.com/doc/Composer-Overlaid-Components-FoZrF0cFggzSUZirZ9MNo
Test Plan: TODO. Manual
Reviewers: juan, bengotow
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D2946
Summary:
- Simplify undoManager to just maintain the undo/redo history items
- DraftEditingSession manages snapshotting state of draft, hack allows it to also save selection (still hoping to eventually put selection in body HTML as markers)
- Switch from `debounce` to `throttle` style behavior so typing for along time followed by undo doesn't undo away your entire block.
This resolves two issues:
+ Changes to participant fields are no longer undoable because they go straight to the session.
+ Changes to metadata weren't undoable.
Test Plan: Tests WIP
Reviewers: evan, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D2956
Summary:
Add basic globally accessible performance monitoring.
Allows us to measure load times for composer windows (or whatever else we
want) and view the data as a Histogram on Mixpanel
Test Plan: manual
Reviewers: bengotow, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D2965
Summary:
Adds ability to drop tokens in subject via a custom rendered subject field which
renders a contenteditable instead of an input.
Decided to completely replace the subject field via injected components for a
few resons:
- That's the way we are currently extending the functionality of the participant fields, so it keeps the plugin code consistent (at the cost of potentially more code)
- Completely replacing the subject for a contenteditable means we hace to do extra work to clean up the html before sending.
- Reusing our Contenteditable.cjsx class for the subject is overkill, but using a vanilla contenteditable meant duplicating a bunch of the code in that class if we want to add
Test Plan: Unit tests
Reviewers: bengotow, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D2949
Summary:
- Add some docs to Table components
- Updates Table components to use a TableDataSource instead of accessing arrays, cleans up code a bit
- Add enzyme lib to have a cleaner and simpler api to write tests for React Components
- Updates decorators to extend from the BaseComponent instead of vanilla Component, this way instance methods are still available on composed components
Test Plan: - Unit tests
Reviewers: evan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2941
- This prevented emoji selection via the popover from working on a new
window because the plugin is loaded after the contenteditable sets up
the action listeners, so we need to re set them on update