How to use the react-orbitjs.withData function in react-orbitjs

To help you get started, we’ve selected a few react-orbitjs 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 sillsdev / appbuilder-portal / source / SIL.AppBuilder.Portal.Frontend / src / ui / components / project-table / table / row / index.tsx View on Github external
<div>
            {isPrivate &amp;&amp; }
            {showProjectActions &amp;&amp; }
          </div>
        

        
      
    );
  }
}

export default compose(
  withRouter,
  withMomentTimezone,
  withOrbit(({ project }) =&gt; ({
    // refetching the project (from local cache)
    // subscribes this component to changes to the project.
    project: (q) =&gt; q.findRecord(project),
    organization: (q) =&gt; q.findRelatedRecord(project, 'organization'),
    owner: (q) =&gt; q.findRelatedRecord(project, 'owner'),
    group: (q) =&gt; q.findRelatedRecord(project, 'group'),
    products: (q) =&gt; q.findRelatedRecords(project, 'products'),
  }))
)(Row);
github sillsdev / appbuilder-portal / source / SIL.AppBuilder.Portal.Frontend / src / ui / routes / organizations / settings / products / index.tsx View on Github external
onChange={this.togglePrivacy}
          /&gt;
        

        <hr>

        <h3>{t('org.productSelectTitle')}</h3>
        
      
    );
  }
}

export default compose(
  withTranslations,
  withOrbit(({ organization }) =&gt; ({
    organizationProductDefinitions: (q) =&gt;
      q.findRelatedRecords(organization, 'organizationProductDefinitions'),
  }))
)(ProductsRoute);
github sillsdev / appbuilder-portal / source / SIL.AppBuilder.Portal.Frontend / src / data / containers / resources / workflow-definition / with-data-actions.tsx View on Github external
);
    };

    render() {
      const actionProps = {
        createRecord: this.createRecord,
        updateAttributes: this.updateAttributes,
        updateAttribute: this.updateAttribute,
        updateStoreType: this.updateStoreType,
      };

      return ;
    }
  }

  return compose(withOrbit({}))(WorkflowDefinitionDataActionWrapper);
}
github sillsdev / appbuilder-portal / source / SIL.AppBuilder.Portal.Frontend / src / ui / routes / admin / settings / organizations / edit / index.tsx View on Github external
}
}

export default compose(
  withRouter,
  withTranslations,
  query(({ match: { params: { orgId } } }) => ({
    organization: [
      (q) => buildFindRecord(q, 'organization', orgId),
      buildOptions({
        include: ['owner'],
      }),
    ],
  })),
  withLoader(({ organization }) => !organization),
  withOrbit(({ organization }) => ({
    owner: (q) => q.findRelatedRecord(organization, 'owner'),
  })),
  withDataActions
)(EditOrganization);
github sillsdev / appbuilder-portal / source / SIL.AppBuilder.Portal.Frontend / src / ui / routes / admin / settings / workflow-definitions / edit / index.tsx View on Github external
return ;
  }
}

export default compose(
  withRouter,
  query(({ match: { params: { workflowDefinitionId } } }) =&gt; ({
    workflowDefinition: [
      (q) =&gt; buildFindRecord(q, 'workflowDefinition', workflowDefinitionId),
      buildOptions({
        include: ['store-type'],
      }),
    ],
  })),
  withLoader(({ workflowDefinition }) =&gt; !workflowDefinition),
  withOrbit(({ workflowDefinition }) =&gt; ({
    storeType: (q) =&gt; q.findRelatedRecord(workflowDefinition, 'storeType'),
  })),
  withDataActions,
  withTranslations
)(EditWorkflowDefinitions);
github sillsdev / appbuilder-portal / source / SIL.AppBuilder.Portal.Frontend / src / data / with-stubbed-dev-data.tsx View on Github external
console.debug('DEV: created:', data);

          this.setState({ _data: data });
        });
      }

      render() {
        if (this.state._data) {
          return ;
        } else {
          return 'Creating your stubbed dev data...';
        }
      }
    }

    return compose(withData(mapRecordsToProps))(WrapperClass);
  };
}
github sillsdev / appbuilder-portal / source / SIL.AppBuilder.Portal.Frontend / src / ui / routes / projects / show / with-access-restriction.tsx View on Github external
export function withAccessRestriction(WrappedComponent) {
  return compose(
    withRelationships((props: INeededProps) =&gt; {
      const { currentUser } = props;

      return {
        currentUserOrganizations: [currentUser, 'organizationMemberships', 'organization'],
      };
    }),
    withOrbit((passedProps: INeededProps) =&gt; {
      const { project } = passedProps;

      return {
        projectOrg: (q) =&gt; buildFindRelatedRecord(q, project, 'organization'),
      };
    }),
    withLoader(
      ({ projectOrg, currentUserOrganizations }) =&gt; !projectOrg || !currentUserOrganizations
    )
  )((props: INeededProps &amp; IProvidedProps &amp; i18nProps) =&gt; {
    const { t, currentUserOrganizations, projectOrg } = props;

    const currentUserOrgIds = currentUserOrganizations.map((o) =&gt; o.id);

    const isAMember = currentUserOrgIds.includes(projectOrg.id);
github sillsdev / appbuilder-portal / source / SIL.AppBuilder.Portal.Frontend / src / ui / routes / users / editsettings / settings / groups / group-select.tsx View on Github external
);
    });
  }
}

export default compose(
  withOrbit(({ organization }) =&gt; ({
    groups: (q) =&gt; q.findRelatedRecords(organization, 'groups'),
  })),
  withProps((props: IOwnProps) =&gt; {
    const { user } = props;

    return {
      propsForGroupMemberships: {
        user,
      },
    };
  }),
  withGroupMemberships
)(GroupSelect);
github sillsdev / appbuilder-portal / source / SIL.AppBuilder.Portal.Frontend / src / ui / routes / tasks / row.tsx View on Github external
}

export default compose(
  withTranslations,
  withRouter,
  withOrbit(({ userTask }) =&gt; {
    return {
      product: (q) =&gt; q.findRelatedRecord(userTask, 'product'),
      assignedTo: (q) =&gt; q.findRelatedRecord(userTask, 'user'),
    };
  }),
  withOrbit(({ product }) =&gt; ({
    project: (q) =&gt; q.findRelatedRecord(product, 'project'),
    productDefinition: (q) =&gt; q.findRelatedRecord(product, 'productDefinition'),
  })),
  withOrbit(({ productDefinition }) =&gt; ({
    workflow: (q) =&gt; q.findRelatedRecord(productDefinition, 'workflow'),
  }))
)(TaskRow);
github sillsdev / appbuilder-portal / source / SIL.AppBuilder.Portal.Frontend / src / ui / routes / users / list / invitations / index.tsx View on Github external
{error ? (
            <div data-test-error="">
              
            </div>
          ) : null}
        
      
    );
  }
}

export default compose(
  withTranslations,
  withCurrentUserContext,
  withCurrentOrganization,
  withData({})
)(InviteUserModal);