Sitelet https://web.archive.org/web/20201007140344/https://github.com/marmelab/react-admin/issues/5309
Skip to content
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 customization of "Element deleted" notification when using <DeleteButton> #5309

Open
gavacho opened this issue Sep 27, 2020 · 2 comments
Open

Comments

@gavacho
Copy link

@gavacho gavacho commented Sep 27, 2020 •

Is your feature request related to a problem? Please describe.
When the user clicks a <DeleteButton> in an Edit toolbar, react-admin displays "Element deleted". I would like to customize that message for different resources (e.g. "Post deleted" and "Comment deleted").

Describe the solution you'd like
I would like DeleteButton to behave like SaveButton and accept onSuccess and onFailure properties.

Describe alternatives you've considered
The "Element deleted" message can be customized using internationalization but I think that's a global change and wouldn't let me customize the message by resource.

@gavacho gavacho changed the title All customization of "Element deleted" notification when using <DeleteButton> Allow customization of "Element deleted" notification when using <DeleteButton> Sep 27, 2020
@fzaninotto
Copy link
Member

@fzaninotto fzaninotto commented Sep 28, 2020

Nice idea. We could also pass the resource in the translate parameters, letting users do the customization. Both are valid enhancements.

@wattry
Copy link

@wattry wattry commented Oct 2, 2020 •

Nice idea. We could also pass the resource in the translate parameters, letting users do the customization. Both are valid enhancements.

We discussed this but someone mentioned passing the resource might not always make grammatical sense. We tried the translation but realized that we could not pass the messageArgs through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.