Commit graph

138 commits

Author SHA1 Message Date
Evan Morikawa cd9ccd85e2 refactor(DB): promisify database
Summary:
WIP. The app launches and works for me. I still need to fix the tests
just the DB ones though :D

I changed the `DatabaseProxy` into a `DatabaseConnection` object. It will
request a fully instantiated databse from the backend Browser.

If we're already setup, it'll connect straight to the existing DB.

If we're not setup, then it'll create a new database and run the inital
schema migration on it. The `_createNewDatabase` promise won't resolve
until the migration has run.

Until we add in a more sophisticated migration system and get rid of the
stupid `modelClassMap` that's shoved in `Utils`, I'm passing in a series
of `_setupQueries()` to get everything started.

The `DatabaseConnection` is also the one responsible for queuing up
queries until the DB is fully populated and ready to go.

We actually get a lot of queries before we're setup because a lot of
Stores will make DB requests on `require` in their `constructor` or `init`
methods. (remember all the times we call `_populateStore` in `init`).

Now those queries are aggregated by the `DatabaseConnection` and then
executed sequentially.

Our methods like `persistModel` now resolve only after both the queries
have completed AND their corresponding `triggerLater` has completed as
well.

Test Plan: in progress

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1688
2015-06-26 07:42:41 -07:00
Ben Gotow 8c764ca75d fix(composer): Show a scrollbar in the popout composer
Summary:
Fixes T1990

Change the ScrollRegion component so that you can optionally provide a getScrollbar prop that resolves to a ScrollRegion.Scrollbar component. This allows you to easily put the Scrollbar outside of the ScrollRegion if necessary.

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T1990

Differential Revision: https://phab.nylas.com/D1665
2015-06-23 15:21:25 -07:00
Evan Morikawa 4671bf885f feat(message): New Message List UI
Summary:
Initial message list collapsing

messages can be expanded explicitly

styling message items

composer UI and collapsing

expanding and collapsing headers

style new reply area

adding in message controls

Add message actions dropdown

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1664
2015-06-22 15:49:52 -07:00
Ben Gotow c404b19b33 fix(*): Throttle so that DatabaseView won't pile on queries during scroll, better small attachment styles
Summary:
fix(attachment): Bad filenames breaking icons

fix developer bar colors

fix critical bug with files

Render small attachments inline-block, without hover effect, and with nice dotted transparency background

Test Plan: No new tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1661
2015-06-19 11:31:27 -07:00
Ben Gotow 06c72a5604 fix(mailto): Use paste logic to parse fields in mailto links, support poorly encoded URLs
Summary:
Fixes T1927

- Allow email addresses to contain `_`
- Centralize logic for parsing string into Contact objects into ContactStore
- Always decode and then encode mailto links to ensure spaces, special characters are properly encoded and that the URL is valid
- Add specs for mailto:// behavior

Test Plan: Run wonderful new tests covering mailto://

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T1927

Differential Revision: https://phab.nylas.com/D1657
2015-06-18 11:58:07 -07:00
Evan Morikawa 6864e193c9 fix(lint): fix minor style errors 2015-06-17 20:43:14 -07:00
Evan Morikawa 2e9a2ac167 feat(salesforce): new UI for Salesforce
Summary:
style opportunity picker and placeholder on tokenizing text fields

UI for synced opportunities

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1655
2015-06-17 20:40:08 -07:00
Evan Morikawa e2fa53f45d feat(composer): new composer and button styles
Summary:
initial styling of image attachments

more styles for composer overflow

style composer toolbar

toolbar styling

Fixes to inline composer

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1647
2015-06-17 16:03:50 -07:00
Ben Gotow e10f402d3d fix(focus): Wait for cc/bcc to exist before trying to focus them
Summary:
It was hard to notice this regression because the `?` in `@refs[field]?.focus?()` meant `focus('textFieldCc')` failed silently.

Now we catch that the field we're asked to focus doesn't exist, and try again after the next render.

Fixes T1982

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T1982

