How to use the jsonforms-core.resolveData function in jsonforms-core

To help you get started, we’ve selected a few jsonforms-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipsesource / jsonforms / packages / default / src / additional / tree-renderer.tsx View on Github external
private renderChildren(prop: ContainmentProperty,
                         parentPath: string,
                         parentSchema: JsonSchema) {

    const composedPath = compose(parentPath, prop.property);
    const data = resolveData(this.props.data, composedPath);
    const schema = prop.schema;
    const array = data;
    const key = prop.property;
    const parentProperties = JsonForms.schemaService.getContainmentProperties(parentSchema);

    for (const property of parentProperties) {
      // If available, additionally use schema id to identify the correct property
      if (!_.isEmpty(schema.id) && schema.id !== property.schema.id) {
        continue;
      }
      if (key === property.property) {
        return this.expandArray(array, property, composedPath);
      }
    }
    // TODO proper logging
    console.warn('Could not render children because no fitting property was found.');
github eclipsesource / jsonforms / packages / default / src / additional / tree-renderer.tsx View on Github external
private expandObject(
    path: string,
    schema: JsonSchema,
    parentPath?: string
  ) {

    const { uischema, rootData, dispatch } = this.props;
    const data = resolveData(rootData, path);
    const liClasses = this.state.selected === data ? 'selected' : '';

    // TODO: key should be set in caller
    const vnode = (
      <li>
        <div>
          {
            _.has(uischema.options, 'imageProvider') ?
              <span> : ''
          }

          <span>
              this.setState({
                selected: {</span></span></div></li>