npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@lolocompany/react-admin-lolo

v2.1.13

Published

A library for schema-driven web apps using [Lolo](https://lolo.company), [React Admin](https://github.com/marmelab/react-admin) and [RJSF](https://github.com/rjsf-team/react-jsonschema-form)

Downloads

40

Readme

react-admin-lolo

A Library for schema-driven web apps using Lolo, React Admin and RJSF at core.

From Create, Read, Update, Delete operations to more complex implementations such as Graphs, Autocomplete widgets and Map Integrations are schema driven.

That is, As Schema changes, the View, Components, Widgets change and operate accordingly.

Installation

Create a new React app using custom configurations or create-react-app

npx create-react-app my-example-app

react-admin-lolo is available via npm as Lolo Org scoped publicly available package. You can install it using:

npm install --save @lolocompany/react-admin-lolo

Note:

react-admin-lolo requires a few dependencies to be installed along with it to operate as expected.

  • @aws-amplify/ui-react: ^1.2.5
  • aws-amplify: >=3.0.0
  • react-admin: >=3.0.0
  • react-admin-import-csv: >=1.0.0
npm install --save @aws-amplify/[email protected] aws-amplify react-admin react-admin-import-csv

Documentation

Implementation

To generate base Layout, Menu, AppBar and Dashboard view out of the box, include the following code in your React App, App.js file.

// in App.js

import React from 'react';
import { LoloAdmin, LoloResource } from '@lolocompany/react-admin-lolo';
import { Layout } from './Layout';

function App() {
  return (
    <LoloAdmin
      apiUrl={"https://dev.lolo.company/" + AppId}
      title="My Admin"
      dashboard={() => <h1>Dashboard Panel!</h1>}
      layout={Layout}
    >
      <LoloResource name="directors" />
      <LoloResource name="movies" />
    </LoloAdmin>
  );
}

export default App;

Customizing

Override Props

LoloResource supports the same override props as react-admin Resource. So for example, to customize the side menu icon and list view for directors:

import UserIcon from '@material-ui/icons/People';
import MyList from './MyList';

<LoloResource name="directors" icon={UserIcon} list={MyList} />;

Schema Transforms

Schema transform functions help you manipulate the schema that is fetched from the respective resource's schema API. Each function recieves following values as arguments transform(writableSchema, pristineSchema, selectedAccount) where in:

  • writableSchema: Manipulated schema with updated/removed properties

  • pristineSchema: Original schema recieved from the resource's schema API

  • selectedAccount: Current account selected for the panel

The LoloResource component accepts the following schema tranform functions as props:

  • listSchemaTransform: Manipulates the List component schema. It helps in displaying selected fields on the table list. For Example, the following will only display ID and Name on the enterprise table:
<LoloResource
  name="enterprises"
  listSchemaTransform={({ properties, ...rest }, pristineSchema, selectedAccount) => {
    const { id, name } = properties;
    return {
      ...rest,
      properties: { id, name },
    };
  }}
/>
  • createSchemaTransform: Manipulates the Create component schema. For Example, the following will add an extra field customId on the create form with a read only property:
<LoloResource
  createSchemaTransform={(writableSchema, pristineSchema, selectedAccount) => ({
    ...writableSchema,
    customId: { type: 'string', readOnly: true },
  })}
/>
  • editSchemaTransform: Manipulates the Edit component schema. For Example, the following will add an extra field customId on the edit form:
<LoloResource
  editSchemaTransform={(writableSchema, pristineSchema, selectedAccount) => ({
    ...writableSchema,
    customId: { type: 'string' },
  })}
/>