Differential Revision: https://phab.nylas.com/D1643
2015-06-17 12:29:32 -07:00
Ben Gotow e87110b3e2 fix(send-warnings): One character is valid body (T1929) and attachment is valid body (T1881)
Summary: This fixes T1881 and fixes T1929 and adds two additional test cases

Test Plan: Run 2 new tests

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T1929, T1881

Differential Revision: https://phab.nylas.com/D1645
2015-06-17 12:29:21 -07:00
Evan Morikawa a48fc2dd34 feat(attachment): improved downloading and draggable images
Summary:
Fixes T1975
Fixes T1900
Fixes T1899
Fixes T1979

Attachments downloading update progress

downloads will restart if the file on disk isn't complete

can drag images onto drive

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T1900, T1899, T1975, T1979

Differential Revision: https://phab.nylas.com/D1638
2015-06-15 18:48:17 -07:00
Evan Morikawa e326547614 fix(specs): silence noisy specs and fix warnings
Summary:
Silence buffered process spec

Clean up error reporter and spec bootup

fix errors in draft store spec

package manager spec and theme spec fixes

Fix memory leak in draft store

Test Plan: mmmmmm tests. Run all those green passing tests :)

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1628
2015-06-15 18:29:59 -07:00
Ben Gotow c23b4a0af9 fix(T1758): Handle initial focus properly if draft is not yet ready 2015-06-15 14:48:54 -07:00
Evan Morikawa e43d58b337 fix(keymap): add ctrl-enter to send email 2015-06-12 17:47:59 -07:00
Evan Morikawa dba73561d6 Fixes T1928: don't lose focus on cc and bcc fields
Summary: Fixes T1928

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T1928

Differential Revision: https://phab.nylas.com/D1622
2015-06-11 18:48:55 -07:00
Ben Gotow 912cb4634e fix(style): Minor styling adjustments (floating toolbar, token carats) 2015-06-11 18:46:30 -07:00
Evan Morikawa 81f1b5538e Fixes T1868: tokenizing inputs resize properly
Summary:
Fixes T1868
The hidden sizing window was not getting whitespace properly and the width
was different because of different paddings

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T1868

Differential Revision: https://phab.nylas.com/D1623
2015-06-11 18:39:55 -07:00
Evan Morikawa 48f1cc80d6 feat(update): autoupdater adds an updateLevel param
Summary:
There's now an `updateLevel` that can be set in the config file.

It has the valid values of "major", "minor", "patch", and "commit". By
default it upgrades on the "patch" level.

If you want to be on the bleeding edge, manually change the config file to
add `updateLevel: 'commit'`

Test Plan: A new `auto-update-manager-spec` :)

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1567
2015-06-11 12:23:31 -07:00
Evan Morikawa 449e11cdda feat(attachments): new attachments & uploads UI with img support
Summary:
Initial styles on attachments ui

More file uploading UI

fix race condition in draft saving

attachments and uploads interweaved

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1610
2015-06-11 12:04:52 -07:00
Ben Gotow 81eb565e7d fix(composer): Border appearing in inline composer 2015-06-08 17:27:09 -07:00
Ben Gotow 79f0405148 feat(starring): Star and unstar threads in the thread list
Summary:
When two or more buttons are grouped together, cut the padding off one interior edge so they're spaced more appropriately

Remove source list graphics for active states we aren't using

Starred in the sidebar

Small fix to the feature that keeps the selected item visible as you scroll

Test Plan: No new tests yet

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1607
2015-06-08 17:02:50 -07:00
Ben Gotow 1f589be4ad feat(paste): Add files by pasting them into the composer
Summary: You can now add file attachments by pasting them.

Test Plan: Run 3 new specs! We only had specs for sanitization so I added some for the paste event handler as well.

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1604
2015-06-08 12:41:31 -07:00
Ben Gotow c2b4343880 fix(css): Invalid padding value separated by commas 2015-06-05 18:33:17 -07:00
Ben Gotow af5e2ea1dd fix(mac-build): CSS Linter warnings treated as errors 2015-06-05 18:22:11 -07:00
Ben Gotow 6fa2e20197 fix(iframes): Contextual menus for email contents
Summary: Fixes T1191

