Skip to content

Commit

Permalink
Merge 0bf3484 into bb2d645
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandoorn committed Oct 30, 2017
2 parents bb2d645 + 0bf3484 commit 4e60c3f
Show file tree
Hide file tree
Showing 101 changed files with 1,996 additions and 148 deletions.
Expand Up @@ -112,6 +112,14 @@ Here you will find all configuration options of ``sylius_grid``.
position: 100
options:
restore_label: sylius.ui.restore
bulk:
delete:
type: delete
label: sylius.ui.delete
enabled: true
icon: ~
position: 100
options: { }
subitem:
addresses:
type: links
Expand Down
@@ -0,0 +1,48 @@
Custom Bulk Action
==================

There are cases where pressing a button per item in a grid is not suitable. And there are also certain
cases when built-in bulk action types are not enough.

All you need to do is create your own bulk action template and register it for the ``sylius_grid``.

In the template we will specify the button's icon to be ``export`` and its colour to be ``orange``.

.. code-block:: twig
{% import '@SyliusUi/Macro/buttons.html.twig' as buttons %}
{% set path = options.link.url|default(path(options.link.route)) %}
{{ buttons.default(path, action.label, null, 'export', 'orange') }}
Now configure the new action's template like below in the ``app/config/config.yml``:

.. code-block:: yaml
# app/config/config.yml
sylius_grid:
templates:
bulk_action:
export: "@App/Grid/BulkAction/export.html.twig"
From now on you can use your new bulk action type in the grid configuration!

Let's assume that you already have a route for exporting by injecting ids, then you can configure the grid action:

.. code-block:: yaml
sylius_grid:
grids:
app_admin_product:
...
actions:
bulk:
export:
type: export
label: Export Data
options:
link:
route: app_admin_product_export
parameters:
format: csv
Expand Up @@ -23,4 +23,5 @@ Some of the features worth mentioning:
custom_field_type
custom_filter
custom_action
custom_bulk_action
configuration
19 changes: 19 additions & 0 deletions features/addressing/managing_zones/deleting_multiple_zones.feature
@@ -0,0 +1,19 @@
@managing_zones
Feature: Deleting multiple zones
In order to remove test, obsolete or incorrect zones in an efficient way
As an Administrator
I want to be able to delete multiple zones at once

Background:
Given the store has zones "North America", "South America" and "Europe"
And I am logged in as an administrator

@ui @javascript
Scenario: Deleting multiple zones at once
When I browse zones
And I check the "North America" zone
And I check also the "South America" zone
And I delete them
Then I should be notified that they have been successfully deleted
And I should see a single zone in the list
And I should see the zone "Europe" in the list
@@ -0,0 +1,21 @@
@managing_channels
Feature: Deleting multiple channels
In order to remove test, obsolete or incorrect channels in an efficient way
As an Administrator
I want to be able to delete multiple channels at once

Background:
Given the store operates on a channel named "US Store"
And the store operates on another channel named "PL Store"
And the store operates on another channel named "DE Store"
And I am logged in as an administrator

@ui @javascript
Scenario: Deleting multiple channels at once
When I browse channels
And I check the "PL Store" channel
And I check also the "DE Store" channel
And I delete them
Then I should be notified that they have been successfully deleted
And I should see a single channel in the list
And I should see the channel "US Store" in the list
@@ -0,0 +1,22 @@
@managing_exchange_rates
Feature: Deleting multiple exchange rates
In order to remove obsolete exchange rates in an efficient way
As an Administrator
I want to be able to delete multiple exchange rates at once

Background:
Given the store has currency "Euro", "British Pound" and "Polish Zloty"
And the exchange rate of "Euro" to "British Pound" is 0.84
And the exchange rate of "British Pound" to "Polish Zloty" is 5.31
And the exchange rate of "Polish Zloty" to "Euro" is 0.22
And I am logged in as an administrator

@ui @javascript
Scenario: Deleting multiple exchange rates at once
When I browse exchange rates
And I check the exchange rate between "Euro" and "British Pound"
And I check the exchange rate between "British Pound" and "Polish Zloty"
And I delete them
Then I should be notified that they have been successfully deleted
And I should see a single exchange rate in the list
And I should see the exchange rate between "Polish Zloty" and "Euro" in the list
@@ -0,0 +1,21 @@
@managing_payment_methods
Feature: Deleting multiple payment methods
In order to remove test, obsolete or incorrect payment methods in an efficient way
As an Administrator
I want to be able to delete multiple payment methods at once

