Summary: Shortens and simplifies UI variables so that unused variables are no longer present.
Test Plan: Tested locally.
Reviewers: evan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2738
Summary:
This implements EditableList re-ordering via a new prop callback.
You can drag and drop items in the mail rules list and the accounts list.
Note that you can't drag between lists - right now this is just to enable
re-ordering.
Test Plan: No new specs yet
Reviewers: evan, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D2495
Summary:
Originally, this was going to be a totally independent package, but
I wasn't able to isolate the functionality and get it tied in to
the delta-stream consumption. Here's how it currently works:
- The preferences package has a new tab which allows you to edit
mail filters. Filters are saved in a new core store, and a new
stock component (ScenarioEditor) renders the editor. The editor
takes a set of templates that define a value space, and outputs
a valid set of values.
- A new MailFilterProcessor takes messages and creates tasks to
apply the actions from the MailFiltersStore.
- The worker-sync package now uses the MailFilterProcessor to
apply filters /before/ it calls didPassivelyReceiveNewModels,
so filtrs are applied before any notifications are created.
- A new task, ReprocessMailFiltersTask allows you to run filters
on all of your existing mail. It leverages the existing TaskQueue
architecture to: a) resume where it left off if you quit midway,
b) be queryable (for status) from all windows and c) cancelable.
The TaskQueue is a bit strange because it runs performLocal and
performRemote very differently, and I had to use `performRemote`.
(todo refactor soon.)
This diff also changes the EditableList a bit to behave like a
controlled component and render focused / unfocused states.
Test Plan: Run tests, only for actual filter processing atm.
Reviewers: juan, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D2379
- When prop specified to not allow empty selection it should also
prevent it from being cleared when pressing Esc while focusing the list
- Adds a default value to the edit item input
- Updates specs
- Updates styles
Summary:
Adds the new Account preferences page. This consists of two major React components,
PreferencesAccountList and PreferencesAccountDetails, both of which use EditableList.
I added a bunch of fixes and updated the API for EditableList, plus a bit of
refactoring for PreferencesAccount component, and a bunch of CSS so its a big diff.
The detailed changelog:
Updates to EditableList:
- Fix bug updating selection state when arrows pressed to move selection
- Add new props:
- allowEmptySelection to allow the list to have no selection
- createInputProps to pass aditional props to the createInput
- Add scroll region for list items
- Update styles and refactor render methods
Other Updates:
- Updates Account model to hold aliases and a label
- Adds getter for label to default to email
- Update accountswitcher to display label, update styles and spec
- Refactor PreferencesAccounts component:
- Splits it into smaller components,
- Removes unused code
- Splits preferences styelsheets into smaller separate stylesheet for
account page. Adds some updates and fixes (scroll-region padding)
- Update AccountStore to be able to perform updates on an account.
- Adds new Action to update account, and an action to remove account to
be consistent with Action usage
- Adds components for Account list and Aliases list using EditableList
Test Plan: - All specs pass, but need to write new tests!
Reviewers: bengotow, evan
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2332
- Fix issue with using this.props.children which was preventing
rerendering
- Updates styles for list
- Updates create item input:
- Add key to prevent warning
- Add prop for the placeholder
- Add onBlur behavior
Summary:
- Generic list component wich supports adding, editing and removing
string-like items or components
- Needs some css love
Test Plan: - Unit tests.
Reviewers: evan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2322