react-admin

react-admin No 'Access-Control-Allow-Origin'

浪子不回头ぞ 提交于 2020-02-06 10:09:51
问题 I'm trying to use react-admin in my project, which requires Content-Range . So in my server I have written : @GetMapping("admin/user") ResponseEntity<List<User> > getAll() { System.out.println(new Date());; HttpHeaders responseHeaders = new HttpHeaders(); responseHeaders.set("Content-Range", "posts 0-"+userRepository.findAll().size()+"/"+userRepository.findAll().size()); return ResponseEntity.ok() .headers(responseHeaders) .body(userRepository.findAll()); } Also configured CORS : @Bean public

React-Admin <ImageInput> to upload images to rails api

醉酒当歌 提交于 2020-01-24 18:50:53
问题 I am trying to upload images from react-admin to rails api backend using active storage. In the documentation of react-admin it says: "Note that the image upload returns a File object. It is your responsibility to handle it depending on your API behavior. You can for instance encode it in base64, or send it as a multi-part form data" I am trying to send it as a multi-part form. I have been reading here and there but I can not find what I want, at least a roadmap of how I should proceed. 回答1:

React-admin | How to concat source inside ReferenceField

有些话、适合烂在心里 提交于 2020-01-15 09:39:47
问题 I have a table "fos_user" and "version", I would like to display "9.0.1.A" instead of "/ version / 1". =>fos_user https://i.imgur.com/C8f0qor.png =>version https://i.imgur.com/HFSKIdz.png Is it possible to concatenate the fields of the "version" table to display it in the source, like this? https://i.imgur.com/rxJBmtp.png Because it will prevent me from creating a new field in the "version" table. Best regards, 回答1: React-admin | How to concat source inside ReferenceField ? Answer:

How to paginate react-admin lists when the total is unknown?

牧云@^-^@ 提交于 2020-01-06 14:20:38
问题 Summary : I can't get a total number of records from my GraphQL endpoint. I only know if I have reached the end of my GraphQL records list when I am parsing the response from the endpoint. How can I make my custom pagination component aware that it's on the last page? Details : I'm using React Admin with AWS AppSync (GraphQL on DynamoDB) using ra-data-graphql . AppSync can't tell you the total number of records available to a list query, and it also limits the number of records you can return

How to display ImageInput src in another component on react-admin?

牧云@^-^@ 提交于 2020-01-06 02:29:28
问题 I'm using react-admin and I want to display the chosen image in another component. I have already an image on my Edit screen. When I select a new one with ImageInput, I'd like to display it in my <Poster /> component and change the existing image with a new one. <Poster id="poster" {...props} source="card_image_path" label="resources.cards.fields.card_image_path" /> <ImageInput id="imageInput" source="images" accept="image/*"> <ImageField source="src" title="title" /> </ImageInput> 回答1: Pass

How to prevent get request from being send if the length of the query field is short in react-admin

我与影子孤独终老i 提交于 2020-01-03 11:03:08
问题 I'm using react-admin and trying to create a filter with autocomplete field that will make a query as I type and will only start sending the query when the search criteria length is longer then 2. I'm currently using shouldRenderSuggestions inside of my AutocompleteInput field but this still send two requests with an empty string in the "nickname" filter, this is the code part: <AutocompleteInput optionText="nickname" shouldRenderSuggestions={(val) => { return val.trim().length > 2 }}/> The

In Material UI, How can I override a selector selected component style?

半城伤御伤魂 提交于 2020-01-03 04:01:07
问题 In Material UI, to extend the distance between MuiInputLabel and MuiInput , I have to override the marginTop of label + .MuiInput-formControl . However, createMuiTheme 's override only provide direct override of a Mui Component CSS, such as: createMuiTheme({ overrides: { MuiInput: { formControl: { marginTop: '1.5rem', }, }, } }) How can I do something like: createMuiTheme({ overrides: { 'label+MuiInput': { formControl: { marginTop: '1.5rem', }, }, } }) Thanks... 回答1: Here's the relevant JSS

react-admin Create a custom page which can be accessed from menu sidebar

主宰稳场 提交于 2020-01-02 11:44:13
问题 I'm new to react-admin, how can I create a custom page that can access from menu sidebar? What I'm looking for is similar to this tutorial: https://marmelab.com/blog/2019/03/07/react-admin-advanced-recipes-user-profile.html but I need to be able to access that Profile page from an icon in left menu sidebar just like other Resource. Thanks 回答1: You need to use your menu component: import React from 'react'; import { Layout, MenuItemLink, Responsive } from 'react-admin'; import MyAppbar from '.

react-admin Create a custom page which can be accessed from menu sidebar

▼魔方 西西 提交于 2020-01-02 11:43:20
问题 I'm new to react-admin, how can I create a custom page that can access from menu sidebar? What I'm looking for is similar to this tutorial: https://marmelab.com/blog/2019/03/07/react-admin-advanced-recipes-user-profile.html but I need to be able to access that Profile page from an icon in left menu sidebar just like other Resource. Thanks 回答1: You need to use your menu component: import React from 'react'; import { Layout, MenuItemLink, Responsive } from 'react-admin'; import MyAppbar from '.

react-admin - How to set input values based on another

↘锁芯ラ 提交于 2019-12-30 08:52:24
问题 i'm trying to create a ZIP code input that loads street, state and city values automatically in a Create form using React-Admin. How can I populate the inputs based on the onBlur event of the zip code input? The best result i achieved is the following scenario: I created a custom component that has 4 Inputs: zip code (in my country is called CEP), street address, state and city. Then I added an onBlur event on the zip input and set the value on the inputs based on state attributes. Here is