Skip to content

Commit

Permalink
Add TreeEditorProps and mapStateToTreeEditorProps to util
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarmueller committed Aug 14, 2018
1 parent 6fb881c commit c37e4c6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/browser/tree-editor-utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
import { JsonSchema7 } from '@jsonforms/core';
import { getSchema, getUiSchema } from '@jsonforms/core';
import { Property } from '@jsonforms/material-tree-renderer';

export interface TreeEditorProps {
uischema: any;
schema: any;
rootData: any;
filterPredicate: any;
labelProvider: any;
imageProvider: any;
}


export interface LabelDefinition {
/** A constant label value displayed for every object for which this label definition applies. */
constant?: string;
Expand Down Expand Up @@ -57,3 +68,13 @@ export const filterPredicate = (modelMapping) => (data: Object) => {
return false;
};
};

export const mapStateToTreeEditorProps = (state, ownProps) => {
return {
uischema: getUiSchema(state),
schema: getSchema(state),
filterPredicate: ownProps.filterPredicate,
labelProvider: ownProps.labelProvider,
imageProvider: ownProps.imageProvider
};
};

0 comments on commit c37e4c6

Please sign in to comment.