SpreeHideableTaxons

This extension adds a hidden field to Spree::Taxon and hides taxons with hidden == true from the default menus. It also shows an additional "Hidden" checkbox in the admin panel.

This is a reimplementation of the great work done by @markalinn updated for Spree 3.1+

Installation

  1. Add this extension to your Gemfile with this line:
    ruby
    gem 'spree_hideable_taxons', github: 'theam/spree_hideable_taxons', branch: 'X-Y-stable'

    (Replace X-Y-stable with the version of Spree you're using)

  2. Install the gem using Bundler:
    ruby
    bundle install

  3. Copy & run migrations
    ruby
    bundle exec rails g spree_hideable_taxons:install

  4. Restart your server

If your server was running, restart it so that it can find the assets properly.

TODO

  • Add tests for:
    • Check that the admin controller saves the hidden field
    • Check that a taxonomy is not shown when its root taxon is hidden
    • Check that a taxon is not shown when it's hidden
  • Current implementation extends the Spree::FrontendHelper module, which is not the best for extensibility. I think that helper should be transformed in a partial in Spree so it can be extended via Deface.
  • Check compatibility with Spree 3.2.0+

Testing

First bundle your dependencies, then run rake. rake will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using rake test_app.

bundle
bundle exec rake

When testing your applications integration with this extension you may use it's factories.
Simply add this require statement to your spec_helper:

require 'spree_hideable_taxons/factories'

Contributing

Follow the classical "Thanks for being awesome methodology": Fork, improve and send your pull requests!

Copyright (c) 2017 The Agile Monkeys, released under the New BSD License

Comments

No comments yet

Please login to add comment.