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

Prototypes move to extension #1517

Merged
merged 32 commits into from
Oct 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
4a4e602
Remove prototypes controller
Sep 29, 2016
d3ed7a7
Remove prototype views
Sep 29, 2016
8f7f432
Remove prototype-creation feature spec
Sep 29, 2016
f29476d
Remove @prototype assignment from controller
Sep 30, 2016
b2c0680
Remove prototype routes
Sep 30, 2016
722863c
Remove prototypes from product sub tabs
Oct 4, 2016
5434a7f
Remove prototypes button from toolbar
Oct 4, 2016
bb83bc7
Remove prototype from form
Oct 4, 2016
1ad2198
Remove prototype for ajax
Oct 4, 2016
5b5e4c3
Remove prototype from new product page
Oct 4, 2016
c7ee8b3
Remove prototype clearfix
Oct 4, 2016
da8f769
Remove test for prototypes tab on homepage
Oct 4, 2016
a39a9bd
Remove prototype sections of spec
Oct 4, 2016
cdc51e1
Delete prototype model
Oct 4, 2016
cb83680
Remove prototype models and associations
Oct 5, 2016
82865eb
Remove callback and accessor from product model
Oct 5, 2016
2e795e8
Remove relations from property model
Oct 5, 2016
3e81f93
Delete property prototype model
Oct 5, 2016
b0c4383
Delete prototype taxon
Oct 5, 2016
54faba9
Remove prototype relations from taxon
Oct 5, 2016
64b8824
Remove prototype translations
Oct 5, 2016
98f92d1
Remove prototype from product display permission set
Oct 5, 2016
27b43a9
Remove prototype from product management permission set
Oct 5, 2016
a490cb3
Remove prototype from PermittedAttributes
Oct 5, 2016
923a726
Remove prototype factory
Oct 5, 2016
f687a00
Remove prototype factory spec
Oct 5, 2016
46a2d3e
Remove prototype from product display spec
Oct 5, 2016
c35c7d4
Remove prototype from product management permission set spec
Oct 5, 2016
25bbec4
Remove prototype-contexts from product model spec
Oct 5, 2016
0ef151c
Remove prototype shared contexts
Oct 6, 2016
95cd0f1
Remove sample prototypes
Oct 6, 2016
4ffd596
Update CHANGELOG
Oct 12, 2016
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
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## Solidus 2.1.0 (master, unreleased)
* Prototypes were removed from the admin; the extension `solidus_prototype`
provides the same functionality

* Remove `currency` from line items.

Expand Down Expand Up @@ -238,7 +240,7 @@

https://github.com/solidusio/solidus/pull/904

In order to convert your historical shipping rate taxation data, please run
In order to convert your historical shipping rate taxation data, please run
`rake solidus:upgrade:one_point_three` - this will create persisted taxation notes
for historical shipping rates. Be aware though that these taxation notes are
estimations and should not be used for accounting purposes.
Expand Down
6 changes: 0 additions & 6 deletions backend/app/controllers/spree/admin/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ class ProductsController < ResourceController
helper 'spree/products'

before_action :load_data, except: [:index]
create.before :create_before
update.before :update_before
helper_method :clone_object_url

Expand Down Expand Up @@ -115,11 +114,6 @@ def collection
@collection
end

def create_before
return if params[:product][:prototype_id].blank?
@prototype = Spree::Prototype.find(params[:product][:prototype_id])
end

def update_before
# note: we only reset the product properties if we're receiving a post
# from the form on that tab
Expand Down
26 changes: 0 additions & 26 deletions backend/app/controllers/spree/admin/prototypes_controller.rb

This file was deleted.

