Skip to content

Commit 97e3c0d

Browse files
authored
Merge pull request #375 from dotkernel/issue374
Changed route names to be in line with API naming scheme
2 parents 494d105 + ed980dd commit 97e3c0d

38 files changed

+166
-167
lines changed

config/autoload/authorization-guards.global.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,33 @@
1818
'type' => 'RoutePermission',
1919
'options' => [
2020
'rules' => [
21-
'admin::admin-login-form' => [],
22-
'admin::admin-login' => [],
23-
'admin::admin-create-form' => ['authenticated'],
24-
'admin::admin-create' => ['authenticated'],
25-
'admin::admin-delete-form' => ['authenticated'],
26-
'admin::admin-delete' => ['authenticated'],
27-
'admin::admin-edit-form' => ['authenticated'],
28-
'admin::admin-edit' => ['authenticated'],
29-
'admin::admin-list' => ['authenticated'],
30-
'admin::admin-login-list' => ['authenticated'],
31-
'admin::account-change-password' => ['authenticated'],
32-
'admin::account-edit-form' => ['authenticated'],
33-
'admin::account-edit' => ['authenticated'],
34-
'admin::admin-logout' => ['authenticated'],
21+
'admin::login-admin-form' => [],
22+
'admin::login-admin' => [],
23+
'admin::create-admin-form' => ['authenticated'],
24+
'admin::create-admin' => ['authenticated'],
25+
'admin::delete-admin-form' => ['authenticated'],
26+
'admin::delete-admin' => ['authenticated'],
27+
'admin::edit-admin-form' => ['authenticated'],
28+
'admin::edit-admin' => ['authenticated'],
29+
'admin::list-admin' => ['authenticated'],
30+
'admin::list-admin-login' => ['authenticated'],
31+
'admin::change-account-password' => ['authenticated'],
32+
'admin::edit-account-form' => ['authenticated'],
33+
'admin::edit-account' => ['authenticated'],
34+
'admin::logout-admin' => ['authenticated'],
3535
'app::index-redirect' => ['authenticated'],
36-
'dashboard::dashboard-view' => ['authenticated'],
36+
'dashboard::view-dashboard' => ['authenticated'],
3737
'page::components' => ['authenticated'],
38-
'setting::setting-store' => ['authenticated'],
39-
'setting::setting-view' => ['authenticated'],
40-
'user::user-create-form' => ['authenticated'],
41-
'user::user-create' => ['authenticated'],
42-
'user::user-edit-form' => ['authenticated'],
43-
'user::user-edit' => ['authenticated'],
44-
'user::user-delete-form' => ['authenticated'],
45-
'user::user-delete' => ['authenticated'],
46-
'user::user-list' => ['authenticated'],
47-
'user::user-avatar-edit' => ['authenticated'],
38+
'setting::store-setting' => ['authenticated'],
39+
'setting::view-setting' => ['authenticated'],
40+
'user::create-user-form' => ['authenticated'],
41+
'user::create-user' => ['authenticated'],
42+
'user::edit-user-form' => ['authenticated'],
43+
'user::edit-user' => ['authenticated'],
44+
'user::delete-user-form' => ['authenticated'],
45+
'user::delete-user' => ['authenticated'],
46+
'user::list-user' => ['authenticated'],
47+
'user::edit-user-avatar' => ['authenticated'],
4848
],
4949
],
5050
],

