Skip to content

Commit

Permalink
Merge pull request #2737 from benjaminwil/backend/promotions/form
Browse files Browse the repository at this point in the history
Remove promotions admin UI that misleadingly doesn't do anything on the solidus_frontend
  • Loading branch information
gmacdougall authored May 29, 2018
2 parents f999ac6 + d2b6516 commit b8bcd53
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 39 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Solidus 2.7.0 (master, unreleased)

### Admin

- The promotions "Advertise" checkbox and the "URL Path" promotion activation method have been removed from the admin UI because the features are not implemented in solidus_frontend [#2737](https://github.com/solidusio/solidus/pull/2737) ([benjaminwil](https://github.com/benjaminwil)

## Solidus 2.6.0 (2018-05-16)

### Major changes
Expand Down
12 changes: 0 additions & 12 deletions backend/app/views/spree/admin/promotions/_activations_new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
<%= t('.multiple_codes') %>
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<%= radio_button_tag('activation_type', 'path', activation_type == 'path') %>
<%= t('.path') %>
</label>
</div>
</div>
<div class="col-9">
<input name="promotion[apply_automatically]" type="hidden" value="0">
Expand Down Expand Up @@ -60,11 +54,5 @@
<% end %>
</div>

<div data-activation-type="path">
<div class="field" id="promotion_path_field">
<%= f.label :path, class: "required" %>
<%= f.text_field :path, class: "fullwidth", required: true %>
</div>
</div>
</div>
</div>
11 changes: 1 addition & 10 deletions backend/app/views/spree/admin/promotions/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,12 @@
<div class="row">
<div id="general_fields" class="col-9">
<div class="row">
<div class="col-3">
<div class="col-12">
<%= f.field_container :name do %>
<%= f.label :name, class: 'required' %>
<%= f.text_field :name, class: 'fullwidth', required: true %>
<% end %>

<%= f.field_container :advertise do %>
<label>
<%= f.check_box :advertise %>
<%= Spree::Promotion.human_attribute_name :advertise %>
</label>
<% end %>
</div>

<div class="col-9">
<%= f.field_container :description do %>
<%= f.label :description %><br />
<%= f.text_area :description, rows: 7, class: 'fullwidth' %>
Expand Down
14 changes: 0 additions & 14 deletions backend/spec/features/admin/promotion_adjustments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,20 +180,6 @@
expect(promotion.rules).to be_blank
end

it "should allow an admin to create a promo requiring a landing page to be visited" do
fill_in "Name", with: "SAVE SAVE SAVE"
choose "URL Path"
fill_in "Path", with: "content/cvv"
click_button "Create"
expect(page).to have_title("SAVE SAVE SAVE - Promotions")

promotion = Spree::Promotion.find_by(name: "SAVE SAVE SAVE")
expect(promotion.path).to eq("content/cvv")
expect(promotion).not_to be_apply_automatically
expect(promotion.codes).to be_empty
expect(promotion.rules).to be_blank
end

it "should allow an admin to create a promo with generated codes" do
fill_in "Name", with: "SAVE SAVE SAVE"
choose "Multiple promotion codes"
Expand Down
4 changes: 1 addition & 3 deletions core/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,14 @@ en:
spree/product_property:
value: Value
spree/promotion:
advertise: Advertise
apply_automatically: Apply Automatically
code: Code
description: Description
event_name: Event Name
expires_at: End
name: Name
path: Path
per_code_usage_limit: Per Code Usage Limit
per_code_usage_limit: Per code usage limit
promotion_uses: Promotion Uses
starts_at: Start
status: Status
Expand Down Expand Up @@ -859,7 +858,6 @@ en:
activations_new:
auto: Apply to all orders
multiple_codes: Multiple promotion codes
path: URL Path
single_code: Single promotion code
activations_edit:
auto: All orders will attempt to use this promotion
Expand Down

0 comments on commit b8bcd53

Please sign in to comment.