Some suggestions
See original GitHub issueHi @benwinding
I just made some PRs in order to resolve some issues I had in the last weeks. I hope you’ll like the improvements.
I have some other suggestions that can be discussed here if you want.
Suggestions
I suppose that all console.log
should be forbidden, right?
I used to dispatch an action crudUpdateMany
in order to save that in the redux store and then it will trigger an UPDATE_MANY
event to the according data provider. You, otherwise, you use directly the data provider for each item. I am not sure what is the best use of this ATM. Otherwise, I can see there is 2 kind of operations:
- UPDATE if the primary key does not exist in the list
- CREATE if the primary key already exist
It can be a little tricky but I believe we should allow the developer to choose the action to execute in those cases, don’t you think? Like adding a new prop.
Also, we manage papaparse props ourselves. That could be interesting to set default props and then let the developers override the props based on their own needs. Maybe by reusing the same standard of react-admin. They use an exporter
prop, we could have an importer
prop.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top GitHub Comments
That’s a clever idea. react-admin already use
Confirm
modal to check for validation (like deletion). We should investigate on this to reuse their component.Also, your idea gave some idea about new properties:
overwrite
andconfirm
. The confirm is a boolean to indicate if the modal should be opened. Ifconfirm=false
andoverwrite
is set, we should bypass the modal process to automatically execute the update/create.That could be really good. The last thing that we should handle is when a user wants to import both new and updated data… Not sure how we can do that, because we cannot predict what user will put in the csv file.
Hey @Odonno,
I’ve made some recent updates and included a demo here. Let me know what you think.
If you’d like to add some additional features or fix something, please have a look at the
development
notes at the bottom of the README, and submit a PR.Cheers for your help, Ben