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 users to edit datastructures #8
Conversation
Add an "edit" button to collection views. Users can edit and save EDN and the underlying datastructures will be updated. I had to be careful with the save process because (om/update! data new-data) triggers a re-mount of the component, which caused an error when we tried to set state on the newly unmounted component.
Damn! This looks great!
Thank you! Yes. There's no need to reach for So I just checked this out and I'm so excited to merge it but I have a couple questions:
Overall, you made my day with this PR. 👍 |
:fontWeight "bold" | ||
:padding "0" | ||
:opacity (if disable? "0.5" "1.0")}} | ||
(if (om/get-state owner :editing?) "save" "edit"))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize please ("Save", "Edit").
Few ideas:
Overall, what's there in the PR is definitely better than not having it in at all, and it's awesome of you to have done this @travis - thank you! |
Glad I could help! Thanks to @dwwoelfel for giving me the task, it was super fun. |
@sgrove Awesome notes. Thanks for investigating this PR deeply. If @travis wants to make some more patches or at least fix the recommendations in the code review notes, I don't see why we can't begin merging this now and push out a |
- focus editor on edit, save on blur - copy tweaks - predicates to make key detection read better - code formatting tweaks
@travis Awesome. So can I merge this and release a |
yeah, definitely down with merging now and putting up more prs with refinements |
@travis Cool. I'll merge this. Thanks again! And send me more patches! 😉 |
Allow users to edit datastructures
arg, apparently I broke the save button somehow. will fix and pr. |
No worries. I'll be around. 👍 |
huh, or maybe not. saw it once, might have been old code? something to keep an eye out for. |
Just pushed up the |
Add an "edit" button to collection views. Users can edit and save EDN and the underlying datastructures will be updated.
I had to be careful with the save process because
(om/update! data new-data)
triggers a re-mount of the component, which caused an error when we tried to set state on the newly unmounted component.
Also add support for displaying dates.
This addresses #5 and uses callbacks rather than channels because it felt simpler. Ideally I'd like to find a way to factor the editing component out into its own subcomponent, but it ends up pretty intertwined because of the ways the current state of the editor changes what should display. Thoughts welcome!