Commit graph

56 commits

Author SHA1 Message Date
Juan Tejada eeb0e8fc5b fix(snooze): Fix path to main file in package.json 2016-05-16 17:53:42 -07:00
Juan Tejada aff5505743 fix(snooze): Sentry error: "Can't create Snooze Category"
- This error was still being thrown for a large number of accounts,
despite the fact that the N1-Snoozed category was being created
- This error was happening when adding a new account which did not already have a
snooze category in the backend:
  - When the account is added the AccountStore triggers more than once,
  causing the SnoozeStore to send more than one request to create the
  same category. Any request after the first one will fail because the
  category already exists
- The fix is not try to create a category unless the accounts have
actually changed
2016-05-16 16:21:27 -07:00
Evan Morikawa 2d2e459094 fix(lint): final linter fixes
fix(lint): final set of linter fixes
2016-05-06 16:32:34 -07:00
Ben Gotow 2ff92946b7 fix(lint): Various linter fixes 2016-05-06 16:23:48 -07:00
Ben Gotow 7533dc0ac6 fix(lint): Various linter issues 2016-05-06 16:06:16 -07:00
Evan Morikawa 3d3b9bf87f fix(lint): fixing various linter errors.
746 left
2016-05-06 13:42:09 -07:00
Evan Morikawa 2e2f877ddb feat(babel6): 1,774 linter errors 2016-05-06 11:55:46 -07:00
Evan Morikawa e054a6ac91 feat(babel6): Yay all the tests pass 2016-05-06 11:55:36 -07:00
Evan Morikawa 390007cac9 feat(babel6): fix es6 describe function syntax 2016-05-06 11:55:20 -07:00
Evan Morikawa 2692fce522 feat(babel6): Fix destructuring default from exports and update linter 2016-05-06 11:55:14 -07:00
Evan Morikawa 9e4029036a feat(babel6): Rename to js to es6 2016-05-06 11:55:02 -07:00
Evan Morikawa 8db8722f74 feat(babel6): Initial babel conversion 2016-05-06 11:54:38 -07:00
Karim Hamidou b82e47ba34 [N1] Changes to allow running edgehill-server locally
Summary: This is mostly config changes.

Test Plan: Tested the Google OAuth flow.

Reviewers: bengotow, drew

Reviewed By: bengotow, drew

Differential Revision: https://phab.nylas.com/D2907
2016-04-29 10:18:51 -07:00
Ben Gotow f1c0a1615d fix(focus): Remove focusedField in favor of imperative focus, break apart ComposerView
Summary:
- Removes controlled focus in the composer!
  - No React components ever perfom focus in lifecycle methods. Never again.
  - A new `Utils.schedule({action, after, timeout})` helper makes it easy to say "setState or load draft, etc. and then focus"
  - The DraftStore issues a focusDraft action after creating a draft, which causes the MessageList to focus and scroll to the desired composer, which itself decides which field to focus.
  - The MessageList never focuses anything automatically.
- Refactors ComposerView apart — ComposerHeader handles all top fields, DraftSessionContainer handles draft session initialization and exposes props to ComposerView
  - ComposerHeader now uses a KeyCommandRegion (with focusIn and focusOut) to do the expanding and collapsing of the participants fields. May rename that container very soon.
- Removes all CommandRegistry handling of tab and shift-tab. Unless you preventDefault, the browser does it's thing.
- Removes all tabIndexes greater than 1. This is an anti-pattern—assigning everything a tabIndex of 0 tells the browser to move between them based on their order in the DOM, and is almost always what you want.
- Adds "TabGroupRegion" which allows you to create a tab/shift-tabbing group, (so tabbing does not leave the active composer). Can't believe this isn't a browser feature.

Todos:
- Occasionally, clicking out of the composer contenteditable requires two clicks. This is because atomicEdit is restoring selection within the contenteditable and breaking blur.
- Because the ComposerView does not render until it has a draft, we're back to it being white in popout composers for a brief moment. We will fix this another way - all the "return unless draft" statements were untenable.
- Clicking a row in the thread list no longer shifts focus to the message list and focuses the last draft. This will be restored soon.

