Commit graph

410 commits

Author SHA1 Message Date
Evan Morikawa f89b905b10 feat(composer): allow extensions to composer participant searching 2016-11-14 14:01:00 -08:00
Ben Gotow 80b315d708 deps(*): Lift deps out of packages for simpler install / better deduping 2016-11-09 14:24:10 -08:00
Ben Gotow f558f05d69 fix(image-editing): Fix selector for finding <img> 2016-11-08 11:54:19 -08:00
Juan Tejada 20b6a6e070 feat(attachments): Add ability to preview with quicklook (mac only)
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
2016-11-01 16:13:42 -07:00
Juan Tejada b8ed562d19 🎨(attachments): DRY and cleanup attachment components code
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
2016-10-31 17:26:20 -07:00
Ben Gotow 020cc06b36 lint(send-action-button): Whoa nylaslint just chill 😂 2016-10-27 15:06:51 -07:00
Juan Tejada 990719685a fix(warnings):Fix react warning caused by decorator 2016-10-27 12:05:02 -07:00
Juan Tejada da48d8433e fix(specs): Fix date input specs 2016-10-27 11:35:37 -07:00
Juan Tejada 5d837ffd02 feat(undo-send): Add undo send
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
2016-10-26 20:40:10 -07:00
Evan Morikawa d4dec88148 feat(SFDC): Initial SFDC commit
Fixes to generated form error handling

Remove console fix css

Styles with tokenizing field and generated form

Gen form fixes for required

Gen form styles

Fix datepicker in generated form

Can compute plain text for messages

Add resolvePath. Fix bug in sidebar scoring

Plaintext fixes

Use new syntax for global plugin actions

fix(styles): fix input[type='url'] syntax error in inputs.less

Remove sendToAllWindows action

Style fix to generated form

bump(SFDC): 0.4.100

Trigger AppVeyor

Trigger AppVeyor

Add ci-build to appveyor yml

Only build mac

Publish all builds that make it to AppVeyor or Travis

Bump submodule

Update submodule to init recursively for appveyor

feat(win): add getAllWindowDimensions

bump(SFDC): 0.4.101

fix(form): generated form handles disabled inputs

Make tokeizing field editable

bump(SFDC): 0.4.102

bump(SFDC): 0.4.103

bump(SFDC): 0.4.104

bump(SFDC): 0.4.105

🎨(salesforce): Highlight prefilled fields

Form fixes

Fix prefill class

Fix z-index of fieldsets

Refactor our BoldedSearchResult component

Move and split sidebar section into thread list and toolbar

Fixing referenceTo

bump(SFDC): 0.4.106

bump(SFDC): 0.4.107

bump(SFDC): 0.4.108

Fix delete object from form

Don't show tokenizing input field borders on window

Close popover after adding existing opportunity

Fix required fields

bump(SFDC): 0.4.109

Merge submodule with master

Only store raw data for full object fetches

Use Salesforce error reporter

Refactor form and smart fields

Fix form validation

Remove DOM form validation

bump(SFDC): 0.4.110

Fix mini month view

bump(SFDC): 0.4.111

Fix Record Type layouts

bump(SFDC): 0.4.113

Fix click target

bump(version): 0.4.53 and update Changelog

fix(changelog): Update changelog to reflect latest puublished release

fix(thread-sharing): Update popover style

bump(build)

fix(thread-sharing): Find-thread, incr timestamp delta to 1min in ms

🎨(thread-sharing): Prefer url and querystring modules to parse url

fix(mail-merge): Correctly handle empty column names

fix(thread-sharing): Throw error when thread is /not/ found

fix(thread-sharing): Timestamp range in seconds

fix(N1.sh): Allow path to working copy to have spaces

bump(electron): Electron 1.4, node-sqlite 3.1.4+fts

