Skip to content

Commit 4fc58d9

Browse files
committed
requested changes + unit tests
Signed-off-by: MarioRadu <magda_marior@yahoo.com>
1 parent 80927d4 commit 4fc58d9

File tree

56 files changed

+2151
-415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2151
-415
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
"ext-gettext": "*",
3232
"dotkernel/dot-cache": "^4.0",
3333
"dotkernel/dot-cli": "^3.5.0",
34-
"dotkernel/dot-controller": "^3.4.3",
3534
"dotkernel/dot-data-fixtures": "^1.1.3",
3635
"dotkernel/dot-dependency-injection": "^1.0",
3736
"dotkernel/dot-errorhandler": "^4.0.0",
@@ -72,6 +71,8 @@
7271
"psr-4": {
7372
"Admin\\App\\": "src/App/src/",
7473
"Admin\\Admin\\": "src/Admin/src/",
74+
"Admin\\Page\\": "src/Page/src/",
75+
"Admin\\Dashboard\\": "src/Dashboard/src/",
7576
"Admin\\Setting\\": "src/Setting/src/"
7677
}
7778
},

config/autoload/local.php.dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ return [
3030
'name' => $app['name'] ?? '',
3131
'url' => $baseUrl,
3232
],
33+
'routes' => [
34+
'page' => [
35+
'component' => 'components',
36+
],
37+
],
3338
'databases' => $databases,
3439
'doctrine' => [
3540
'connection' => [

config/autoload/navigation.global.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
'options' => [
7575
'label' => 'Logout',
7676
'route' => [
77-
'route_name' => 'admin::logout',
77+
'route_name' => 'admin::admin-logout',
7878
],
7979
'icon' => 'ti-power-off',
8080
],

config/config.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
Admin\App\ConfigProvider::class,
5252
Admin\Admin\ConfigProvider::class,
5353
Admin\Setting\ConfigProvider::class,
54+
Admin\Page\ConfigProvider::class,
55+
Admin\Dashboard\ConfigProvider::class,
5456

5557
// Load application config in a pre-defined order in such a way that local settings
5658
// overwrite global settings. (Loaded as first to last):

phpstan.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ parameters:
2121
path: src
2222
-
2323
message: '#Call to an undefined method Laminas\\Authentication\\AuthenticationServiceInterface::getAdapter\(\)#'
24-
path: src/Admin/src/Handler/Account/LoginHandler.php
24+
path: src/Admin/src/Handler/Account/PostAccountLoginHandler.php
2525
-
2626
message: '#Call to an undefined method Laminas\\Authentication\\AuthenticationServiceInterface::getStorage\(\)#'
27-
path: src/Admin/src/Handler/Account/LoginHandler.php
27+
path: src/Admin/src/Handler/Account/PostAccountLoginHandler.php
2828

src/Admin/src/ConfigProvider.php

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
use Admin\Admin\Form\AdminForm;
1515
use Admin\Admin\Form\ChangePasswordForm;
1616
use Admin\Admin\Form\LoginForm;
17-
use Admin\Admin\Handler\Account\PostAccountChangePasswordHandler;
18-
use Admin\Admin\Handler\Account\PostAccountEditHandler;
1917
use Admin\Admin\Handler\Account\GetAccountEditFormHandler;
2018
use Admin\Admin\Handler\Account\GetAccountLoginFormHandler;
21-
use Admin\Admin\Handler\Account\PostAccountLoginHandler;
2219
use Admin\Admin\Handler\Account\GetAccountLogoutHandler;
23-
use Admin\Admin\Handler\Admin\PostAdminDeleteHandler;
24-
use Admin\Admin\Handler\Admin\PostAdminEditHandler;
25-
use Admin\Admin\Handler\Admin\GetAdminListHandler;
20+
use Admin\Admin\Handler\Account\PostAccountChangePasswordHandler;
21+
use Admin\Admin\Handler\Account\PostAccountEditHandler;
22+
use Admin\Admin\Handler\Account\PostAccountLoginHandler;
2623
use Admin\Admin\Handler\Admin\GetAdminCreateFormHandler;
2724
use Admin\Admin\Handler\Admin\GetAdminDeleteFormHandler;
2825
use Admin\Admin\Handler\Admin\GetAdminEditFormHandler;
26+
use Admin\Admin\Handler\Admin\GetAdminListHandler;
2927
use Admin\Admin\Handler\Admin\GetAdminLoginListHandler;
3028
use Admin\Admin\Handler\Admin\PostAdminCreateHandler;
29+
use Admin\Admin\Handler\Admin\PostAdminDeleteHandler;
30+
use Admin\Admin\Handler\Admin\PostAdminEditHandler;
3131
use Admin\Admin\Repository\AdminLoginRepository;
3232
use Admin\Admin\Repository\AdminRepository;
3333
use Admin\Admin\Repository\AdminRoleRepository;
@@ -66,29 +66,29 @@ public function getDependencies(): array
6666
],
6767
],
6868
'factories' => [
69-
AdminController::class => AttributedServiceFactory::class,
70-
GetAdminCreateFormHandler::class => AttributedServiceFactory::class,
71-
PostAdminCreateHandler::class => AttributedServiceFactory::class,
72-
GetAdminEditFormHandler::class => AttributedServiceFactory::class,
73-
PostAdminEditHandler::class => AttributedServiceFactory::class,
74-
GetAdminDeleteFormHandler::class => AttributedServiceFactory::class,
75-
PostAdminDeleteHandler::class => AttributedServiceFactory::class,
76-
GetAdminListHandler::class => AttributedServiceFactory::class,
77-
GetAdminLoginListHandler::class => AttributedServiceFactory::class,
78-
GetAccountEditFormHandler::class => AttributedServiceFactory::class,
79-
PostAccountEditHandler::class => AttributedServiceFactory::class,
80-
PostAccountChangePasswordHandler::class => AttributedServiceFactory::class,
81-
GetAccountLoginFormHandler::class => AttributedServiceFactory::class,
82-
PostAccountLoginHandler::class => AttributedServiceFactory::class,
83-
GetAccountLogoutHandler::class => AttributedServiceFactory::class,
84-
AdminService::class => AttributedServiceFactory::class,
85-
AdminRoleService::class => AttributedServiceFactory::class,
86-
AdminRepository::class => AttributedRepositoryFactory::class,
87-
AdminRoleRepository::class => AttributedRepositoryFactory::class,
88-
AdminLoginRepository::class => AttributedRepositoryFactory::class,
89-
AdminForm::class => ElementFactory::class,
90-
AuthenticationService::class => AuthenticationServiceFactory::class,
91-
AuthenticationAdapter::class => AttributedServiceFactory::class,
69+
AdminController::class => AttributedServiceFactory::class,
70+
GetAdminCreateFormHandler::class => AttributedServiceFactory::class,
71+
PostAdminCreateHandler::class => AttributedServiceFactory::class,
72+
GetAdminEditFormHandler::class => AttributedServiceFactory::class,
73+
PostAdminEditHandler::class => AttributedServiceFactory::class,
74+
GetAdminDeleteFormHandler::class => AttributedServiceFactory::class,
75+
PostAdminDeleteHandler::class => AttributedServiceFactory::class,
76+
GetAdminListHandler::class => AttributedServiceFactory::class,
77+
GetAdminLoginListHandler::class => AttributedServiceFactory::class,
78+
GetAccountEditFormHandler::class => AttributedServiceFactory::class,
79+
PostAccountEditHandler::class => AttributedServiceFactory::class,
80+
PostAccountChangePasswordHandler::class => AttributedServiceFactory::class,
81+
GetAccountLoginFormHandler::class => AttributedServiceFactory::class,
82+
PostAccountLoginHandler::class => AttributedServiceFactory::class,
83+
GetAccountLogoutHandler::class => AttributedServiceFactory::class,
84+
AdminService::class => AttributedServiceFactory::class,
85+
AdminRoleService::class => AttributedServiceFactory::class,
86+
AdminRepository::class => AttributedRepositoryFactory::class,
87+
AdminRoleRepository::class => AttributedRepositoryFactory::class,
88+
AdminLoginRepository::class => AttributedRepositoryFactory::class,
89+
AdminForm::class => ElementFactory::class,
90+
AuthenticationService::class => AuthenticationServiceFactory::class,
91+
AuthenticationAdapter::class => AttributedServiceFactory::class,
9292
],
9393
'aliases' => [
9494
AdminInterface::class => Admin::class,

src/Admin/src/Handler/Account/GetAccountEditFormHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
4141
$this->accountForm->setAttribute('action', $this->router->generateUri('admin::edit-account'));
4242
$this->changePasswordForm->setAttribute(
4343
'action',
44-
$this->router->generateUri('admin::change-password')
44+
$this->router->generateUri('admin::account-change-password')
4545
);
4646

4747
$identity = $this->authenticationService->getIdentity();

src/Admin/src/Handler/Account/GetAccountLogoutHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
2929
$this->authenticationService->clearIdentity();
3030

3131
return new RedirectResponse(
32-
$this->router->generateUri('admin::get-login-form')
32+
$this->router->generateUri('admin::admin-login-form')
3333
);
3434
}
3535
}

src/Admin/src/Handler/Account/PostAccountChangePasswordHandler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ public function handle(ServerRequestInterface $request): ResponseInterface
5454
{
5555
try {
5656
$this->accountForm->setAttribute('action', $this->router->generateUri('admin::edit-account'));
57-
$this->changePasswordForm->setAttribute('action', $this->router->generateUri('admin::change-password'));
57+
$this->changePasswordForm->setAttribute(
58+
'action',
59+
$this->router->generateUri('admin::account-change-password')
60+
);
5861

5962
/** @var AdminIdentity $adminIdentity */
6063
$adminIdentity = $this->authenticationService->getIdentity();

src/Admin/src/Handler/Account/PostAccountEditHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
5555

5656
$this->changePasswordForm->setAttribute(
5757
'action',
58-
$this->router->generateUri('admin::change-password')
58+
$this->router->generateUri('admin::account-change-password')
5959
);
6060

6161
$identity = $this->authenticationService->getIdentity();

0 commit comments

Comments
 (0)