-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Add support for sharing table views via link #168
Conversation
This seems very nice, I like that you managed to make it all without having to touch the components themselves. I'm also thinking if showColumns should be part of the hash. Is that really something you want to share? I'm also wondering if perhaps the hash could be cleaned up a bit. This actually goes for the data saved in the localStorage as well. Sometimes it stores an empty filter, so perhaps we should filter out empty filters before saving and adding to the hash? |
I was thinking about excluding the columns bit myself too. I don't think it is entirely necessary and would reduce complexity a bit. I agree that the data could be shortened a bit and it does seem like empty filters are being stored in localStorage. I didn't want to add additional logic that would be specific to the hash and have a disconnect between what is visible in the URL and what is stored in localStorage. I would love to see empty/default/unused filtering data excluded from localStorage and the hash to make both more concise. Do you have any suggestions or insight into a way to do that? Right now all I can think of is another function that would take the field in question and check if it is empty or default so there could be an if statement around each of the filter/sort/pagination save logic. |
I think you could add a simple filtering function for excluding any CrudFilters that have an empty list as value. You don't need to have any specific logic for specific fields, it should be generic |
I've changed the table setting updater functions as discussed. Both localStorage and the URL hash are only being set if the change differs from the default table behavior. In addition, in the case of filters only filters that actually contain a filter value are being saved, this significantly reduces the number of characters that needed to be saved. |
I think it looks good now, so I'll go ahead and merge it. Thanks for the contribution again! |
Updated PR changing UX to follow discussion in #164
What does this do?
Adds share buttonshare API orcurrent URL to provide sharable linkwhen clicking shareWhat is the use case for this feature?
What is missing?
Possible translation issues. I'm not a linguist but did my best to add translations for the share button where applicablePlease let me know if you see problems or things you'd like changed to get this merged. This is my first open-source contribution and I'm not a React developer (Vue+.NET is my wheelhouse). Thanks for the work you've done on this great tool!