[FEAT] Make implementing "save and continue editing" button easier
See original GitHub issueSee discussion on Discord
Is your feature request related to a problem? Please describe. Django-Admin implements two buttons on its edit pages: “Save” and “Save and continue editing”. The latter is sorely missed in Refine.
Describe the solution you’d like
As discussed on Discord, a possible solution would be to have useForm
return a mutation function, which can be combined with { redirect: false }
option and actionButtons
on <Edit>
to build both buttons.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Implement a save page and continue editing option - Jira
This should be easy to implement: Create a new save button that does the same as the existing one, minus reloading the page....
Read more >Trying to make Save & Continue Editing button. How can I tell ...
I already have an Edit button that just appends the &e=T parameter to the current item page. But im going to use SQL...
Read more >Save buttons that don't save - User Experience Stack Exchange
If I understand you correctly, you have a window that automatically saves changes for the user as they adjust items. Currently you have...
Read more >How to "save and continue editing" a task in django-viewflow
I'm building an approval workflow using django-viewflow and django-material. A key component of the workflow is for the end user to fill in ......
Read more >Saving Button Designs to Edit or Print - YouTube
Button Maker Software - BAB 6.0. Save to Edit - Saving Button Designs to Edit or Print - Build-a- Button Design Software.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this looks good for a simple solution. But I also feel this can be simplified a bit, for better DX.
list("posts")
is basically whatuseForm({ redirect: "list" })
is doing, but with an additional burden to explicitly name the resource in question. Yes, we are writing code for a particular resource, but to have to type its name only a couple of times in code is a feature not a bug. Also,form.getFieldsValue(true)
could probably be a default argument value, since bothonFinish
andform
come fromuseForm
, i.e. are available in the same scope. Then we’d arrive at this:But then again,
<SaveButton>
is a Refine component, so if we use all defaults, we might be talking aboutbut I’m not sure whether this would be easy to implement, since
<SaveButton>
doesn’t handle redirect and probably shouldn’t.Ohh, thank you. I’ve fixed it!