From 636d97974cd2f31e4bffc356ba7e40ce47195b45 Mon Sep 17 00:00:00 2001 From: Benjamin Willems Date: Wed, 16 May 2018 14:04:18 -0700 Subject: [PATCH 1/5] Remove "Advertise" checkbox from the promotions UI While making promotions advertisable is a good feature, the "Advertise" checkbox doesn't do anything when using `solidus_frontend` and `solidus_backend` out of the box. There also isn't a clear path forward for how developers should use this feature. Where should promotions be advertised? How should complex promotions be advertised? Developers can implement custom promotion advertisement features by using the `advertise` attribute on `Spree::Promotion`s, but keeping this in the UI isn't helpful. Let's consider re-adding this to the UI if we can make the usage cleared and working in the default `solidus_frontend` configuration. --- .../app/views/spree/admin/promotions/_form.html.erb | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/backend/app/views/spree/admin/promotions/_form.html.erb b/backend/app/views/spree/admin/promotions/_form.html.erb index 0163ca1d975..cfc15186246 100644 --- a/backend/app/views/spree/admin/promotions/_form.html.erb +++ b/backend/app/views/spree/admin/promotions/_form.html.erb @@ -5,21 +5,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 %> - - <% end %> -
- -
<%= f.field_container :description do %> <%= f.label :description %>
<%= f.text_area :description, rows: 7, class: 'fullwidth' %> From a80321d9c4f97927607cf4b57d4e13d045683c32 Mon Sep 17 00:00:00 2001 From: Benjamin Willems Date: Wed, 16 May 2018 14:22:38 -0700 Subject: [PATCH 2/5] Remove "Path" activation option from promotions UI While having a promotion activate when the customer reaches a path is a great feature idea, this this activation type is not actually wired up to anything. If a store admin tried to set up a path-activated promotion, it would not work. This also does not provide a clear path forward for developers trying to set up a feature like this. This feature may be a good candidate for an extension with additional documentation. --- .../spree/admin/promotions/_activations_new.html.erb | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/backend/app/views/spree/admin/promotions/_activations_new.html.erb b/backend/app/views/spree/admin/promotions/_activations_new.html.erb index 31b9f73d768..c47bf6b74e8 100644 --- a/backend/app/views/spree/admin/promotions/_activations_new.html.erb +++ b/backend/app/views/spree/admin/promotions/_activations_new.html.erb @@ -19,12 +19,6 @@ <%= t('.multiple_codes') %>
-
- -
@@ -60,11 +54,5 @@ <% end %>
-
-
- <%= f.label :path, class: "required" %> - <%= f.text_field :path, class: "fullwidth", required: true %> -
-
From 84bd4f5047929c91095fa4e8c2cca1b19a2f3fb6 Mon Sep 17 00:00:00 2001 From: Benjamin Willems Date: Wed, 16 May 2018 14:29:05 -0700 Subject: [PATCH 3/5] Remove unused locales strings; fix capitalization --- core/config/locales/en.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/config/locales/en.yml b/core/config/locales/en.yml index 60ed739b90f..8c04d262eef 100644 --- a/core/config/locales/en.yml +++ b/core/config/locales/en.yml @@ -177,7 +177,6 @@ en: spree/product_property: value: Value spree/promotion: - advertise: Advertise apply_automatically: Apply Automatically code: Code description: Description @@ -185,7 +184,7 @@ en: 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 @@ -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 From 3aeda1bf4863642ddb8bcd42c9cd9d105fd7b5e8 Mon Sep 17 00:00:00 2001 From: Benjamin Willems Date: Thu, 17 May 2018 11:23:07 -0700 Subject: [PATCH 4/5] Remove path promotion activation method spec --- .../features/admin/promotion_adjustments_spec.rb | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/backend/spec/features/admin/promotion_adjustments_spec.rb b/backend/spec/features/admin/promotion_adjustments_spec.rb index 4ed09e59497..3d7c58b52f9 100644 --- a/backend/spec/features/admin/promotion_adjustments_spec.rb +++ b/backend/spec/features/admin/promotion_adjustments_spec.rb @@ -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" From d2b65163c8634cf45891ed0243edfbe488030252 Mon Sep 17 00:00:00 2001 From: Benjamin Willems Date: Thu, 17 May 2018 13:14:29 -0700 Subject: [PATCH 5/5] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e03d241350f..78e66c6754d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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