Test Plan: No new tests to see here.

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T1191

Differential Revision: https://phab.nylas.com/D1603
2015-06-05 16:47:30 -07:00
Ben Gotow 5fbd881304 feat(theming): Definitely not hacker mode. I don't know what you're talking about.
Summary: Add docs for new RetinaImg modes

Test Plan: Not much to test, except that it looks good!

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1595
2015-06-05 11:40:44 -07:00
Ben Gotow a26b8d4bc4 fix(*): Resolve a variety of small and simple bugs
Summary:
Fix T1822 - saving templates not working, not showing template

Fix T1800 - give composers a minimum size

Fix the bottom bar of the composer so the gray bar goes all the way across in popout mode.

Fix T1825 - switch to a more attractive "June 4, 2015 at 3:10 PM" styling for expanded dates

Remove, rather than hide, react components for text fields in composer. Fixes T1147

Fix specs

Switch to 999+ instead of infinity. Fixes T1768

Fix broken TemplateStore specs

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T1147, T1768, T1822, T1800, T1825

Differential Revision: https://phab.nylas.com/D1601
2015-06-05 11:02:44 -07:00
Ben Gotow e303705b45 feat(*): draft icon, misc fixes, and WorkspaceStore / custom toolbar in secondary windows
Summary:
Features:
- ThreadListParticipants ignores drafts when computing participants, renders "Draft" label, pending design

- Put the WorkspaceStore in every window—means they all get toolbars and custom gumdrop icons on Mac OS X

Bug Fixes:

- Never display notifications for email the user just sent

- Fix obscure issue with DatabaseView trying to update metadata on items it froze. This resolves issue with names remaining bold after marking as read, drafts not appearing in message list immediately.

- When you pop out a draft, save it first and *wait* for the commit() promise to succeed.

- If you scroll very fast, you node.contentWindow can be null in eventedIframe

Other:

Make it OK to re-register the same component

Make it possible to unregister a hot window

Break the Sheet Toolbar out into it's own file to make things manageable

Replace `package.windowPropsReceived` with a store-style model where anyone can listen for changes to `windowProps`

When I put the WorkspaceStore in every window, I ran into a problem because the package was no longer rendering an instance of the Composer, it was declaring a root sheet with a composer in it. This meant that it was actually a React component that needed to listen to window props, not the package itself.

`atom` is already an event emitter, so I added a `onWindowPropsReceived` hook so that components can listen to window props as if they were listening to a store. I think this might be more flexible than only broadcasting the props change event to packages.

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1592
2015-06-03 16:02:19 -07:00
Ben Gotow a3b45cf33a feature(package-management): Package management interface, APM integration
Summary:
Update a few more packages to deactivate properly

Miscelaneous fixes

Initial commit of new settings package

WIP

WIP - can load and unload and install / uninstall

Click to create new boilerplate package, package updating

Test Plan: Run tests

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1582
2015-06-02 19:04:21 -07:00
Ben Gotow 215dbbd3f3 fix(focus): When composing a forward, focus on the To field.
Summary:
fix specs

This functionality used to work but `component` isn't defined and focus: was failing. Added specs to make sure this doesn't happen again.

Test Plan: Run new specs

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1583
2015-06-01 15:12:18 -07:00
Evan Morikawa 28a6668567 Fixes T1751: Make sure composer can't send twice
Summary:
Fixes T1751
Since there's time between clicking "send" and the draft appearing on the
TaskQueue (which is what we use to determine sending state declaratively)
it's possible for it to send twice.

I opted to use `setState` at the Composer View level since I don't think
we should debouce the Action or the Store. It's totally fine for a script
to queue a bunch of messages to send via the queue. We really just want to
stop it at the user intaction level.

Test Plan: There's a test for this now in the composer-spec

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T1751

Differential Revision: https://phab.nylas.com/D1576
2015-06-01 11:24:32 -04:00
Evan Morikawa 7bd3f7ac78 update linter to look at all less files
Test Plan: script/grunt lint

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1549
2015-05-21 14:50:40 -07:00
Ben Gotow e198c4f6c4 fix(asar): Support ASAR, and running of specs in prod builds
Summary:
fix(task-queue): Repair the findTask function