Test Plan: Broken

Reviewers: juan, evan

Reviewed By: juan, evan

Differential Revision: https://phab.nylas.com/D2814
2016-04-04 15:22:01 -07:00
Ben Gotow 886328ff7a bump(react): 0.13.2 => 0.14.7
Great breakdown of React changes here:
https://github.com/facebook/react/blob/master/CHANGELOG.md#0140-october-7-2015

Due to deprecation warnings, I don't think this will break third-party extensions unless they were doing really bad things.
2016-03-29 01:43:12 -07:00
Juan Tejada e40f4c58fd fix(snooze): Correctly display snoozed until label 2016-03-23 18:00:46 -07:00
Juan Tejada 687597134d feat(selection): Add new display for selection count + update toolbar
Summary:
- New behavior is that the in split mode, you will perform actions on
  the selection via the MessageListToolbar (the toolbar positioned above
  the message list)
- Refactored and moved around a bunch of code to achieve this:
  - Mostly renaming stuff and moving stuff around and removing some
    duplication
  - Update naming of toolbar role to a single role, and update relevant code
  - Converted and refactored a bunch of code into ES6, specifically to reuse the code for the ThreadActionsToolbar at the 2 locations
  - Deprecated MultiselectActionBar in favor of MultiselectToolbar
  - Deprecated old roles
- Punted the animation for the stackable cards in the selection display for now.
- #370

Test Plan: - Manual and unit tests

Reviewers: evan, drew, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2756
2016-03-21 12:20:11 -07:00
Juan Tejada cfbbcd23d3 fix(snooze): Correctly query and create snooze categories per account
Summary:
- Was not properly updating the references to snoozed categories when
  accounts were added or removed
- Update whenCategoriesReady to make sure we listen until category syncing has concluded (Move inside CategoryStore)
- #1676, #1658

Test Plan: - TODO

Reviewers: evan, drew, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2723
2016-03-14 15:36:39 -07:00
Juan Tejada 42e5f4c605 fix(snooze): Fix getter for inbox category in when moving to snooze 2016-03-10 17:46:23 -08:00
Ben Gotow f706d4d80f fix(sync): Pull down and associate metadata during initial sync
Summary:
Snooze should wait for categories on all accounts

Fix authPlugin to rembmer `plugin+accountId`, not pluginId, add specs

categories() returned [], categories(acctId) returned {}

dry up sync worker, fetch metadata before anything else

Test Plan: Run tests

Reviewers: drew, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D2693
2016-03-10 11:06:06 -08:00
Juan Tejada fcf8fa766c fix(snooze-button): Change div to button 2016-03-09 16:10:15 -08:00
Juan Tejada e3fc29ee36 remove(popover): Remove Popover in favor of FixedPopover
Summary:
- FixedPopover now correctly adjusts itself when overflowing outside
  window, in all directions
  - Updates styles
  - Adds specs
- Remove Popover and popover.less, and refactor all code that used it in
  favor of the new FixedPopover

Test Plan: Unit tests

Reviewers: drew, evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2697
2016-03-09 10:05:46 -08:00
Juan Tejada 37af2ba42c fix(remove-from-view): Fix logic for delete/remove-from-view behavior:
Summary:
- Separate gmail's remove-from-view and delete behaviors and write logic
  for each of those
  - Remove MailboxPerspective::{canArchiveThreads, canTrashThreads,
    removeThreads} and some unecessary code in TaskFactory
  - Instead, add MailboxPerspective::tasksForRemovingFromPerspective (I
    know its a bit of a mouthful)
  - I initially tried to put all of the logic for each execution path
    inside the TaskFactory by checking perspective types, but it made
    more sense to use the polymorphism already in place for the different
    perspective types.
  - There is a default delete/remove-from-view behavior which is
    configurable via simple ruleset objects. The gmail behavior is
    configured in this way.
