Skip to content

Commit

Permalink
Remove all remaining references to JSTree
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
graygilmore committed Jan 7, 2016
1 parent 9021471 commit 733e202
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 48 deletions.
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
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

0 comments on commit 733e202

Please sign in to comment.