-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Remove all remaining references to JSTree #664
Conversation
👍 |
Thank you Gray. I believe there is also a There was some concern raised last time this was brought up that this is an incompatibility and should be deprecated instead. I feel otherwise and am fairly confident nobody would use these routes. The data format they return is only useful when using jstree (possibly only the really old version we had installed) |
Now that we're editing our taxonomies with jQuery UI Sortable we no longer need to have these hanging around. We've actually already completely removed the JSTree library.
9aa70e3
to
733e202
Compare
@jhawthorn thanks, forgot about those. Fixed the commit. I had considered the incompatibility issue but considering the fact that we've nuked jstree from the project anyways it makes sense that this would need to be a customization for somebody to take on in their own project. |
👍 |
@jhawthorn I'm generally opposed to this as more people were using it than I expected (from a poke around of people/projects). I would want us to find a way to deprecate it for 1.2 and remove it at a later date. Is there another way to get the same structure of data out of our public API? |
No, but it's a trivial transformation. // /api/taxonomies/1/taxons/1/jstree
[{"data":"Bags","attr":{"id":3,"name":"Bags"},"state":"closed"},{"data":"Mugs","attr":{"id":4,"name":"Mugs"},"state":"closed"},{"data":"Clothing","attr":{"id":5,"name":"Clothing"},"state":"closed"}] Compared to the proper route // /api/taxonomies/1/taxons/1
{"id":1,"name":"Categories","pretty_name":"Categories","permalink":"categories","parent_id":null,"taxonomy_id":1,"taxons":[{"id":3,"name":"Bags","pretty_name":"Categories -\u003e Bags","permalink":"categories/bags","parent_id":1,"taxonomy_id":1},{"id":4,"name":"Mugs","pretty_name":"Categories -\u003e Mugs","permalink":"categories/mugs","parent_id":1,"taxonomy_id":1},{"id":5,"name":"Clothing","pretty_name":"Categories -\u003e Clothing","permalink":"categories/clothing","parent_id":1,"taxonomy_id":1}]} Here's my go at a transform in js $.map(data.taxons, function(t){
return {"data": t.name, "attr": {"id": t.id, "name": t.name}, "state": "closed"};
}) |
get :jstree | ||
end | ||
end | ||
resources :taxons |
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.
👎 since API removals are a major change for people. Anyone who has an iOS or Android app using these endpoints are going to get stuck on previous versions of Solidus unless they code their own.
Maybe provide a gem for this so that way we don't leave anyone in the dust and just provide deprecation warnings that it'll be removed in 2.0?
I'm still in favour of removing this as I don't expect anyone to use the jstree specific route of the api, but discussion seems to have stalled. Closing this issue for now. |
We are not using JSTree anymore (solidusio#569) but we still have these routes available for stores that used it outside JSTree scopes. We decided to deprecate these routes long time ago but we never did it. See also #194. Once we've deprecated this enough we can probably just resurrect solidusio#664.
This commit continues the cleanup that was accomplished when we moved from JSTree to jQuery UI Sortable in this PR: #569
Closes #194