config/autoload/navigation.global.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
'options' => [
1616
'label' => 'Dashboard',
1717
'route' => [
18-
'route_name' => 'dashboard::dashboard-view',
18+
'route_name' => 'dashboard::view-dashboard',
1919
],
2020
'icon' => 'c-blue-500 fa fa-home',
2121
],
@@ -31,15 +31,15 @@
3131
'options' => [
3232
'label' => 'Admin accounts',
3333
'route' => [
34-
'route_name' => 'admin::admin-list',
34+
'route_name' => 'admin::list-admin',
3535
],
3636
],
3737
],
3838
[
3939
'options' => [
4040
'label' => 'Login attempts',
4141
'route' => [
42-
'route_name' => 'admin::admin-login-list',
42+
'route_name' => 'admin::list-admin-login',
4343
],
4444
],
4545
],
@@ -56,7 +56,7 @@
5656
'options' => [
5757
'label' => 'User accounts',
5858
'route' => [
59-
'route_name' => 'user::user-list',
59+
'route_name' => 'user::list-user',
6060
],
6161
],
6262
],
@@ -82,7 +82,7 @@
8282
'options' => [
8383
'label' => 'Profile',
8484
'route' => [
85-
'route_name' => 'admin::account-edit-form',
85+
'route_name' => 'admin::edit-account-form',
8686
],
8787
'icon' => 'ti-user',
8888
],
@@ -91,7 +91,7 @@
9191
'options' => [
9292
'label' => 'Logout',
9393
'route' => [
94-
'route_name' => 'admin::admin-logout',
94+
'route_name' => 'admin::logout-admin',
9595
],
9696
'icon' => 'ti-power-off',
9797
],

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ public function handle(ServerRequestInterface $request): ResponseInterface
5252
return new EmptyResponse(StatusCodeInterface::STATUS_NOT_FOUND);
5353
}
5454

55-
$this->accountForm->setAttribute('action', $this->router->generateUri('admin::account-edit'));
55+
$this->accountForm->setAttribute('action', $this->router->generateUri('admin::edit-account'));
5656
$this->changePasswordForm
57-
->setAttribute('action', $this->router->generateUri('admin::account-change-password'));
57+
->setAttribute('action', $this->router->generateUri('admin::change-account-password'));
5858

5959
$this->accountForm->bind($admin);
6060

