How to use ra-core - 10 common examples

To help you get started, we’ve selected a few ra-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 bootstrap-styled / ra-ui / src / components / list / BulkDeleteAction.js View on Github external
if (process.env.NODE_ENV !== 'production') {
      // eslint-disable-next-line no-console
      console.warn(
        ' is deprecated. Use the  component instead, via the bulkActionButton props.'
      );
    }
    const {
      basePath,
      dispatchCrudDeleteMany,
      resource,
      selectedIds,
      startUndoable,
      undoable,
    } = this.props;
    if (undoable) {
      startUndoable(crudDeleteMany(resource, selectedIds, basePath));
    } else {
      dispatchCrudDeleteMany(resource, selectedIds, basePath);
    }
    this.props.onExit();
  };
github marmelab / react-admin / packages / ra-ui-materialui / src / list / BulkDeleteAction.js View on Github external
useEffect(() => {
        if (process.env.NODE_ENV !== 'production') {
            // eslint-disable-next-line no-console
            console.warn(
                ' is deprecated. Use the  component instead, via the bulkActionButton props.'
            );
        }
        const { basePath, resource, selectedIds, undoable, onExit } = props;
        if (undoable) {
            dispatch(
                startUndoable(crudDeleteMany(resource, selectedIds, basePath))
            );
        } else {
            dispatch(crudDeleteMany(resource, selectedIds, basePath));
        }
        onExit();
    }, [dispatch, props]);
github marmelab / react-admin / packages / ra-ui-materialui / src / list / BulkDeleteAction.js View on Github external
useEffect(() => {
        if (process.env.NODE_ENV !== 'production') {
            // eslint-disable-next-line no-console
            console.warn(
                ' is deprecated. Use the  component instead, via the bulkActionButton props.'
            );
        }
        const { basePath, resource, selectedIds, undoable, onExit } = props;
        if (undoable) {
            dispatch(
                startUndoable(crudDeleteMany(resource, selectedIds, basePath))
            );
        } else {
            dispatch(crudDeleteMany(resource, selectedIds, basePath));
        }
        onExit();
    }, [dispatch, props]);
github go-zepto / zepto / plugins / linkeradmin / frontend / packages / linkeradmin / src / index.tsx View on Github external
async init() {
    const targetEl = document.getElementById(this.target);
    const res = await fetchUtils.fetchJson(this.schemaPath);
    try {
      const schema: Schema = res.json;
      const gen: Generator = new Generator({
        schema,
        defaultRowClick: this.defaultRowClick,
      });
      const resComps = schema.admin.resources.map((r: Resource) =>  gen.generateResourceComp(r));
      const LayoutComp = generateLayoutComp(schema);
      const AdminApp = () => (
        
      );
      ReactDOM.render(, targetEl);
    } catch (error) {
      // TODO: Handle this error
      console.error(error);
    }
github bootstrap-styled / ra-ui / src / components / list / ListGuesser.js View on Github external
componentDidUpdate() {
    const { ids, data, resource } = this.props;
    if (ids.length > 0 && data && !this.state.inferredChild) {
      const inferredElements = getElementsFromRecords(
        ids.map(id => data[id]),
        listFieldTypes
      );
      const inferredChild = new InferredElement(
        listFieldTypes.table,
        null,
        inferredElements
      );

      process.env.NODE_ENV !== 'production' && // eslint-disable-line
      // eslint-disable-next-line no-console
      console.log(
        `Guessed List:

export const ${inflection.capitalize(
    inflection.singularize(resource)
  )}List = props => (
    
${inferredChild.getRepresentation()}
github marmelab / react-admin / packages / ra-ui-materialui / src / detail / ShowGuesser.js View on Github external
useEffect(() => {
        if (record && !inferredChild) {
            const inferredElements = getElementsFromRecords(
                [record],
                showFieldTypes
            );
            const inferredChild = new InferredElement(
                showFieldTypes.show,
                null,
                inferredElements
            );

            process.env.NODE_ENV !== 'production' &&
                // eslint-disable-next-line no-console
                console.log(
                    `Guessed Show:

export const ${inflection.capitalize(
                        inflection.singularize(resource)
                    )}Show = props => (
    
${inferredChild.getRepresentation()}
github bootstrap-styled / ra-ui / src / components / detail / EditGuesser.js View on Github external
componentDidUpdate() {
    const { record, resource } = this.props;
    if (record && !this.state.inferredChild) {
      const inferredElements = getElementsFromRecords(
        [record],
        editFieldTypes
      );
      const inferredChild = new InferredElement(
        editFieldTypes.form,
        null,
        inferredElements
      );

      process.env.NODE_ENV !== 'production' // eslint-disable-line
      // eslint-disable-next-line no-console
      && console.log(
        `Guessed Edit:

export const ${inflection.capitalize(
    inflection.singularize(resource)
  )}Edit = props => (
    
${inferredChild.getRepresentation()}
github marmelab / react-admin / packages / ra-ui-materialui / src / list / ListGuesser.js View on Github external
componentDidUpdate() {
        const { ids, data, resource } = this.props;
        if (ids.length > 0 && data && !this.state.inferredChild) {
            const inferredElements = getElementsFromRecords(
                ids.map(id => data[id]),
                listFieldTypes
            );
            const inferredChild = new InferredElement(
                listFieldTypes.table,
                null,
                inferredElements
            );

            process.env.NODE_ENV !== 'production' &&
                // eslint-disable-next-line no-console
                console.log(
                    `Guessed List:

export const ${inflection.capitalize(
                        inflection.singularize(resource)
                    )}List = props => (
    
${inferredChild.getRepresentation()}
github marmelab / react-admin / packages / ra-ui-materialui / src / detail / EditGuesser.js View on Github external
useEffect(() => {
        if (record && !inferredChild) {
            const inferredElements = getElementsFromRecords(
                [record],
                editFieldTypes
            );
            const inferredChild = new InferredElement(
                editFieldTypes.form,
                null,
                inferredElements
            );

            process.env.NODE_ENV !== 'production' &&
                // eslint-disable-next-line no-console
                console.log(
                    `Guessed Edit:

export const ${inflection.capitalize(
                        inflection.singularize(resource)
                    )}Edit = props => (
    
${inferredChild.getRepresentation()}
github bootstrap-styled / ra-ui / src / components / detail / ShowGuesser.js View on Github external
componentDidUpdate() {
    const { record, resource } = this.props;
    if (record && !this.state.inferredChild) {
      const inferredElements = getElementsFromRecords(
        [record],
        showFieldTypes
      );
      const inferredChild = new InferredElement(
        showFieldTypes.show,
        null,
        inferredElements
      );

      process.env.NODE_ENV !== 'production' // eslint-disable-line
      // eslint-disable-next-line no-console
      && console.log(
        `Guessed Show:

export const ${inflection.capitalize(
    inflection.singularize(resource)
  )}Show = props => (
    
${inferredChild.getRepresentation()}