Skip to content

Commit

Permalink
feature #16272 Merge Bootstrap Admin Panel to 2.0 branch (TheMilek, N…
Browse files Browse the repository at this point in the history
…oResponseMate, GSadee, jakubtobiasz, Wojdylak, kulczy, Rafikooo, mpysiak)

This PR was merged into the 2.0 branch.

Discussion
----------

| Q               | A
|-----------------|-----
| Branch?         | 2.0
| Bug fix?        | no
| New feature?    |yes
| BC breaks?      | yes
| Deprecations?   | no
| Related tickets | 
| License         | MIT

As our new Bootstrap Admin Panel is already mostly covered and starting to be functional, I would like to merge branch `bootstrap-admin-panel` to `2.0` and continue the work here.

<!--
 - Bug fixes must be submitted against the 1.12 or 1.13 branches
 - Features and deprecations must be submitted against the 1.14 branch
 - Features, removing deprecations and BC breaks must be submitted against the 2.0 branch
 - Make sure that the correct base branch is set

 To be sure you are not breaking any Backward Compatibilities, check the documentation:
 https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html
-->


Commits
-------

c046fb7 Use extension instead of changing the existing forms in ProductBundle
38c8be5 minor review fixes
115d4c2 Revoke change of AutocompleteChoiceType to AdminBundle's one
10a2cc5 move ProductType related extensions definitions to dedicated file
165b84c Bring back the transformer from ProductBundle and create a new one for Admin
eff1c8f Use ProductAssociationType instead of extension
2310f81 [Admin][DX] Remove autocompleters
480cfca [Admin][Product] Add ProductAttribute autocomplete type
9516ad0 [Admin][DX] Change `AutocompleteChoiceType` suffix to `AutocompleteType`
72411ad [Admin][DX] Add default aliases to autocomplete fields
6e256e6 [Admin][UX] Add more searchable fields to autocompletes
e694fbd Merge branch '2.0' into bootstrap-admin-panel
6b26f4a Add the "sylius.live_component" tag and the translation layer
04fc430 Move all components from the "TwigComponent" directory under the "Twig\Component" directory
c2f0596 Convert all AsLiveComponent attribute to the custom sylius.live_component tag
8823b74 Bump ux-symfony packages minimal version
32e2cca Update PHPStan ignore rules for Twig components
ce811f2 Fix the malformed sylius_admin:country:form component usages
2fd9297 Fix not adding the 'controller.service_arguments' tag to services tagged with sylius.live_component
1e30fb3 Bring back #[AsLiveComponent] attribute to LiveComponent classes
65969a7 Unfinalize all components
7be88ea Rename `TaxonTreeComponent` component to `TreeComponent`
7e52dfa Fix Product's Form component service id
e435ebf Rename `ShipComponent` to `ShipFormComponent`
ed65c29 Adjust the Zone's form component to the new standard
3d06429 [Behat] Change mink panther to chromedriver
bf3a434 Rename sylius_admin:order:history:address to sylius_admin:order:addresshistory
6f3c0d9 [Behat] Disable behat test
73b4a5f Unify index actions
4cc8549 Add show buttons to the homepage
064db37 Improve filter section
5e319d4 Make bolder header
d3748e9 Style grid fields templates
4e6f42d Improve grids view
7d37d78 Fix tests
5fd5746 [Admin][Zone] Move FormComponent
8b6d2b1 [Admin][Zone] Move FormComponent (#16256)
32fcf43 [Admin][Product][Inventory] Enable behat tests
08c3e85 [Admin][Taxon] Implements media management
630f9a1 [Admin][Taxon][Image] Enable behat tests
e6deeb4 [Behat] Submit live component before submitting the form
e3909ab [Behat] Extract waitForFormUpdate function to CrudFormElement
59695b1 [Taxon][Behat] Extract management of image to separate form element.
554da08 [Admin][Taxon] Remove unnecessary code
e30e391 [Admin][Taxon] Split media more granularly
f42496c [Admin][Taxon] Rename FormImageElement to ImageFormElement
36e06c0 Merge branch '2.0' into bootstrap-admin-panel
bb4e9f3 [Admin][UI] Add error indicators for form tabs and accordions
865a481 Review fixes
d1ed503 Remove final from the Zone's form component
e6bd06a Remove final from the Zone's form component (#16270)
cb9ac59 [Admin][UI] Add error indicators for form tabs and accordions (#16263)
27a9529 [Admin][Product] Add view in store button
d8e1758 [Admin][Product] Enable and fix tests
f7378ae Changes after CR
c940afe Merge branch '2.0' into bootstrap-admin-panel
a313b14 Fixes after CR
6d6079e minor #16268 [Admin][Product] Add view in store button (mpysiak)
68da42b [Maintenance] Enable non-UI tests in CI
71ff79c [Behat] Add possibility to accepting null as value in response checker
f083d82 [Admin][UX] Filter translatable autocomplete results based on current locale
  • Loading branch information
GSadee committed May 20, 2024
2 parents 9b2f339 + f083d82 commit 2a35ebc
Show file tree
Hide file tree
Showing 1,816 changed files with 24,306 additions and 13,447 deletions.
18 changes: 12 additions & 6 deletions .bunnyshell/docker/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ ARG NODE_VERSION=20
ARG ALPINE_VERSION=3.18
ARG COMPOSER_VERSION=2.6
ARG PHP_EXTENSION_INSTALLER_VERSION=latest
ARG DATABASE_URL

FROM composer:${COMPOSER_VERSION} AS composer

FROM mlocati/php-extension-installer:${PHP_EXTENSION_INSTALLER_VERSION} AS php_extension_installer

FROM php:${PHP_VERSION}-fpm-alpine${ALPINE_VERSION} AS base

ENV DATABASE_URL=${DATABASE_URL}

# persistent / runtime deps
RUN apk add --no-cache \
acl \
Expand Down Expand Up @@ -89,20 +92,23 @@ RUN set -eux; \
g++ \
gcc \
make \
git \
;

# prevent the reinstallation of vendors at every changes in the source code
COPY package.json yarn.* ./
RUN set -eux; \
yarn install; \
yarn cache clean
COPY package.json package-*.json ./

COPY --from=base /srv/sylius/src/Sylius/Bundle/UiBundle/Resources/private src/Sylius/Bundle/UiBundle/Resources/private/
COPY --from=base /srv/sylius/src/Sylius/Bundle/AdminBundle/Resources/private src/Sylius/Bundle/AdminBundle/Resources/private/
COPY --from=base /srv/sylius/src/Sylius/Bundle/AdminBundle src/Sylius/Bundle/AdminBundle/
COPY --from=base /srv/sylius/src/Sylius/Bundle/ShopBundle/Resources/private src/Sylius/Bundle/ShopBundle/Resources/private/
COPY --from=base /srv/sylius/vendor/symfony/ux-autocomplete/assets vendor/symfony/ux-autocomplete/assets/
COPY --from=base /srv/sylius/vendor/symfony/ux-live-component/assets vendor/symfony/ux-live-component/assets/

RUN set -eux; \
npm install;

COPY webpack.config.js ./
RUN yarn build:prod
RUN npm run build:prod

FROM base AS sylius_php_prod

Expand Down
2 changes: 2 additions & 0 deletions .bunnyshell/templates/preview/bunnyshell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ components:
context: .
dockerfile: .bunnyshell/docker/php/Dockerfile
target: sylius_php_prod
args:
DATABASE_URL: 'mysql://{{ env.vars.MYSQL_USER }}:{{ env.vars.MYSQL_PASSWORD }}@database/{{ env.vars.MYSQL_DATABASE }}?serverVersion=8.0'
command: php-fpm
entrypoint: /usr/local/bin/php-entrypoint
environment:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_e2e-custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
run: |
composer config minimum-stability dev
composer config prefer-stable true
- name: Prepare manifest.json files
run: |
mkdir -p public/build/admin
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_e2e-mariadb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
- name: "Checkout"
if: "${{ inputs.branch == '' }}"
uses: actions/checkout@v4

- name: Prepare manifest.json files
run: |
mkdir -p public/build/admin
Expand All @@ -87,7 +87,7 @@ jobs:
echo "{}" > public/build/shop/manifest.json
echo "{}" > public/build/app/admin/manifest.json
echo "{}" > public/build/app/shop/manifest.json
- name: Build application
uses: SyliusLabs/BuildTestAppAction@v2.2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_e2e-mysql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
echo "{}" > public/build/shop/manifest.json
echo "{}" > public/build/app/admin/manifest.json
echo "{}" > public/build/app/shop/manifest.json
- name: Build application
uses: SyliusLabs/BuildTestAppAction@v2.2
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_e2e-pgsql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: "Checkout"
if: "${{ inputs.branch == '' }}"
uses: actions/checkout@v4

- name: Prepare manifest.json files
run: |
mkdir -p public/build/admin
Expand All @@ -77,7 +77,7 @@ jobs:
echo "{}" > public/build/shop/manifest.json
echo "{}" > public/build/app/admin/manifest.json
echo "{}" > public/build/app/shop/manifest.json
- name: Build application
uses: SyliusLabs/BuildTestAppAction@v2.2
with:
Expand Down
1 change: 1 addition & 0 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"Psr\\Container\\ContainerInterface",
"Psr\\Http\\Message\\RequestFactoryInterface",
"Psr\\Http\\Message\\StreamFactoryInterface",
"Sylius\\Bundle\\UiBundle\\Registry\\TemplateBlockRegistryInterface",
"Symfony\\Component\\Security\\Core\\Encoder\\EncoderFactoryInterface"
],
"php-core-extensions" : [
Expand Down
17 changes: 12 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,12 @@
"sylius/resource": "^1.10",
"sylius/resource-bundle": "^1.10",
"sylius/theme-bundle": "^2.3",
"sylius/twig-hooks": "~0.2.4",
"symfony/asset": "^6.4.0",
"symfony/cache-contracts": "^2.5 || ^3.0",
"symfony/clock": "^6.4.0",
"symfony/config": "^6.4.0",
"symfony/console": "^6.4.1",
"symfony/cache-contracts": "^2.5 || ^3.0",
"symfony/dependency-injection": "^6.4.1",
"symfony/deprecation-contracts": "^2.5.2",
"symfony/doctrine-bridge": "^6.4.0",
Expand Down Expand Up @@ -125,17 +126,24 @@
"symfony/security-http": "^6.4.0",
"symfony/serializer": "^6.4.0",
"symfony/service-contracts": "^2.5 || ^3.0",
"symfony/stimulus-bundle": "^2.12",
"symfony/string": "^6.4.0",
"symfony/templating": "^6.4.0",
"symfony/translation": "^6.4.0",
"symfony/translation-contracts": "^2.5.2",
"symfony/twig-bundle": "^6.4.0",
"symfony/ux-autocomplete": "^2.17",
"symfony/ux-live-component": "^2.17",
"symfony/ux-twig-component": "^2.17",
"symfony/validator": "^6.4.0",
"symfony/webpack-encore-bundle": "^1.17.1",
"symfony/workflow": "^6.4.0",
"symfony/yaml": "^6.4.0",
"twig/intl-extra": "^2.12 || ^3.4",
"twig/twig": "^2.12 || ^3.3",
"symfonycasts/dynamic-forms": "v0.1.1",
"twig/extra-bundle": "~3.8.0",
"twig/intl-extra": "~3.8.0",
"twig/string-extra": "~3.8.0",
"twig/twig": "~3.8.0",
"webmozart/assert": "^1.9",
"willdurand/hateoas": "^3.0",
"willdurand/hateoas-bundle": "^2.0",
Expand Down Expand Up @@ -189,8 +197,7 @@
"api-platform/core": "2.7.17",
"doctrine/orm": ">= 2.16.0",
"lexik/jwt-authentication-bundle": "^2.18",
"stof/doctrine-extensions-bundle": "1.8.0",
"twig/twig": "3.9.0"
"stof/doctrine-extensions-bundle": "1.8.0"
},
"require-dev": {
"behat/behat": "^3.6.1",
Expand Down
6 changes: 6 additions & 0 deletions config/bundles.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,10 @@
SyliusLabs\DoctrineMigrationsExtraBundle\SyliusLabsDoctrineMigrationsExtraBundle::class => ['all' => true],
SyliusLabs\Polyfill\Symfony\Security\Bundle\SyliusLabsPolyfillSymfonySecurityBundle::class => ['all' => true],
Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true],
Symfony\UX\TwigComponent\TwigComponentBundle::class => ['all' => true],
Symfony\UX\StimulusBundle\StimulusBundle::class => ['all' => true],
Symfony\UX\LiveComponent\LiveComponentBundle::class => ['all' => true],
Sylius\TwigHooks\TwigHooksBundle::class => ['all' => true],
Symfony\UX\Autocomplete\AutocompleteBundle::class => ['all' => true],
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
];
4 changes: 2 additions & 2 deletions config/packages/_sylius.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
imports:
- { resource: "@SyliusCoreBundle/Resources/config/app/config.yml" }

- { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" }

- { resource: "@SyliusShopBundle/Resources/config/app/config.yml" }

- { resource: "@SyliusApiBundle/Resources/config/app/config.yaml" }

- { resource: "@SyliusAdminBundle/Resources/config/app/config.yml" }

- { resource: "../parameters.yaml" }

parameters:
Expand Down
8 changes: 0 additions & 8 deletions config/packages/twig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,3 @@ twig:
paths: ['%kernel.project_dir%/templates']
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'

services:
_defaults:
public: false
autowire: true
autoconfigure: true

Twig\Extra\Intl\IntlExtension: ~
5 changes: 5 additions & 0 deletions config/routes/ux_live_component.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
live_component:
resource: '@LiveComponentBundle/config/routes.php'
prefix: '/_components'
# adjust prefix to add localization to your components
#prefix: '/{_locale}/_components'
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: Adding a new country
Background:
Given I am logged in as an administrator

@ui @api
@api @ui
Scenario: Adding country
When I want to add a new country
And I choose "United States"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: Adding countries with provinces
Background:
Given I am logged in as an administrator

@ui @javascript @api
@api @ui @javascript
Scenario: Adding a country with a province
When I want to add a new country
And I choose "United Kingdom"
Expand All @@ -17,7 +17,7 @@ Feature: Adding countries with provinces
And the country "United Kingdom" should appear in the store
And the country "United Kingdom" should have the "Scotland" province

@ui @javascript @api
@api @ui @javascript
Scenario: Adding a country with two provinces
When I want to add a new country
And I choose "United Kingdom"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Country validation
Given the store operates in "Norway"
And I am logged in as an administrator

@ui @api
@api @ui
Scenario: Trying to add a new country with used code
When I want to add a new country
Then I should not be able to choose "Norway"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: Editing country
Background:
Given I am logged in as an administrator

@ui @api
@api @ui
Scenario: Disabling country
Given the store has country "United States"
When I want to edit this country
Expand All @@ -16,7 +16,7 @@ Feature: Editing country
Then I should be notified that it has been successfully edited
And this country should be disabled

@ui @api
@api @ui
Scenario: Enabling country
Given the store has disabled country "United States"
When I want to edit this country
Expand All @@ -25,7 +25,7 @@ Feature: Editing country
Then I should be notified that it has been successfully edited
And this country should be enabled

@ui @api
@api @ui
Scenario: Seeing disabled code field while editing country
Given the store has country "United States"
When I want to edit this country
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Feature: Managing provinces of a country
Given the store has country "United Kingdom"
And I am logged in as an administrator

@ui @javascript @api
@api @ui @javascript
Scenario: Adding a province to an existing country
When I want to edit this country
And I add the "Scotland" province with "GB-SCT" code
And I save my changes
Then I should be notified that it has been successfully edited
And this country should have the "Scotland" province

@ui @javascript @api
@api @ui @javascript
Scenario: Removing a province from an existing country
Given this country has the "Northern Ireland" province with "GB-NIR" code
When I want to edit this country
Expand All @@ -25,7 +25,7 @@ Feature: Managing provinces of a country
Then I should be notified that it has been successfully edited
And this country should not have the "Northern Ireland" province

@ui @javascript @api
@api @ui @javascript
Scenario: Removing a province that is a zone member should not be possible
Given this country has the "Northern Ireland" province with "GB-NIR" code
And this country also has the "Scotland" province with "GB-SCT" code
Expand All @@ -43,7 +43,7 @@ Feature: Managing provinces of a country
And this country should still have the "Scotland" province
And this country should still have the "England" province

@ui @javascript @api
@api @ui @javascript
Scenario: Removing a province that is not a zone member anymore should be possible
Given this country has the "Northern Ireland" province with "GB-NIR" code
And this country also has the "Scotland" province with "GB-SCT" code
Expand All @@ -60,18 +60,18 @@ Feature: Managing provinces of a country
And this country should not have the "England" province
And this country should still have the "Northern Ireland" and "Scotland" provinces

@ui @javascript @api
@api @ui @javascript
Scenario: Removing and adding a new province to an existing country
Given this country has the "Northern Ireland" province with "GB-NIR" code
When I want to edit this country
And I delete the "Northern Ireland" province of this country
And I add the "Scotland" province with "GB-SCT" code
And I delete the "Northern Ireland" province of this country
And I save my changes
Then I should be notified that it has been successfully edited
And this country should not have the "Northern Ireland" province
And this country should have the "Scotland" province

@ui @javascript @api
@api @ui @javascript
Scenario: Adding a province with an austrian province code
When I want to edit this country
And I add the "Wien" province with "AT-9" code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@ Feature: Province unique fields validation
And this country has the "Northern Ireland" province with "GB-NIR" code
And I am logged in as an administrator

@ui @javascript @api
@api @ui @javascript
Scenario: Trying to add a new province with a taken code
When I want to add a new country
And I choose "Gibraltar"
And I add the "Scotland" province with "GB-NIR" code
And I try to add it
Then I should be notified that province code must be unique

@ui @javascript @api
@api @ui @javascript
Scenario: Trying to add a new province with a taken name
When I want to edit this country
And I add the "Northern Ireland" province with "GB-NI" code
And I save my changes
Then I should be notified that province name must be unique

@ui @javascript @api
@api @ui @javascript
Scenario: Trying to add new provinces with duplicated codes
When I want to edit this country
And I add the "Scotland" province with "GB-SCO" code
And I add the "Not Scotland" province with "GB-SCO" code
And I save my changes
Then I should be notified that all province codes and names within this country need to be unique

@ui @javascript @api
@api @ui @javascript
Scenario: Trying to add new provinces with duplicated names
When I want to edit this country
And I add the "Scotland" province with "GB-SC" code
Expand Down
Loading

0 comments on commit 2a35ebc

Please sign in to comment.