This repository has been archived by the owner on Apr 15, 2020. It is now read-only.
Releases: 92green/react-entity-editor
Releases · 92green/react-entity-editor
RoundRedPanda
- Fix bug where
EntityEditorStateRedux
was not usingid
from config as it's store key - Operations are now passed the
result
of the previous operation inactionProps
. - Readme update to reflect the ongoing nature of the development of this poor, neglected, somewhat tangled library
ParsimoniousPeacock
- Results from successful or errored operations are passed into each subsequent status as a
result
prop. react-modal
is now a peer dep, and by default the modal is not applied. This might be monorepo'd into another package in future- State is now stored in a separate component which is composed above the EntityEditorHock by default
redux/EntityEditorStateReducer
andredux/EntityEditorStateRedux
(hock) exist to store state in redux- Config has changed
- Added:
composeComponents
key, a function that returns an array of components to compose. - The modal can be added via
composeComponents
- The
statusOutput
option in config has been removed. - Removed:
prompt
andpromptContainer
- Added:
import {BaseConfig, EntityEditorState, EntityEditorHock} from 'react-entity-editor';
import EntityEditorModal from 'react-entity-editor/lib/modal/Modal';
...
// to add a modal or use a different state storage hock, add this.
BaseConfig.merge({
composeComponents: (config) => [
EntityEditorState(config), // or EntityEditorStateRedux(config)
EntityEditorHock(config),
EntityEditorModal({
appElement: "#body"
}) // or your own Modal hock if you prefer
]
});
SpotlessTahr
Contents
- Adding react router 3 plugin
- Renaming modal class name props and adding a way to assign then via config
Breaking changes
config.components
is removed. Useconfig.prompt.component
andconfig.promptContent.component
instead.Modal
andModalContent
class name props have changed.
Additions
- Added
config.prompt.props
andconfig.promptContent.props
as a way of passing props to prompt components.
InconsequentialMoose
Contents
- Changes to improve the setting of dirty state. See examples for the new preferred setup for keeping dirty state.
Breaking changes
operations.dirty
now no longer accepts any arguments.operations.clean
should be used whereoperations.dirty({dirty: false})
was previously used.operations.go
now include aclean
step in their workflow by default.
Additions
- Added
operations.clean
, which is equivalent tooperations.dirty({dirty: false})
.
Examples
- All updated to use new API
InferiorFox
Breaking changes
- Config: operations on tasks are now just strings on
config.tasks.xxx.operation
which refer to an operation, whereas they used to be a double barrel function onconfig.tasks.xxx.operate
. The functions in the tasks accomplished nothing that can't be better achieved by operations calling other operations. See thesave
operation for the best example of this. - Config:
config.operationProps
now appear under aprops
key in the object passed as the first argument of the first function of each operation. Previously these were top-level within the object. - Config:
config.operationProps
is no longer required. When not provided this passes all of the props passed toEntityEditorHock
through to the operations. - BaseConfig: write actions no longer set dirty state. This is now left entirely to the user, and works better this way.
Additions
- Added
ReactRouter4Config
export containingreact-router
version 4 config, used on Ants example.- Closes #30
- Added
config.lifecycleMethods
, where functions can be set to fire onEntityEditorHock
lifecycle methods. Seeconfig/ReactRouter4Config
for an example. I don't anticipate much need to use this.
Examples updates
- Cleaned up examples, restructured components within them to be less magic, and to separate the parts of the examples that show how things are done versus those that are merely there to make the examples work.
- Ants example fully works with router navigation protection.
WearyDonkey
- Composed components inside of
EntityEditorHock
are now pure render. - Added stub operations to
BaseConfig
to warn if you haven't set them yourself. - Added create and update actions and matching operations to
BaseConfig
. - Bug fix: merging configs no longer merges arrays or workflows.
EntityEditorHock
no longer passesworkflow
prop.- Can now pass
passConfig
prop toEntityEditorHock
to force it to pass down its config. Intended for use by other higher order components.
MaleSilverfish
- Default button class names have change from
Button
andButton-grey
toButton-primary
andButton-secondary
. - OperationProps can now accept non-functions.
- Now uses
prop-types
library.
PastMagpie
- Pass down
operation
prop (partially applied) so apps can call these without associated workflows, and can call them while actions are mid-progress. - Replace individual abilities on
abilities
prop with singleactionable
boolean - Change naming of base operations to drop
on
prefix - Remove
dirty
actions and tasks, keep only thedirty
operation now - Make editorState usage more in line with React's
setState
- Remove
dirty: false
ongo
operation as it's not a concern ofgo
whatdirty
is. Now dirty should be set manually usingoperations
, usually oncomponentWillMount
andcomponentWillUnmount
of a form component - Use a new button pattern in docs for less code duplication
- Use
entityEditor.names
props in docs - Remove unused flow types
HeavyAfricanLeopard
EntityEditor higher order component now passes down a names
prop containing entity names.
Names is an object that contains strings representing the names of the entity, It contains singular, plural, caplitalized singular and capitalized plural in the following object shape using "cat"
as an example:
```
names = {
item: "cat",
items: "cats",
Item: "Cat",
Items: "Cats"
};
```
StrictLimpet
The API and usage are very close to the final structure now. Too many changes to name here, please follow the examples provided in the docs
folder.