-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to configure export button props from list component and global admin #8285
Comments
Thanks for the suggestion. Another possibility would be to add Configurable capabilities to the ExportButton, leveraging #8145, so that you can set the maxResults in local preferences. @fzaninotto what do you think? |
Hi @soullivaneuh, and thanks for your suggestion. Replacing So we won't allow to customize the export size in the As for making the |
@fzaninotto You are right, replacing the vendor import by a local one is not a big pain, and this is not what I reported. The big pain to me, is the fact we have to copy/paste all the vendor code of This is what is represented by the code block added to the issue body: dozens of line just to change one, plus the fact we do not rely to the future vendor update anymore. I understand the principles you pointing our, but I think the problematic is still justified. Can this issue be reconsidered and discussed about other possible alternatives? Regards |
Maybe is not a crazy idea to add |
Yes, at least that if you do not want a super prop on the Even if this is more configuration tweaking here, so we should have a way to easily access to that. Even I understand we should avoid having one component with a ton of props, but it also make no sense to me to completely override core component of react-admin just to be able to change one prop of a sub component being used on it. |
@soullivaneuh You shouldn't have to write that much code to override the ListActions const ListActions = () => (
<TopToolbar>
<FilterButton/>
<CreateButton/>
<ExportButton/>
</TopToolbar>
); Is all you need. |
@fzaninotto Well, your sample is indeed tiny, but does not look like the vendor one: react-admin/packages/ra-ui-materialui/src/list/ListActions.tsx Lines 48 to 99 in 69d1cd1
And you get rid of all the dynamic button logic addition, which its need to make our custom component re-usable across the resource, plus the So no, it's a bit more complicated than that in my opinion. |
The react-admin code is more complex because we have to maintain backward compatibility with previous versions. You only have one version to manage. Anyway, let's agree to disagree. You want to write less code, we want to avoid complexity, and these two objectives can't meet in this feature request. Considering that your problem already has a solution, I suggest we leave it here. |
Is your feature request related to a problem? Please describe.
We currently need to change the default export max result from
1000
(defined here) to5000
globally on the app.To do so, we have first to create custom
List
andListActions
components:Then, we have to replace the vendor
List
usage by our local one on each list resource we define on our project (nearly 15 for our case).I see two main drawbacks with that:
Describe the solution you'd like
The ability to define the exporter option directly to the
List
:Or globally using the
Admin
component:Describe alternatives you've considered
The alternative is already described by the problem section.
Additional context
N/A
The text was updated successfully, but these errors were encountered: