admin-on-rest

How to create a ReferenceInput wrapped component?

天大地大妈咪最大 提交于 2019-12-02 06:17:38
I'm trying to create a wrap component that includes admin-on-rest ReferenceInput What am I missing? I have seen the answer Error on Creating custom ReferenceInput with separate component but I do not know how to apply it in this case //Works!! export const commentsCreate = (props) => ( <Create title = "Create" {...props} > <SimpleForm> <ReferenceInput label="Posts" source="field" reference="posts" allowEmpty {...props}> <AutocompleteInput optionText="name" {...props}/> </ReferenceInput> </SimpleForm> </Create> ); /* Fail: ReferenceInput.js:303 Uncaught (in promise) TypeError: Cannot read

admin on rest send extra params to rest call

女生的网名这么多〃 提交于 2019-12-02 04:33:18
问题 i have upload button inside create form, on button click handler i will upload image to cloud and on upload success i get image url. i need to pass this image url to rest api. this is my sample code. When i submit my form i need to send image url as parameter. Can anyone help me. Here is my code: <SimpleForm label="Create Artist"> <TextInput source="name" label="Name" /> <FlatButton style={styles.button} label="Upload Image" primary onClick={this.handleClick} /> </SimpleForm> this.handleClick

admin on rest send extra params to rest call

本小妞迷上赌 提交于 2019-12-02 00:49:26
i have upload button inside create form, on button click handler i will upload image to cloud and on upload success i get image url. i need to pass this image url to rest api. this is my sample code. When i submit my form i need to send image url as parameter. Can anyone help me. Here is my code: <SimpleForm label="Create Artist"> <TextInput source="name" label="Name" /> <FlatButton style={styles.button} label="Upload Image" primary onClick={this.handleClick} /> </SimpleForm> this.handleClick = () => { cloudinary.openUploadWidget({ cloud_name: 'demo', upload_preset: 'sh3432', cropping: 'server

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

babel JS file can't resolve “@babel/runtime/helpers/builtin/classCallCheck”

假装没事ソ 提交于 2019-11-27 04:50:51
问题 on-rest my project was working great untill I delete my node_modules file and try to re-install npm package. I am getting this error ./node_modules/react-event-listener/dist/react-event-listener.cjs.js Module not found: Can't resolve '@babel/runtime/helpers/builtin/classCallCheck' in '/Users/suatkarabacak/Desktop/demarkedashboard/node_modules/react-event-listener/dist' My package.json is looking like this. { "name": "demo", "version": "0.1.0", "private": true, "dependencies": { "admin-on-rest

How to richly style AOR Edit page

半腔热情 提交于 2019-11-26 18:39:49
问题 Have to create an edit Page editing a number of parameters on an instance of a'tale' resource. However adding any element such as an MUI Card or even a div, is causing the app to freeze in various ways. These are the approaches I have tried. 1) Adding a card component or placing my elements within a div for styling export const EditorEditTale = (props) => { return ( <Edit {...props} title="Tale Editor"> <SimpleForm > <div> <Image /> <TaleCardHeader props={ props } style={taleCardHeaderStyle