2 changes: 1 addition & 1 deletion backend/app/models/spree/backend_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class BackendConfiguration < Preferences::Configuration
ORDER_TABS ||= [:orders, :payments, :creditcard_payments,
:shipments, :credit_cards, :return_authorizations,
:customer_returns, :adjustments, :customer_details]
PRODUCT_TABS ||= [:products, :option_types, :properties, :prototypes,
PRODUCT_TABS ||= [:products, :option_types, :properties,
:variants, :product_properties, :taxonomies,
:taxons]
REPORT_TABS ||= [:reports]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
<li>
<%= link_to_add_fields Spree.t(:add_product_properties), 'tbody#product_properties', :class => 'plus button' %>
</li>
<li>
<span id="new_ptype_link">
<%= link_to Spree.t(:select_from_prototype), available_admin_prototypes_url, :remote => true, :class => 'button fa fa-copy' %>
</span>
</li>
</ul>
<% end %>
<% end %>
Expand All @@ -23,8 +18,6 @@
<legend align="center"><%= plural_resource_name(Spree::ProductProperty) %></legend>
<div class="add_product_properties" data-hook="add_product_properties"></div>

<div id="prototypes" data-hook></div>

<table class="index sortable" data-hook data-sortable-link="<%= update_positions_admin_product_product_properties_url %>">
<thead>
<tr data-hook="product_properties_header">
Expand Down
33 changes: 0 additions & 33 deletions backend/app/views/spree/admin/products/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
</div>
<% end %>

<div data-hook="new_product_prototype" class="col-xs-3">
<%= f.field_container :prototype do %>
<%= f.label :prototype_id, Spree::Prototype.model_name.human %><br />
<%= f.collection_select :prototype_id, Spree::Prototype.all, :id, :name, {:include_blank => true}, {:class => 'select2 fullwidth'} %>
<% end %>
</div>

<div data-hook="new_product_price" class="col-xs-3">
<%= f.field_container :price do %>
<%= f.label :price, class: 'required' %><br />
Expand Down Expand Up @@ -69,33 +62,7 @@
</div>
</div>

<div class="clearfix" data-hook="product-from-prototype" id="product-from-prototype">
<%= render :file => 'spree/admin/prototypes/show' if @prototype %>
</div>

<%= render :partial => 'spree/admin/shared/new_resource_links' %>

</fieldset>
<% end %>

<script type="text/javascript">
//<![CDATA[
(function($){
var base_url = "<%= admin_prototypes_url %>";
var prototype_select = $('#product_prototype_id');
prototype_select.change(function() {
var id = prototype_select.val();
if (id.length) {
var url = new Uri(base_url);
url.setPath(url.path() + '/' + id);
$('#product-from-prototype').load(url.toString());
} else {
$('#product-from-prototype').empty();
}
})
if (prototype_select.html() == "") {
prototype_select.change();
}
})(jQuery);
//]]>
</script>
36 changes: 0 additions & 36 deletions backend/app/views/spree/admin/prototypes/_form.html.erb

This file was deleted.

25 changes: 0 additions & 25 deletions backend/app/views/spree/admin/prototypes/_prototypes.html.erb

This file was deleted.

2 changes: 0 additions & 2 deletions backend/app/views/spree/admin/prototypes/available.js.erb

This file was deleted.

15 changes: 0 additions & 15 deletions backend/app/views/spree/admin/prototypes/edit.html.erb

This file was deleted.

50 changes: 0 additions & 50 deletions backend/app/views/spree/admin/prototypes/index.html.erb

This file was deleted.

9 changes: 0 additions & 9 deletions backend/app/views/spree/admin/prototypes/new.html.erb

This file was deleted.

5 changes: 0 additions & 5 deletions backend/app/views/spree/admin/prototypes/new.js.erb

This file was deleted.

4 changes: 0 additions & 4 deletions backend/app/views/spree/admin/prototypes/select.js.erb

This file was deleted.

42 changes: 0 additions & 42 deletions backend/app/views/spree/admin/prototypes/show.html.erb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
<% if can? :admin, Spree::Property %>
<%= tab :properties %>
<% end %>
<% if can? :admin, Spree::Prototype %>
<%= tab :prototypes %>
<% end %>
<% if can? :admin, Spree::Taxonomy %>
<%= tab :taxonomies %>
<% end %>
Expand Down
10 changes: 0 additions & 10 deletions backend/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,6 @@

delete '/product_properties/:id', to: "product_properties#destroy", as: :product_property

resources :prototypes do
member do
get :select
end

collection do
get :available
end
end

resources :orders, except: [:show] do
member do
get :cart
Expand Down
3 changes: 0 additions & 3 deletions backend/spec/features/admin/homepage_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@
within('.selected .admin-subnav') { page.find_link("Property Types")['/admin/properties'] }
end

it "should have a link to prototypes" do
within('.selected .admin-subnav') { page.find_link("Prototypes")['/admin/prototypes'] }
end
end
end

Expand Down
Loading