High-level metadata-driven view components for LSD applications
npm install lsd-viewsLSD Views
=========
LSD Views provides a set of high-level React components designed
for use in the view part of LSD applications.
They enable large chunks of functionality to be defined with a single element.
For example, the EntityListWithView component, combined with some supporting definitions, displays a list of
objects of a certain type, and when one is selected, shows the object in an edit view, and takes care of saving
the changes to the application state.
Most of the components rely heavily on metadata about the business object classes defined with the
LSD Metadata classes.
Many also need:
- an EntityManager for the business object class that knows how to get, list and save instances
- a NavigationManager that knows how to navigate to the correct view for instances of that class
The aim is that these manager objects and the metadata define what is unique about each business object
class, and the parts of the functionality that are the same for each type of business object
are taken care of by the view component.
The view created can be customised by passing in other components as properties or child elements.
``javascript`
By default, the edit view uses the EntityView component, but in this example that is overridden with a AccountView
custom component that is defined like this:
`javascript
let AccountView = React.createClass({
render: function () {
const postingsView =
return
}
})
AccountView.propTypes = EntityView.propTypes
`
It shows a standard EntityView` but overrides which properties are shown and the type of view used to display one of the properties.