-
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.
![image](https://github.com/user-attachments/assets/c6500310-63ee-496f-b434-3ea790f6ed1f) Empty one :)
- Loading branch information
Showing
10 changed files
with
136 additions
and
3 deletions.
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
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,9 @@ | ||
{% extends '@SyliusAdminUi/base.html.twig' %} | ||
|
||
{% block title %} | ||
{{ 'sylius.ui.dashboard'|trans }} {{ parent() }} | ||
{% endblock %} | ||
|
||
{% block body %} | ||
{% hook ['sylius_admin.dashboard.index', 'sylius_admin.common.index'] %} | ||
{% endblock %} |
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
63 changes: 63 additions & 0 deletions
63
src/BootstrapAdminUi/config/app/twig_hooks/dashboard/index.php
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,63 @@ | ||
<?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; | ||
|
||
return static function (ContainerConfigurator $container): void { | ||
$container->extension('sylius_twig_hooks', [ | ||
'hooks' => [ | ||
'sylius_admin.dashboard.index' => [ | ||
'sidebar' => [ | ||
'template' => '@SyliusBootstrapAdminUi/shared/crud/common/sidebar.html.twig', | ||
], | ||
'navbar' => [ | ||
'template' => '@SyliusBootstrapAdminUi/shared/crud/common/navbar.html.twig', | ||
], | ||
'content' => [ | ||
'template' => '@SyliusBootstrapAdminUi/shared/crud/common/content.html.twig', | ||
], | ||
], | ||
|
||
'sylius_admin.dashboard.index.content' => [ | ||
'header' => [ | ||
'template' => '@SyliusBootstrapAdminUi/shared/crud/common/content/header.html.twig', | ||
], | ||
'grid' => [ | ||
'enabled' => false, | ||
], | ||
], | ||
|
||
'sylius_admin.dashboard.index.content.header' => [ | ||
'breadcrumbs' => [ | ||
'enabled' => false, | ||
], | ||
'title_block' => [ | ||
'template' => '@SyliusBootstrapAdminUi/shared/crud/common/content/header/title_block.html.twig', | ||
], | ||
], | ||
|
||
'sylius_admin.dashboard.index.content.header.title_block' => [ | ||
'title' => [ | ||
'template' => '@SyliusBootstrapAdminUi/shared/crud/common/content/header/title_block/title.html.twig', | ||
'configuration' => [ | ||
'title' => 'sylius.ui.dashboard', | ||
'sylius_test_html_attribute' => 'dashboard-header', | ||
], | ||
], | ||
'actions' => [ | ||
'enabled' => false, | ||
], | ||
], | ||
], | ||
]); | ||
}; |
5 changes: 5 additions & 0 deletions
5
src/BootstrapAdminUi/templates/shared/crud/common/navbar.html.twig
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,5 @@ | ||
<header class="navbar d-print-none"> | ||
<div class="container-xl d-flex"> | ||
{% hook 'sylius_admin.common.component.navbar' with { _prefixes: [] } %} | ||
</div> | ||
</header> |
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
4 changes: 4 additions & 0 deletions
4
src/BootstrapAdminUi/tests/Functional/.application/config/packages/security.yaml
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,4 @@ | ||
security: | ||
firewalls: | ||
dev: | ||
pattern: ^/(_(profiler|wdt)|css|images|js)/ |
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,40 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MainTests\Sylius\Functional; | ||
|
||
use App\Factory\UserFactory; | ||
use Symfony\Bundle\FrameworkBundle\KernelBrowser; | ||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
use Zenstruck\Foundry\Test\Factories; | ||
use Zenstruck\Foundry\Test\ResetDatabase; | ||
|
||
final class DashboardTest extends WebTestCase | ||
{ | ||
Use Factories; | ||
use ResetDatabase; | ||
|
||
private KernelBrowser $client; | ||
|
||
protected function setUp(): void | ||
{ | ||
$this->client = self::createClient(); | ||
|
||
$user = UserFactory::new() | ||
->admin() | ||
->create() | ||
; | ||
|
||
$this->client->loginUser($user->_real()); | ||
} | ||
|
||
public function testDashboard(): void | ||
{ | ||
$this->client->request('GET', '/admin/'); | ||
|
||
self::assertResponseIsSuccessful(); | ||
|
||
self::assertSelectorTextContains('h1.page-title', 'Dashboard'); | ||
} | ||
} |