Add "ship logs" and "open logs" to the developer menu

Patches for Chromium 42

Test Plan: Run tests!

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1547
2015-05-21 14:41:30 -07:00
Evan Morikawa 9d18b1e1d5 Fixes T1344: composer links fixed 2015-05-20 10:22:03 -07:00
Evan Morikawa 3807831826 fix(composer): polish composer edge cases
Summary:
Fixes T1327
Fixes T1294
Fixes T1307
Fixes T1207

- More robus Undo Manager
- Scrolls to the most recent undo location
- Fixes a variety of bugs when the composer's cursor ends up in an unsupported
location
- Fixes auto-scroll detection at end of content

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T1207, T1294, T1307, T1327

Differential Revision: https://phab.nylas.com/D1529
2015-05-19 16:12:39 -07:00
Evan Morikawa fc4b3b56d7 refactor(utils): switch to regular underscore
Summary:
Fixes: T1334

remove final InboxApp references

move out all underscore-plus methods

Mass find and replace of underscore-plus

sed -i '' -- 's/underscore-plus/underscore/g' **/*.coffee
sed -i '' -- 's/underscore-plus/underscore/g' **/*.cjsx

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1534
2015-05-19 16:06:59 -07:00
Evan Morikawa ae41c94e42 refactor(draft): clean up draft store session proxy logic
Summary:
This is an effort to make the logic around the process of sending a draft
cleaner and easier to understand.

Fixes T1253

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Maniphest Tasks: T1253

Differential Revision: https://phab.nylas.com/D1518
2015-05-19 12:07:08 -07:00
Ben Gotow 9378f4480c fix(naming): Move atom/inbox/nilas refs to Nylas
Conflicts:
	internal_packages/inbox-activity-bar/lib/activity-bar-long-poll-item.cjsx
2015-05-15 11:07:28 -07:00
Ben Gotow dc9e8dc8af fix(paste): Don't paste html with surrounding line breaks
Summary: This resolves T1187 — pasting plain text and html now work pretty well

Test Plan: Run new test case

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T1187

Differential Revision: https://review.inboxapp.com/D1511
2015-05-15 10:56:40 -07:00
Ben Gotow 4f4e7f802d fix(T1242): Warn when sending an empty body, or a body that is all quoted text and not a forward.
Summary: Resolves T1242

Test Plan: Run new tests

Reviewers: evan

Reviewed By: evan

Maniphest Tasks: T1242

Differential Revision: https://review.inboxapp.com/D1509
2015-05-15 10:53:22 -07:00
Evan Morikawa 0e0f296866 fix(*): fix draft preparing
Summary:
Fixes T1162: Search no longer lowercases

Fixes T1212: Selection anchor nodes are restored properly

Fixes T1254: Make sessionForLocalId return a promise

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: mg

Maniphest Tasks: T1263, T1212, T1162, T1254

Differential Revision: https://review.inboxapp.com/D1512
2015-05-15 10:45:18 -07:00
Evan Morikawa ecb4e49a7a fix(composer): pasting into composer sanitizes and preserves whitespace
Summary:
Fixes T1132
Added tests, and an html sanitizer.

Test Plan:
See contenteditable-component-spec.cjsx
edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Subscribers: mg

Maniphest Tasks: T1132

Differential Revision: https://review.inboxapp.com/D1492
2015-05-11 18:07:06 -07:00
Evan Morikawa db687e584e feat(salesforce): load current user
Summary:
Loads the current user to pre-populate the Salesforce field in the
creators
add tabindex to tokenizing text fields

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1468
2015-05-07 15:28:44 -07:00
Ben Gotow 21a32ac57f fix(*): Message list container styles, logout exceptions, composer logic cleanup
Summary:
This diff makes a couple changes:

- New drafts are no longer created in the composer component. Draft creation is back in the draft store where it belongs!
  - This means that the Draft List doesn't *always* contain two extra drafts, which are the unopened hot windows.
- Windows never show until they're loaded, which means windows open slowly vs. opening empty. I think the former is preferable but it's easy to change.
- Login window is now sized *before* it's shown instead of afterwards
- The mailto: behavior is now handled by the DraftStore, which gets rid of the whole draftInitialJSON thing that never made any sense.

fix(login) Make login window show at the correct size

logout from edgehill completely

Fix draft delete issue

Don't show windows, hot or cold, until they've loaded

Move logic for responding to mailto links into the draft store

Always fire `windowPropsChanged` after packages load or the window is shown

Show more error codes in red in activity bar

Make sure DraftStoreProxy doesn't interrupt the rendering of the composer with a new draft

Fix account-sidebar scroll issue, maybe?

Test Plan: Run tests!

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1479
2015-05-07 14:42:39 -07:00
Evan Morikawa 016ea60f3e feat(composer): instant composer
Summary: Fixes to make popout composers load instantly

Test Plan: edgheill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1460
2015-05-01 12:58:51 -04:00
Ben Gotow 9ffe0d74dd feat(unsafe-components): Wrap injected components, catch exceptions, clean up ComponentRegistry
Summary:
This diff gives the ComponentRegistry a cleaner, smaller API. Instead of querying by name, location or role,
it's now just location and role, and you can register components for one or more location and one or more
roles without assigning the entries in the registry separate names.

When you register with the ComponentRegistry, the syntax is also cleaner and uses the component's displayName
instead of requiring you to provide a name. You also provide the actual component when unregistering, ensuring
that you can't unregister someone else's component.

InjectedComponent and InjectedComponentSet now wrap their children in UnsafeComponent, which prevents
render/component lifecycle problems from propogating.

Existing components have been updated:

1. maxWidth / minWidth are now containerStyles.maxWidth/minWidth
2. displayName is now required to use the CR.
3. containerRequired = false can be provided to exempt a component from being wrapped in an UnsafeComponent.
   This is useful because it's slightly faster and keeps DOM flat.

This diff also makes the "Show Component Regions" more awesome. It displays column regions, since they now
use the InjectedComponentSet, and also shows for InjectedComponent as well as InjectedComponentSet.

Change ComponentRegistry syntax, lots more work on safely wrapping items. See description.

Fix for inline flexbox scenarios (message actions)

Allow ~/.inbox/packages to be symlinked to a github repo

Test Plan: Run tests!

Reviewers: evan

Reviewed By: evan

Differential Revision: https://review.inboxapp.com/D1457
2015-04-30 16:10:15 -07:00
Evan Morikawa e3dfbe59be refactor(react): convert to class-based React components
Summary: Fix react upgrade errors

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1456
2015-04-30 13:08:29 -07:00
Evan Morikawa 57cb02c76a feat(salesforce): associate threads with SF objects
Summary:
#### WIP! ####

This is making it all work with the association endpoint, putting
together the Salesforce Sidebar interfaces, and getting the nested
creators/updaters working.

I still need to do a bunch of UI work and actually debug the whole
workflow still

---

rename SalesforceContactStore to SalesforceSearchStore

rename SalesforceContact to SalesforceSearchResult

salesforce sidebar changes

salesforce association picker

object form store fixes

figuring out newFormItem instigators

Make SalesforceObjectFormStore declarative off SalesforceObjectStore

Make action basd handlers for SalesforceObjectStore

sidebar store create and associate

salesforce sidebar and picker fixes

association works and displays on sidebar

salesforce object form fixes

object form fixes

fix salesforce updating

Test Plan: TODO

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1440
2015-04-30 11:35:38 -07:00
Evan Morikawa 01938c1c78 fix(mailto): dead refernece to displayComposer
Summary: mailto from cold start waits for window to open

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://review.inboxapp.com/D1453
2015-04-29 17:38:16 -07:00
Ben Gotow 1efe193d12 fix(*): Composer horizontal scroll, fix archive-lots-and-scroll-down, draft-store cleanup exception, 2015-04-28 17:33:46 -07:00