react-admin

Use <List /> on React-Admin dashboard

醉酒当歌 提交于 2019-12-04 08:13:55
I'm using react-admin v2.3.2 with a custom dashboard component as shown in the react-admin tutorial. <Admin dashboard={MyDashboard}> <Resource name="incidents ... /> </Admin> Now I'd like to display a list of incidents on my dashboard using the component of react-admin but react-admin complains about missing properties like 'hasEdit'. I simply passed the props of the dashboard component to the List but this does obviously not work: class MyDashboard extends React.Component { constructor(props) { super(props) render( return <List {...this.props}> <Datagrid> .... </Datagrid> </List> ) } Is it

Is it possible to have multiple dataProviders in react-admin?

孤者浪人 提交于 2019-12-03 07:11:49
If I have multiple distinct REST API back-ends (separate apps doing separate things), and I want a single UI (react-admin-based) app that is capable of doing CRUD to entities managed by these various back-ends, I'm curious if it's possible to wire up react-admin to do that. I'm imagining that instead of this (single/global dataProvider): const App = () => ( <Admin dataProvider={simpleRestProvider('http://path.to.foo.api')}> <Resource name="foos" list={FooList} /> </Admin> ); we could do something like this (resource-specific dataProviders): const App = () => ( <Admin > <Resource name="foos"

In react-admin get access to redux store

Deadly 提交于 2019-12-01 07:40:09
My question is related to react-admin repo. I want to dispatch an action, outside of scope of a component, in order to do that, I've read that I need to get access to the actual redux store itself, and dispatch on in directly, so I know that the Admin component has an initialState prop, but it only accepts default state object, not the store. So I can't make a store and pass it in. My question is: How do I access redux store of an Admin component? How can I dispatch an action outside of a component, when using Admin as my main app component? my current app entry looks like this:

In react-admin get access to redux store

主宰稳场 提交于 2019-12-01 02:11:04
问题 My question is related to react-admin repo. I want to dispatch an action, outside of scope of a component, in order to do that, I've read that I need to get access to the actual redux store itself, and dispatch on in directly, so I know that the Admin component has an initialState prop, but it only accepts default state object, not the store. So I can't make a store and pass it in. My question is: How do I access redux store of an Admin component? How can I dispatch an action outside of a

Nested menu (sub-menu)

自作多情 提交于 2019-11-30 05:31:05
问题 I'm trying to implement Sub-menu (nested menu). It's worth to mention that I'm using hydra component and don't have previous experience with redux (started learning it a few days ago because of this specific problem). I've followed the example provided on material-ui for nested list https://material-ui.com/demos/lists/#nested-list. And tutorial from https://marmelab.com/react-admin/Theming.html#using-a-custom-menu for custom menu implementation. So I have a few questions. 1) Can I have

React Admin - Get current value in a form

做~自己de王妃 提交于 2019-11-30 05:14:15
问题 I am having big troubles getting the "updated" value of a record in an edit form. I always get the initial record values, even though I have an input linked to the right record source, which should update it. Is there an alternative way to get the values of the SimpleForm ? I have a simple edit form : <Edit {...props}> <SimpleForm> <MyEditForm {...props} /> </SimpleForm> </Edit> MyEditForm is as follow: class MyEditForm extends React.Component { componentDidUpdate(prevProps, prevState,

how can I show customized error messaged from server side validation in React Admin package?

安稳与你 提交于 2019-11-29 10:22:37
Is there any way to perform server side form validation using https://github.com/marmelab/react-admin package? Here's the code for AdminCreate Component. It sends create request to api. Api returns validation error with status code 422 or status code 200 if everything is ok. export class AdminCreate extends Component { render() { return <Create {...this.props}> <SimpleForm> <TextInput source="name" type="text" /> <TextInput source="email" type="email"/> <TextInput source="password" type="password"/> <TextInput source="password_confirmation" type="password"/> <TextInput source="phone" type="tel

how can I show customized error messaged from server side validation in React Admin package?

人走茶凉 提交于 2019-11-28 03:38:54
问题 Is there any way to perform server side form validation using https://github.com/marmelab/react-admin package? Here's the code for AdminCreate Component. It sends create request to api. Api returns validation error with status code 422 or status code 200 if everything is ok. export class AdminCreate extends Component { render() { return <Create {...this.props}> <SimpleForm> <TextInput source="name" type="text" /> <TextInput source="email" type="email"/> <TextInput source="password" type=

Support for resource nesting

[亡魂溺海] 提交于 2019-11-27 07:58:54
问题 I am wondering, is it possible to configure DataProvider/Resource/List to support REST urls like api/users/1/roles ? For RESTful API it is very common use case to get childs of certain parent entity, but I cant figure it how to setup React Admin and achieve this. I am using custom DataProvider build on OData spec backend. I understand that I can get roles of certain user by filtered request on api/roles?filter={userId: 1} or something like that, but my issue is that my users and roles are in