-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
800 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,13 +14,15 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
php: [ "8.1", "8.2", "8.3" ] | ||
postgres: ["14.6"] | ||
symfony: [ "^6.4", "^7.0" ] | ||
exclude: | ||
- php: "8.1" | ||
symfony: "^7.0" | ||
name: "PHP ${{ matrix.php }} / Symfony ${{ matrix.symfony }}" | ||
env: | ||
APP_ENV: test | ||
DATABASE_URL: "pgsql://postgres:[email protected]/sylius_stack?charset=utf8&serverVersion=${{ matrix.postgres }}" | ||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v3 | ||
|
@@ -32,6 +34,15 @@ jobs: | |
tools: symfony | ||
coverage: none | ||
|
||
- name: Shutdown default MySQL | ||
run: sudo service mysql stop | ||
|
||
- name: Setup PostgreSQL | ||
uses: harmon758/postgresql-action@v1 | ||
with: | ||
postgresql version: "${{ matrix.postgres }}" | ||
postgresql password: "postgres" | ||
|
||
- name: "Restrict packages' versions" | ||
run: | | ||
composer global config --no-plugins allow-plugins.symfony/flex true | ||
|
@@ -70,6 +81,11 @@ jobs: | |
- name: Run PHPStan | ||
run: vendor/bin/phpstan analyse | ||
|
||
- name: Create Testing database | ||
run: | | ||
bin/console doctrine:database:create | ||
bin/console doctrine:schema:create | ||
- name: Run PHPUnit | ||
run: vendor/bin/phpunit | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?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 App\Grid; | ||
|
||
use App\Entity\Book; | ||
use Sylius\Bundle\GridBundle\Builder\Action\CreateAction; | ||
use Sylius\Bundle\GridBundle\Builder\Action\DeleteAction; | ||
use Sylius\Bundle\GridBundle\Builder\Action\ShowAction; | ||
use Sylius\Bundle\GridBundle\Builder\Action\UpdateAction; | ||
use Sylius\Bundle\GridBundle\Builder\ActionGroup\BulkActionGroup; | ||
use Sylius\Bundle\GridBundle\Builder\ActionGroup\ItemActionGroup; | ||
use Sylius\Bundle\GridBundle\Builder\ActionGroup\MainActionGroup; | ||
use Sylius\Bundle\GridBundle\Builder\Field\StringField; | ||
use Sylius\Bundle\GridBundle\Builder\Filter\StringFilter; | ||
use Sylius\Bundle\GridBundle\Builder\GridBuilderInterface; | ||
use Sylius\Bundle\GridBundle\Grid\AbstractGrid; | ||
use Sylius\Bundle\GridBundle\Grid\ResourceAwareGridInterface; | ||
|
||
final class BookGrid extends AbstractGrid implements ResourceAwareGridInterface | ||
{ | ||
public static function getName(): string | ||
{ | ||
return 'app_book'; | ||
} | ||
|
||
public function buildGrid(GridBuilderInterface $gridBuilder): void | ||
{ | ||
$gridBuilder | ||
->orderBy('title') | ||
->addFilter( | ||
StringFilter::create('search', ['title', 'authorName']) | ||
->setLabel('sylius.ui.search'), | ||
) | ||
->addField( | ||
StringField::create('title') | ||
->setLabel('Title') | ||
->setSortable(true), | ||
) | ||
->addField( | ||
StringField::create('authorName') | ||
->setLabel('Author Name') | ||
->setSortable(true), | ||
) | ||
->addActionGroup( | ||
MainActionGroup::create( | ||
CreateAction::create(), | ||
), | ||
) | ||
->addActionGroup( | ||
ItemActionGroup::create( | ||
// ShowAction::create(), | ||
UpdateAction::create(), | ||
DeleteAction::create(), | ||
), | ||
) | ||
->addActionGroup( | ||
BulkActionGroup::create( | ||
DeleteAction::create(), | ||
), | ||
) | ||
; | ||
} | ||
|
||
public function getResourceClass(): string | ||
{ | ||
return Book::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
sylius_admin_ui: | ||
routing: | ||
#dashboard_path: '/admin' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "sylius/admin-ui", | ||
"type": "library", | ||
"require": { | ||
"php": "^8.1", | ||
"knplabs/knp-menu-bundle": "^3.0", | ||
"sylius/twig-hooks": "^0.2", | ||
"symfony/http-kernel": "^6.4 || ^7.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Sylius\\AdminUi\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Tests\\Sylius\\AdminUi\\": "tests/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?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 Symfony\Component\DependencyInjection\Loader\Configurator; | ||
|
||
use Sylius\AdminUi\Knp\Menu\MenuBuilder; | ||
use Sylius\AdminUi\Knp\Menu\MenuBuilderInterface; | ||
use Sylius\AdminUi\TwigHooks\Hookable\Metadata\RoutingHookableMetadataFactory; | ||
|
||
return function (ContainerConfigurator $configurator): void { | ||
$services = $configurator->services(); | ||
|
||
$services->set('sylius_admin_ui.knp.menu_builder', MenuBuilder::class) | ||
->args([service('knp_menu.factory')]) | ||
->tag(name: 'knp_menu.menu_builder', attributes: ['method' => 'createMenu', 'alias' => 'sylius_admin_ui.menu.sidebar']) | ||
; | ||
$services->alias(MenuBuilderInterface::class, 'sylius_admin_ui.knp.menu_builder'); | ||
|
||
$services->set('sylius_admin_ui.twig_hooks.factory.hookable_metadata', RoutingHookableMetadataFactory::class) | ||
->decorate('twig_hooks.factory.hookable_metadata') | ||
->args([ | ||
service('.inner'), | ||
param('sylius_admin_ui.routing'), | ||
]) | ||
; | ||
}; |
Oops, something went wrong.