6161
return new HtmlResponse(
62-
$this->template->render('admin::account-view', [
62+
$this->template->render('admin::view-account', [
6363
'accountForm' => $this->accountForm->prepare(),
6464
'changePasswordForm' => $this->changePasswordForm->prepare(),
6565
])

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::admin-login-form')
32+
$this->router->generateUri('admin::login-admin-form')
3333
);
3434
}
3535
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
5959
$this->changePasswordForm->setData($data);
6060
if (! $this->changePasswordForm->isValid()) {
6161
return new HtmlResponse(
62-
$this->template->render('admin::account-view', [
62+
$this->template->render('admin::view-account', [
6363
'accountForm' => $this->accountForm->prepare(),
6464
'changePasswordForm' => $this->changePasswordForm->prepare(),
6565
])
@@ -74,9 +74,9 @@ public function handle(ServerRequestInterface $request): ResponseInterface
7474
return new EmptyResponse(StatusCodeInterface::STATUS_NOT_FOUND);
7575
}
7676

77-
$this->accountForm->setAttribute('action', $this->router->generateUri('admin::account-edit'));
77+
$this->accountForm->setAttribute('action', $this->router->generateUri('admin::edit-account'));
7878
$this->changePasswordForm
79-
->setAttribute('action', $this->router->generateUri('admin::account-change-password'));
79+
->setAttribute('action', $this->router->generateUri('admin::change-account-password'));
8080

8181
try {
8282
/** @var ChangePasswordDataType $data */
@@ -97,6 +97,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface
9797
$this->messenger->addError(Message::AN_ERROR_OCCURRED);
9898
}
9999

100-
return new RedirectResponse($this->router->generateUri('admin::account-edit-form'));
100+
return new RedirectResponse($this->router->generateUri('admin::edit-account-form'));
101101
}
102102
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
6161
$this->accountForm->setData($data);
6262
if (! $this->accountForm->isValid()) {
6363
return new HtmlResponse(
64-
$this->template->render('admin::account-view', [
64+
$this->template->render('admin::view-account', [
6565
'accountForm' => $this->accountForm->prepare(),
6666
'changePasswordForm' => $this->changePasswordForm->prepare(),
6767
])
@@ -76,9 +76,9 @@ public function handle(ServerRequestInterface $request): ResponseInterface
7676
return new EmptyResponse(StatusCodeInterface::STATUS_NOT_FOUND);
7777
}
7878

79-
$this->accountForm->setAttribute('action', $this->router->generateUri('admin::account-edit'));
79+
$this->accountForm->setAttribute('action', $this->router->generateUri('admin::edit-account'));
8080
$this->changePasswordForm
81-
->setAttribute('action', $this->router->generateUri('admin::account-change-password'));
81+
->setAttribute('action', $this->router->generateUri('admin::change-account-password'));
8282

8383
try {
8484
/** @var EditAccountDataType $data */
@@ -97,6 +97,6 @@ public function handle(ServerRequestInterface $request): ResponseInterface
9797
$this->messenger->addError(Message::AN_ERROR_OCCURRED);
9898
}
9999

100-
return new RedirectResponse($this->router->generateUri('admin::account-edit'));
100+
return new RedirectResponse($this->router->generateUri('admin::edit-account'));
101101
}
102102
}

src/Admin/src/Handler/Admin/GetAdminCreateFormHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ public function __construct(
2929

3030
public function handle(ServerRequestInterface $request): ResponseInterface
3131
{
32-
$this->createAdminForm->setAttribute('action', $this->router->generateUri('admin::admin-create'));
32+
$this->createAdminForm->setAttribute('action', $this->router->generateUri('admin::create-admin'));
3333

3434
return new HtmlResponse(
35-
$this->template->render('admin::admin-create-form', [
35+
$this->template->render('admin::create-admin-form', [
3636
'form' => $this->createAdminForm->prepare(),
3737
])
3838
);

src/Admin/src/Handler/Admin/GetAdminDeleteFormHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ public function handle(ServerRequestInterface $request): ResponseInterface
4848

4949
$this->deleteAdminForm->setAttribute(
5050
'action',
51-
$this->router->generateUri('admin::admin-delete', ['uuid' => $admin->getUuid()->toString()])
51+
$this->router->generateUri('admin::delete-admin', ['uuid' => $admin->getUuid()->toString()])
5252
);
5353

5454
return new HtmlResponse(
55-
$this->template->render('admin::admin-delete-form', [
55+
$this->template->render('admin::delete-admin-form', [
5656
'form' => $this->deleteAdminForm->prepare(),
5757
'admin' => $admin,
5858
]),

src/Admin/src/Handler/Admin/GetAdminEditFormHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ public function handle(ServerRequestInterface $request): ResponseInterface
7171
$this->editAdminForm
7272
->setAttribute(
7373
'action',
74-
$this->router->generateUri('admin::admin-edit', ['uuid' => $admin->getUuid()->toString()])
74+
$this->router->generateUri('admin::edit-admin', ['uuid' => $admin->getUuid()->toString()])
7575
)
7676
->bind($admin)
7777
->setRoles($adminRoles);
7878

7979
return new HtmlResponse(
80-
$this->template->render('admin::admin-edit-form', [
80+
$this->template->render('admin::edit-admin-form', [
8181
'form' => $this->editAdminForm->prepare(),
8282
'admin' => $admin,
8383
])

src/Admin/src/Handler/Admin/GetAdminListHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(
3030
public function handle(ServerRequestInterface $request): ResponseInterface
3131
{
3232
return new HtmlResponse(
33-
$this->template->render('admin::admin-list', [
33+
$this->template->render('admin::list-admin', [
3434
'pagination' => $this->adminService->getAdmins($request->getQueryParams()),
3535
'statuses' => AdminStatusEnum::cases(),
3636
'roles' => AdminRoleEnum::cases(),

0 commit comments

Comments
 (0)