Commit graph

386 commits

Author SHA1 Message Date
jathpala 7faa9ac7bd Better support 24-hour time (#2622)
* Added support for 24-hour time to the thread list view (Issue #682)

* Add 24-hour time support to the thread list scroll tooltip (Issue #682)

* Fix for 24-hour time in the thread list scroll tooltip (#682)

Correctly imports the DateUtils module

* Add support for 24-hour time to the draft threads list (Issue #682)

* Add 24-hour time to the message sidebar

* Fix for 24-hour time in the message view so the rollover tooltip is 24hour also (#682)

* Removed unused date functions from utils

fullTimeString and shortTimeString from src/flux/models/utils.coffee were not
compatible with 24-hour time. These functions were modified and moved to
DateUtils in src/date-utils.

* Fix for display of 24-hour time in the message view (Issue #682)

* Removed unused import of Utils in a couple of files

Prompted by Travis build errors.

* Updates to handling of date/time display

Incorporates changes suggested by @bengotow.
Re-enables support for the isDetailed property in message-timestamp (if this is set
to true, a medium length date/time string will be used for display).
Re-enables additional display varieties based on when the email was received. Note
that this is implemented slightly different to the orinal version - time is now given
as an absolute time rather than "... days ago" format.
TZ guessing moved to the global scope of date-utils for performance reasons.

* Minor de-linting

* Re-enable all tests by unfocusing the test suite

A previous commit (ad04775) added an fdescribe() to one of the tests in
draft-helpers-spec. This changes that to a regular describe() so that
all tests will be run when running ./N1 --test.

* Added tests for the new DateUtils functions

Added tests for getTimeFormat, mediumTimeString and fullTimeString.
Removed no longer relevant tests from message-timestamp-spec as _formattedDate
has been removed in favour of the functions in date-utils.

To test shortTimeString, we need to be able to set a fake current time which is
possible in jasmine 2.0+ but not in 1.3 which is currently in use.

As a possible bug, when running more than 10 tests the following warning is raised:
"(node:25025) Warning: Possible EventEmitter memory leak detected.
11 on-config-reloaded listeners added. Use emitter.setMaxListeners() to increase limit",
source: internal/process/warning.js (24)

* Minor de-linting
2016-07-28 17:42:14 -07:00
Juan Tejada c347a36ab5 fix(mail-merge): Skip row in table data if its empty
- Don't show annoying error if entire row is empty
- Just show error if just the email cell is empty
2016-07-28 14:05:51 -07:00
Ben Gotow 0c41498977 fix(quoted-text): Don’t add <body>, <head> accidentally to text when transforming 2016-07-28 13:33:59 -07:00
Annie 796af843a0 fix(mail-merge): Fix column deletion and added a spec for uneven data
Summary: After importing an uneven csv (not all rows have the same number of columns e.g. rows: [[1,2][3,4,5]]), deleting the last column would improperly delete data in rows with fewer columns. This is because we were slicing each row based on row.length - 1 which is not the same for all rows. Fixed this by creating a new variable newNumColumns which is columns.length - 1.

Test Plan: Added new test data with uneven data and added a test in table-data-source-spec for removeLastColumn on this uneven set.

Reviewers: juan

Reviewed By: juan

Subscribers: juan

Differential Revision: https://phab.nylas.com/D3133
2016-07-28 12:12:10 -07:00
Annie ea60c69fa6 refactor(folders): Make folders disappear when deleted rather than graying out until confirmed
Summary:
When testing we thought that Deleting a folder turns it grey but keeps it in the folder list; trying again throws this error.
It turns out, that the folder was actually going to be deleted if left alone long enough, however, since it sat there grey for a while
we would attempt to delete it again which would throw an error. To get around this, we removed the isDeleted grey state and
unpersisted the folder right when delete is clicked then persisted the folder if there was an API error.

fix(folders): Add new and extend destroy category task specs

Test Plan: I tested locally, tweaked destroy category task specs and added minor new specs

Reviewers: bengotow, juan

Reviewed By: juan

Subscribers: bengotow, juan

Differential Revision: https://phab.nylas.com/D3131
2016-07-28 12:10:54 -07:00
Ben Gotow 0723457f27 fix(specs): Wait longer in DraftStore specs for window close 2016-07-28 11:20:02 -07:00
Annie 4c452aaf47 fix(downloads): Add a check to see if last download directory is different, only show item in folder if true
Summary:
Each file downloaded would open finder and show the path to the file. Users were reporting that this felt excessive when downloading multiple files all to the same location #1044. I added a check to see if the path was the same as the previous file path, and only showed the item in the folder if these differed.

Also added tests for this in file download store.

test(downloads): Add tests for showing item in folder only if lastDownloadDirectory differs

Test Plan: Added tests to file-download-store-spec

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D3121
2016-07-26 15:02:09 -07:00
jathpala 525e6c6444 Re-enable all tests by unfocusing the test suite (#2667)
A previous commit (ad04775) added an fdescribe() to one of the tests in
draft-helpers-spec. This changes that to a regular describe() so that
all tests will be run when running ./N1 --test.
2016-07-23 06:32:12 -07:00
Juan Tejada 7b020765e9 fix(mail-merge): Keep column links state properly in sync #2493
Summary:
See https://phab.nylas.com/D3112 for full description
- Update EditorAPI.insertCustomComponent to take a pre-generated
anchorId

Test Plan: Unit tests + manual

Reviewers: bengotow, halla, jackie

Reviewed By: jackie

Differential Revision: https://phab.nylas.com/D3113
2016-07-22 14:25:31 -07:00
Jackie Luo d916e1d8fa fix(lint): Fix linter issues 2016-07-21 22:53:19 -07:00
Jackie Luo ad047755e6 fix(quoted-text): Check that message is reply 2016-07-21 17:45:47 -07:00
Jackie Luo ba32391351 spec(quoted-text): Fix broken tests 😞 2016-07-21 15:47:54 -07:00
Halla Moore 7ca9f7667c Implement a participant cap for multi-send, add multi-send unit tests
Summary:
Prevent hitting SMTP rate limit with multi-send
Some users were hitting the SMTP rate limit when sending messages
with multi-send to too many recipients. There is a backend patch
to help with this, but we decided it would be useful to limit it
on the client side as well.

Test Plan: Added unit tests

Reviewers: jackie, juan

Reviewed By: jackie, juan

Differential Revision: https://phab.nylas.com/D3109
2016-07-21 11:36:45 -07:00
Ben Gotow 893feb2ad8 fix(contacts): Support unicode characters in domains #1920 2016-07-18 14:25:00 -07:00
Annie 39e5a2ee96 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
Halla Moore ce8cdf8cd7 fix(specs): Fix specs on Linux
Summary: Specs were failing on Linux, this diff fixes them.

Test Plan: Unit tests

Reviewers: evan, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3029
2016-06-15 16:30:52 -07:00
Evan Morikawa 0322625380 fix(spec): fix failing draft specs 2016-06-10 11:54:47 -07:00
Juan Tejada b1a8efc50a fix(specs): Fix DraftStore and SendManyDraftsTask specs 2016-06-10 11:32:38 -07:00
Evan Morikawa 903e5834c1 fix(templates): detect empty bodies and fix CSS 2016-06-09 15:00:58 -07:00
Juan Tejada e5521161b7 fix(themes): Properly set theme on the hot window
- First composer window you open after changing the theme will now have
the correct theme
2016-06-09 14:12:44 -07:00
Ben Gotow c1bbec25cd fix(identity): deprecate updaterId, provide safe access to identity.id 2016-06-02 18:56:09 -07:00
Ben Gotow 3615c7ea49 fix(undo): Improve messaging around label changes, modernize undo-redo-store
Summary: Just a small patch to address bad messaging

Test Plan: Run one new test!

Reviewers: jackie, juan

Reviewed By: jackie, juan

Differential Revision: https://phab.nylas.com/D3000
2016-06-01 14:36:57 -07:00
Ben Gotow 856334c088 fix(tasks): Call super.isDependent, wrap model lookup in transaction
Summary:
ChangeFolder/ChangeLabel still need to call super.isDependentOnTask!

Formalize "retrieve latest models" part of the performLocal process, ensure that it's always /inside/ the transaction that is going to write the changes. This ensures that queueing two tasks for the same thread at the same time don't cause a race...

...condition between the two tasks (end result is currently arbitrary!)

Add "move to label" mail rule to go alongside "Add Label"

Test Plan: All broken... willfix.

Reviewers: juan, evan, jackie

Reviewed By: evan, jackie

Differential Revision: https://phab.nylas.com/D2999
2016-05-31 16:31:24 -07:00
Juan Tejada 48556bef98 fix(build): Fix remaining specs (composer-view, send-draft-task) 2016-05-25 10:25:36 -07:00
Juan Tejada 78d27bc62a fix(specs): Fix merge conflicts and some specs 2016-05-24 19:04:20 -07:00
Juan Tejada 0ec108c906 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
Ben Gotow bf955891d9 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 e420a7af1f fix(specs): Fix specs for TaskQueue 2016-05-19 12:33:31 -07:00
Evan Morikawa 99a8b4fb04 fix(spec): remove obsolete account store spec 2016-05-19 11:59:02 -07:00
Evan Morikawa b0e66519fc fix(spec): fix config setting spy 2016-05-19 11:50:19 -07:00
Ben Gotow c6f6c7c3a0 fix(tasks): Check Task is in registry, remove any non-tasks when loading 2016-05-19 11:35:48 -07:00
Evan Morikawa 18c8a4a10f fix(undo): can redo more than one undo item 2016-05-18 16:43:48 -07:00
Juan Tejada 3bfc452f5e fix(build): Fix lint errors 2016-05-16 19:53:26 -07:00
Ben Gotow 3559f5e419 fix(config): Move all reads / writes to the main process
Summary:
Moves all reading / writing of config file to the main process,
to avoid needing to write code to lock across processes. This should also
be more efficient than re-loading the file in all processes when it's
saved.

Test Plan: Run tests

Reviewers: evan, jackie

Reviewed By: evan, jackie

Differential Revision: https://phab.nylas.com/D2963
2016-05-16 16:38:46 -05:00
Ben Gotow eb4aa0e208 fix(retry): When tasks fail, try fewer times: 2s, 4s, 8s, 16s, 30s 2016-05-16 15:44:41 -05:00
Evan Morikawa 61caf7b363 fix(spec): update NylasEnv specs 2016-05-16 13:26:33 -07:00
Evan Morikawa 7d70177720 fix(spec): Convert NylasEnvSpec from coffee to es6 2016-05-16 11:43:48 -07:00
Ben Gotow 8f29e1cfbe fix(401/403): Unify error bars, query /account, improve reconnect flow
Summary: See https://paper.dropbox.com/doc/Sync-disabling-for-N1-URZmjVpSSxWFvjC62TiFI

Test Plan: Tests incoming

Reviewers: juan, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2959
2016-05-13 14:16:54 -07:00
Ben Gotow 0441acf94a fix(fastmail): Strip "INBOX." prefix from displayNames
This can't be done on the API side because the API serves other customers.

The API will properly handle renames, crates and prepend `INBOX.`
2016-05-12 16:14:30 -07:00
Juan Tejada 2bcd5032a8 fix(specs): Remove fdescribe 2016-05-12 15:23:06 -07:00
Juan Tejada 150ac1e887 fix(specs): Fix spec for DraftEditingSession 2016-05-12 15:21:28 -07:00
Juan Tejada 3ef9da941f fix(build): Fix linter errors 2016-05-11 16:38:30 -07:00
Juan Tejada eacf54b4eb fix(build): Fix lint issues and specs 2016-05-11 15:33:52 -07:00
Juan Tejada 72e86dde36 specs(table): Add specs for table components
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
2016-05-11 14:36:59 -07:00
Ben Gotow eab8cb9085 fix(draft-factory): ReplyTo takes precedence over "from me" #2175 2016-05-10 10:33:46 -07:00
Evan Morikawa 5c01292e8b fix(spec): fix injected component spec 2016-05-06 16:42:55 -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
Ben Gotow 0e2b5501e3 fix(lint): Correct more linter errors 2016-05-06 14:10:28 -07:00
Evan Morikawa d9be81b7f5 feat(babel6): fix es6 importing from coffee 2016-05-06 12:00:45 -07:00