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

Add customer address books in order creation view | Add webpack #184

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
611286d
add address book to create order form, include js and css files
BartoszWojdalowicz Jan 18, 2022
309852e
Add webpack encore to plugin
Jan 18, 2022
c2d7ec8
Add built assets, change plugin name
Jan 19, 2022
1633e6e
edit templates
BartoszWojdalowicz Mar 9, 2022
56d4561
add behat tests and modify existing
BartoszWojdalowicz Mar 9, 2022
1896935
Improved: OrderPaymentLinkSender
igormukhingmailcom Sep 10, 2020
d0d34de
Shouldn't have payment limit on order
kayue May 6, 2021
cd3fa75
Remove useless Migrations step from README.md
rv-garnier Dec 9, 2021
8396442
[Maintenance] Drop support for PHP 7.4
GSadee Feb 25, 2022
5ee743e
[Maintenance] Bump up support for Symfony 5 to 5.4 version
GSadee Feb 25, 2022
a929f1e
[Maintenance] Bump up node version in workflow
GSadee Feb 25, 2022
7796e5f
[Maintenance] Drop support for Sylius 1.9 + add for Sylius 1.11
GSadee Feb 25, 2022
f0300f6
Replace Zend PriorityQueue with Laminas PriorityQueue
GSadee Feb 25, 2022
8a516a8
[Maintenance] Add notes to UPGRADE file for 0.13.0
GSadee Feb 25, 2022
ab9353c
Fix state machine exception on order creation
maciekpaprocki Oct 13, 2021
7b232c3
added phpspec tests
maciekpaprocki Oct 28, 2021
8ae8979
Remove PHPUnit cache file
GSadee Feb 25, 2022
6bb2396
Generate changelog for v0.13.0
GSadee Feb 25, 2022
aa83615
Merge branch 'master' into feature/address-book
BartoszWojdalowicz Mar 9, 2022
bf152d5
Merge pull request #1 from BartoszWojdalowicz/feature/address-book
BartoszWojdalowicz Mar 9, 2022
5e7d64f
Merge branch 'master' of https://github.com/Sylius/AdminOrderCreation…
BartoszWojdalowicz Mar 9, 2022
79e1b42
Merge branch 'master' of https://github.com/BartoszWojdalowicz/AdminO…
BartoszWojdalowicz Mar 9, 2022
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
/vendor/
/node_modules/
/composer.lock
/phpspec.yml

