Skip to content
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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions api/app/controllers/spree/api/taxonomies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ def show
respond_with(taxonomy)
end

# Because JSTree wants parameters in a *slightly* different format
def jstree
show
end

def create
authorize! :create, Taxonomy
@taxonomy = Taxonomy.new(taxonomy_params)
Expand Down
4 changes: 0 additions & 4 deletions api/app/controllers/spree/api/taxons_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ def show
respond_with(@taxon)
end

def jstree
show
end

def create
authorize! :create, Taxon
@taxon = Spree::Taxon.new(taxon_params)
Expand Down
8 changes: 0 additions & 8 deletions api/app/views/spree/api/taxonomies/jstree.rabl

This file was deleted.

8 changes: 0 additions & 8 deletions api/app/views/spree/api/taxons/jstree.rabl

This file was deleted.

9 changes: 1 addition & 8 deletions api/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,7 @@
resources :states, only: [:index, :show]

resources :taxonomies do
member do
get :jstree
end
resources :taxons do
member do
get :jstree
end
end
resources :taxons
Copy link
Contributor

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?

end

resources :taxons, only: [:index]
Expand Down
7 changes: 0 additions & 7 deletions api/spec/controllers/spree/api/taxonomies_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ module Spree
expect(children.first.key?('taxons')).to be true
end

it "gets the jstree-friendly version of a taxonomy" do
api_get :jstree, :id => taxonomy.id
expect(json_response["data"]).to eq(taxonomy.root.name)
expect(json_response["attr"]).to eq({ "id" => taxonomy.root.id, "name" => taxonomy.root.name})
expect(json_response["state"]).to eq("closed")
end

it "can learn how to create a new taxonomy" do
api_get :new
expect(json_response["attributes"]).to eq(attributes.map(&:to_s))
Expand Down
8 changes: 0 additions & 8 deletions api/spec/controllers/spree/api/taxons_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,6 @@ module Spree
expect(json_response['taxons'].count).to eq 1
end

it "gets all taxons in JSTree form" do
api_get :jstree, :taxonomy_id => taxonomy.id, :id => taxon.id
response = json_response.first
expect(response["data"]).to eq(taxon2.name)
expect(response["attr"]).to eq({ "name" => taxon2.name, "id" => taxon2.id})
expect(response["state"]).to eq("closed")
end

it "can learn how to create a new taxon" do
api_get :new, :taxonomy_id => taxonomy.id
expect(json_response["attributes"]).to eq(attributes.map(&:to_s))
Expand Down