fix(keymaps): Correctly map mod+z to undo, instead of just z (#2663)

fix(tutorial): Minor tweaks, finalized styling

Add link for Darkish theme (#2854)

Fix typo: dependencesi > dependencies (#2838)

feat(channels): Choose an update channel! Limited time only!

Summary: Just a small select input.

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3282

fix(logging): Fix query logging: escape '%' properly

fix(trial): Compute “days remaining” in timezone-aware way

fix(util): Utils.deepClone properly clones dates

Merge submodule with master

bump(SFDC): 0.4.114

fix(trial): Move”days left” bar to the sidebar, new design

fix(lint): import ui-variables for linter

Refactor object store and gen form updates

feat(msg-list): Don't make participants mailto links, add context menu

fix(long-connection): Throw error for reporting, instead of just logging

design tweaks, breaking css up into files, update readme (#2858)

fix(darkside): `script/grunt lint` requires explicit LESS includes

fix(specs): Display which tests are console.logging

fix(promise): Don't use deprecated Promise.longStackTraces()

fix(error): Let APIErrors have proper stack traces

Update submodule

Revert "fix(promise): Don't use deprecated Promise.longStackTraces()"

This reverts commit ac7602155c.

Bump submodule

bump(SFDC): 0.4.115

fix(specs): Fix tests that were console.logging, bump coffee-react

fix(drag-drop): Restore support for thread dragging

fix(thread-sharing): Fix unloading plugin

fix(auth): Update autofill for Fastmail.fm

fix(tooltips): Position relative to custom container for composer

lint(*): Fix issue breaking the build

bump(react): 15.3.x, warning removal, thread-sharing tweaks

es6(db): Convert attribute class declarations to ES2016

es6(db): Didn’t wait for NylasLint…

hack(channel-picker): Hide Salesforce for now

fix(accounts): Restore account re-ordering

fix(specs): attribute conversion fixed bugs, broke specs

fix(task-queue): performLocal now operates serially

Revert "fix(task-queue): performLocal now operates serially"

This reverts commit 5274ce3543.

Add back in `isSameDomainAsMe`

es6(db): Query-related classes moved to ES2016

fix(task-queue): task queue dependencies are only for preceding tasks

bump(SFDC): 0.4.116

Revert "fix(task-queue): task queue dependencies are only for preceding tasks"

This reverts commit e1e8c1cd9429b5aa20e19d4e2b8eca7215aa4a2c.

Add sequentialId check to tasks

Design pass on SF icons

fix(search/long-conn): Process results buffer before ending connection (#750)

NylasLongConnection ends the connection when the 'end' event is emitted
by the `request` object. When this happens, the global connection buffer is cleared.
Also, the global buffer holds the data we've received from the connection, and
whenever we receive new data, we accumulate it in the buffer and call a processBuffer function
which is throttled to 400ms.

Given that the buffer is global state, and processing occurs
asynchronously with a delay of up to 400ms, if the 'end' event on the connection is
fired before we actually get to process the buffer, we would clear it and show no results.

This scenario currently only affected search because if we accidentally
threw away some data when streaming deltas, we will get that data again
when we reopen the delta streaming connection.

fix(tray): Flipped logic in displaying unread count

Add section to Message footer

bump(SFDC): 0.4.117

fix linter

bump(electron): Update to 1.4.1 to fix intermittent Symbol() error

es6(db): Query builder converted to ES6

fix(long-connection): `close` instead of `end` on network end event

NylasLongConnection.Status.Ended means that we can't open the
connection again. When we get a network level 'end' event, that doesn't
map to our meaning of `Ended`, so we should just close it instead

Fix db setup

bump(SFDC): 0.4.118

feat(transforms): Replace regexp body transforms with DOM approach

Summary:
We originally didn't do this because creating a DOM tree was loading images.
Using range.createContextualFragment seems to do it without the tree ever
being attached.

Accompanying changes to src/pro are here:
https://phab.nylas.com/D3300
https://github.com/nylas/edgehill/compare/bengotow/draft-dom-transformations?expand=1

Also rename applyTransformsToDraft => applyTransformsForSending. Needed
a new name because the function signature has changed. AFAIK there are no
open source plugins using the old functions.

Test Plan: All specs updated

Reviewers: evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D3299

fix(tooltips): Defer display of background, ensure dot inside window

bump(SFDC): 0.4.119

Merged in latest master from N1

fix(attribute): fix es6 conversion error

bump(SFDC): 0.4.120

Include calendar fix

fix(warnings): Fix warnings for react unkown dom prop

When using the pattern `{...extraProps}` to transfer props in the render method,
if rendering a native dom element, react will issue a new warning if we
end up passing invalid dom props:
https://facebook.github.io/react/warnings/unknown-prop.html

This adds a helper library to exclude invalid fom props instead of
manually excluding props inside each render method

fix(attribute): fix es6 conversion error

fix(mail-merge): fix `applyExtensionTransformsToDraft` rename

bump(SFDC): 0.4.121

Add welcome modal with video

Move close button to modal component and update styling

Fix linter errors

fix(help): Better help URL

fix(mail-merge): Add test coverage

Add jitter to BackoffTimer

Summary:
This should help us avoid the thundering herd problem if we have some
kind of API outage affecting a wide number of clients.

Test Plan: Tests

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: juan

Differential Revision: https://phab.nylas.com/D3297

fix(contact-sidebar): Correctly update selected contact

Sometimes, when selecting a contact (with name, email) inside a thread,
the dropdown (`<select>`) did not correctly reflect the selected
contact.

This was because when focusing a contact, the FocusedContactStore
queried that contact from the database just by email, and the contact
retured from the database became the focused one. However, sometimes the
returned contact might have the same email but different email, and
given that the `<select>` component is keyed by both name,email, it
couldn't find the appropriate <option> to render, so it could not update
to reflect the newly selected contact

Now, the FocusedContactStore queries by email and name to prevent this

Fix broken test

Summary:
Fixes a test that was broken due to my unfamiliarity with
CoffeeScript :-/

Test Plan: Tests

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: juan

Differential Revision: https://phab.nylas.com/D3302

feat(inline-images): Drag & drop or paste inline images

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

Revert "fix(task-queue): performLocal now operates serially"

This reverts commit 5274ce3543.

fix(lint)

es6(db): DatabaseTransaction & Query moved to ES6

fix(tasks): Add instrumentation to Task's performLocal

A slow performLocal may be one of the causes of #2725

update: Update CHANGELOG for v0.4.55

fix(whitespace)

fix(install-location): Update language and remove buggy regex

fix(tasks): Report slow performLocal only when it takes > 500ms

fix(mail-merge): Reduce max number of emails to 250

Almost always, you will get rate limited trying to send 500 emails.
Reduce to 250 to make it more reasonable

💄(sidebar): Github repos should not wrap

fix(sidebar): Command-click + href to open in background

Global window event handler should work when clicking elements /inside/ of an a tag with an href.

💄(mail-merge): Fix alignment and height of tokens

fix(composer): No need for overlaid z-index: 10, appearing over menus

fix(db): Add an index on Thread.client_id for modelify

fix(overlaid-comps): Check if supports preview only after we know exists

fix(warnings): Correctly remove all unknown props warnings

fix(thread-list): Use interaction handlers, don’t update selection directly

fix(drafts): Sanitize quoted text to avoid overlaid component issues [!!]

fix(lint): Change variable to const

fix(search): Update local search syntax to include more results

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

fix(react): React refuses to add `partition` attr to webview

fix(identity): Always refresh accounts after identity

This fixes an issue where changing your Nylas ID didn’t refresh your accounts, and N1 would still think they were invalid.

fix(db): Messages with empty bodies always showing loading spinner due to ‘’ == null

Bump submodule

fix(composer): Dedupe registered key bindings to avoid double undo in composer

fix(calendar): CSS layout fix for Chromium 53

fix(mail-merge): Reduce limit to 150 messages, improve error handling

fix(composer): Add additional isMounted checks

Resolves this exception: https://gist.github.com/jstejada/a26dc6a7a2896dcef9be3cec60eaecdb

fix(perspectives): More robust validation of saved perspectives, never open to blank screen

fix(specs): Fix mail merge specs

🎨(thread-sharing): Fix icon

fix(lint): Fix coffeelint errors

fix(draft-list): Don't render html string in draft subject

fix(dev): Pretty print deltas

🎨(activity-list): punctuation

fix(window-state): Per electron#7278, save state in beforeunload

Related:
https://github.com/electron/electron/issues/7278
https://github.com/atom/atom/pull/3223/files

As of Chromium 36, unload is async and @zcbenz does not think it happens reliabily in Electron. Move saving of window state to beforeunload, following suit with Atom.

fix(composer): Wrap composer instead of allowing overflow-x

fix(spec): remove unnecessary messages & prevent extra hot window

bump(SFDC): 0.4.123

fix(linter): fix linter error

fix(linter): fix linter error

rm(ship-logs): Remove unused log shipping, prevents many-processes bug on win32

feat(bios): Linkify twitter hashtags and mentions in bios

fix(composer): When pasting links that are tracked, extract actual link

fix(self-hosting) Don't load packages that don't support self-hosting

feat(self-hosting) Add onboarding page about self-hosting plugin restrictions

bump(verison): 0.4.56, more items in changelog

fix(data-source): Wait until the next cycle to cleanup

Fixes a crash when switching to the thread list from the draft list, where there are very briefly zero observers.

💄(share-thread): Fix positioning of share thread button

fix(tutorial-tips): Don't display when component is not visible

fix(participants): When copying, include space #2871

fix(spellcheck): Do not spellcheck <code>, <a>, <pre> tags

This fixes #2877. The templates feature becomes broken when variable names contain misspellings.

fix(specs): Minor spec fixes

fix(composer): enable click regions on margins of composer

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

fix(composer): can shift-tab more places

Allow shift-tab to go back to subject from anywhere except in front of a
tab character

fix(composer): fix margin when editing contact chip

fix(composer): tokenizing text field trigger logic moved to composer

Put acess tokens and refresh tokens in keychain

fix modal spacing

bump(SFDC): 0.4.125

fix tokenizing field margins

fix(tutorial-tips): Recompute pos when theme changes

fix(share-thread): Closed when blurred when blurred or new thread selected

fix(dev-mode): Don’t save to config.json, use flag instead

Turns out even the built, packaged version of the app can be restarted into dev mode by adding `—dev` to argv and using the new relaunch API.

es6(db): Move DatabaseStore to ES6

💄(outline-view): Add title attr for tooltips

fix+🎨(notifs): Cleanup, handle nonexistent thread when opening notification

Notifications now check to see the thread they are supposed to open
exists.

Also, clean up FocusedContentStore._onFocus so that it doesn't have the side
effect of dispatching another action and messay logic.
Instead, added Actions.ensureCategoryFocused, to focus any category, and which
should be used separately from focusing content (notifications now use
this action for "opening" the thread)
Also, convert FocusedPerspectiveStore to ES6

fix(specs): Activity List

fix(composer): enable click regions on margins of composer

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

fix(composer): can shift-tab more places

Allow shift-tab to go back to subject from anywhere except in front of a
tab character

fix(composer): fix margin when editing contact chip

fix(composer): tokenizing text field trigger logic moved to composer

🔪 Last remaining traces of coffeescript in submodule!

fix(tools): Make `arc lint` great again

Add proper arc config for linting ES6 files with eslint

fix(files): When download mode is “manual” prompt about inline attachments

Summary:
When you have your "Download attachments for new mail" setting set
to "manually", inline images always appear broken with no explanation.

This patch listens for the image load to fail and displays a button which
queues the fetchFile task on click. This seemed like the best approach because
it doesn't slow down the loading of the message with more fstats / lookups.
(Seeing if the file has already been downloaded is an async operation)

Test Plan: No specs atm

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3313

feat(sidebar-notifs) Create sidebar notifications to replace old bars

Summary:
Move the old bar notifications to the sidebar, and only display one notification
at a time using a priority-rating system. Remove all of the old notification
infrastructure.

Test Plan: Added specs, also reproduced notifications locally

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: juan

Differential Revision: https://phab.nylas.com/D3310

bump(submodule)

fix(lint)

fix(phising): Handle scenarios where input is malformed (Sentry 51642)

https://sentry.nylas.com/sentry/edgehill/group/51642/

fix(templates): Handle error when scanning dir (Sentry 44351)

https://sentry.nylas.com/sentry/edgehill/group/44351/

fix(perspectives): Restore when only account cannot be found (Sentry 59061)

https://sentry.nylas.com/sentry/edgehill/group/59061/

refator(notification): move base notification to nylas-component-kit

Remove all salesforce objects on logout

Add syncing of salesforce objects

Summary:
Depends on D3327
- Also remove all coffeescript
- Make it so salesforce mail label grabs opportunity from database
- Make sure metadata is kept in sync when salesforce objects are deleted
- Set up stub for Salesforce Object cache via SalesforceObjectStore
- Cleanups here and there

Test Plan: Manual

Reviewers: jackie, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3328

fix(db): Switch to better-sqlite3, resolves offline issue

Summary:
Better-SQLite3 is a fork of node-sqlite3 which includes a re-written JavaScript interface. It’s more synchronous, but better reflects what is actually sync vs. async in sqlite’s C++ API. (Not much is really async under the hood.) This diff uses a branch of better-sqlite3 I’ve edited to support Node 6.

In my tests, this branch spends 3.24x less time executing queries than `master`. (Measured time spent in calls to `this._db[run|all|get]` over the first 5000 queries of initial sync. It also increased the performance of starring a thread in the thread list by 28%.

This library also allows us to use a prepared statement cache, which is great because we often make the same queries repeatedly as query subscriptions refresh the UI and deltas are dumped into the app. The old interface didn’t expose statements (cached query plans) to JS.

better-sqlite3 advertises that it uses the JS garbage collector instead of lower level C++ memory management. I tested syncing my entire mailbox to verify that memory usage is not significantly different on this branch after a lot of queries have been made.

Finally, it looks like we can finally stop building sqlite3 from scratch in `script/bootstrap`. This library builds properly with `apm install`. 🎉

We might want to change the DatabaseStore and DatabaseTransaction classes more, now that it’s possible to execute queries synchronously. It could make things cleaner and get us out of promise-hell in a few places. In this diff I tried to change as little as possible.

Test Plan: Run tests, everything still works

Reviewers: juan, jackie

Reviewed By: juan, jackie

Differential Revision: https://phab.nylas.com/D3315

Fixing broken screenshot link (#2911)

Replacing with new screenshot

fix(onboarding): Fire event when user selects account type

bump(sqlite3): Fix issue with CI build / bindings location

fix(reporter): Handle errors cleaning log files (Sentry #6887)

Switch spellcheck libaries

Summary:
Switch to electron-spellchecker, which will allow N1 to
spellcheck more intelligently across languages. It auto-
detects languages and downloads dictionaries on the fly.

Test Plan: Specs, manual testing

Reviewers: bengotow, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3319

Update Windows.md

fix(jquery): remove jquery

fix(spec): remove unused spec helpers

fix(specs) convert nylas-protocol-handler-spec to ES6 (#2886)

fix(win32): Still need custom sqlite3 build cmd for win32 😥

This also includes a bump of the better-sqlite3 module to support compilation on ia32.

feat(popout-threads) Add functionality to open threads in popout windows

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

fix(analytics): Add pgp encryption events

Email Encrypted
Email Encryption Errored
Email Decrypted
Email Decryption Errored

feat(win32): Allow N1 to become the system-wide mailto: handler

Summary: This will address the longstanding concern in #417

Test Plan: No new tests

Reviewers: juan, evan

Reviewed By: juan, evan

Maniphest Tasks: T7065

Differential Revision: https://phab.nylas.com/D3322

bump(version): 0.4.57

 (0.4.58 was accidentally in prev commit)

fix(readme): Improve Win32 build instructions

fix(readme): More Win32-specific instructions

fix(spellchecker): Use cross-platform misspellings, fix lint error

feat(calendar): can pick which calendars you want displayed

Summary:
Adds a resizable column next to the calendar that lets you pick which
calendars you want to turn on and off.

The picker sidebar styling mimics that of the main account sidebar.

Calendars are grouped by account.

We store the disabled calendars in in your config.

I added a `notIn` SQL method so it'll perform `WHERE calendarId NOT IN
['a', 'b', ...]` instead of `NOT (WHERE calendarId IN ['a', 'b', 'c'])`

I wanted it to be an exclusion (instead of inclusion) list so the default
was "all on" and we didn't need to always fetch the full list of
calendarIds from the database to compare against.

This also fixed a test that was failing constantly: The Query Subscription
Pool Spec was not being properly reset on each test. As a result, the test
would fail with an instance of a query subscription that Jasmine would
attempt to pretty print. Jasmine would fail to pretty print it because of
a jasmine bug that fails to properly display Objects with null prototypes.
The DatabaseStore's EventEmitter has a property with a null prototyp
causing the error

Test Plan: manual

Reviewers: bengotow, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3336

fix(linter)

Merge submodule with master

Bump submodule

Bump database version and submodule

fix(contact): add hasSameDomainAsMe method to Contact

Better email syncing with Salesforce

feat(dock): Automatically add N1 to the OS X dock upon install

Note - you need to `killall Dock` to see this after it happens

Add main window calendar package

Summary: Add tiny helper app for calendar goodness

Test Plan: No tests yet

Reviewers: juan, halla

Reviewed By: halla

Differential Revision: https://phab.nylas.com/D3346

cleanup(*): Remove dead .bowerrc, .gitignore files

es6(db): Convert the ORM specs to ES2016

bump(Electron): 1.4.3

fix(license): Swap ref to GPLv3 with the whole thing so GitHub picks it up

Clean up spec-bootstrap and jasmine-helper

Convert spec-suite to es6

Extract out jasmine reporters

Move global imports back to jasmine-helper

Extract to N1SpecRunner

Fold jasmine-helper into spec runner

Convert `spec-suite` to `n1-spec-loader`

Convert spec-helper to es6

Remove unused methods from spec-helper

Move waitsForPromise to jasmine-extensions

Move spec runner & deps into `n1-spec-runner` folder

Remove unused spec-helper-platform

Move specs into subfolders

Initial extraction of all methods out of of spec-helper

Fixes to spec-helper extraction

fix(spec):

Dramatically clean up and simply the spec bootup process.

Converting spec bootup system to es6 from coffee.

Converted old `jasmine-helper`, `spec-helper`, and `spec-suite` to a new
`n1-spec-runner` file.

Each of these old files had tons and tons of code related to various parts
of the spec bootup and running process.

Each of those parts have been extracted into individual files

Fix linter

Add icons to object types in picker

Remove opp references in popover

bump submodule

fix(spellchecker) Add a cache to improve performance

fix(notifs): Don’t render empty <img />

lint(*): Bump to ESLint 3.8

Update linter

bump submodule

bump submodule

bump submodule

bump submodule

bumpd submodule

Add sync thread toggles

Search focused contact by email

fix(mailto): Support body with \n or \r characters

Related to #2923

fix(thread-popout) Add missing packages to the 'thread-popout' window

Summary: Missed some non-composer packages that should be in the 'thread-popout' window

Test Plan: Tested locally

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D3352

fix(mailto): Missing return in URL handling

fix(beta): Add notif when on beta channel

fix(db): Return; preventing ThreadSearch indexing

bump(version): 0.4.58

fix(specs): Don’t run update channel check in specs

fix(search): React warns, convert to ES2016

fix(search): Missed a .default

fix(spellcheck): Don’t include cld sources in build

fix(tooltips): Prevent tooltips from breaking wrapped components

fix(overlaid): Preview button was just invisible?

fix(auth): Hide title when long acct. err present

fix(onboarding): Don’t display “Welcome Back” screen

fix(accounts): Return correct list of email addresses

bump submodule

fix(misc) React warnings, kill cjsx

fix(accounts): Return correct list of email addresses

💄(thread-window): Update pop-out icons

lint(react): InlineImages don’t get session at send-time

fix(mail-merge): Upload files per draft to fix inline images

fix(mail-rules): Allow recipient filters to contain names #2942

bump(version): 0.4.59

💄(thread-window): Add thread-popin icon

update(changelog): 0.4.59

fix(search): Use fts search index for typeahead results

Summary: This improves performance of the search typeahead

Test Plan: Manual

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D3363

fix(popover): 🔪 deprecated popover

fix(popover) Actually 🔪 deprecated popover

feat(flow): Add Flow to Nylas N1

Add flow-typed annotations

Ignore annoying submodules

Add /* @flow */ header to all js & es6 source files

Fix error about having number keys for objects

Remove @flow config from compile-support

Check es6 files

Add jasmine to flow

Revert "Add /* @flow */ header to all js & es6 source files"

This reverts commit c5a57bc402c53633b407b557f28ad12eaa8f27fe.

Update submodule

Add nylas global interface file

Fix generated form and bump

Fixes to generated form

Use customComponent in task

fix(warning): Don't render participant picker with null value

fix(thread-popout): Display the hidden message toggle in the thread-popout

Summary:
Also, maintain the perspective that the thread was opened in, so that the
proper messages are hidden (e.g. hide deleted messages when opened from the
inbox, but not when opened from the trash folder)

Test Plan: Tested locally

Reviewers: juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3366

rm(grim): We’re not using Grim for deprecations

feat(quick-replies): Reply from Mac notifications

use single regex exec for toEquivalentEmailForm (#2962)

Fix JSON spacing (#2958)

Match JSON style to rest of file

Fix issue #2758. Press Escape after a finished search to get back to … (#2939)

* Fix issue #2758. Press Escape after a finished search to get back to Inbox

Use a keydown event when search bar is in focus to capture escape key press

* fix(search): Convert to ES2016

🎨(notifications): Remove indent and left padding from notifications

Revert "Fix issue #2758. Press Escape after a finished search to get back to … (#2939)"

This reverts commit 6377da8291.
This was already fixed in a95c17bce3

fix(utils): Don’t overwrite _ in global scope

feat(tokens): Multi-select for tokenized text fields

Test Plan: Lots of tests, mostly updated to enzyme. Not many new ones.

Reviewers: evan, juan, jackie

Reviewed By: juan, jackie

Subscribers: juan

Differential Revision: https://phab.nylas.com/D3374

fix(tokenizing-text): Re-add shouldBreakOnKeydown prop

build: bump eslint-plugin-import version

feat(field): Let TokenizingTextFields be disabled and onEditMotion
2016-10-26 19:46:54 -04:00
Ben Gotow 8b2cebe093 lint(react): InlineImages don’t get session at send-time 2016-10-24 12:32:58 -07:00
Ben Gotow 2b36e9d8a9 fix(overlaid): Preview button was just invisible? 2016-10-20 16:10:09 -07:00
Ben Gotow c20238314d lint(*): Bump to ESLint 3.8 2016-10-17 18:07:35 -07:00
Ben Gotow 51f9001c21 cleanup(*): Remove dead .bowerrc, .gitignore files 2016-10-14 11:39:34 -07:00
Halla Moore 1c675935a7 feat(popout-threads) Add functionality to open threads in popout windows
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
2016-10-12 13:55:11 -07:00
Evan Morikawa 83f455f031 fix(composer): fix margin when editing contact chip 2016-10-02 12:05:25 -04:00
Evan Morikawa 8e3b436ba3 fix(composer): enable click regions on margins of composer
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
2016-10-02 12:04:55 -04:00
Juan Tejada 4f8ad70d60 fix(search): Update local search syntax to include more results
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
2016-09-28 11:06:10 -07:00
Ben Gotow 3cfd16fc1b fix(composer): No need for overlaid z-index: 10, appearing over menus 2016-09-27 14:40:58 -07:00
Ben Gotow a0ab700ca6 💄(mail-merge): Fix alignment and height of tokens 2016-09-27 14:36:58 -07:00
Ben Gotow 039d9bea61 feat(inline-images): Drag & drop or paste inline images
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
2016-09-26 17:01:19 -07:00
Ben Gotow 18d294c42f feat(transforms): Replace regexp body transforms with DOM approach
Summary:
We originally didn't do this because creating a DOM tree was loading images.
Using range.createContextualFragment seems to do it without the tree ever
being attached.

Accompanying changes to src/pro are here:
https://phab.nylas.com/D3300
https://github.com/nylas/edgehill/compare/bengotow/draft-dom-transformations?expand=1

Also rename applyTransformsToDraft => applyTransformsForSending. Needed
a new name because the function signature has changed. AFAIK there are no
open source plugins using the old functions.

Test Plan: All specs updated

Reviewers: evan, juan

Reviewed By: evan, juan

Differential Revision: https://phab.nylas.com/D3299
2016-09-23 16:36:08 -07:00
Ben Gotow cfc23b729e lint(*): Fix issue breaking the build 2016-09-20 16:34:30 -07:00
Ben Gotow dc2590a834 fix(tooltips): Position relative to custom container for composer 2016-09-20 16:21:31 -07:00
Ben Gotow e533d063d0 fix(specs): Fix tests that were console.logging, bump coffee-react 2016-09-20 15:17:48 -07:00
Juan Tejada 05bb03bae1 fix(mail-merge/preview): Don't unmount components when toggling preview
Summary:
See edgehill revision: https://phab.nylas.com/D3160

- CustomContenteditableComponents.get now takes a single component to register as an overlaid component, and this component will be passed a prop `{isPreview: true}` when it is meant to be rendered as a preview. Update scheduler and mail-merge to use this new api.

- This prevents the mail merge state from being incorrectly updated when we toggled preview mode -- previously, it believed that the tokens had been unmounted when toggling preview, so they were incorrectly removed from the mail merge state.

- Additionally, makes sure that tokens are correctly added to the mail merge state whenever a token is rendered via componentDidMount -- previously, we only added the token to state when a token was dropped on the contenteditable, however, a token might be pasted or an anchor node might be added by any other means, in which case we want the mail merge state to reflect that. (Adds docs about this)

Test Plan: Manual

Reviewers: jackie, evan

Reviewed By: jackie, evan

Differential Revision: https://phab.nylas.com/D3161
2016-08-16 13:21:41 -07:00
Annie d57cca64d0 add(composer): Turn emails into mailto for debugging purposes
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
2016-08-12 16:06:22 -07:00
Annie 1e6ea1dd07 fix(cursor): Make cursor focus at the top of email
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
2016-08-12 14:27:31 -07:00
Jackie Luo 25f77f0269 fix(quoted-text): Check that message is reply 2016-07-21 17:45:47 -07:00
Jackie Luo 9bda66c081 spec(quoted-text): Fix broken tests 😞 2016-07-21 15:47:54 -07:00
Jackie Luo b323275d24 fix(composer): Stop parsing quoted text on each keystroke to prevent composer lag
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
2016-07-21 11:11:14 -07:00
Annie bd361c8abb refactor(signatures): Removed old signature imgs and made static empty signatures page
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
2016-07-11 12:35:41 -07:00
Juan Tejada 4c861ff007 fix(quoted-text): Add option to remove quoted-text, fix styles
- #2323
2016-06-16 15:37:58 -07:00
Ben Gotow d0cb89ebd9 fix(emoji): Remove vertical overflow from composer, allow for popups 2016-06-09 17:51:08 -07:00
Evan Morikawa c4753197ee fix(analytics): improved analytics 2016-06-07 13:38:47 -07:00
Juan Tejada e103809b34 fix(mail-merge): Switch to using new overlaid components api
Summary:
- Fixes several selection and focus issues along the way
- Can now preview what tokens will look like when not editing
- Adds decorator to listen to mail merge session changes and removes a bunch of duplicated code
- Gets rid of all imperative code (and specs) that had to imperatively
reach into the dom to update the tokens

Test Plan: - Unit tests

Reviewers: bengotow, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2989
2016-05-27 11:02:44 -07:00
Juan Tejada 6e57cbaee4 fix(build): Fix remaining specs (composer-view, send-draft-task) 2016-05-25 10:25:36 -07:00
Juan Tejada 39611f8962 fix(specs): Fix merge conflicts and some specs 2016-05-24 19:04:20 -07:00
Juan Tejada db868740c8 fix(build): Fix lint error 2016-05-24 17:53:15 -07:00
Juan Tejada a4ee61eadc fix(mail-merge): Refactor mass sending procedure
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
2016-05-24 17:22:09 -07:00
Evan Morikawa c9ea5b6483 feat(scheduler): Add Overlaid Components
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
2016-05-24 15:47:49 -07:00
Ben Gotow 77733253eb fix(undo): Move undo/redo to session, properly undo all changes
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
2016-05-24 11:48:33 -07:00
Juan Tejada 072490ebcc fix(send-later): Check if draft is valid before scheduling send later 2016-05-19 13:28:28 -07:00
Evan Morikawa 0db70868a8 fix(composer): reduction in composer bootup time 2016-05-17 15:03:49 -07:00
Evan Morikawa 517a9cdd47 feat(perf): add perf monitoring to composer open time
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
2016-05-17 14:23:14 -07:00
Evan Morikawa 6f355093e0 feat(composer): speed up composer loading & fix deactivate error 2016-05-17 12:37:46 -07:00
Juan Tejada 99f8a81e96 fix(mail-merge): Pass session to injected subject 2016-05-13 16:01:12 -07:00
Ben Gotow 26d4361bfb bump(electron): Fix remaining deprecated requires, move to 1.0.1 2016-05-12 13:59:23 -07:00
Juan Tejada 51d51fb47e feat(mail-merge): Add ability to drop tokens in subject
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
2016-05-12 10:47:41 -07:00
Juan Tejada ab55bc68ea fix(build): Fix lint issues and specs 2016-05-11 15:33:52 -07:00