Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[administration] Prototyping Sonata #3158

Merged
merged 1 commit into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/monorepo/monorepo_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ get_all_packages() {
monorepo-tools \
php-image \
luigis-box \
administration \
project-base"
}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ jobs:
- name: Check standards
run: |
docker compose exec -T php-fpm touch ./project-base/app/DEVELOPMENT
docker compose exec -T php-fpm php phing -D production.confirm.action=y composer-dev standards
docker compose exec -T php-fpm php phing -D production.confirm.action=y composer-dev frontend-api-generate-new-keys standards
grossmannmartin marked this conversation as resolved.
Show resolved Hide resolved
- name: Check GraphQl schema
run: docker compose exec -T php-fpm project-base/app/check-schema.sh
standards-storefront:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG-15.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ There is a list of all the repositories maintained by the monorepo:
- [shopsys/frontend-api](https://github.com/shopsys/frontend-api)
- [shopsys/php-image](https://github.com/shopsys/php-image)
- [shopsys/luigis-box](https://github.com/shopsys/luigis-box)
- [shopsys/administration](https://github.com/shopsys/administration)

Packages are formatted by release version.
You can see all the changes done to the package that you carry about with this tree.
Expand Down
22 changes: 18 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"psr-4": {
"App\\": "project-base/app/src/",
"Overblog\\GraphQLBundle\\__DEFINITIONS__\\": "project-base/app/var/overblogCompiledClasses",
"Shopsys\\Administration\\": "packages/administration/src/",
"Shopsys\\CodingStandards\\": "packages/coding-standards/src/",
"Shopsys\\FormTypesBundle\\": "packages/form-types-bundle/src/",
"Shopsys\\FrontendApiBundle\\": "packages/frontend-api/src/",
Expand Down Expand Up @@ -39,6 +40,7 @@
"autoload-dev": {
"psr-4": {
"Tests\\": "project-base/app/tests/",
"Tests\\Administration\\": "packages/administration/tests/",
"Tests\\CodingStandards\\": "packages/coding-standards/tests/",
"Tests\\FrameworkBundle\\": "packages/framework/tests/",
"Tests\\FrontendApiBundle\\": "packages/frontend-api/tests/",
Expand Down Expand Up @@ -84,6 +86,7 @@
"barryvdh/elfinder-flysystem-driver": "^0.4.3",
"commerceguys/intl": "^1.0.0",
"composer/composer": "^2.2.12",
"cweagans/composer-patches": "^1.7",
"defuse/php-encryption": "^2.2.1",
"doctrine/annotations": "^1.6.0",
"doctrine/cache": "^1.7",
Expand All @@ -96,7 +99,7 @@
"doctrine/doctrine-migrations-bundle": "^3.2.2",
"doctrine/migrations": "^3.4.1",
"doctrine/orm": "^2.11.2",
"doctrine/persistence": "^2.4",
"doctrine/persistence": "^3.3",
"elasticsearch/elasticsearch": "^7.6.1",
"enlightn/security-checker": "^1.3",
"fakerphp/faker": "^1.19.0",
Expand Down Expand Up @@ -127,12 +130,12 @@
"overblog/dataloader-bundle": "^0.6.0",
"overblog/graphiql-bundle": "^0.3",
"overblog/graphql-bundle": "1.3.2",
"phing/phing": "3.0.0-rc6",
"phing/phing": "^3.0.0",
"phpdocumentor/reflection-docblock": "^5.3.0",
"presta/sitemap-bundle": "^3.3",
"prezent/doctrine-translatable": "^3.3.0",
"prezent/doctrine-translatable-bundle": "^1.4",
"psr/log": "^1.0",
"psr/log": "^2.0",
"ramsey/uuid": "^4.3.1",
"roave/better-reflection": "^6.0",
"scheb/2fa-bundle": "^5.7",
Expand All @@ -145,7 +148,9 @@
"shopsys/jsformvalidator-bundle": "^1.7.0",
"shopsys/ordered-form": "^5.2",
"snc/redis-bundle": "^4.4.1",
"sonata-project/admin-bundle": "^4.30",
"spatie/opening-hours": "^3.0",
"sonata-project/doctrine-orm-admin-bundle": "^4.9",
"stof/doctrine-extensions-bundle": "^1.3.0",
"symfony-cmf/routing": "^2.0.3",
"symfony-cmf/routing-bundle": "^2.0.3",
Expand Down Expand Up @@ -241,7 +246,8 @@
"ocramius/package-versions": true,
"symfony/flex": true,
"php-http/discovery": true,
"symfony/runtime": true
"symfony/runtime": true,
"cweagans/composer-patches": true
}
},
"extra": {
Expand All @@ -257,9 +263,17 @@
},
"runtime": {
"dotenv_path": "project-base/app/.env"
},
"enable-patching": true,
"patches": {
"composer-exit-on-patch-failure": true,
"twig/twig": {
"Hotfix for issue https://github.com/sonata-project/SonataAdminBundle/issues/8181": "project-base/app/src/Twig/sonata.patch"
}
}
},
"replace": {
"shopsys/administration": "self.version",
"shopsys/article-feed-luigis-box": "self.version",
"shopsys/brand-feed-luigis-box": "self.version",
"shopsys/category-feed-luigis-box": "self.version",
Expand Down
1 change: 1 addition & 0 deletions docs/contributing/guidelines-for-writing-upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Each upgrade file must have a link to the main UPGRADE.md file with general info
- shopsys/product-feed-luigis-box
- shopsys/article-feed-luigis-box
- shopsys/luigis-box
- shopsys/administration

Each section must contain instructions relevant only to the package they cover, and the sections have to be ordered as they are in the list above.

Expand Down
1 change: 1 addition & 0 deletions docs/introduction/monorepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ If you are interested, you can read more about the monorepo approach here - http
- [shopsys/s3-bridge](https://github.com/shopsys/s3-bridge)
- [shopsys/php-image](https://github.com/shopsys/php-image)
- [shopsys/luigis-box](https://github.com/shopsys/luigis-box)
- [shopsys/administration](https://github.com/shopsys/administration)

!!! note

Expand Down
6 changes: 6 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Shopsys\CodingStandards\Helper\CyclomaticComplexitySniffSetting;
use Shopsys\CodingStandards\Sniffs\ConstantVisibilityRequiredSniff;
use Shopsys\CodingStandards\Sniffs\ForceLateStaticBindingForProtectedConstantsSniff;
use Shopsys\CodingStandards\Sniffs\ObjectIsCreatedByFactorySniff;
use SlevomatCodingStandard\Sniffs\Functions\FunctionLengthSniff;
use Symplify\EasyCodingStandard\Config\ECSConfig;

Expand All @@ -33,6 +34,11 @@
],
FunctionLengthSniff::class => [
__DIR__ . '/utils/releaser/src/ReleaseWorker/Release/CreateAndPushGitTagsExceptProjectBaseReleaseWorker.php',
__DIR__ . '/packages/administration/src/Controller/CRUDController.php',
__DIR__ . '/packages/administration/src/**/*Admin.php',
],
ObjectIsCreatedByFactorySniff::class => [
__DIR__ . '/packages/administration/src/Component/FieldDescription/FieldDescriptionFactory.php',
],
],
);
Expand Down
28 changes: 28 additions & 0 deletions packages/administration/.github/workflows/run-checks-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on: [push]
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
name: "Checks and tests"
jobs:
checks-and-tests:
name: Run checks and tests
runs-on: ubuntu-22.04
steps:
- name: GIT checkout branch - ${{ github.ref }}
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- name: Install PHP, extensions and tools
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: bcmath, gd, intl, pdo_pgsql, redis, pgsql, zip
tools: composer
- name: Install Composer dependencies
run: composer install --optimize-autoloader --no-interaction
- name: Run parallel-lint
run: php vendor/bin/parallel-lint ./src ./tests
- name: Run Easy Coding Standards
run: php vendor/bin/ecs check --verbose ./src ./tests
- name: Run PHPUnit
run: php vendor/bin/phpunit tests
5 changes: 5 additions & 0 deletions packages/administration/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/.idea
/.php_cs.cache
/composer.lock
/vendor
/.phpunit.result.cache
10 changes: 10 additions & 0 deletions packages/administration/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Contributing

Thank you for your contributions to Shopsys Admin bundle package.
Together, we are making Shopsys Platform better.

This repository is READ-ONLY.
If you want to [report issues](https://github.com/shopsys/shopsys/issues/new) and/or send [pull requests](https://github.com/shopsys/shopsys/compare),
please use the main [Shopsys repository](https://github.com/shopsys/shopsys).

Please check our [Contribution Guide](https://docs.shopsys.com/en/latest/contributing/) before contributing.
14 changes: 14 additions & 0 deletions packages/administration/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
MIT License

Copyright (c) 2017-2023 Shopsys s.r.o., http://www.shopsys.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE 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.
39 changes: 39 additions & 0 deletions packages/administration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Shopsys Administration bundle

[![Downloads](https://img.shields.io/packagist/dt/shopsys/administration.svg)](https://packagist.org/packages/shopsys/administration)

Bundle for [Shopsys Platform](https://www.shopsys.com/shopsys-platform/) responsible for generating administration.

This repository is maintained by [shopsys/shopsys] monorepo, information about changes is in [monorepo CHANGELOG.md](https://github.com/shopsys/shopsys/blob/master/CHANGELOG.md).

## Installation

The plugin is a Symfony bundle and is installed in the same way:

### Download

Download the package using [Composer](https://getcomposer.org/):

```
composer require shopsys/administration
```

## Contributing

Thank you for your contributions to Shopsys Administration bundle package.
Together, we are making Shopsys Platform better.

This repository is READ-ONLY.
If you want to [report issues](https://github.com/shopsys/shopsys/issues/new) and/or send [pull requests](https://github.com/shopsys/shopsys/compare),
please use the main [Shopsys repository](https://github.com/shopsys/shopsys).

Please check our [Contribution Guide](https://docs.shopsys.com/en/latest/contributing/) before contributing.

## Support

What to do when you are in trouble or need some help?
The best way is to join our [Slack](https://join.slack.com/t/shopsysframework/shared_invite/zt-11wx9au4g-e5pXei73UJydHRQ7nVApAQ).

If you want to [report issues](https://github.com/shopsys/shopsys/issues/new), please use the main [Shopsys repository](https://github.com/shopsys/shopsys).

[shopsys/shopsys]: (https://github.com/shopsys/shopsys)
42 changes: 42 additions & 0 deletions packages/administration/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "shopsys/administration",
"type": "library",
"description": "Shopsys Platform administration",
"keywords": ["administration", "Shopsys Platform", "SSFW", "SSP"],
"license": "MIT",
"authors": [
{
"name": "Shopsys",
"homepage": "https://www.shopsys.com/"
}
],
"autoload": {
"psr-4": {
"Shopsys\\Administration\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\Administration\\": "tests/"
}
},
"require": {
"php": "^8.3",
"ext-json": "*",
"cweagans/composer-patches": "^1.7",
"sonata-project/admin-bundle": "^4.30",
"sonata-project/doctrine-orm-admin-bundle": "^4.9",
"twig/twig": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5.20",
"shopsys/coding-standards": "15.0.x-dev"
},
"config": {
"allow-plugins": {
"symfony/flex": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"cweagans/composer-patches": true
}
}
}
31 changes: 31 additions & 0 deletions packages/administration/ecs.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Fixer\FunctionNotation\PhpdocToPropertyTypeFixer;
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer;
use Shopsys\CodingStandards\CsFixer\ForbiddenPrivateVisibilityFixer;
use Shopsys\CodingStandards\Sniffs\ForceLateStaticBindingForProtectedConstantsSniff;
use Shopsys\CodingStandards\Sniffs\ObjectIsCreatedByFactorySniff;
use SlevomatCodingStandard\Sniffs\Functions\FunctionLengthSniff;
use SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSniff;
use Symplify\EasyCodingStandard\Config\ECSConfig;

/**
* @param Symplify\EasyCodingStandard\Config\ECSConfig $ecsConfig
*/
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->import(__DIR__ . '/vendor/shopsys/coding-standards/ecs.php', null, true);

$ecsConfig->skip(
[
ObjectIsCreatedByFactorySniff::class => [
__DIR__ . '/packages/administration/src/Component/FieldDescription/FieldDescriptionFactory.php',
],
FunctionLengthSniff::class => [
__DIR__ . '/packages/administration/src/Controller/CRUDController.php',
__DIR__ . '/packages/administration/src/**/*Admin.php',
],
],
);
};
17 changes: 17 additions & 0 deletions packages/administration/phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
failOnWarning="true"
beStrictAboutTestsThatDoNotTestAnything="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
>
<coverage/>
</phpunit>
Loading
Loading