/etc/build/*
!/etc/build/.gitkeep
!/etc/build/.gitignore

/tests/Application/yarn.lock

Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
"sylius-labs/coding-standard": "^3.0",
"symfony/debug-bundle": "^4.4 || ^5.4",
"symfony/dotenv": "^4.4 || ^5.4",
"symfony/web-profiler-bundle": "^4.4 || ^5.4"
"symfony/web-profiler-bundle": "^4.4 || ^5.4",
"symfony/webpack-encore-bundle": "^1.12",
"symfony/web-server-bundle": "^4.4 || ^5.4"
Comment on lines +50 to +52

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be ^5.4 || ^6.0

},
"conflict": {
"doctrine/dbal": "^3.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@admin_order_creation_managing_orders
Feature: Creating order with different billing address
In order to place an order in the name of a Customer
As an Administrator
I want to be able to create an order with different shipping and billing addresses in Admin panel

Background:
Given the store operates on a single channel in "United States"
And the store has a product "Stark Coat" priced at "$100"
And the store has a product "Lannister Banner" priced at "$40"
And the store ships everywhere for free
And the store allows paying with "Cash on Delivery"
And there is a customer account "jon.snow@the-wall.com"
And their default address is "Ankh-Morpork", "Frost Alley", "90210", "United States" for "Jon Snow"
And this customer has an address "Ned Stark", "Banana Street", "90232", "New York", "United States" in their address book
And I am logged in as an administrator

@ui @javascript
Scenario: Creating an order with both addresses from address books
When I create a new order for "jon.snow@the-wall.com" and channel "United States"
And I add "Stark Coat" to this order
And I see the address book shipping address select
And I see the address book billing address select
And I select first address in shipping address book with name "Jon Snow"
And I select first address in billing address book with name "Ned Stark"
And I select "Free" shipping method
And I select "Cash on Delivery" payment method
And I place and confirm this order
Then I should be notified that order has been successfully created
And this order shipping address should be "Jon Snow", "Frost Alley", "90210", "Ankh-Morpork", "United States"
And this order billing address should be "Ned Stark", "Banana Street", "90232", "New York", "United States"
And there should be one not paid nor shipped order with channel "United States" for "jon.snow@the-wall.com" in the registry
Comment on lines +19 to +32

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Scenario: Creating an order with both addresses from address books
When I create a new order for "jon.snow@the-wall.com" and channel "United States"
And I add "Stark Coat" to this order
And I see the address book shipping address select
And I see the address book billing address select
And I select first address in shipping address book with name "Jon Snow"
And I select first address in billing address book with name "Ned Stark"
And I select "Free" shipping method
And I select "Cash on Delivery" payment method
And I place and confirm this order
Then I should be notified that order has been successfully created
And this order shipping address should be "Jon Snow", "Frost Alley", "90210", "Ankh-Morpork", "United States"
And this order billing address should be "Ned Stark", "Banana Street", "90232", "New York", "United States"
And there should be one not paid nor shipped order with channel "United States" for "jon.snow@the-wall.com" in the registry
Scenario: Creating an order with both addresses from address books
When I create a new order for "jon.snow@the-wall.com" and channel "United States"
And I add "Stark Coat" to this order
And I select first address in shipping address book with name "Jon Snow"
And I select first address in billing address book with name "Ned Stark"
And I select "Free" shipping method
And I select "Cash on Delivery" payment method
And I place and confirm this order
Then I should be notified that order has been successfully created
And this order shipping address should be "Jon Snow", "Frost Alley", "90210", "Ankh-Morpork", "United States"
And this order billing address should be "Ned Stark", "Banana Street", "90232", "New York", "United States"
And there should be one not paid nor shipped order with channel "United States" for "jon.snow@the-wall.com" in the registry

If we don't see the address book select field, we can't click it. So, in my opinion, these two steps seem redundant. Same below.


@ui @javascript
Scenario: Creating an order with one address from address books
When I create a new order for "jon.snow@the-wall.com" and channel "United States"
And I add "Stark Coat" to this order
And I see the address book shipping address select
And I see the address book billing address select
And I specify this order shipping address as "Ankh-Morpork", "Frost Alley", "90210", "United States" for "Jon Snow"
And I select first address in billing address book with name "Ned Stark"
And I select "Free" shipping method
And I select "Cash on Delivery" payment method
And I place and confirm this order
Then I should be notified that order has been successfully created
And this order billing address should be "Ned Stark", "Banana Street", "90232", "New York", "United States"
And this order shipping address should be "Jon Snow", "Frost Alley", "90210", "Ankh-Morpork", "United States"
And there should be one not paid nor shipped order with channel "United States" for "jon.snow@the-wall.com" in the registry
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Feature: Creating order with different billing address
Scenario: Creating an order with both addresses specified
When I create a new order for "jon.snow@the-wall.com" and channel "United States"
And I add "Stark Coat" to this order
And I should not see the address book shipping address select
And I should not see the address book billing address select
Comment on lines +20 to +21

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed as well. If there's some kind of "wait" we should move it to the specify step.

And I specify this order shipping address as "Ankh-Morpork", "Frost Alley", "90210", "United States" for "Jon Snow"
And I specify this order billing address as "Rivendell", "Elm Street", "444", "United States" for "Ned Stark"
And I select "Free" shipping method
Expand Down
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@sylius/admin-order-creation-plugin",
"description": "Admin order creation plugin for Sylius.",
"repository": "https://github.com/Sylius/AdminOrderCreationPlugin.git",
"license": "MIT",
"scripts": {
"dist": "yarn encore production --config-name sylius-plugin-dist"
}
}
12 changes: 12 additions & 0 deletions public/build/sylius/orderCreation/admin/entrypoints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"entrypoints": {
"sylius-orderCreation-admin": {
"css": [
"/build/sylius/orderCreation/admin/sylius-orderCreation-admin.css"
],
"js": [
"/build/sylius/orderCreation/admin/sylius-orderCreation-admin.js"
]
}
}
}
4 changes: 4 additions & 0 deletions public/build/sylius/orderCreation/admin/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"build/sylius/orderCreation/admin/sylius-orderCreation-admin.css": "/build/sylius/orderCreation/admin/sylius-orderCreation-admin.css",
"build/sylius/orderCreation/admin/sylius-orderCreation-admin.js": "/build/sylius/orderCreation/admin/sylius-orderCreation-admin.js"
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading