0.1.3 • Published 6 years ago

@humanizei/ra-platform v0.1.3

Weekly downloads
1
License
MIT
Repository
bitbucket
Last release
6 years ago

ra-platform

A react-admin component for building Humanizei Platorm apps.

Features

  • API Gateway Data Provider.
  • Humanizei SSO Auth Provider.
  • Internationalization based on Platform Service + Default Platform i18n.
  • Security Component to handle a user security based on Authorities, Roles, Scopes.
  • Custom Validators.

Notes

Currently the ra-platform is a pre-alpha release, which means that could be unstable and might had break changes any time. Also, the full documentation is not provided yet since the Platform is under development. Each partner that desired to have more information could contact directly the OSS Humanizei Team.

Development Notes

Install tsc before build it.

npm install -g typescript

Usage

Defining a API Gateway Configuration:

import {config} from "@humanizei/ra-platform";

const AppGatewayConfiguration = {
    apiUrl: config.baseUrl,
    services: {
        // Each key identify the microservice resource id.
        "core": {
            // Map the resources that your app will consume.
            resources: [
                "tenants"
            ]
        }
    }
};
export default AppGatewayConfiguration;

Defining custom-routes:

import React from 'react';
import {Route} from "react-router-dom";
import Configuration from "../configuration/Configuration";

export default () => [
    <Route path="/configuration" component={Configuration} />
];

Defining custom menu items:

import SettingsIcon from '@material-ui/icons/Settings';

export default [
    {
        route: '/configuration', label: 'pos.configuration', icon: SettingsIcon, withAuthorities: ''
    }
]

Under your App.js:

import React from 'react';
import {Admin, Resource } from 'react-admin';
import {
    platformAuthProvider,
    i18nProvider,
    platformRoutes,
    PlatformLayout,
    PlatformMenu,
    SingleSignOneLogin
} from '@humanizei/ra-platform';

import { apiGatewayClient } from './@common'

import Dashboard from './dashboard/Dashboard' ;
import i18n from './i18n'
import menuItems from "./menuItems";
import routes from "./routes";
import myResource from './myResource'

const App = () => (
    <Admin
        title="Humanizei | Sample App"
        authProvider={platformAuthProvider(apiGatewayClient)}
        dataProvider={apiGatewayClient.dataProvider()}
        i18nProvider={i18nProvider(i18n)}
        appLayout={PlatformLayout}
        customRoutes={platformRoutes(routes)}
        menu={PlatformMenu(menuItems)}
        loginPage={SingleSignOneLogin}
        dashboard={Dashboard}
        locale="pt">
        <Resource name="myResource" {...myResource}/>
    </Admin>
);
export default App;
0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.1-beta-1

7 years ago

0.0.1-beta

7 years ago

0.0.1-alpha-3

7 years ago

0.0.1-alpha-2

7 years ago

0.0.1-alpha-1

7 years ago

0.0.1-alpha

7 years ago