Background:
Given the store has a payment method "Offline" with a code "offline"
And the store has also a payment method "Bank transfer" with a code "transfer"
And the store has also a payment method "PayPal Express Checkout" with a code "paypal" and Paypal Express Checkout gateway
And I am logged in as an administrator

@ui @javascript
Scenario: Deleting multiple payment methods at once
When I browse payment methods
And I check the "Offline" payment method
And I check also the "Bank transfer" payment method
And I delete them
Then I should be notified that they have been successfully deleted
And I should see a single payment method in the list
And I should see the payment method "PayPal Express Checkout" in the list
@@ -0,0 +1,21 @@
@managing_product_association_types
Feature: Deleting multiple product association types
In order to remove test, obsolete or incorrect product association types in an efficient way
As an Administrator
I want to be able to delete multiple product association types at once

Background:
Given the store has a product association type "Cross sell"
And the store has also a product association type "Up sell"
And the store has also a product association type "Accessories"
And I am logged in as an administrator

@ui @javascript
Scenario: Deleting multiple product association types at once
When I browse product association types
And I check the "Cross sell" product association type
And I check also the "Up sell" product association type
And I delete them
Then I should be notified that they have been successfully deleted
And I should see a single product association type in the list
And I should see the product association type "Accessories" in the list
@@ -0,0 +1,21 @@
@managing_product_attributes
Feature: Deleting multiple product attributes
In order to remove test, obsolete or incorrect product attributes in an efficient way
As an Administrator
I want to be able to delete multiple product attributes at once

Background:
Given the store has a text product attribute "Publisher"
And the store has a textarea product attribute "Description"
And the store has a integer product attribute "Pages"
And I am logged in as an administrator

@ui @javascript
Scenario: Deleting multiple product attributes at once
When I browse product attributes
And I check the "Publisher" product attribute
And I check also the "Description" product attribute
And I delete them
Then I should be notified that they have been successfully deleted
And I should see a single product attribute in the list
And I should see the product attribute "Pages" in the list
@@ -0,0 +1,21 @@
@managing_product_options
Feature: Deleting multiple product options
In order to remove test, obsolete or incorrect product options in an efficient way
As an Administrator
I want to be able to delete multiple product options at once

Background:
Given the store has a product option "T-Shirt size"
And the store has also a product option "T-Shirt color"
And the store has also a product option "T-Shirt brand"
And I am logged in as an administrator

@ui @javascript
Scenario: Deleting multiple product options at once
When I browse product options
And I check the "T-Shirt size" product option
And I check also the "T-Shirt color" product option
And I delete them
Then I should be notified that they have been successfully deleted
And I should see a single product option in the list
And I should see the product option "T-Shirt brand" in the list
@@ -0,0 +1,22 @@
@managing_product_reviews
Feature: Deleting multiple product reviews
In order to remove test, obsolete or incorrect product reviews in an efficient way
As an Administrator
I want to be able to delete multiple product reviews at once

Background:
Given the store has a product "Audi RS7 model"
And this product has a review titled "Awesome" and rated 5 with a comment "Nice product" added by customer "batman@dc.com"
And this product has also a review titled "Bad" and rated 1 with a comment "Really bad" added by customer "theflash@dc.com"
And this product has also a review titled "Cool" and rated 4 with a comment "Quite cool" added by customer "aquaman@dc.com"
And I am logged in as an administrator

@ui @javascript
Scenario: Deleting multiple product reviews at once
When I browse product reviews
And I check the "Awesome" product review
And I check also the "Bad" product review
And I delete them
Then I should be notified that they have been successfully deleted
And I should see a single product review in the list
And I should see the product review "Cool" in the list
@@ -0,0 +1,21 @@
@managing_product_variants
Feature: Deleting multiple product variants
In order to remove test, obsolete or incorrect product variants in an efficient way
As an Administrator
I want to be able to delete multiple product variants at once from the product catalog

Background:
Given the store operates on a single channel in "United States"
And the store has a "PHP Mug" configurable product
And this product has "Small PHP Mug", "Medium PHP Mug" and "Big PHP Mug" variants
And I am logged in as an administrator

@ui @javascript
Scenario: Deleting multiple product variants at once
When I browse variants of this product
And I check the "Small PHP Mug" product variant
And I check also the "Medium PHP Mug" product variant
And I delete them
Then I should be notified that they have been successfully deleted
And I should see a single product variant in the list
And I should see the product variant "Big PHP Mug" in the list
@@ -0,0 +1,19 @@
@managing_products
Feature: Deleting multiple products
In order to remove test, obsolete or incorrect products in an efficient way
As an Administrator
I want to be able to delete multiple products at once from the product catalog

Background:
Given the store has "Audi RS5 model", "Audi RS6 model" and "Audi RS7 model" products
And I am logged in as an administrator

@ui @javascript
Scenario: Deleting multiple products at once
When I browse products
And I check the "Audi RS5 model" product
And I check also the "Audi RS6 model" product
And I delete them
Then I should be notified that they have been successfully deleted
And I should see a single product in the list
And I should see the product "Audi RS7 model" in the list
@@ -0,0 +1,21 @@
@managing_promotion_coupons
Feature: Deleting multiple coupons
In order to remove test, obsolete or incorrect coupons in an efficient way
As an Administrator
I want to be able to delete multiple coupons at once from the registry

Background:
Given the store operates on a single channel in "United States"
And there is a promotion "Christmas sale"
And this promotion has "SANTA1", "SANTA2" and "SANTA3" coupons
And I am logged in as an administrator

@ui @javascript
Scenario: Deleting multiple coupons at once
When I browse coupons of this promotion
And I check the "SANTA1" coupon
And I check also the "SANTA2" coupon
And I delete them
Then I should be notified that they have been successfully deleted
And I should see a single coupon in the list
And I should see the coupon "SANTA3" in the list
Expand Up @@ -12,7 +12,7 @@ Feature: Browsing promotions
@ui
Scenario: Browsing promotions
Given I want to browse promotions
Then there should be 1 promotion
Then I should see a single promotion in the list
And the "Basic promotion" promotion should exist in the registry

@ui
Expand Down
@@ -0,0 +1,22 @@
@managing_promotions
Feature: Deleting multiple promotions
In order to remove test, obsolete or incorrect promotions in an efficient way
As an Administrator
I want to be able to delete multiple promotions at once from the registry

Background:
Given the store operates on a single channel in "United States"
And there is a promotion "Christmas sale"
And there is also a promotion "New Year sale"
And there is also a promotion "Easter sale"
And I am logged in as an administrator

@ui @javascript
Scenario: Deleting multiple promotions at once
When I browse promotions
And I check the "Christmas sale" promotion
And I check also the "New Year sale" promotion
And I delete them
Then I should be notified that they have been successfully deleted
And I should see a single promotion in the list
And I should see the promotion "Easter sale" in the list
@@ -0,0 +1,20 @@
@managing_shipping_categories
Feature: Deleting multiple shipping categories
In order to remove test, obsolete or incorrect shipping categories in an efficient way
As an Administrator
I want to be able to delete multiple shipping categories at once

Background:
Given the store has "Standard" shipping category
And the store has "Big" and "Small" shipping category
And I am logged in as an administrator

@ui @javascript
Scenario: Deleting multiple shipping categories at once
When I browse shipping categories
And I check the "Big" shipping category
And I check also the "Small" shipping category
And I delete them
Then I should be notified that they have been successfully deleted
And I should see a single shipping category in the list
And I should see the shipping category "Standard" in the list
@@ -0,0 +1,20 @@
@managing_shipping_methods
Feature: Deleting multiple shipping methods
In order to remove test, obsolete or incorrect shipping methods in an efficient way
As an Administrator
I want to be able to delete multiple shipping methods at once

Background:
Given the store operates on a single channel in "United States"
And the store allows shipping with "UPS", "FedEx" and "DHL"
And I am logged in as an administrator

@ui @javascript
Scenario: Deleting multiple shipping methods at once
When I browse shipping methods
And I check the "UPS" shipping method
And I check also the "FedEx" shipping method
And I delete them
Then I should be notified that they have been successfully deleted
And I should see a single shipping method in the list
And I should see the shipping method "DHL" in the list

0 comments on commit 4e60c3f

Please sign in to comment.