- Update swipe css classes based on destination of threads
- Fixes #1460:
  - Update logic to display archive/trash buttons and context menu options correctly
    when selected threads can be archived/trashed (not based on
    perspective)
  - Same for swiping
- Add a bunch of specs
- Convert some code to ES6
- TODO write some docs for new functions

Test Plan: Unit tests

Reviewers: drew, evan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2682
2016-03-07 18:16:37 -08:00
Juan Tejada 848bb09f84 fix(date-utils): Add localization to date formats
Summary:
- Setting the locale in moment was not sufficient to actually use the
  correct localized formats.
- Moment provides localized format via the formats : 'L', 'LL', 'll',
  etc. See: http://momentjs.com/docs/#/displaying/format/
- Updates to set our date formats based on localized formats:
  - Unfortunately, localized formats always contain the year, so I
    manually removed the year from our short format.
- Actually fixes: #1515
- Fixes bug where setting nextWeek or thisWeekend returned incorrect
  date if the current day was saturday or sunday
- Add specs

Test Plan: Unit tests

Reviewers: evan, drew, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2688
2016-03-07 16:44:54 -08:00
Juan Tejada 1023600c7e fix(lint): Fix linter error in specs 2016-03-03 13:45:28 -08:00
Juan Tejada 0fd2d107b2 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 f413386b80 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
Juan Tejada c5f112f846 fix(snooze): Do not display snooze buttons unless looking at inbox 2016-02-25 14:02:58 -08:00
Evan Morikawa a63bc9e4b0 fix(analytics): fix send later and snooze analytics 2016-02-25 14:01:15 -08:00
Ben Gotow 1d130e15c8 perf(snooze): Don't wrap snooze label in unsafe container 2016-02-25 13:39:30 -08:00
Juan Tejada f22fdbae49 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
Evan Morikawa 18be81098e feat(analytics): add analytics to send later, snooze, tracking 2016-02-25 12:34:09 -08:00
Juan Tejada 164ac49fa5 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 7d05523b0f fix(plugins): Add headers for composer popover + Fix in snooze popover 2016-02-25 10:24:29 -08:00
Ben Gotow 0553b7bde3 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
Drew Regitsky 6fe36c72a5 fix(snooze): options text capitalization: title case => sentence case 2016-02-24 17:56:52 -08:00
Juan Tejada 4aecf745ac 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
Evan Morikawa cbed789b94 fix(snooze): look at allCategories instead of userCategories 2016-02-24 16:51:34 -08:00
Juan Tejada 3187d2f0d1 fix(snooze): Fix quick action button, remove italic from popover 2016-02-24 15:33:57 -08:00
Juan Tejada 6458a90eda fix(snooze): Close popover on error 2016-02-24 15:11:03 -08:00
Juan Tejada 2eefbc28d3 fix(snooze): Close popover when opening a new one 2016-02-24 15:08:53 -08:00
Juan Tejada f7b1209b5c fix(fixed-popover): Reposition when overflowing on left direction
- This is a temporary solution
2016-02-24 15:02:42 -08:00
Ben Gotow 030d86e3bd fix(snooze/send-later): Change chrono config to always prefer dates in future 2016-02-24 13:16:53 -08:00
Ben Gotow 90b9570f91 fix(send-later): Resolves a variety of small bugs from QA 2016-02-24 12:26:56 -08:00
Juan Tejada 3f59176380 💄 (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 3125d4d2ff 💄 (snooze): Add quotes to popover placeholder 2016-02-24 10:28:08 -08:00
Juan Tejada c0da487e02 fix(snooze): Close all popover types when submitting date with enter 2016-02-24 10:27:16 -08:00
Juan Tejada d34f30cc3e 💄 (plugins): Clean up constants in plugins
- Fix some eslint issues
2016-02-23 22:55:47 -08:00
Juan Tejada 3a55a126b6 fix(snooze): Fix react component warnings 2016-02-23 22:39:18 -08:00
Ben Gotow 9315ee3385 fix(metadata-plugins): Add production app ids 2016-02-23 22:29:49 -08:00