mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
[UPMERGE] 2.0 -> payment-request (#17134)
This PR has been generated automatically. For more details see [upmerge_pr.yaml](/Sylius/Sylius/blob/1.13/.github/workflows/upmerge_pr.yaml). **Remember!** The upmerge should always be merged with using `Merge pull request` button. In case of conflicts, please resolve them manually with usign the following commands: ``` git fetch upstream gh pr checkout <this-pr-number> git merge upstream/payment-request -m "Resolve conflicts between 2.0 and payment-request" ``` If you use other name for the upstream remote, please replace `upstream` with the name of your remote pointing to the `Sylius/Sylius` repository. Once the conflicts are resolved, please run `git merge --continue` and push the changes to this PR.
This commit is contained in:
commit
fd4b2cdb39
202 changed files with 601 additions and 2627 deletions
164
LICENSE
164
LICENSE
|
|
@ -17,167 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
|
||||
Encourage widespread and fair use of Sylius logo and brand identity.
|
||||
|
||||
This Trademarks and Logos use policy (the “Policy”) is based on the Ubuntu
|
||||
and Symfony trademark policy and published under the CC-BY-SA license. You
|
||||
are welcome to base your own project trademark policies off it, just let
|
||||
others use your changes and give credit to the Ubuntu and Symfony projects
|
||||
as the original source!
|
||||
|
||||
Version n°1. Published on April 5th 2019.
|
||||
|
||||
The objective of the Policy is to encourage widespread use of the Sylius
|
||||
trademarks by the Sylius community while controlling that use in order to
|
||||
avoid confusion on the part of Sylius users and the general public, to
|
||||
maintain the value of the image and reputation of the trademarks and to
|
||||
protect them from inappropriate or unauthorised use.
|
||||
|
||||
The sections below describe what is allowed, what isn’t allowed, and cases
|
||||
in which you should ask permission.
|
||||
If you have any doubt, please contact us and a member of our legal
|
||||
representative will be in touch with you shortly.
|
||||
If you are aware a breach or misuse of the Sylius trademarks in any
|
||||
way, we would appreciate you bringing this to our attention. Please
|
||||
contact us so that we can investigate this further.
|
||||
|
||||
The Trademarks and Logos
|
||||
Sylius sp. z o.o. owns the verbal trademark containing
|
||||
in whole or part of the word “Sylius”.
|
||||
|
||||
Any verbal mark starting with the letters “Sylius” is sufficiently
|
||||
similar to one or more of the trademarks that permission will be
|
||||
needed in order to use it.
|
||||
|
||||
All verbal trademarks of Sylius sp. z o.o., all distinctive signs used in
|
||||
commerce by Sylius sp. z o.o. to designate his products or services related
|
||||
to Sylius are collectively referred to as the “Trademarks”.
|
||||
|
||||
Permitted use of the Trademarks
|
||||
Certain usages of the Trademarks are fine and no specific permission
|
||||
from us is needed.
|
||||
|
||||
Community advocacy. Sylius is built by its community. We share access to
|
||||
the Trademarks with the entire community for the purposes of discussion,
|
||||
development and advocacy. We recognise that most of the open source discussion
|
||||
and development areas are for non-commercial purposes and will allow the
|
||||
use of the Trademarks in this context, provided:
|
||||
|
||||
the Trademark is used in a manner consistent with this Policy;
|
||||
there is no commercial intent behind the use;
|
||||
what you are referring to is in fact Sylius. If someone is confused into
|
||||
thinking that what isn’t Sylius is, in fact, Sylius, you are probably doing
|
||||
something wrong;
|
||||
there is no suggestion (through words or appearance) that your project is
|
||||
approved, sponsored, or affiliated with Sylius, Sylius sp. z o.o. or its
|
||||
related projects unless it actually has been approved by and is accountable
|
||||
to Sylius sp. z o.o. and the Sylius Project.
|
||||
Building on Sylius or for Sylius. If you are producing new software which is
|
||||
intended for use with or on Sylius, you may use the Trademark in a way which
|
||||
indicates the intent of your product. For example, if you are developing a
|
||||
system management tool for Sylius, acceptable project titles would be
|
||||
“System Management for Sylius” or “Sylius Based Systems Management”. We would
|
||||
strongly discourage, and likely would consider to be problematic, a name such
|
||||
as SyliusMan, Sylius Management, etc. Furthermore, you may not use the
|
||||
Trademarks in a way which implies an endorsement where that doesn’t exist,
|
||||
or which attempts to unfairly or confusingly capitalise on the goodwill
|
||||
or brand of the project.
|
||||
|
||||
Commentary and parody. The Trademarks and Logos are designed to cover use of
|
||||
a mark to imply origin or endorsement by the project. When a user downloads
|
||||
something called Sylius, they should know it comes from the Sylius project.
|
||||
This helps Sylius build a reputation that will not be damaged by confusion
|
||||
around what is, and isn’t, Sylius. Using the Trademarks in your discussion,
|
||||
commentary, criticism or parody, in ways that unequivocally do not imply
|
||||
endorsement, is permissible. Anyone is free to write articles, create
|
||||
websites, blog about, or talk about Sylius — as long as it’s clear to
|
||||
everyone — including people completely unfamiliar with Sylius — that they
|
||||
are simply referring to Sylius and in no way speaking for the Sylius
|
||||
project and/or for Sylius sp. z o.o.
|
||||
|
||||
We reserve the right to review all usage within the open source community,
|
||||
and to object to any usage that appears to overstep the bounds of discussion
|
||||
and good-faith non-commercial development. In any event, once a project has
|
||||
left the open source project phase or otherwise become a commercial project,
|
||||
this Policy does not authorise any use of the Trademarks in connection to
|
||||
that project.
|
||||
|
||||
Restricted use that requires a trademark licence
|
||||
Permission from us is necessary to use any of the Trademarks under any
|
||||
circumstances other than those specifically permitted above.
|
||||
|
||||
These include but are not limited to:
|
||||
|
||||
Any commercial use including for any services related to Sylius such as
|
||||
providing training services, conference services, or design services (should
|
||||
you wish to provide such services, please contact us beforehand to explore
|
||||
Sylius Solution Partner Program);
|
||||
Use on or in relation to a software product that includes or is built on top
|
||||
of a product supplied by us, if there is any commercial intent associated
|
||||
with that product;
|
||||
Use in a domain name or URL;
|
||||
Use for merchandising purposes, e.g. on t-shirts and the like.
|
||||
If you wish to have permission for any of the uses above or for any other use
|
||||
which is not specifically referred to in this Policy, please contact us and
|
||||
we’ll let you know as soon as possible if your proposed use is permissible.
|
||||
Permission may only be granted subject to certain conditions and these may
|
||||
include the requirement that you enter into an agreement with us to maintain
|
||||
the quality of the product and/or service which you intend to supply at a
|
||||
prescribed level.
|
||||
|
||||
While there may be exceptions, it is very unlikely that we will approve
|
||||
Trademark use in the following cases:
|
||||
|
||||
Use of a Trademark in a company name;
|
||||
Use of a Trademark in a domain name which has a commercial intent. The
|
||||
commercial intent can range from promotion of a company or product, to
|
||||
collecting revenue generated by advertising;
|
||||
The calling of any software or product by the name Sylius (or another
|
||||
related Trademark);
|
||||
Use in combination with any other marks or logos. This include use of
|
||||
a Trademark in a manner that creates a “combined mark,” or use that
|
||||
integrates other wording with the Trademark in a way that the public may
|
||||
think of the use as a new mark (for example Club Sylius or SyliusBooks, or
|
||||
in a way that by use of special fonts or presentation with nearby words or
|
||||
images conveys an impression that the two are tied in some way);
|
||||
Use in combination with any product or service which is presented as being
|
||||
Certified or Official or formally associated with us or our products or
|
||||
services;
|
||||
Use in a way which implies an endorsement where that doesn’t exist, or which
|
||||
attempts to unfairly or confusingly capitalise on the goodwill or brand of
|
||||
the project;
|
||||
Use of a Trademark in a manner that disparages Sylius, or Sylius sp. z o.o.;
|
||||
or its products and is not clearly third-party parody;
|
||||
Use of a Trademark on or in relation to a software product which constitutes
|
||||
a substantially modified version of a product supplied by the Sylius project,
|
||||
that is to say with material changes to the code, or services relating to
|
||||
such a product; and
|
||||
Use of a Trademark in a title or metatag of a web page whose sole intention or
|
||||
result is to influence search engine rankings or result listings (for example
|
||||
use as keyword for advertising purposes), rather than for discussion,
|
||||
development or advocacy of the Trademarks.
|
||||
Logo usage guidelines
|
||||
Except otherwise agreed, any use of Logos shall be expressly authorized by
|
||||
writing by Sylius sp. z o.o.. To get any authorization to use any Logo,
|
||||
please contact us and a member of our team will be in touch with you shortly.
|
||||
|
||||
Our logos are presented in multiple colours and it is important that their
|
||||
visual integrity be maintained.
|
||||
|
||||
Therefore, when use of Logos is authorized, it is therefore preferable that
|
||||
the logos only be used in their standard form but if you should feel the need
|
||||
to alter them in any way you should keep the following guidelines in mind.
|
||||
|
||||
It should also be borne in mind that the more you wish to vary our logos
|
||||
from their standard form the smaller is the chance that we will be able to
|
||||
approve your proposed use.
|
||||
|
||||
If presented in multiple colours, the logo should only use the “official”
|
||||
logo colours.
|
||||
You may use transparency and gradient/depth tools but should retain the
|
||||
“official” colours.
|
||||
Any scaling must retain the original proportions of the logo.
|
||||
In case of non-compliance with Trademarks and Logos’ Use Policy or
|
||||
applicable law, any use of the Trademarks and/or Logos will be prohibited.
|
||||
|
|
|
|||
162
LICENSE_OF_TRADEMARK_AND_LOGO
Normal file
162
LICENSE_OF_TRADEMARK_AND_LOGO
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
Encourage widespread and fair use of Sylius logo and brand identity.
|
||||
|
||||
This Trademarks and Logos use policy (the “Policy”) is based on the Ubuntu
|
||||
and Symfony trademark policy and published under the CC-BY-SA license. You
|
||||
are welcome to base your own project trademark policies off it, just let
|
||||
others use your changes and give credit to the Ubuntu and Symfony projects
|
||||
as the original source!
|
||||
|
||||
Version n°1. Published on April 5th 2019.
|
||||
|
||||
The objective of the Policy is to encourage widespread use of the Sylius
|
||||
trademarks by the Sylius community while controlling that use in order to
|
||||
avoid confusion on the part of Sylius users and the general public, to
|
||||
maintain the value of the image and reputation of the trademarks and to
|
||||
protect them from inappropriate or unauthorised use.
|
||||
|
||||
The sections below describe what is allowed, what isn’t allowed, and cases
|
||||
in which you should ask permission.
|
||||
If you have any doubt, please contact us and a member of our legal
|
||||
representative will be in touch with you shortly.
|
||||
If you are aware a breach or misuse of the Sylius trademarks in any
|
||||
way, we would appreciate you bringing this to our attention. Please
|
||||
contact us so that we can investigate this further.
|
||||
|
||||
The Trademarks and Logos
|
||||
Sylius sp. z o.o. owns the verbal trademark containing
|
||||
in whole or part of the word “Sylius”.
|
||||
|
||||
Any verbal mark starting with the letters “Sylius” is sufficiently
|
||||
similar to one or more of the trademarks that permission will be
|
||||
needed in order to use it.
|
||||
|
||||
All verbal trademarks of Sylius sp. z o.o., all distinctive signs used in
|
||||
commerce by Sylius sp. z o.o. to designate his products or services related
|
||||
to Sylius are collectively referred to as the “Trademarks”.
|
||||
|
||||
Permitted use of the Trademarks
|
||||
Certain usages of the Trademarks are fine and no specific permission
|
||||
from us is needed.
|
||||
|
||||
Community advocacy. Sylius is built by its community. We share access to
|
||||
the Trademarks with the entire community for the purposes of discussion,
|
||||
development and advocacy. We recognise that most of the open source discussion
|
||||
and development areas are for non-commercial purposes and will allow the
|
||||
use of the Trademarks in this context, provided:
|
||||
|
||||
the Trademark is used in a manner consistent with this Policy;
|
||||
there is no commercial intent behind the use;
|
||||
what you are referring to is in fact Sylius. If someone is confused into
|
||||
thinking that what isn’t Sylius is, in fact, Sylius, you are probably doing
|
||||
something wrong;
|
||||
there is no suggestion (through words or appearance) that your project is
|
||||
approved, sponsored, or affiliated with Sylius, Sylius sp. z o.o. or its
|
||||
related projects unless it actually has been approved by and is accountable
|
||||
to Sylius sp. z o.o. and the Sylius Project.
|
||||
Building on Sylius or for Sylius. If you are producing new software which is
|
||||
intended for use with or on Sylius, you may use the Trademark in a way which
|
||||
indicates the intent of your product. For example, if you are developing a
|
||||
system management tool for Sylius, acceptable project titles would be
|
||||
“System Management for Sylius” or “Sylius Based Systems Management”. We would
|
||||
strongly discourage, and likely would consider to be problematic, a name such
|
||||
as SyliusMan, Sylius Management, etc. Furthermore, you may not use the
|
||||
Trademarks in a way which implies an endorsement where that doesn’t exist,
|
||||
or which attempts to unfairly or confusingly capitalise on the goodwill
|
||||
or brand of the project.
|
||||
|
||||
Commentary and parody. The Trademarks and Logos are designed to cover use of
|
||||
a mark to imply origin or endorsement by the project. When a user downloads
|
||||
something called Sylius, they should know it comes from the Sylius project.
|
||||
This helps Sylius build a reputation that will not be damaged by confusion
|
||||
around what is, and isn’t, Sylius. Using the Trademarks in your discussion,
|
||||
commentary, criticism or parody, in ways that unequivocally do not imply
|
||||
endorsement, is permissible. Anyone is free to write articles, create
|
||||
websites, blog about, or talk about Sylius — as long as it’s clear to
|
||||
everyone — including people completely unfamiliar with Sylius — that they
|
||||
are simply referring to Sylius and in no way speaking for the Sylius
|
||||
project and/or for Sylius sp. z o.o.
|
||||
|
||||
We reserve the right to review all usage within the open source community,
|
||||
and to object to any usage that appears to overstep the bounds of discussion
|
||||
and good-faith non-commercial development. In any event, once a project has
|
||||
left the open source project phase or otherwise become a commercial project,
|
||||
this Policy does not authorise any use of the Trademarks in connection to
|
||||
that project.
|
||||
|
||||
Restricted use that requires a trademark licence
|
||||
Permission from us is necessary to use any of the Trademarks under any
|
||||
circumstances other than those specifically permitted above.
|
||||
|
||||
These include but are not limited to:
|
||||
|
||||
Any commercial use including for any services related to Sylius such as
|
||||
providing training services, conference services, or design services (should
|
||||
you wish to provide such services, please contact us beforehand to explore
|
||||
Sylius Solution Partner Program);
|
||||
Use on or in relation to a software product that includes or is built on top
|
||||
of a product supplied by us, if there is any commercial intent associated
|
||||
with that product;
|
||||
Use in a domain name or URL;
|
||||
Use for merchandising purposes, e.g. on t-shirts and the like.
|
||||
If you wish to have permission for any of the uses above or for any other use
|
||||
which is not specifically referred to in this Policy, please contact us and
|
||||
we’ll let you know as soon as possible if your proposed use is permissible.
|
||||
Permission may only be granted subject to certain conditions and these may
|
||||
include the requirement that you enter into an agreement with us to maintain
|
||||
the quality of the product and/or service which you intend to supply at a
|
||||
prescribed level.
|
||||
|
||||
While there may be exceptions, it is very unlikely that we will approve
|
||||
Trademark use in the following cases:
|
||||
|
||||
Use of a Trademark in a company name;
|
||||
Use of a Trademark in a domain name which has a commercial intent. The
|
||||
commercial intent can range from promotion of a company or product, to
|
||||
collecting revenue generated by advertising;
|
||||
The calling of any software or product by the name Sylius (or another
|
||||
related Trademark);
|
||||
Use in combination with any other marks or logos. This include use of
|
||||
a Trademark in a manner that creates a “combined mark,” or use that
|
||||
integrates other wording with the Trademark in a way that the public may
|
||||
think of the use as a new mark (for example Club Sylius or SyliusBooks, or
|
||||
in a way that by use of special fonts or presentation with nearby words or
|
||||
images conveys an impression that the two are tied in some way);
|
||||
Use in combination with any product or service which is presented as being
|
||||
Certified or Official or formally associated with us or our products or
|
||||
services;
|
||||
Use in a way which implies an endorsement where that doesn’t exist, or which
|
||||
attempts to unfairly or confusingly capitalise on the goodwill or brand of
|
||||
the project;
|
||||
Use of a Trademark in a manner that disparages Sylius, or Sylius sp. z o.o.;
|
||||
or its products and is not clearly third-party parody;
|
||||
Use of a Trademark on or in relation to a software product which constitutes
|
||||
a substantially modified version of a product supplied by the Sylius project,
|
||||
that is to say with material changes to the code, or services relating to
|
||||
such a product; and
|
||||
Use of a Trademark in a title or metatag of a web page whose sole intention or
|
||||
result is to influence search engine rankings or result listings (for example
|
||||
use as keyword for advertising purposes), rather than for discussion,
|
||||
development or advocacy of the Trademarks.
|
||||
Logo usage guidelines
|
||||
Except otherwise agreed, any use of Logos shall be expressly authorized by
|
||||
writing by Sylius sp. z o.o.. To get any authorization to use any Logo,
|
||||
please contact us and a member of our team will be in touch with you shortly.
|
||||
|
||||
Our logos are presented in multiple colours and it is important that their
|
||||
visual integrity be maintained.
|
||||
|
||||
Therefore, when use of Logos is authorized, it is therefore preferable that
|
||||
the logos only be used in their standard form but if you should feel the need
|
||||
to alter them in any way you should keep the following guidelines in mind.
|
||||
|
||||
It should also be borne in mind that the more you wish to vary our logos
|
||||
from their standard form the smaller is the chance that we will be able to
|
||||
approve your proposed use.
|
||||
|
||||
If presented in multiple colours, the logo should only use the “official”
|
||||
logo colours.
|
||||
You may use transparency and gradient/depth tools but should retain the
|
||||
“official” colours.
|
||||
Any scaling must retain the original proportions of the logo.
|
||||
In case of non-compliance with Trademarks and Logos’ Use Policy or
|
||||
applicable law, any use of the Trademarks and/or Logos will be prohibited.
|
||||
|
|
@ -42,6 +42,41 @@
|
|||
* `sylius.grid_driver.doctrine.phpcrodm`
|
||||
* `sylius.listener.api_postgresql_driver_exception_listener`
|
||||
|
||||
* Aliases introduced in Sylius 1.14 have now become the primary service IDs in Sylius 2.0. The old service IDs have been removed, and all references must be updated accordingly:
|
||||
|
||||
| Old ID | New ID |
|
||||
|-------------------------------------------------------------|-------------------------------------------------------------------------------------|
|
||||
| **AttributeBundle** | |
|
||||
| `sylius.form.type.attribute_type.select.choices_collection` | `sylius.form.type.attribute_type.configuration.select_attribute_choices_collection` |
|
||||
| `sylius.attribute_type.select.value.translations` | `sylius.form.type.attribute_type.configuration.select_attribute_value_translations` |
|
||||
| `sylius.validator.valid_text_attribute` | `sylius.validator.valid_text_attribute_configuration` |
|
||||
| `sylius.validator.valid_select_attribute` | `sylius.validator.valid_select_attribute_configuration` |
|
||||
| **AddressingBundle** | |
|
||||
| `sylius.province_naming_provider` | `sylius.provider.province_naming` |
|
||||
| `sylius.zone_matcher` | `sylius.matcher.zone` |
|
||||
| `sylius.address_comparator` | `sylius.comparator.address` |
|
||||
| **ChannelBundle** | |
|
||||
| `sylius.channel_collector` | `sylius.collector.channel` |
|
||||
| **CurrencyBundle** | |
|
||||
| `sylius.currency_converter` | `sylius.converter.currency` |
|
||||
| `sylius.currency_name_converter` | `sylius.converter.currency_name` |
|
||||
| **InventoryBundle** | |
|
||||
| `sylius.availability_checker.default` | `sylius.availability_checker` |
|
||||
| **MoneyBundle** | |
|
||||
| `sylius.twig.extension.convert_amount` | `sylius.twig.extension.convert_money` |
|
||||
| `sylius.twig.extension.money` | `sylius.twig.extension.format_money` |
|
||||
| `sylius.money_formatter` | `sylius.formatter.money` |
|
||||
|
||||
The old service IDs are no longer available in Sylius 2.0. Please ensure your configurations and service references use the new service IDs.
|
||||
|
||||
* The following services had new aliases added in Sylius 1.14. In Sylius 2.0, these aliases have become the primary service IDs, and the old service IDs remain as aliases:
|
||||
|
||||
| Current ID | New Alias |
|
||||
|--------------------------------------------------------------------------------|---------------------------------------------|
|
||||
| **AddressingBundle** | |
|
||||
| `Sylius\Component\Addressing\Checker\ZoneDeletionCheckerInterface` | `sylius.checker.zone_deletion` |
|
||||
| `Sylius\Component\Addressing\Checker\CountryProvincesDeletionCheckerInterface` | `sylius.checker.country_provinces_deletion` |
|
||||
|
||||
* The following parameters were removed:
|
||||
|
||||
* `sylius.mongodb_odm.repository.class`
|
||||
|
|
@ -328,6 +363,37 @@
|
|||
)
|
||||
```
|
||||
|
||||
## Grids
|
||||
|
||||
The experimental `entities` filter has been removed. It has been replaced by the generic `entity` one.
|
||||
|
||||
```diff
|
||||
sylius_grid:
|
||||
grids:
|
||||
# ...
|
||||
sylius_admin_catalog_promotion:
|
||||
# ...
|
||||
filters:
|
||||
channel:
|
||||
- type: entities
|
||||
+ type: entity
|
||||
label: sylius.ui.channel
|
||||
form_options:
|
||||
class: "%sylius.model.channel.class%"
|
||||
options:
|
||||
- field: product.channels.id
|
||||
+ fields: [product.channels.id]
|
||||
```
|
||||
|
||||
The following service has been removed:
|
||||
|
||||
- sylius.grid_filter.entities
|
||||
|
||||
The following classes have been removed:
|
||||
|
||||
- Sylius\Component\Core\Grid\Filter\EntitiesFilter
|
||||
- Sylius\Bundle\CoreBundle\Form\Type\Grid\Filter\EntitiesFilterType
|
||||
|
||||
## Password Encoder & Salt
|
||||
The encoder and salt has been removed from the User entities. It will use the password hasher configured on Symfony security configuration.
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
"ext-intl": "*",
|
||||
"ext-json": "*",
|
||||
"ext-simplexml": "*",
|
||||
"api-platform/core": "^3.4.0",
|
||||
"api-platform/core": "^3.4.2",
|
||||
"babdev/pagerfanta-bundle": "^3.7 || ^4.0",
|
||||
"behat/transliterator": "^1.3",
|
||||
"doctrine/collections": "^1.6",
|
||||
|
|
@ -50,7 +50,6 @@
|
|||
"gedmo/doctrine-extensions": "^3.2",
|
||||
"guzzlehttp/guzzle": "^6.5 || ^7.0",
|
||||
"guzzlehttp/psr7": "^2.5",
|
||||
"jms/serializer-bundle": "^5.0",
|
||||
"knplabs/gaufrette": "^0.10 || ^0.11",
|
||||
"knplabs/knp-gaufrette-bundle": "^0.8 || ^0.9",
|
||||
"knplabs/knp-menu": "^3.1",
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ return [
|
|||
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
|
||||
winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true],
|
||||
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
|
||||
JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true],
|
||||
Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true],
|
||||
Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
|
||||
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
jms_serializer:
|
||||
visitors:
|
||||
json_serialization:
|
||||
options:
|
||||
- JSON_PRETTY_PRINT
|
||||
- JSON_UNESCAPED_SLASHES
|
||||
- JSON_PRESERVE_ZERO_FRACTION
|
||||
json_deserialization:
|
||||
options:
|
||||
- JSON_PRETTY_PRINT
|
||||
- JSON_UNESCAPED_SLASHES
|
||||
- JSON_PRESERVE_ZERO_FRACTION
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
jms_serializer:
|
||||
visitors:
|
||||
xml_serialization:
|
||||
format_output: '%kernel.debug%'
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
jms_serializer:
|
||||
visitors:
|
||||
json_serialization:
|
||||
options:
|
||||
- JSON_UNESCAPED_SLASHES
|
||||
- JSON_PRESERVE_ZERO_FRACTION
|
||||
json_deserialization:
|
||||
options:
|
||||
- JSON_UNESCAPED_SLASHES
|
||||
- JSON_PRESERVE_ZERO_FRACTION
|
||||
|
|
@ -82,18 +82,6 @@ In order to send emails you need to configure Mailer Service. Basically there ar
|
|||
|
||||
* We are recommending to use `Symfony Mailer <https://symfony.com/doc/current/mailer.html>`_ where out of the box, you can deliver emails by configuring the ``MAILER_DSN`` variable in your .env file.
|
||||
* In Symfony Mailer use the `3rd Party Transports <https://symfony.com/doc/current/mailer.html#using-a-3rd-party-transport>`_
|
||||
* (deprecated) Use SwiftMailer with this short configuration:
|
||||
|
||||
1. **Create an account on a mailing service.**
|
||||
2. **In your** ``.env`` **file modify/add the** ``MAILER_URL`` **variable.**
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
MAILER_URL=gmail://username:password@local
|
||||
|
||||
.. note::
|
||||
|
||||
Email delivery is disabled for test, dev and staging environments by default. The prod environment has delivery turned on.
|
||||
|
||||
You can learn more about configuring mailer service in :doc:`How to configure mailer? </cookbook/emails/mailer>`
|
||||
|
||||
|
|
|
|||
|
|
@ -41,8 +41,6 @@ Don't worry, everything was automatically installed via Composer.
|
|||
public function registerBundles()
|
||||
{
|
||||
$bundles = array(
|
||||
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
|
||||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
|
||||
|
|
|
|||
|
|
@ -41,8 +41,6 @@ Don't worry, everything was automatically installed via Composer.
|
|||
public function registerBundles()
|
||||
{
|
||||
$bundles = array(
|
||||
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
|
||||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
new Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(),
|
||||
|
|
|
|||
|
|
@ -41,10 +41,8 @@ Don't worry, everything was automatically installed via Composer.
|
|||
public function registerBundles()
|
||||
{
|
||||
$bundles = array(
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
|
||||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
|
||||
new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
|
||||
new Sylius\Bundle\CustomerBundle\SyliusCustomerBundle(),
|
||||
|
||||
|
|
|
|||
|
|
@ -40,8 +40,6 @@ Don't worry, everything was automatically installed via Composer.
|
|||
public function registerBundles()
|
||||
{
|
||||
$bundles = array(
|
||||
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
|
||||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
|
||||
|
|
|
|||
|
|
@ -41,10 +41,8 @@ Don't worry, everything was automatically installed via Composer.
|
|||
public function registerBundles()
|
||||
{
|
||||
$bundles = array(
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
|
||||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
|
||||
new Sylius\Bundle\ProductBundle\SyliusProductBundle(),
|
||||
new Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(),
|
||||
new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
|
||||
|
|
|
|||
|
|
@ -41,10 +41,8 @@ Don't worry, everything was automatically installed via Composer.
|
|||
public function registerBundles()
|
||||
{
|
||||
$bundles = array(
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
|
||||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
|
||||
new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
|
||||
new Sylius\Bundle\PromotionBundle\SyliusPromotionBundle(),
|
||||
|
||||
|
|
|
|||
|
|
@ -41,8 +41,6 @@ Don't worry, everything was automatically installed via Composer.
|
|||
public function registerBundles()
|
||||
{
|
||||
$bundles = array(
|
||||
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
|
||||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
new Sylius\Bundle\ShippingBundle\SyliusShippingBundle(),
|
||||
|
|
|
|||
|
|
@ -41,8 +41,6 @@ Don't worry, everything was automatically installed via Composer.
|
|||
public function registerBundles()
|
||||
{
|
||||
$bundles = array(
|
||||
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
|
||||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
new Sylius\Bundle\TaxationBundle\SyliusTaxationBundle(),
|
||||
|
|
|
|||
|
|
@ -44,8 +44,6 @@ Don't worry, everything was automatically installed via Composer.
|
|||
public function registerBundles()
|
||||
{
|
||||
$bundles = array(
|
||||
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
|
||||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
new Sylius\Bundle\TaxonomyBundle\SyliusTaxonomyBundle(),
|
||||
|
|
|
|||
|
|
@ -41,10 +41,8 @@ Don't worry, everything was automatically installed via Composer.
|
|||
public function registerBundles()
|
||||
{
|
||||
$bundles = array(
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
|
||||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
|
||||
new Sylius\Bundle\ResourceBundle\SyliusResourceBundle(),
|
||||
new Sylius\Bundle\MailerBundle\SyliusMailerBundle(),
|
||||
new Sylius\Bundle\UserBundle\SyliusUserBundle(),
|
||||
|
|
|
|||
12
docs/conf.py
12
docs/conf.py
|
|
@ -3,6 +3,14 @@ import sys, os
|
|||
from sphinx.highlighting import lexers
|
||||
from pygments.lexers.web import PhpLexer
|
||||
|
||||
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "https://docs.sylius.com")
|
||||
|
||||
# Tell Jinja2 templates the build is running on Read the Docs
|
||||
if os.environ.get("READTHEDOCS", "") == "True":
|
||||
if "html_context" not in globals():
|
||||
html_context = {}
|
||||
html_context["READTHEDOCS"] = True
|
||||
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.doctest',
|
||||
|
|
@ -21,8 +29,10 @@ copyright = u'2011-2024, Sylius Sp. z o.o.'
|
|||
version = ''
|
||||
release = ''
|
||||
exclude_patterns = ['_includes/*.rst']
|
||||
html_theme = 'sylius_rtd_theme'
|
||||
html_theme = "sylius_rtd_theme"
|
||||
html_theme_path = ["_themes"]
|
||||
html_context = html_context if 'html_context' in globals() else {}
|
||||
html_context['style'] = 'css/theme.css'
|
||||
html_favicon = 'favicon.ico'
|
||||
htmlhelp_basename = 'Syliusdoc'
|
||||
man_pages = [
|
||||
|
|
|
|||
|
|
@ -8,16 +8,7 @@ In Sylius emails are configured the Symfony way, so you can get inspired by the
|
|||
|
||||
We are recommending to use `Symfony Mailer <https://symfony.com/doc/current/mailer.html>`_ where out of the box, you can deliver emails by configuring the ``MAILER_DSN`` variable in your .env file.
|
||||
|
||||
If you prefer using the SwiftMailer service you will need to:
|
||||
|
||||
1. **Create an account on a mailing service.**
|
||||
2. **In the your** ``.env`` **file modify/add the** ``MAILER_URL`` **variable.**
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
MAILER_URL=gmail://username:password@localhost
|
||||
|
||||
Emails delivery is disable for `test`, `dev` and `stage` environments by default. The `prod` environment has delivery turned
|
||||
Emails delivery is disabled for `test`, `dev` and `stage` environments by default. The `prod` environment has delivery turned
|
||||
on by default, so there is nothing to worry about if you did not change anything about it.
|
||||
|
||||
**That's pretty much all! All the other issues are dependent on the service you are using.**
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
sphinx==1.8.5
|
||||
alabaster==0.7.13
|
||||
docutils<0.18
|
||||
jinja2==3.0.0
|
||||
pyOpenSSL
|
||||
requests[security]
|
||||
sphinx-copybutton
|
||||
sphinx-autobuild
|
||||
sphinx>=7.0.1
|
||||
alabaster>=0.7.13
|
||||
docutils>=0.18.1,<0.21
|
||||
jinja2>=3.0.0,<4.0
|
||||
pyOpenSSL>=21.0.0
|
||||
requests[security]>=2.25.0
|
||||
sphinx-copybutton>=0.5.0
|
||||
sphinx-autobuild>=2021.3.14
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
@managing_orders
|
||||
Feature: Assigning customer's IP address to a placed order
|
||||
In order to know from which IP address a new order has been placed
|
||||
As an Administrator
|
||||
I want to have customer's IP address assigned to their orders
|
||||
|
||||
Background:
|
||||
Given the store operates on a single channel in "United States"
|
||||
And the store has a product "PHP T-Shirt" priced at "$19.99"
|
||||
And the store ships everywhere for Free
|
||||
And the store allows paying Offline
|
||||
And there is a customer account "customer@example.com"
|
||||
And there is a customer "customer@example.com" that placed order with "PHP T-Shirt" product to "United States" based billing address with "Free" shipping method and "Offline" payment method without completing it
|
||||
And the customer logged in as "customer@example.com"
|
||||
And the customer confirmed the order
|
||||
|
||||
@api @ui
|
||||
Scenario: Verifying the customer's IP address for a newly placed order
|
||||
Given I am logged in as an administrator
|
||||
When I view the summary of the order placed by "customer@example.com"
|
||||
Then I should see this customer's IP address
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
@checkout
|
||||
Feature: Assigning customer's IP address to a placed order
|
||||
In order to know from which IP address a new order has been places
|
||||
As an Administrator
|
||||
I want to have customer's IP address assigned to their orders
|
||||
|
||||
Background:
|
||||
Given the store operates on a single channel in "United States"
|
||||
And the store has a product "PHP T-Shirt" priced at "$19.99"
|
||||
And the store ships everywhere for Free
|
||||
And the store allows paying Offline
|
||||
And there is an administrator "sylius@example.com" identified by "sylius"
|
||||
And there is a customer account "customer@example.com" identified by "sylius"
|
||||
And I am logged in as "customer@example.com"
|
||||
|
||||
@todo @ui
|
||||
Scenario: Assigning customer's IP address to a newly placed order
|
||||
Given I have product "PHP T-Shirt" in the cart
|
||||
And I specified the billing address as "Ankh Morpork", "Frost Alley", "90210", "United States" for "Jon Snow"
|
||||
And I proceed with "Free" shipping method and "Offline" payment
|
||||
And I confirm my order
|
||||
Then the administrator should know about IP address of this order made by "customer@example.com"
|
||||
|
|
@ -55,6 +55,7 @@ final readonly class ManagingOrdersContext implements Context
|
|||
* @Given /^I am viewing the summary of (this order)$/
|
||||
* @Given I am viewing the summary of the order :order
|
||||
* @When I view the summary of the order :order
|
||||
* @When /^I view the summary of the (order placed by "[^"]+")$/
|
||||
*/
|
||||
public function iSeeTheOrder(OrderInterface $order): void
|
||||
{
|
||||
|
|
@ -1267,6 +1268,14 @@ final readonly class ManagingOrdersContext implements Context
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then I should see this customer's IP address
|
||||
*/
|
||||
public function iShouldSeeCustomersIpAddress(): void
|
||||
{
|
||||
Assert::notEmpty($this->responseChecker->getValue($this->client->getLastResponse(), 'customerIp'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $address
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -345,6 +345,7 @@ final class CheckoutContext implements Context
|
|||
|
||||
/**
|
||||
* @Given I confirmed my order
|
||||
* @Given the customer confirmed the order
|
||||
* @When I confirm my order
|
||||
* @When /^the (?:visitor|customer) confirm his order$/
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -130,6 +130,20 @@ final readonly class OrderContext implements Context
|
|||
$this->objectManager->flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given /^there is a (customer "[^"]+") that placed order with ("[^"]+" product) to ("[^"]+" based billing address) with ("[^"]+" shipping method) and ("[^"]+" payment) method without completing it$/
|
||||
*/
|
||||
public function thereIsACustomerThatPlacedOrderWithProductToBasedBillingAddressWithShippingMethodAndPaymentMethodWithoutCompletingIt(
|
||||
CustomerInterface $customer,
|
||||
ProductInterface $product,
|
||||
AddressInterface $address,
|
||||
ShippingMethodInterface $shippingMethod,
|
||||
PaymentMethodInterface $paymentMethod,
|
||||
): void {
|
||||
$this->placeOrder($product, $shippingMethod, $address, $paymentMethod, $customer, 1, false);
|
||||
$this->objectManager->flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Given /^the guest customer placed order with ("[^"]+" product) for "([^"]+)" and ("[^"]+" based billing address) with ("[^"]+" shipping method) and ("[^"]+" payment)$/
|
||||
*/
|
||||
|
|
@ -876,7 +890,10 @@ final readonly class OrderContext implements Context
|
|||
/** @var OrderInterface $order */
|
||||
$order = $this->orderFactory->createNew();
|
||||
|
||||
$order->setCustomer($customer);
|
||||
$customer->getUser() === null
|
||||
? $order->setCustomer($customer)
|
||||
: $order->setCustomerWithAuthorization($customer)
|
||||
;
|
||||
$order->setChannel($channel ?? $this->sharedStorage->get('channel'));
|
||||
$order->setLocaleCode($this->sharedStorage->get('locale')->getCode());
|
||||
$order->setCurrencyCode($order->getChannel()->getBaseCurrency()->getCode());
|
||||
|
|
@ -932,6 +949,7 @@ final readonly class OrderContext implements Context
|
|||
ShippingMethodInterface $shippingMethod,
|
||||
AddressInterface $address,
|
||||
PaymentMethodInterface $paymentMethod,
|
||||
bool $completeOrder = true,
|
||||
): void {
|
||||
$order->setShippingAddress($address);
|
||||
$order->setBillingAddress(clone $address);
|
||||
|
|
@ -939,7 +957,9 @@ final readonly class OrderContext implements Context
|
|||
$this->applyTransitionOnOrderCheckout($order, OrderCheckoutTransitions::TRANSITION_ADDRESS);
|
||||
|
||||
$this->proceedSelectingShippingAndPaymentMethod($order, $shippingMethod, $paymentMethod);
|
||||
$this->completeCheckout($order);
|
||||
if ($completeOrder) {
|
||||
$this->completeCheckout($order);
|
||||
}
|
||||
}
|
||||
|
||||
private function completeCheckout(OrderInterface $order): void
|
||||
|
|
@ -1139,6 +1159,7 @@ final readonly class OrderContext implements Context
|
|||
PaymentMethodInterface $paymentMethod,
|
||||
CustomerInterface $customer,
|
||||
int $number,
|
||||
bool $completeOrder = true,
|
||||
): void {
|
||||
$variant = $this->getProductVariant($product);
|
||||
|
||||
|
|
@ -1154,11 +1175,17 @@ final readonly class OrderContext implements Context
|
|||
$order = $this->createOrder($customer, '#00000' . $number);
|
||||
$order->addItem($item);
|
||||
|
||||
$this->checkoutUsing($order, $shippingMethod, clone $address, $paymentMethod);
|
||||
$this->applyPaymentTransitionOnOrder($order, PaymentTransitions::TRANSITION_COMPLETE);
|
||||
$this->checkoutUsing($order, $shippingMethod, clone $address, $paymentMethod, $completeOrder);
|
||||
|
||||
if ($completeOrder) {
|
||||
$this->applyPaymentTransitionOnOrder($order, PaymentTransitions::TRANSITION_COMPLETE);
|
||||
}
|
||||
|
||||
$this->objectManager->persist($order);
|
||||
$this->sharedStorage->set('order', $order);
|
||||
if (!$completeOrder) {
|
||||
$this->sharedStorage->set('cart_token', $order->getTokenValue());
|
||||
}
|
||||
}
|
||||
|
||||
private function getProductVariant(ProductInterface $product): ProductVariantInterface
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use Sylius\Bundle\CoreBundle\Fixture\Factory\ExampleFactoryInterface;
|
|||
use Sylius\Component\User\Repository\UserRepositoryInterface;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
final class ShopSecurityContext implements Context
|
||||
final readonly class ShopSecurityContext implements Context
|
||||
{
|
||||
public function __construct(
|
||||
private SharedStorageInterface $sharedStorage,
|
||||
|
|
@ -32,6 +32,7 @@ final class ShopSecurityContext implements Context
|
|||
|
||||
/**
|
||||
* @Given I am logged in as :email
|
||||
* @Given the customer logged in as :email
|
||||
* @When I log in as :email
|
||||
*/
|
||||
public function iAmLoggedInAs(string $email): void
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ final readonly class ManagingOrdersContext implements Context
|
|||
* @Given /^I am viewing the summary of (this order)$/
|
||||
* @Given I am viewing the summary of the order :order
|
||||
* @When I view the summary of the order :order
|
||||
* @When /^I view the summary of the (order placed by "[^"]+")$/
|
||||
*/
|
||||
public function iViewTheSummaryOfTheOrder(OrderInterface $order): void
|
||||
{
|
||||
|
|
@ -865,20 +866,11 @@ final readonly class ManagingOrdersContext implements Context
|
|||
}
|
||||
|
||||
/**
|
||||
* @Then /^(the administrator) should know about IP address of (this order made by "[^"]+")$/
|
||||
* @Then I should see this customer's IP address
|
||||
*/
|
||||
public function theAdministratorShouldKnowAboutIPAddressOfThisOrderMadeBy(
|
||||
AdminUserInterface $user,
|
||||
OrderInterface $order,
|
||||
): void {
|
||||
$this->sharedSecurityService->performActionAsAdminUser(
|
||||
$user,
|
||||
function () use ($order) {
|
||||
$this->showPage->open(['id' => $order->getId()]);
|
||||
|
||||
Assert::notSame($this->showPage->getIpAddressAssigned(), '');
|
||||
},
|
||||
);
|
||||
public function iShouldSeeCustomersIpAddress(): void
|
||||
{
|
||||
Assert::notEmpty($this->showPage->getIpAddressAssigned());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ use Sylius\Component\Core\Model\ShippingMethodInterface;
|
|||
use Sylius\Component\Locale\Model\LocaleInterface;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
final class CheckoutCompleteContext implements Context
|
||||
final readonly class CheckoutCompleteContext implements Context
|
||||
{
|
||||
public function __construct(
|
||||
private SharedStorageInterface $sharedStorage,
|
||||
|
|
@ -44,7 +44,7 @@ final class CheckoutCompleteContext implements Context
|
|||
* @When I try to open checkout complete page
|
||||
* @When I want to complete checkout
|
||||
*/
|
||||
public function iTryToOpenCheckoutCompletePage()
|
||||
public function iTryToOpenCheckoutCompletePage(): void
|
||||
{
|
||||
$this->completePage->tryToOpen();
|
||||
}
|
||||
|
|
@ -52,7 +52,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @When I decide to change the payment method
|
||||
*/
|
||||
public function iGoToThePaymentStep()
|
||||
public function iGoToThePaymentStep(): void
|
||||
{
|
||||
$this->completePage->changePaymentMethod();
|
||||
}
|
||||
|
|
@ -60,7 +60,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @When /^I provide additional note like "([^"]+)"$/
|
||||
*/
|
||||
public function iProvideAdditionalNotesLike($notes)
|
||||
public function iProvideAdditionalNotesLike($notes): void
|
||||
{
|
||||
$this->sharedStorage->set('additional_note', $notes);
|
||||
$this->completePage->addNotes($notes);
|
||||
|
|
@ -69,7 +69,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @When I return to the checkout summary step
|
||||
*/
|
||||
public function iReturnToTheCheckoutSummaryStep()
|
||||
public function iReturnToTheCheckoutSummaryStep(): void
|
||||
{
|
||||
$this->completePage->open();
|
||||
}
|
||||
|
|
@ -78,11 +78,16 @@ final class CheckoutCompleteContext implements Context
|
|||
* @Given I have confirmed order
|
||||
* @Given the visitor confirm his order
|
||||
* @Given the customer confirm his order
|
||||
* @Given the customer confirmed the order
|
||||
* @When I confirm my order
|
||||
* @When I try to confirm my order
|
||||
*/
|
||||
public function iConfirmMyOrder()
|
||||
public function iConfirmMyOrder(): void
|
||||
{
|
||||
if (!$this->completePage->isOpen()) {
|
||||
$this->completePage->open();
|
||||
}
|
||||
|
||||
$this->completePage->confirmOrder();
|
||||
}
|
||||
|
||||
|
|
@ -98,7 +103,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then my order's shipping address should be to :fullName
|
||||
*/
|
||||
public function iShouldSeeThisShippingAddressAsShippingAddress($fullName)
|
||||
public function iShouldSeeThisShippingAddressAsShippingAddress(string $fullName): void
|
||||
{
|
||||
$address = $this->sharedStorage->get('shipping_address_' . StringInflector::nameToLowercaseCode($fullName));
|
||||
|
||||
|
|
@ -108,7 +113,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then my order's billing address should be to :fullName
|
||||
*/
|
||||
public function iShouldSeeThisBillingAddressAsBillingAddress($fullName)
|
||||
public function iShouldSeeThisBillingAddressAsBillingAddress(string $fullName): void
|
||||
{
|
||||
$address = $this->sharedStorage->get('billing_address_' . StringInflector::nameToLowercaseCode($fullName));
|
||||
|
||||
|
|
@ -118,7 +123,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then address to :fullName should be used for both shipping and billing of my order
|
||||
*/
|
||||
public function iShouldSeeThisShippingAddressAsShippingAndBillingAddress($fullName)
|
||||
public function iShouldSeeThisShippingAddressAsShippingAndBillingAddress(string $fullName): void
|
||||
{
|
||||
$this->iShouldSeeThisShippingAddressAsShippingAddress($fullName);
|
||||
$this->iShouldSeeThisBillingAddressAsBillingAddress($fullName);
|
||||
|
|
@ -127,7 +132,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then I should have :quantity :productName products in the cart
|
||||
*/
|
||||
public function iShouldHaveProductsInTheCart($quantity, $productName)
|
||||
public function iShouldHaveProductsInTheCart(string $quantity, string $productName): void
|
||||
{
|
||||
Assert::true($this->completePage->hasItemWithProductAndQuantity($productName, $quantity));
|
||||
}
|
||||
|
|
@ -167,7 +172,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then my order promotion total should be :promotionTotal
|
||||
*/
|
||||
public function myOrderPromotionTotalShouldBe($promotionTotal)
|
||||
public function myOrderPromotionTotalShouldBe(string $promotionTotal): void
|
||||
{
|
||||
Assert::true($this->completePage->hasPromotionTotal($promotionTotal));
|
||||
}
|
||||
|
|
@ -175,7 +180,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then :promotionName should be applied to my order
|
||||
*/
|
||||
public function shouldBeAppliedToMyOrder($promotionName)
|
||||
public function shouldBeAppliedToMyOrder(string $promotionName): void
|
||||
{
|
||||
Assert::true($this->completePage->hasOrderPromotion($promotionName));
|
||||
}
|
||||
|
|
@ -183,7 +188,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then :promotionName should be applied to my order shipping
|
||||
*/
|
||||
public function shouldBeAppliedToMyOrderShipping($promotionName)
|
||||
public function shouldBeAppliedToMyOrderShipping(string $promotionName): void
|
||||
{
|
||||
Assert::true($this->completePage->hasShippingPromotion($promotionName));
|
||||
}
|
||||
|
|
@ -199,7 +204,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then my order's shipping method should be :shippingMethod
|
||||
*/
|
||||
public function myOrdersShippingMethodShouldBe(ShippingMethodInterface $shippingMethod)
|
||||
public function myOrdersShippingMethodShouldBe(ShippingMethodInterface $shippingMethod): void
|
||||
{
|
||||
Assert::true($this->completePage->hasShippingMethod($shippingMethod));
|
||||
}
|
||||
|
|
@ -207,7 +212,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then my order's payment method should be :paymentMethod
|
||||
*/
|
||||
public function myOrdersPaymentMethodShouldBe(PaymentMethodInterface $paymentMethod)
|
||||
public function myOrdersPaymentMethodShouldBe(PaymentMethodInterface $paymentMethod): void
|
||||
{
|
||||
Assert::same($this->completePage->getPaymentMethodName(), $paymentMethod->getName());
|
||||
}
|
||||
|
|
@ -215,7 +220,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then the :product product should have unit price :price
|
||||
*/
|
||||
public function theProductShouldHaveUnitPrice(ProductInterface $product, $price)
|
||||
public function theProductShouldHaveUnitPrice(ProductInterface $product, string $price): void
|
||||
{
|
||||
Assert::true($this->completePage->hasProductUnitPrice($product, $price));
|
||||
}
|
||||
|
|
@ -224,7 +229,7 @@ final class CheckoutCompleteContext implements Context
|
|||
* @Then /^I should be notified that (this product) does not have sufficient stock$/
|
||||
* @Then I should be notified that product :product does not have sufficient stock
|
||||
*/
|
||||
public function iShouldBeNotifiedThatThisProductDoesNotHaveSufficientStock(ProductInterface $product)
|
||||
public function iShouldBeNotifiedThatThisProductDoesNotHaveSufficientStock(ProductInterface $product): void
|
||||
{
|
||||
Assert::true($this->completePage->hasProductOutOfStockValidationMessage($product));
|
||||
}
|
||||
|
|
@ -232,7 +237,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then /^I should not be notified that (this product) does not have sufficient stock$/
|
||||
*/
|
||||
public function iShouldNotBeNotifiedThatThisProductDoesNotHaveSufficientStock(ProductInterface $product)
|
||||
public function iShouldNotBeNotifiedThatThisProductDoesNotHaveSufficientStock(ProductInterface $product): void
|
||||
{
|
||||
Assert::false($this->completePage->hasProductOutOfStockValidationMessage($product));
|
||||
}
|
||||
|
|
@ -248,7 +253,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then I should see :provinceName in the shipping address
|
||||
*/
|
||||
public function iShouldSeeInTheShippingAddress($provinceName)
|
||||
public function iShouldSeeInTheShippingAddress(string $provinceName): void
|
||||
{
|
||||
Assert::true($this->completePage->hasShippingProvinceName($provinceName));
|
||||
}
|
||||
|
|
@ -256,7 +261,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then I should see :provinceName in the billing address
|
||||
*/
|
||||
public function iShouldSeeInTheBillingAddress($provinceName)
|
||||
public function iShouldSeeInTheBillingAddress(string $provinceName): void
|
||||
{
|
||||
Assert::true($this->completePage->hasBillingProvinceName($provinceName));
|
||||
}
|
||||
|
|
@ -264,7 +269,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then I should not see any information about payment method
|
||||
*/
|
||||
public function iShouldNotSeeAnyInformationAboutPaymentMethod()
|
||||
public function iShouldNotSeeAnyInformationAboutPaymentMethod(): void
|
||||
{
|
||||
Assert::false($this->completePage->hasPaymentMethod());
|
||||
}
|
||||
|
|
@ -272,7 +277,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then I should not be able to confirm order because products do not fit :shippingMethod requirements
|
||||
*/
|
||||
public function iShouldNotBeAbleToConfirmOrderBecauseDoNotBelongsToShippingCategory(ShippingMethodInterface $shippingMethod)
|
||||
public function iShouldNotBeAbleToConfirmOrderBecauseDoNotBelongsToShippingCategory(ShippingMethodInterface $shippingMethod): void
|
||||
{
|
||||
$this->completePage->confirmOrder();
|
||||
|
||||
|
|
@ -288,7 +293,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then /^I should be informed that (this promotion) is no longer applied$/
|
||||
*/
|
||||
public function iShouldBeInformedThatMyPromotionIsNoLongerApplied(PromotionInterface $promotion)
|
||||
public function iShouldBeInformedThatMyPromotionIsNoLongerApplied(PromotionInterface $promotion): void
|
||||
{
|
||||
$this->notificationChecker->checkNotification(
|
||||
sprintf('You are no longer eligible for this promotion %s.', $promotion->getName()),
|
||||
|
|
@ -299,7 +304,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then /^I should be informed that (this payment method) has been disabled$/
|
||||
*/
|
||||
public function iShouldBeInformedThatThisPaymentMethodHasBeenDisabled(PaymentMethodInterface $paymentMethod)
|
||||
public function iShouldBeInformedThatThisPaymentMethodHasBeenDisabled(PaymentMethodInterface $paymentMethod): void
|
||||
{
|
||||
Assert::same(
|
||||
$this->completePage->getValidationErrors(),
|
||||
|
|
@ -313,7 +318,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then /^I should be informed that (this product) has been disabled$/
|
||||
*/
|
||||
public function iShouldBeInformedThatThisProductHasBeenDisabled(ProductInterface $product)
|
||||
public function iShouldBeInformedThatThisProductHasBeenDisabled(ProductInterface $product): void
|
||||
{
|
||||
Assert::same(
|
||||
$this->completePage->getValidationErrors(),
|
||||
|
|
@ -347,7 +352,7 @@ final class CheckoutCompleteContext implements Context
|
|||
/**
|
||||
* @Then /^I should be informed that (this variant) has been disabled$/
|
||||
*/
|
||||
public function iShouldBeInformedThatThisVariantHasBeenDisabled(ProductVariantInterface $productVariant)
|
||||
public function iShouldBeInformedThatThisVariantHasBeenDisabled(ProductVariantInterface $productVariant): void
|
||||
{
|
||||
Assert::same(
|
||||
$this->completePage->getValidationErrors(),
|
||||
|
|
|
|||
|
|
@ -398,7 +398,7 @@ class ShowPage extends SymfonyPage implements ShowPageInterface
|
|||
'cancel_order' => '[data-test-cancel-order]',
|
||||
'currency' => '[data-test-currency]',
|
||||
'customer_email' => '[data-test-customer] [data-test-email]',
|
||||
'ip_address' => '#ipAddress',
|
||||
'ip_address' => '[data-test-ip-address]',
|
||||
'item' => '[data-test-item="%name%"]',
|
||||
'items_total' => '[data-test-items-total]',
|
||||
'notes' => '[data-test-notes]',
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@
|
|||
</service>
|
||||
|
||||
<service id="sylius.behat.context.api.admin.managing_product_variants" class="Sylius\Behat\Context\Api\Admin\ManagingProductVariantsContext">
|
||||
<argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" />
|
||||
<argument type="service" id="sylius.resolver.product_variant" />
|
||||
<argument type="service" id="sylius.behat.api_platform_client.admin" />
|
||||
<argument type="service" id="Sylius\Behat\Client\ResponseCheckerInterface" />
|
||||
<argument type="service" id="api_platform.symfony.iri_converter" />
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
<argument type="service" id="sylius.behat.api_platform_client.admin" />
|
||||
<argument type="service" id="Sylius\Behat\Client\ResponseCheckerInterface" />
|
||||
<argument type="service" id="sylius.behat.shared_storage" />
|
||||
<argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" />
|
||||
<argument type="service" id="sylius.resolver.product_variant" />
|
||||
<argument type="service" id="api_platform.iri_converter" />
|
||||
<argument type="service" id="sylius.behat.request_factory" />
|
||||
<argument>%sylius.security.new_api_route%</argument>
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
<argument type="service" id="sylius.repository.shipping_method" />
|
||||
<argument type="service" id="sylius.repository.order" />
|
||||
<argument type="service" id="sylius.repository.payment_method" />
|
||||
<argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" />
|
||||
<argument type="service" id="sylius.resolver.product_variant" />
|
||||
<argument type="service" id="api_platform.iri_converter" />
|
||||
<argument type="service" id="sylius.behat.shared_storage" />
|
||||
<argument type="service" id="sylius.behat.request_factory" />
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<argument type="service" id="sylius.repository.address"/>
|
||||
<argument type="service" id="sylius.repository.adjustment"/>
|
||||
<argument type="service" id="sylius.manager.order"/>
|
||||
<argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface"/>
|
||||
<argument type="service" id="sylius.resolver.product_variant"/>
|
||||
<argument type="service" id="sylius.unpaid_orders_state_updater" />
|
||||
</service>
|
||||
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<service id="Sylius\Behat\Context\Domain\ManagingPriceHistoryContext">
|
||||
<argument type="service" id="sylius.repository.channel_pricing_log_entry" />
|
||||
<argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" />
|
||||
<argument type="service" id="sylius.resolver.product_variant" />
|
||||
<argument type="service" id="Sylius\Bundle\CoreBundle\PriceHistory\Remover\ChannelPricingLogEntriesRemoverInterface" />
|
||||
</service>
|
||||
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
|
||||
<service id="sylius.behat.context.domain.cart" class="Sylius\Behat\Context\Domain\CartContext">
|
||||
<argument type="service" id="sylius.manager.order" />
|
||||
<argument type="service" id="sylius.expired_carts_remover" />
|
||||
<argument type="service" id="sylius.remover.expired_carts" />
|
||||
</service>
|
||||
|
||||
<service id="sylius.behat.context.domain.managing_shipping_methods" class="Sylius\Behat\Context\Domain\ManagingShippingMethodsContext">
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
<service id="sylius.behat.context.setup.cart" class="Sylius\Behat\Context\Setup\CartContext">
|
||||
<argument type="service" id="sylius.repository.order" />
|
||||
<argument type="service" id="sylius.command_bus" />
|
||||
<argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" />
|
||||
<argument type="service" id="sylius.resolver.product_variant" />
|
||||
<argument type="service" id="sylius.random_generator" />
|
||||
<argument type="service" id="sylius.behat.shared_storage" />
|
||||
</service>
|
||||
|
|
@ -126,8 +126,8 @@
|
|||
<argument type="service" id="sylius.repository.order" />
|
||||
<argument type="service" id="sylius.repository.payment_method" />
|
||||
<argument type="service" id="sylius.repository.shipping_method" />
|
||||
<argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" />
|
||||
<argument type="service" id="sylius.order_item_quantity_modifier" />
|
||||
<argument type="service" id="sylius.resolver.product_variant" />
|
||||
<argument type="service" id="sylius.modifier.order_item_quantity" />
|
||||
<argument type="service" id="doctrine.orm.entity_manager" />
|
||||
<argument type="service" id="sylius.behat.clock" />
|
||||
<argument type="service" id="Sylius\Resource\Generator\RandomnessGeneratorInterface" />
|
||||
|
|
@ -147,7 +147,7 @@
|
|||
<service id="Sylius\Behat\Context\Setup\PriceHistoryContext">
|
||||
<argument type="service" id="sylius.behat.context.setup.calendar" />
|
||||
<argument type="service" id="sylius.manager.channel_pricing" />
|
||||
<argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" />
|
||||
<argument type="service" id="sylius.resolver.product_variant" />
|
||||
</service>
|
||||
|
||||
<service id="sylius.behat.context.setup.product" class="Sylius\Behat\Context\Setup\ProductContext">
|
||||
|
|
@ -165,7 +165,7 @@
|
|||
<argument type="service" id="doctrine.orm.entity_manager" />
|
||||
<argument type="service" id="sylius.generator.product_variant" />
|
||||
<argument type="service" id="sylius.repository.product_variant" />
|
||||
<argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" />
|
||||
<argument type="service" id="sylius.resolver.product_variant" />
|
||||
<argument type="service" id="sylius.image_uploader" />
|
||||
<argument type="service" id="sylius.generator.slug" />
|
||||
<argument type="service" id="behat.mink.parameters" />
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@
|
|||
|
||||
<service id="sylius.behat.context.ui.admin.browsing_product_variants" class="Sylius\Behat\Context\Ui\Admin\BrowsingProductVariantsContext">
|
||||
<argument type="service" id="sylius.behat.page.admin.product_variant.index" />
|
||||
<argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" />
|
||||
<argument type="service" id="sylius.resolver.product_variant" />
|
||||
</service>
|
||||
|
||||
<service id="sylius.behat.context.ui.admin.managing_promotions" class="Sylius\Behat\Context\Ui\Admin\ManagingPromotionsContext">
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ default:
|
|||
- sylius.behat.context.transform.user
|
||||
- sylius.behat.context.transform.zone
|
||||
- Sylius\Behat\Context\Transform\CatalogPromotionContext
|
||||
- sylius.behat.context.transform.customer
|
||||
|
||||
- sylius.behat.context.setup.address
|
||||
- sylius.behat.context.setup.admin_user
|
||||
|
|
@ -48,14 +49,13 @@ default:
|
|||
- sylius.behat.context.setup.user
|
||||
- sylius.behat.context.setup.zone
|
||||
- Sylius\Behat\Context\Setup\CatalogPromotionContext
|
||||
- sylius.behat.context.setup.order
|
||||
|
||||
- sylius.behat.context.api.shop.cart
|
||||
- sylius.behat.context.api.shop.channel
|
||||
- sylius.behat.context.api.shop.address
|
||||
- sylius.behat.context.api.shop.checkout
|
||||
- sylius.behat.context.api.shop.login
|
||||
- sylius.behat.context.api.shop.order
|
||||
|
||||
- sylius.behat.context.api.email
|
||||
|
||||
filters:
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ default:
|
|||
- sylius.behat.context.ui.shop.checkout.addressing
|
||||
- sylius.behat.context.ui.shop.checkout.complete
|
||||
- sylius.behat.context.ui.shop.currency
|
||||
- sylius.behat.context.ui.shop.checkout.thank_you
|
||||
|
||||
filters:
|
||||
tags: "@managing_orders&&@ui"
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
# This file is part of the Sylius package.
|
||||
# (c) Sylius Sp. z o.o.
|
||||
|
||||
jms_serializer:
|
||||
metadata:
|
||||
directories:
|
||||
sylius-addressing:
|
||||
namespace_prefix: "Sylius\\Component\\Addressing"
|
||||
path: "@SyliusAddressingBundle/Resources/config/serializer"
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
Sylius\Component\Addressing\Model\Address:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: address
|
||||
properties:
|
||||
id:
|
||||
expose: true
|
||||
type: integer
|
||||
xml_attribute: true
|
||||
firstName:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
lastName:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
street:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
city:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
postcode:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
phoneNumber:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
countryCode:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
provinceCode:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
provinceName:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
Sylius\Component\Addressing\Model\Country:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: country
|
||||
properties:
|
||||
id:
|
||||
expose: true
|
||||
type: integer
|
||||
xml_attribute: true
|
||||
groups: [Default, Detailed]
|
||||
code:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
enabled:
|
||||
expose: true
|
||||
type: boolean
|
||||
groups: [Detailed]
|
||||
provinces:
|
||||
expose: true
|
||||
type: iterable
|
||||
groups: [Detailed]
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
Sylius\Component\Addressing\Model\Province:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: province
|
||||
properties:
|
||||
id:
|
||||
expose: true
|
||||
type: integer
|
||||
xml_attribute: true
|
||||
groups: [Default, Detailed]
|
||||
code:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
name:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
abbreviation:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Detailed]
|
||||
createdAt:
|
||||
expose: true
|
||||
type: DateTime
|
||||
groups: [Detailed]
|
||||
updatedAt:
|
||||
expose: true
|
||||
type: DateTime
|
||||
groups: [Detailed]
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
Sylius\Component\Addressing\Model\Zone:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: zone
|
||||
properties:
|
||||
id:
|
||||
expose: true
|
||||
type: integer
|
||||
xml_attribute: true
|
||||
groups: [Default, Detailed]
|
||||
code:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
name:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
type:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
scope:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Detailed]
|
||||
members:
|
||||
expose: true
|
||||
type: iterable
|
||||
groups: [Detailed]
|
||||
createdAt:
|
||||
expose: true
|
||||
type: DateTime
|
||||
groups: [Detailed]
|
||||
updatedAt:
|
||||
expose: true
|
||||
type: DateTime
|
||||
groups: [Detailed]
|
||||
|
|
@ -41,7 +41,6 @@
|
|||
"doctrine/data-fixtures": "^1.4",
|
||||
"doctrine/doctrine-bundle": "^2.3.1",
|
||||
"doctrine/orm": "^2.13",
|
||||
"jms/serializer-bundle": "^5.0",
|
||||
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
|
||||
"phpspec/phpspec": "^7.2",
|
||||
"phpspec/prophecy-phpunit": "^2.0",
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ class AppKernel extends Kernel
|
|||
{
|
||||
return [
|
||||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
|
||||
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||
new Sylius\Bundle\AddressingBundle\SyliusAddressingBundle(),
|
||||
|
|
|
|||
|
|
@ -180,6 +180,8 @@ twig_hooks:
|
|||
template: '@SyliusAdmin/order/show/content/sections/general/language.html.twig'
|
||||
channel:
|
||||
template: '@SyliusAdmin/order/show/content/sections/general/channel.html.twig'
|
||||
ip_address:
|
||||
template: '@SyliusAdmin/order/show/content/sections/general/ip_address.html.twig'
|
||||
notes:
|
||||
template: '@SyliusAdmin/order/show/content/sections/general/notes.html.twig'
|
||||
|
||||
|
|
|
|||
|
|
@ -79,12 +79,12 @@ sylius_grid:
|
|||
options:
|
||||
fields: [name, code]
|
||||
channel:
|
||||
type: entities
|
||||
type: entity
|
||||
label: sylius.ui.channel
|
||||
form_options:
|
||||
class: "%sylius.model.channel.class%"
|
||||
options:
|
||||
field: channels.id
|
||||
fields: [channels.id]
|
||||
startDate:
|
||||
type: date
|
||||
label: sylius.ui.start_date
|
||||
|
|
|
|||
|
|
@ -55,12 +55,12 @@ sylius_grid:
|
|||
type: boolean
|
||||
label: sylius.ui.enabled
|
||||
channel:
|
||||
type: entities
|
||||
type: entity
|
||||
label: sylius.ui.channel
|
||||
form_options:
|
||||
class: "%sylius.model.channel.class%"
|
||||
options:
|
||||
field: "channels.id"
|
||||
fields: [channels.id]
|
||||
taxon:
|
||||
type: ux_translatable_autocomplete
|
||||
label: sylius.ui.taxon
|
||||
|
|
|
|||
|
|
@ -68,12 +68,12 @@ sylius_grid:
|
|||
options:
|
||||
field: product.enabled
|
||||
channel:
|
||||
type: entities
|
||||
type: entity
|
||||
label: sylius.ui.channel
|
||||
form_options:
|
||||
class: "%sylius.model.channel.class%"
|
||||
options:
|
||||
field: product.channels.id
|
||||
fields: [product.channels.id]
|
||||
actions:
|
||||
main:
|
||||
update_positions:
|
||||
|
|
|
|||
|
|
@ -11,7 +11,11 @@
|
|||
|
||||
-->
|
||||
|
||||
<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
|
||||
<container
|
||||
xmlns="http://symfony.com/schema/dic/services"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
|
||||
>
|
||||
<imports>
|
||||
<import resource="twig/**/*.xml" />
|
||||
</imports>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@sylius-ui/admin",
|
||||
"version": "1.0.0",
|
||||
"version": "2.0.0-alpha-1",
|
||||
"license": "MIT",
|
||||
"author": "Sylius Sp. z o.o.",
|
||||
"dependencies": {
|
||||
|
|
@ -30,5 +30,12 @@
|
|||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/Sylius/SyliusAdminBundle.git"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"./package.json",
|
||||
"./README.md",
|
||||
"./LICENSE",
|
||||
"./index.js",
|
||||
"./Resources/assets/"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
{% set order = hookable_metadata.context.resource %}
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<strong>{{ 'sylius.ui.ip_address'|trans }}:</strong>
|
||||
</div>
|
||||
<div class="mb-3" {{ sylius_test_html_attribute('ip-address') }}>
|
||||
{{ order.customerIp|default('-') }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -41,7 +41,6 @@ return [
|
|||
Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true],
|
||||
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
|
||||
winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true],
|
||||
JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true],
|
||||
Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true],
|
||||
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
|
||||
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
|
||||
|
|
|
|||
|
|
@ -1,552 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Sylius package.
|
||||
*
|
||||
* (c) Sylius Sp. z o.o.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Sylius\Bundle\ApiBundle\ApiPlatform\Metadata\Extractor;
|
||||
|
||||
use ApiPlatform\Elasticsearch\State\Options;
|
||||
use ApiPlatform\Metadata\Exception\InvalidArgumentException;
|
||||
use ApiPlatform\Metadata\Extractor\AbstractResourceExtractor;
|
||||
use ApiPlatform\Metadata\Extractor\ResourceExtractorTrait;
|
||||
use ApiPlatform\Metadata\Extractor\XmlPropertyExtractor;
|
||||
use ApiPlatform\Metadata\Extractor\XmlResourceExtractor as BaseXmlResourceExtractor;
|
||||
use ApiPlatform\Metadata\GetCollection;
|
||||
use ApiPlatform\Metadata\HeaderParameter;
|
||||
use ApiPlatform\Metadata\Post;
|
||||
use ApiPlatform\Metadata\QueryParameter;
|
||||
use ApiPlatform\OpenApi\Model\ExternalDocumentation;
|
||||
use ApiPlatform\OpenApi\Model\Operation as OpenApiOperation;
|
||||
use ApiPlatform\OpenApi\Model\Parameter as OpenApiParameter;
|
||||
use ApiPlatform\OpenApi\Model\RequestBody;
|
||||
use ApiPlatform\State\OptionsInterface;
|
||||
use Symfony\Component\Config\Util\XmlUtils;
|
||||
use Symfony\Component\WebLink\Link;
|
||||
|
||||
/**
|
||||
* This class overrides the {@see \ApiPlatform\Metadata\Extractor\XmlResourceExtractor}
|
||||
* to remove the setting of an incorrect class value when passing it as a parameter
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
final class XmlResourceExtractor extends AbstractResourceExtractor
|
||||
{
|
||||
use ResourceExtractorTrait;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
protected function extractPath(string $path): void
|
||||
{
|
||||
try {
|
||||
/** @var \SimpleXMLElement $xml */
|
||||
$xml = simplexml_import_dom(XmlUtils::loadFile($path, BaseXmlResourceExtractor::SCHEMA));
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
// Ensure it's not a resource
|
||||
try {
|
||||
simplexml_import_dom(XmlUtils::loadFile($path, XmlPropertyExtractor::SCHEMA));
|
||||
} catch (\InvalidArgumentException) {
|
||||
throw new InvalidArgumentException(\sprintf('Error while parsing %s: %s', $path, $e->getMessage()), $e->getCode(), $e);
|
||||
}
|
||||
|
||||
// It's a property: ignore error
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($xml->resource as $resource) {
|
||||
$base = $this->buildExtendedBase($resource);
|
||||
$this->resources[$this->resolve((string) $resource['class'])][] = array_merge($base, [
|
||||
'operations' => $this->buildOperations($resource, $base),
|
||||
'graphQlOperations' => $this->buildGraphQlOperations($resource, $base),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
private function buildExtendedBase(\SimpleXMLElement $resource): array
|
||||
{
|
||||
return array_merge($this->buildBase($resource), [
|
||||
'uriTemplate' => $this->phpize($resource, 'uriTemplate', 'string'),
|
||||
'routePrefix' => $this->phpize($resource, 'routePrefix', 'string'),
|
||||
'stateless' => $this->phpize($resource, 'stateless', 'bool'),
|
||||
'sunset' => $this->phpize($resource, 'sunset', 'string'),
|
||||
'acceptPatch' => $this->phpize($resource, 'acceptPatch', 'string'),
|
||||
'status' => $this->phpize($resource, 'status', 'integer'),
|
||||
'host' => $this->phpize($resource, 'host', 'string'),
|
||||
'condition' => $this->phpize($resource, 'condition', 'string'),
|
||||
'controller' => $this->phpize($resource, 'controller', 'string'),
|
||||
'types' => $this->buildArrayValue($resource, 'type'),
|
||||
'formats' => $this->buildFormats($resource, 'formats'),
|
||||
'inputFormats' => $this->buildFormats($resource, 'inputFormats'),
|
||||
'outputFormats' => $this->buildFormats($resource, 'outputFormats'),
|
||||
'uriVariables' => $this->buildUriVariables($resource),
|
||||
'defaults' => isset($resource->defaults->values) ? $this->buildValues($resource->defaults->values) : null,
|
||||
'requirements' => $this->buildRequirements($resource),
|
||||
'options' => isset($resource->options->values) ? $this->buildValues($resource->options->values) : null,
|
||||
'schemes' => $this->buildArrayValue($resource, 'scheme'),
|
||||
'cacheHeaders' => $this->buildCacheHeaders($resource),
|
||||
'hydraContext' => isset($resource->hydraContext->values) ? $this->buildValues($resource->hydraContext->values) : null,
|
||||
'openapiContext' => isset($resource->openapiContext->values) ? $this->buildValues($resource->openapiContext->values) : null, // TODO Remove in 4.0
|
||||
'openapi' => $this->buildOpenapi($resource),
|
||||
'paginationViaCursor' => $this->buildPaginationViaCursor($resource),
|
||||
'exceptionToStatus' => $this->buildExceptionToStatus($resource),
|
||||
'queryParameterValidationEnabled' => $this->phpize($resource, 'queryParameterValidationEnabled', 'bool'),
|
||||
'stateOptions' => $this->buildStateOptions($resource),
|
||||
'links' => $this->buildLinks($resource),
|
||||
'headers' => $this->buildHeaders($resource),
|
||||
'parameters' => $this->buildParameters($resource),
|
||||
]);
|
||||
}
|
||||
|
||||
private function buildBase(\SimpleXMLElement $resource): array
|
||||
{
|
||||
return [
|
||||
'shortName' => $this->phpize($resource, 'shortName', 'string'),
|
||||
'description' => $this->phpize($resource, 'description', 'string'),
|
||||
'urlGenerationStrategy' => $this->phpize($resource, 'urlGenerationStrategy', 'integer'),
|
||||
'deprecationReason' => $this->phpize($resource, 'deprecationReason', 'string'),
|
||||
'elasticsearch' => $this->phpize($resource, 'elasticsearch', 'bool'),
|
||||
'messenger' => $this->phpize($resource, 'messenger', 'bool|string'),
|
||||
'mercure' => $this->buildMercure($resource),
|
||||
'input' => $this->phpize($resource, 'input', 'bool|string'),
|
||||
'output' => $this->phpize($resource, 'output', 'bool|string'),
|
||||
'fetchPartial' => $this->phpize($resource, 'fetchPartial', 'bool'),
|
||||
'forceEager' => $this->phpize($resource, 'forceEager', 'bool'),
|
||||
'paginationClientEnabled' => $this->phpize($resource, 'paginationClientEnabled', 'bool'),
|
||||
'paginationClientItemsPerPage' => $this->phpize($resource, 'paginationClientItemsPerPage', 'bool'),
|
||||
'paginationClientPartial' => $this->phpize($resource, 'paginationClientPartial', 'bool'),
|
||||
'paginationEnabled' => $this->phpize($resource, 'paginationEnabled', 'bool'),
|
||||
'paginationFetchJoinCollection' => $this->phpize($resource, 'paginationFetchJoinCollection', 'bool'),
|
||||
'paginationUseOutputWalkers' => $this->phpize($resource, 'paginationUseOutputWalkers', 'bool'),
|
||||
'paginationItemsPerPage' => $this->phpize($resource, 'paginationItemsPerPage', 'integer'),
|
||||
'paginationMaximumItemsPerPage' => $this->phpize($resource, 'paginationMaximumItemsPerPage', 'integer'),
|
||||
'paginationPartial' => $this->phpize($resource, 'paginationPartial', 'bool'),
|
||||
'paginationType' => $this->phpize($resource, 'paginationType', 'string'),
|
||||
'processor' => $this->phpize($resource, 'processor', 'string'),
|
||||
'provider' => $this->phpize($resource, 'provider', 'string'),
|
||||
'security' => $this->phpize($resource, 'security', 'string'),
|
||||
'securityMessage' => $this->phpize($resource, 'securityMessage', 'string'),
|
||||
'securityPostDenormalize' => $this->phpize($resource, 'securityPostDenormalize', 'string'),
|
||||
'securityPostDenormalizeMessage' => $this->phpize($resource, 'securityPostDenormalizeMessage', 'string'),
|
||||
'securityPostValidation' => $this->phpize($resource, 'securityPostValidation', 'string'),
|
||||
'securityPostValidationMessage' => $this->phpize($resource, 'securityPostValidationMessage', 'string'),
|
||||
'normalizationContext' => isset($resource->normalizationContext->values) ? $this->buildValues($resource->normalizationContext->values) : null,
|
||||
'denormalizationContext' => isset($resource->denormalizationContext->values) ? $this->buildValues($resource->denormalizationContext->values) : null,
|
||||
'collectDenormalizationErrors' => $this->phpize($resource, 'collectDenormalizationErrors', 'bool'),
|
||||
'validationContext' => isset($resource->validationContext->values) ? $this->buildValues($resource->validationContext->values) : null,
|
||||
'filters' => $this->buildArrayValue($resource, 'filter'),
|
||||
'order' => isset($resource->order->values) ? $this->buildValues($resource->order->values) : null,
|
||||
'extraProperties' => $this->buildExtraProperties($resource, 'extraProperties'),
|
||||
'read' => $this->phpize($resource, 'read', 'bool'),
|
||||
'write' => $this->phpize($resource, 'write', 'bool'),
|
||||
];
|
||||
}
|
||||
|
||||
private function buildFormats(\SimpleXMLElement $resource, string $key): ?array
|
||||
{
|
||||
if (!isset($resource->{$key}->format)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
foreach ($resource->{$key}->format as $format) {
|
||||
if (isset($format['name'])) {
|
||||
$data[(string) $format['name']] = (string) $format;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$data[] = (string) $format;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function buildOpenapi(\SimpleXMLElement $resource): bool|OpenApiOperation|null
|
||||
{
|
||||
if (!isset($resource->openapi) && !isset($resource['openapi'])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (isset($resource['openapi']) && \in_array((string) $resource['openapi'], ['1', '0', 'true', 'false'], true)) {
|
||||
return $this->phpize($resource, 'openapi', 'bool');
|
||||
}
|
||||
|
||||
$openapi = $resource->openapi;
|
||||
$data = [];
|
||||
$attributes = $openapi->attributes();
|
||||
foreach ($attributes as $attribute) {
|
||||
$data[$attribute->getName()] = $this->phpize($attributes, 'deprecated', 'deprecated' === $attribute->getName() ? 'bool' : 'string');
|
||||
}
|
||||
|
||||
$data['tags'] = $this->buildArrayValue($resource, 'tag');
|
||||
|
||||
if (isset($openapi->responses->response)) {
|
||||
foreach ($openapi->responses->response as $response) {
|
||||
$data['responses'][(string) $response->attributes()->status] = [
|
||||
'description' => $this->phpize($response, 'description', 'string'),
|
||||
'content' => isset($response->content->values) ? $this->buildValues($response->content->values) : null,
|
||||
'headers' => isset($response->headers->values) ? $this->buildValues($response->headers->values) : null,
|
||||
'links' => isset($response->links->values) ? $this->buildValues($response->links->values) : null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$data['externalDocs'] = isset($openapi->externalDocs) ? new ExternalDocumentation(
|
||||
description: $this->phpize($resource, 'description', 'string'),
|
||||
url: $this->phpize($resource, 'url', 'string'),
|
||||
) : null;
|
||||
|
||||
if (isset($openapi->parameters->parameter)) {
|
||||
foreach ($openapi->parameters->parameter as $parameter) {
|
||||
$data['parameters'][(string) $parameter->attributes()->name] = new OpenApiParameter(
|
||||
name: $this->phpize($parameter, 'name', 'string'),
|
||||
in: $this->phpize($parameter, 'in', 'string'),
|
||||
description: $this->phpize($parameter, 'description', 'string'),
|
||||
required: $this->phpize($parameter, 'required', 'bool'),
|
||||
deprecated: $this->phpize($parameter, 'deprecated', 'bool'),
|
||||
allowEmptyValue: $this->phpize($parameter, 'allowEmptyValue', 'bool'),
|
||||
schema: isset($parameter->schema->values) ? $this->buildValues($parameter->schema->values) : null,
|
||||
style: $this->phpize($parameter, 'style', 'string'),
|
||||
explode: $this->phpize($parameter, 'explode', 'bool'),
|
||||
allowReserved: $this->phpize($parameter, 'allowReserved', 'bool'),
|
||||
example: $this->phpize($parameter, 'example', 'string'),
|
||||
examples: isset($parameter->examples->values) ? new \ArrayObject($this->buildValues($parameter->examples->values)) : null,
|
||||
content: isset($parameter->content->values) ? new \ArrayObject($this->buildValues($parameter->content->values)) : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
$data['requestBody'] = isset($openapi->requestBody) ? new RequestBody(
|
||||
description: $this->phpize($openapi->requestBody, 'description', 'string'),
|
||||
content: isset($openapi->requestBody->content->values) ? new \ArrayObject($this->buildValues($openapi->requestBody->content->values)) : null,
|
||||
required: $this->phpize($openapi->requestBody, 'required', 'bool'),
|
||||
) : null;
|
||||
|
||||
$data['callbacks'] = isset($openapi->callbacks->values) ? new \ArrayObject($this->buildValues($openapi->callbacks->values)) : null;
|
||||
|
||||
$data['security'] = isset($openapi->security->values) ? $this->buildValues($openapi->security->values) : null;
|
||||
|
||||
if (isset($openapi->servers->server)) {
|
||||
foreach ($openapi->servers->server as $server) {
|
||||
$data['servers'][] = [
|
||||
'description' => $this->phpize($server, 'description', 'string'),
|
||||
'url' => $this->phpize($server, 'url', 'string'),
|
||||
'variables' => isset($server->variables->values) ? $this->buildValues($server->variables->values) : null,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$data['extensionProperties'] = isset($openapi->extensionProperties->values) ? $this->buildValues($openapi->extensionProperties->values) : null;
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
if (null === $value) {
|
||||
unset($data[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
return new OpenApiOperation(...$data);
|
||||
}
|
||||
|
||||
private function buildUriVariables(\SimpleXMLElement $resource): ?array
|
||||
{
|
||||
if (!isset($resource->uriVariables->uriVariable)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$uriVariables = [];
|
||||
foreach ($resource->uriVariables->uriVariable as $data) {
|
||||
$parameterName = (string) $data['parameterName'];
|
||||
if (1 === (null === $data->attributes() ? 0 : \count($data->attributes()))) {
|
||||
$uriVariables[$parameterName] = $parameterName;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($fromProperty = $this->phpize($data, 'fromProperty', 'string')) {
|
||||
$uriVariables[$parameterName]['from_property'] = $fromProperty;
|
||||
}
|
||||
if ($toProperty = $this->phpize($data, 'toProperty', 'string')) {
|
||||
$uriVariables[$parameterName]['to_property'] = $toProperty;
|
||||
}
|
||||
if ($fromClass = $this->resolve($this->phpize($data, 'fromClass', 'string'))) {
|
||||
$uriVariables[$parameterName]['from_class'] = $fromClass;
|
||||
}
|
||||
if ($toClass = $this->resolve($this->phpize($data, 'toClass', 'string'))) {
|
||||
$uriVariables[$parameterName]['to_class'] = $toClass;
|
||||
}
|
||||
if (isset($data->identifiers->values)) {
|
||||
$uriVariables[$parameterName]['identifiers'] = $this->buildValues($data->identifiers->values);
|
||||
}
|
||||
if (null !== ($compositeIdentifier = $this->phpize($data, 'compositeIdentifier', 'bool'))) {
|
||||
$uriVariables[$parameterName]['composite_identifier'] = $compositeIdentifier;
|
||||
}
|
||||
}
|
||||
|
||||
return $uriVariables;
|
||||
}
|
||||
|
||||
private function buildCacheHeaders(\SimpleXMLElement $resource): ?array
|
||||
{
|
||||
if (!isset($resource->cacheHeaders->cacheHeader)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
foreach ($resource->cacheHeaders->cacheHeader as $cacheHeader) {
|
||||
if (isset($cacheHeader->values->value)) {
|
||||
$data[(string) $cacheHeader['name']] = $this->buildValues($cacheHeader->values);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$data[(string) $cacheHeader['name']] = (string) $cacheHeader;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function buildRequirements(\SimpleXMLElement $resource): ?array
|
||||
{
|
||||
if (!isset($resource->requirements->requirement)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
foreach ($resource->requirements->requirement as $requirement) {
|
||||
$data[(string) $requirement->attributes()->property] = (string) $requirement;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function buildMercure(\SimpleXMLElement $resource): array|bool|null
|
||||
{
|
||||
if (!isset($resource->mercure)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (null !== $resource->mercure->attributes()->private) {
|
||||
return ['private' => $this->phpize($resource->mercure->attributes(), 'private', 'bool')];
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function buildPaginationViaCursor(\SimpleXMLElement $resource): ?array
|
||||
{
|
||||
if (!isset($resource->paginationViaCursor->paginationField)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
foreach ($resource->paginationViaCursor->paginationField as $paginationField) {
|
||||
$data[(string) $paginationField['field']] = (string) $paginationField['direction'];
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function buildExceptionToStatus(\SimpleXMLElement $resource): ?array
|
||||
{
|
||||
if (!isset($resource->exceptionToStatus->exception)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
foreach ($resource->exceptionToStatus->exception as $exception) {
|
||||
$data[(string) $exception['class']] = (int) $exception['statusCode'];
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function buildExtraProperties(\SimpleXMLElement $resource, ?string $key = null): ?array
|
||||
{
|
||||
if (null !== $key) {
|
||||
if (!isset($resource->{$key})) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$resource = $resource->{$key};
|
||||
}
|
||||
|
||||
return $this->buildValues($resource->values);
|
||||
}
|
||||
|
||||
private function buildOperations(\SimpleXMLElement $resource, array $root): ?array
|
||||
{
|
||||
if (!isset($resource->operations->operation)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
foreach ($resource->operations->operation as $operation) {
|
||||
$datum = $this->buildExtendedBase($operation);
|
||||
foreach ($datum as $key => $value) {
|
||||
if (null === $value) {
|
||||
$datum[$key] = $root[$key];
|
||||
}
|
||||
}
|
||||
|
||||
if (\in_array((string) $operation['class'], [GetCollection::class, Post::class], true)) {
|
||||
$datum['itemUriTemplate'] = $this->phpize($operation, 'itemUriTemplate', 'string');
|
||||
} elseif (isset($operation['itemUriTemplate'])) {
|
||||
throw new InvalidArgumentException(\sprintf('"itemUriTemplate" option is not allowed on a %s operation.', $operation['class']));
|
||||
}
|
||||
|
||||
$data[] = array_merge($datum, [
|
||||
'collection' => $this->phpize($operation, 'collection', 'bool'),
|
||||
'class' => (string) $operation['class'],
|
||||
'method' => $this->phpize($operation, 'method', 'string'),
|
||||
'read' => $this->phpize($operation, 'read', 'bool'),
|
||||
'deserialize' => $this->phpize($operation, 'deserialize', 'bool'),
|
||||
'validate' => $this->phpize($operation, 'validate', 'bool'),
|
||||
'write' => $this->phpize($operation, 'write', 'bool'),
|
||||
'serialize' => $this->phpize($operation, 'serialize', 'bool'),
|
||||
'queryParameterValidate' => $this->phpize($operation, 'queryParameterValidate', 'bool'),
|
||||
'priority' => $this->phpize($operation, 'priority', 'integer'),
|
||||
'name' => $this->phpize($operation, 'name', 'string'),
|
||||
'routeName' => $this->phpize($operation, 'routeName', 'string'),
|
||||
]);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function buildGraphQlOperations(\SimpleXMLElement $resource, array $root): ?array
|
||||
{
|
||||
if (!isset($resource->graphQlOperations->graphQlOperation)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
foreach ($resource->graphQlOperations->graphQlOperation as $operation) {
|
||||
$datum = $this->buildBase($operation);
|
||||
foreach ($datum as $key => $value) {
|
||||
if (null === $value) {
|
||||
$datum[$key] = $root[$key];
|
||||
}
|
||||
}
|
||||
|
||||
$data[] = array_merge($datum, [
|
||||
'resolver' => $this->phpize($operation, 'resolver', 'string'),
|
||||
'args' => $this->buildArgs($operation),
|
||||
'extraArgs' => $this->buildExtraArgs($operation),
|
||||
'class' => (string) $operation['class'],
|
||||
'read' => $this->phpize($operation, 'read', 'bool'),
|
||||
'deserialize' => $this->phpize($operation, 'deserialize', 'bool'),
|
||||
'validate' => $this->phpize($operation, 'validate', 'bool'),
|
||||
'write' => $this->phpize($operation, 'write', 'bool'),
|
||||
'serialize' => $this->phpize($operation, 'serialize', 'bool'),
|
||||
'priority' => $this->phpize($operation, 'priority', 'integer'),
|
||||
'name' => $this->phpize($operation, 'name', 'string'),
|
||||
]);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
private function buildStateOptions(\SimpleXMLElement $resource): ?OptionsInterface
|
||||
{
|
||||
$stateOptions = $resource->stateOptions ?? null;
|
||||
if (!$stateOptions) {
|
||||
return null;
|
||||
}
|
||||
$elasticsearchOptions = $stateOptions->elasticsearchOptions ?? null;
|
||||
if ($elasticsearchOptions) {
|
||||
if (class_exists(Options::class)) {
|
||||
return new Options(
|
||||
isset($elasticsearchOptions['index']) ? (string) $elasticsearchOptions['index'] : null,
|
||||
isset($elasticsearchOptions['type']) ? (string) $elasticsearchOptions['type'] : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Link[]
|
||||
*/
|
||||
private function buildLinks(\SimpleXMLElement $resource): ?array
|
||||
{
|
||||
if (!$resource->links) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$links = [];
|
||||
foreach ($resource->links as $link) {
|
||||
$links[] = new Link(rel: (string) $link->link->attributes()->rel, href: (string) $link->link->attributes()->href);
|
||||
}
|
||||
|
||||
return $links;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string>
|
||||
*/
|
||||
private function buildHeaders(\SimpleXMLElement $resource): ?array
|
||||
{
|
||||
if (!$resource->headers) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$headers = [];
|
||||
foreach ($resource->headers as $header) {
|
||||
$headers[(string) $header->header->attributes()->key] = (string) $header->header->attributes()->value;
|
||||
}
|
||||
|
||||
return $headers;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, \ApiPlatform\Metadata\Parameter>
|
||||
*/
|
||||
private function buildParameters(\SimpleXMLElement $resource): ?array
|
||||
{
|
||||
if (!$resource->parameters) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$parameters = [];
|
||||
foreach ($resource->parameters->parameter as $parameter) {
|
||||
$key = (string) $parameter->attributes()->key;
|
||||
$cl = ('header' === (string) $parameter->attributes()->in) ? HeaderParameter::class : QueryParameter::class;
|
||||
$parameters[$key] = new $cl(
|
||||
key: $key,
|
||||
required: $this->phpize($parameter, 'required', 'bool'),
|
||||
schema: isset($parameter->schema->values) ? $this->buildValues($parameter->schema->values) : null,
|
||||
openApi: isset($parameter->openapi) ? new OpenApiParameter(
|
||||
name: $this->phpize($parameter->openapi, 'name', 'string'),
|
||||
in: $this->phpize($parameter->openapi, 'in', 'string'),
|
||||
description: $this->phpize($parameter->openapi, 'description', 'string'),
|
||||
required: $this->phpize($parameter->openapi, 'required', 'bool'),
|
||||
deprecated: $this->phpize($parameter->openapi, 'deprecated', 'bool'),
|
||||
allowEmptyValue: $this->phpize($parameter->openapi, 'allowEmptyValue', 'bool'),
|
||||
schema: isset($parameter->openapi->schema->values) ? $this->buildValues($parameter->openapi->schema->values) : null,
|
||||
style: $this->phpize($parameter->openapi, 'style', 'string'),
|
||||
explode: $this->phpize($parameter->openapi, 'explode', 'bool'),
|
||||
allowReserved: $this->phpize($parameter->openapi, 'allowReserved', 'bool'),
|
||||
example: $this->phpize($parameter->openapi, 'example', 'string'),
|
||||
examples: isset($parameter->openapi->examples->values) ? new \ArrayObject($this->buildValues($parameter->openapi->examples->values)) : null,
|
||||
content: isset($parameter->openapi->content->values) ? new \ArrayObject($this->buildValues($parameter->openapi->content->values)) : null,
|
||||
) : null,
|
||||
provider: $this->phpize($parameter, 'provider', 'string'),
|
||||
filter: $this->phpize($parameter, 'filter', 'string'),
|
||||
property: $this->phpize($parameter, 'property', 'string'),
|
||||
description: $this->phpize($parameter, 'description', 'string'),
|
||||
priority: $this->phpize($parameter, 'priority', 'integer'),
|
||||
extraProperties: $this->buildExtraProperties($parameter, 'extraProperties') ?? [],
|
||||
);
|
||||
}
|
||||
|
||||
return $parameters;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Sylius package.
|
||||
*
|
||||
* (c) Sylius Sp. z o.o.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Sylius\Bundle\ApiBundle\DependencyInjection\Compiler;
|
||||
|
||||
use Sylius\Bundle\ApiBundle\ApiPlatform\Metadata\Extractor\XmlResourceExtractor;
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
||||
final class XmlResourceExtractorCompilerPass implements CompilerPassInterface
|
||||
{
|
||||
public function process(ContainerBuilder $container): void
|
||||
{
|
||||
if ($container->hasDefinition('api_platform.metadata.resource_extractor.xml')) {
|
||||
$definition = $container->getDefinition('api_platform.metadata.resource_extractor.xml');
|
||||
$definition->setClass(XmlResourceExtractor::class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -208,5 +208,9 @@
|
|||
<group>sylius:shop:cart:show</group>
|
||||
<group>sylius:shop:order:account:show</group>
|
||||
</attribute>
|
||||
|
||||
<attribute name="customerIp">
|
||||
<group>sylius:admin:order:show</group>
|
||||
</attribute>
|
||||
</class>
|
||||
</serializer>
|
||||
|
|
|
|||
|
|
@ -42,15 +42,15 @@
|
|||
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Cart\AddItemToCartHandler">
|
||||
<argument type="service" id="sylius.repository.order" />
|
||||
<argument type="service" id="sylius.repository.product_variant" />
|
||||
<argument type="service" id="sylius.order_modifier" />
|
||||
<argument type="service" id="sylius.modifier.order" />
|
||||
<argument type="service" id="sylius.factory.order_item" />
|
||||
<argument type="service" id="sylius.order_item_quantity_modifier" />
|
||||
<argument type="service" id="sylius.modifier.order_item_quantity" />
|
||||
<tag name="messenger.message_handler" bus="sylius.command_bus" />
|
||||
</service>
|
||||
|
||||
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Cart\RemoveItemFromCartHandler">
|
||||
<argument type="service" id="sylius.repository.order_item" />
|
||||
<argument type="service" id="sylius.order_modifier" />
|
||||
<argument type="service" id="sylius.modifier.order" />
|
||||
<tag name="messenger.message_handler" bus="sylius.command_bus" />
|
||||
</service>
|
||||
|
||||
|
|
@ -109,7 +109,7 @@
|
|||
|
||||
<service id="Sylius\Bundle\ApiBundle\CommandHandler\Cart\ChangeItemQuantityInCartHandler">
|
||||
<argument type="service" id="sylius.repository.order_item" />
|
||||
<argument type="service" id="sylius.order_item_quantity_modifier" />
|
||||
<argument type="service" id="sylius.modifier.order_item_quantity" />
|
||||
<argument type="service" id="sylius.order_processing.order_processor" />
|
||||
<tag name="messenger.message_handler" bus="sylius.command_bus" />
|
||||
</service>
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
</service>
|
||||
|
||||
<service id="Sylius\Bundle\ApiBundle\Serializer\ProductNormalizer">
|
||||
<argument type="service" id="Sylius\Component\Product\Resolver\ProductVariantResolverInterface" />
|
||||
<argument type="service" id="sylius.resolver.product_variant" />
|
||||
<argument type="service" id="api_platform.symfony.iri_converter" />
|
||||
<argument type="service" id="sylius.section_resolver.uri_based_section_resolver" />
|
||||
<tag name="serializer.normalizer" priority="64" />
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ declare(strict_types=1);
|
|||
namespace Sylius\Bundle\ApiBundle;
|
||||
|
||||
use Sylius\Bundle\ApiBundle\DependencyInjection\Compiler\LegacyErrorHandlingCompilerPass;
|
||||
use Sylius\Bundle\ApiBundle\DependencyInjection\Compiler\XmlResourceExtractorCompilerPass;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
|
|
@ -23,6 +22,5 @@ final class SyliusApiBundle extends Bundle
|
|||
public function build(ContainerBuilder $container): void
|
||||
{
|
||||
$container->addCompilerPass(new LegacyErrorHandlingCompilerPass());
|
||||
$container->addCompilerPass(new XmlResourceExtractorCompilerPass());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ final class ApiLoaderTest extends TestCase
|
|||
{
|
||||
use ProphecyTrait;
|
||||
|
||||
private ObjectProphecy|LoaderInterface $baseApiLoader;
|
||||
private LoaderInterface|ObjectProphecy $baseApiLoader;
|
||||
|
||||
private LoaderInterface $apiLoader;
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ final class ApiLoaderTest extends TestCase
|
|||
}
|
||||
|
||||
/** @test */
|
||||
function it_removes_routes_from_route_collection_loaded_by_base_api_loader(): void
|
||||
public function it_removes_routes_from_route_collection_loaded_by_base_api_loader(): void
|
||||
{
|
||||
$routeCollection = $this->prophesize(RouteCollection::class);
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ final class ApiLoaderTest extends TestCase
|
|||
}
|
||||
|
||||
/** @test */
|
||||
function it_uses_base_api_loader_for_supports_method(): void
|
||||
public function it_uses_base_api_loader_for_supports_method(): void
|
||||
{
|
||||
$this->baseApiLoader->supports('.', 'api_platform')->willReturn(true);
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ final class ApiLoaderTest extends TestCase
|
|||
}
|
||||
|
||||
/** @test */
|
||||
function it_uses_base_api_loader_to_get_resolver(): void
|
||||
public function it_uses_base_api_loader_to_get_resolver(): void
|
||||
{
|
||||
$loaderResolver = $this->prophesize(LoaderResolverInterface::class);
|
||||
|
||||
|
|
@ -84,7 +84,7 @@ final class ApiLoaderTest extends TestCase
|
|||
}
|
||||
|
||||
/** @test */
|
||||
function it_uses_base_api_loader_to_set_resolver(): void
|
||||
public function it_uses_base_api_loader_to_set_resolver(): void
|
||||
{
|
||||
$loaderResolver = $this->prophesize(LoaderResolverInterface::class);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
<resource class="%sylius.model.channel.class%">
|
||||
<operations>
|
||||
<operation
|
||||
name="test_channels_new_path_xml"
|
||||
name="test_channel_new_path_xml"
|
||||
class="ApiPlatform\Metadata\GetCollection"
|
||||
uriTemplate="/shop/channels-new-path-xml"
|
||||
>
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
</normalizationContext>
|
||||
</operation>
|
||||
|
||||
<operation name="sylius_api_shop_channel_get" class="ApiPlatform\Metadata\Get" uriTemplate="/shop/channels/new/{code}">
|
||||
<operation name="sylius_api_shop_channel_get" class="ApiPlatform\Metadata\Get" uriTemplate="/shop/channels/new-xml/{code}">
|
||||
<normalizationContext>
|
||||
<values>
|
||||
<value name="groups">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
resources:
|
||||
'%sylius.model.currency.class%':
|
||||
operations:
|
||||
ApiPlatform\Metadata\GetCollection:
|
||||
name: test_currency_new_path_yaml
|
||||
uriTemplate: '/shop/currencies-new-path-yaml'
|
||||
normalizationContext:
|
||||
groups: ['sylius:shop:currency:index']
|
||||
|
||||
ApiPlatform\Metadata\Get:
|
||||
name: sylius_api_shop_currency_get
|
||||
uriTemplate: '/shop/currencies/new-yaml/{code}'
|
||||
normalizationContext:
|
||||
groups: ['sylius:shop:currency:show']
|
||||
|
|
@ -41,7 +41,6 @@ return [
|
|||
Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true],
|
||||
winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true],
|
||||
Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true],
|
||||
JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true],
|
||||
Knp\Bundle\GaufretteBundle\KnpGaufretteBundle::class => ['all' => true],
|
||||
League\FlysystemBundle\FlysystemBundle::class => ['all' => true],
|
||||
Liip\ImagineBundle\LiipImagineBundle::class => ['all' => true],
|
||||
|
|
|
|||
|
|
@ -35,6 +35,15 @@ final class MergingConfigsTest extends ApiTestCase
|
|||
self::assertJsonContains(['@type' => 'hydra:Collection']);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_allows_to_add_a_new_operation_with_yaml(): void
|
||||
{
|
||||
static::createClient()->request('GET', '/api/v2/shop/currencies-new-path-yaml');
|
||||
|
||||
self::assertResponseIsSuccessful();
|
||||
self::assertJsonContains(['@type' => 'hydra:Collection']);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_allows_to_overwrite_an_existing_endpoint_with_xml(): void
|
||||
{
|
||||
|
|
@ -42,7 +51,19 @@ final class MergingConfigsTest extends ApiTestCase
|
|||
|
||||
self::assertResponseStatusCodeSame(404);
|
||||
|
||||
static::createClient()->request('GET', '/api/v2/shop/channels/new/WEB');
|
||||
static::createClient()->request('GET', '/api/v2/shop/channels/new-xml/WEB');
|
||||
|
||||
self::assertResponseIsSuccessful();
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_allows_to_overwrite_an_existing_endpoint_with_yaml(): void
|
||||
{
|
||||
static::createClient()->request('GET', '/api/v2/shop/currencies/USD');
|
||||
|
||||
self::assertResponseStatusCodeSame(404);
|
||||
|
||||
static::createClient()->request('GET', '/api/v2/shop/currencies/new-yaml/USD');
|
||||
|
||||
self::assertResponseIsSuccessful();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
"require": {
|
||||
"php": "^8.2",
|
||||
"doctrine/dbal": "^3.0",
|
||||
"api-platform/core": "^3.4.0",
|
||||
"api-platform/core": "^3.4.2",
|
||||
"enshrined/svg-sanitize": "^0.16",
|
||||
"lexik/jwt-authentication-bundle": "^2.11",
|
||||
"sylius/core-bundle": "^2.0",
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
# This file is part of the Sylius package.
|
||||
# (c) Sylius Sp. z o.o.
|
||||
|
||||
jms_serializer:
|
||||
metadata:
|
||||
directories:
|
||||
sylius-attribute:
|
||||
namespace_prefix: "Sylius\\Component\\Attribute"
|
||||
path: "@SyliusAttributeBundle/Resources/config/serializer"
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
Sylius\Component\Attribute\Model\Attribute:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: attribute
|
||||
properties:
|
||||
id:
|
||||
expose: true
|
||||
type: integer
|
||||
xml_attribute: true
|
||||
groups: [Default, Detailed]
|
||||
code:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
position:
|
||||
expose: true
|
||||
type: integer
|
||||
groups: [Default, Detailed]
|
||||
type:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
createdAt:
|
||||
expose: true
|
||||
type: DateTime
|
||||
groups: [Detailed]
|
||||
updatedAt:
|
||||
expose: true
|
||||
type: DateTime
|
||||
groups: [Detailed]
|
||||
translations:
|
||||
expose: true
|
||||
type: iterable
|
||||
groups: [Default, Detailed]
|
||||
configuration:
|
||||
expose: true
|
||||
type: iterable
|
||||
groups: [Detailed]
|
||||
translatable:
|
||||
expose: true
|
||||
type: boolean
|
||||
groups: [Default, Detailed]
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
Sylius\Component\Attribute\Model\AttributeValue:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: attribute-value
|
||||
properties:
|
||||
id:
|
||||
expose: true
|
||||
type: integer
|
||||
xml_attribute: true
|
||||
groups: [Default, Detailed]
|
||||
localeCode:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
virtual_properties:
|
||||
getCode:
|
||||
serialized_name: code
|
||||
getName:
|
||||
serialized_name: name
|
||||
getValue:
|
||||
serialized_name: value
|
||||
getType:
|
||||
serialized_name: type
|
||||
|
|
@ -36,7 +36,6 @@
|
|||
"require-dev": {
|
||||
"doctrine/doctrine-bundle": "^2.3.1",
|
||||
"doctrine/orm": "^2.13",
|
||||
"jms/serializer-bundle": "^5.0",
|
||||
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
|
||||
"phpspec/phpspec": "^7.2",
|
||||
"phpspec/prophecy-phpunit": "^2.0",
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ class AppKernel extends Kernel
|
|||
{
|
||||
return [
|
||||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
|
||||
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||
new Sylius\Bundle\AttributeBundle\SyliusAttributeBundle(),
|
||||
|
|
|
|||
|
|
@ -1,9 +0,0 @@
|
|||
# This file is part of the Sylius package.
|
||||
# (c) Sylius Sp. z o.o.
|
||||
|
||||
jms_serializer:
|
||||
metadata:
|
||||
directories:
|
||||
sylius-channel:
|
||||
namespace_prefix: "Sylius\\Component\\Channel"
|
||||
path: "@SyliusChannelBundle/Resources/config/serializer"
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
Sylius\Component\Channel\Model\Channel:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: channel
|
||||
properties:
|
||||
id:
|
||||
expose: true
|
||||
type: integer
|
||||
xml_attribute: true
|
||||
groups: [Default, Detailed]
|
||||
code:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
name:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Detailed]
|
||||
hostname:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Detailed]
|
||||
enabled:
|
||||
expose: true
|
||||
type: boolean
|
||||
groups: [Detailed]
|
||||
description:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Detailed]
|
||||
color:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Detailed]
|
||||
createdAt:
|
||||
expose: true
|
||||
type: DateTime
|
||||
groups: [Detailed]
|
||||
updatedAt:
|
||||
expose: true
|
||||
type: DateTime
|
||||
groups: [Detailed]
|
||||
|
|
@ -33,7 +33,6 @@
|
|||
"require-dev": {
|
||||
"doctrine/doctrine-bundle": "^2.3.1",
|
||||
"doctrine/orm": "^2.13",
|
||||
"jms/serializer-bundle": "^5.0",
|
||||
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
|
||||
"phpspec/phpspec": "^7.2",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ class AppKernel extends Kernel
|
|||
{
|
||||
return [
|
||||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
|
||||
new winzou\Bundle\StateMachineBundle\winzouStateMachineBundle(),
|
||||
new JMS\SerializerBundle\JMSSerializerBundle(),
|
||||
new BabDev\PagerfantaBundle\BabDevPagerfantaBundle(),
|
||||
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||
new Sylius\Bundle\ChannelBundle\SyliusChannelBundle(),
|
||||
|
|
|
|||
|
|
@ -102,7 +102,6 @@ final class SyliusCoreExtension extends AbstractResourceExtension implements Pre
|
|||
$this->prependDefaultDriver($container, $config['driver']);
|
||||
$this->prependHwiOauth($container);
|
||||
$this->prependDoctrineMigrations($container);
|
||||
$this->prependJmsSerializerIfAdminApiBundleIsNotPresent($container);
|
||||
$this->prependSyliusOrderBundle($container, $config);
|
||||
}
|
||||
|
||||
|
|
@ -141,31 +140,6 @@ final class SyliusCoreExtension extends AbstractResourceExtension implements Pre
|
|||
$loader->load('services/integrations/hwi_oauth.xml');
|
||||
}
|
||||
|
||||
private function prependJmsSerializerIfAdminApiBundleIsNotPresent(ContainerBuilder $container): void
|
||||
{
|
||||
if (!$container->hasExtension('jms_serializer')) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($container->hasExtension('sylius_admin_api')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$container->prependExtensionConfig('jms_serializer', [
|
||||
'metadata' => [
|
||||
'directories' => [
|
||||
'sylius-core' => [
|
||||
'namespace_prefix' => 'Sylius\Component\Core',
|
||||
'path' => '@SyliusCoreBundle/Resources/config/serializer',
|
||||
],
|
||||
],
|
||||
],
|
||||
'property_naming' => [
|
||||
'id' => 'jms_serializer.identical_property_naming_strategy',
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
private function prependSyliusOrderBundle(ContainerBuilder $container, array $config): void
|
||||
{
|
||||
if (!$container->hasExtension('sylius_order')) {
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Sylius package.
|
||||
*
|
||||
* (c) Sylius Sp. z o.o.
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Sylius\Bundle\CoreBundle\Form\Type\Grid\Filter;
|
||||
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
final class EntitiesFilterType extends AbstractType
|
||||
{
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver
|
||||
->setDefaults([
|
||||
'class' => null,
|
||||
'label' => false,
|
||||
'placeholder' => 'sylius.ui.all',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function getParent(): string
|
||||
{
|
||||
return EntityType::class;
|
||||
}
|
||||
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'sylius_grid_filter_entities';
|
||||
}
|
||||
}
|
||||
|
|
@ -2,20 +2,11 @@
|
|||
# (c) Sylius Sp. z o.o.
|
||||
|
||||
imports:
|
||||
- { resource: "@SyliusAddressingBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusAttributeBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusChannelBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusCurrencyBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusCustomerBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusInventoryBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusLocaleBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusOrderBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusPaymentBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusProductBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusPromotionBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusShippingBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusTaxationBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusTaxonomyBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusUserBundle/Resources/config/app/config.yml" }
|
||||
- { resource: "@SyliusUiBundle/Resources/config/app/config.yml" }
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ winzou_state_machine:
|
|||
before:
|
||||
sylius_assign_number:
|
||||
on: ["create"]
|
||||
do: ["@sylius.order_number_assigner", "assignNumber"]
|
||||
do: ["@sylius.number_assigner.order_number", "assignNumber"]
|
||||
args: ["object"]
|
||||
priority: -200
|
||||
sylius_assign_token:
|
||||
|
|
|
|||
|
|
@ -58,6 +58,11 @@ winzou_state_machine:
|
|||
do: ["@sylius.state_resolver.order_checkout", "resolve"]
|
||||
args: ["object"]
|
||||
priority: -100
|
||||
sylius_customer_ip_assign:
|
||||
on: ["complete"]
|
||||
do: ["@sylius.listener.order_customer_ip", "__invoke"]
|
||||
args: ["object"]
|
||||
priority: -500
|
||||
sylius_control_payment_state:
|
||||
on: ["complete"]
|
||||
do: ["@sylius.state_resolver.order_payment", "resolve"]
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
Sylius\Component\Core\Model\AdminUser:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: sylius_admin_user
|
||||
properties:
|
||||
firstName:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Detailed]
|
||||
lastName:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Detailed]
|
||||
localCode:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Detailed]
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
Sylius\Component\Core\Model\Channel:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: channel
|
||||
properties:
|
||||
taxCalculationStrategy:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Detailed]
|
||||
menuTaxon:
|
||||
expose: true
|
||||
groups: [Detailed]
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
Sylius\Component\Core\Model\ChannelPricing:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: channel
|
||||
properties:
|
||||
channelCode:
|
||||
expose: true
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
price:
|
||||
expose: true
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
productVariant:
|
||||
expose: true
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
Sylius\Component\Core\Model\Customer:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: sylius_customer
|
||||
properties:
|
||||
user:
|
||||
expose: true
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
Sylius\Component\Core\Model\Image:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: image
|
||||
properties:
|
||||
id:
|
||||
expose: true
|
||||
type: integer
|
||||
xml_attribute: true
|
||||
groups: [Default, Detailed]
|
||||
type:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
path:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed]
|
||||
owner:
|
||||
expose: true
|
||||
groups: [Detailed]
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
Sylius\Component\Core\Model\Order:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: order
|
||||
properties:
|
||||
checkoutState:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
currencyCode:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
localeCode:
|
||||
expose: true
|
||||
type: string
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
shippingAddress:
|
||||
expose: true
|
||||
groups: [Detailed]
|
||||
billingAddress:
|
||||
expose: true
|
||||
groups: [Detailed]
|
||||
shipments:
|
||||
expose: true
|
||||
groups: [Detailed]
|
||||
payments:
|
||||
expose: true
|
||||
groups: [Detailed]
|
||||
customer:
|
||||
expose: true
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
channel:
|
||||
expose: true
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
promotionCoupon:
|
||||
expose: true
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
Sylius\Component\Core\Model\OrderItem:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: order-item
|
||||
properties:
|
||||
variant:
|
||||
expose: true
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
Sylius\Component\Core\Model\OrderItemUnit:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: order-item-unit
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
Sylius\Component\Core\Model\Payment:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: payment
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
Sylius\Component\Core\Model\PaymentMethod:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: payment-method
|
||||
properties:
|
||||
channels:
|
||||
expose: true
|
||||
groups: [Detailed]
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
Sylius\Component\Core\Model\Product:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: product
|
||||
properties:
|
||||
shortDescription:
|
||||
expose: true
|
||||
type: string
|
||||
averageRating:
|
||||
expose: true
|
||||
type: float
|
||||
groups: [Default, Detailed]
|
||||
images:
|
||||
expose: true
|
||||
type: iterable
|
||||
groups: [Default, Detailed]
|
||||
channels:
|
||||
expose: true
|
||||
type: iterable
|
||||
groups: [Detailed]
|
||||
reviews:
|
||||
expose: true
|
||||
type: iterable
|
||||
groups: [Detailed]
|
||||
productTaxons:
|
||||
expose: true
|
||||
type: iterable
|
||||
groups: [Detailed]
|
||||
mainTaxon:
|
||||
expose: true
|
||||
groups: [Detailed]
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
Sylius\Component\Core\Model\ProductImage:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: product-image
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
Sylius\Component\Core\Model\ProductTaxon:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: product-taxon
|
||||
properties:
|
||||
id:
|
||||
expose: true
|
||||
type: integer
|
||||
xml_attribute: true
|
||||
position:
|
||||
expose: true
|
||||
type: integer
|
||||
taxon:
|
||||
expose: true
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
Sylius\Component\Core\Model\ProductVariant:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: variant
|
||||
properties:
|
||||
onHold:
|
||||
expose: true
|
||||
type: integer
|
||||
groups: [Detailed]
|
||||
onHand:
|
||||
expose: true
|
||||
type: integer
|
||||
groups: [Detailed]
|
||||
tracked:
|
||||
expose: true
|
||||
type: boolean
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
version:
|
||||
expose: true
|
||||
type: integer
|
||||
groups: [Default, Detailed]
|
||||
width:
|
||||
expose: true
|
||||
type: float
|
||||
groups: [Detailed]
|
||||
height:
|
||||
expose: true
|
||||
type: float
|
||||
groups: [Detailed]
|
||||
depth:
|
||||
expose: true
|
||||
type: float
|
||||
groups: [Detailed]
|
||||
weight:
|
||||
expose: true
|
||||
type: float
|
||||
groups: [Detailed]
|
||||
taxCategory:
|
||||
expose: true
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
shippingCategory:
|
||||
expose: true
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
channelPricings:
|
||||
expose: true
|
||||
type: iterable
|
||||
groups: [Default, Detailed, DetailedCart]
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
Sylius\Component\Core\Model\Promotion:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: promotion
|
||||
properties:
|
||||
channels:
|
||||
expose: true
|
||||
type: iterable
|
||||
groups: [Detailed]
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
Sylius\Component\Core\Model\PromotionCoupon:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: promotion-coupon
|
||||
properties:
|
||||
perCustomerUsageLimit:
|
||||
expose: true
|
||||
type: integer
|
||||
groups: [Detailed]
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
Sylius\Component\Core\Model\Property:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: property
|
||||
properties:
|
||||
name:
|
||||
expose: true
|
||||
type: string
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
Sylius\Component\Core\Model\Shipment:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: shipment
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
Sylius\Component\Core\Model\ShippingMethod:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: shipping-method
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
Sylius\Component\Core\Model\ShopUser:
|
||||
exclusion_policy: ALL
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
Sylius\Component\Core\Model\TaxRate:
|
||||
exclusion_policy: ALL
|
||||
xml_root_name: tax-rate
|
||||
properties:
|
||||
zone:
|
||||
expose: false
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue