user-routing.module.ts 2 KB
Newer Older
1
2
3
import {AdminUserCreateRoutable} from "@admin/user/components/routables/admin-user-create/admin-user-create.routable";
import {AdminUserDetailRoutable} from "@admin/user/components/routables/admin-user-detail/admin-user-detail.routable";
import {AdminUserListRoutable} from "@admin/user/components/routables/admin-user-list/admin-user-list.routable";
4
import {AdminUserState} from "@admin/user/stores/admin-user.state";
5
6
7
8
9
import {NgModule} from "@angular/core";
import {
  RouterModule,
  Routes,
} from "@angular/router";
10
import {ApplicationRolePermissionEnum} from "@shared/enums/application-role-permission.enum";
11
12
13
14
import {
  AdminRoutesEnum,
  AppRoutesEnum,
} from "@shared/enums/routes.enum";
15
import {ApplicationRoleGuardService} from "@shared/guards/application-role-guard.service";
16
import {CanDeactivateGuard} from "@shared/services/can-deactivate-guard.service";
17
import {TRANSLATE} from "solidify-frontend";
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

const routes: Routes = [
  {
    path: AppRoutesEnum.root,
    component: AdminUserListRoutable,
    data: {
      permission: ApplicationRolePermissionEnum.rootPermission,
    },
    canActivate: [ApplicationRoleGuardService],
  },
  {
    path: AdminRoutesEnum.userDetail + AppRoutesEnum.separator + AppRoutesEnum.paramId,
    component: AdminUserDetailRoutable,
    data: {
      breadcrumb: TRANSLATE("breadcrumb.admin.user.detail"),
33
      breadcrumbMemoizedSelector: AdminUserState.currentTitle,
34
35
      permission: ApplicationRolePermissionEnum.rootPermission,
    },
36
37
38
39
40
41
42
43
44
    children: [
      {
        path: AdminRoutesEnum.userEdit,
        data: {
          breadcrumb: TRANSLATE("breadcrumb.admin.user.edit"),
        },
        canDeactivate: [CanDeactivateGuard],
      },
    ],
45
46
47
48
49
50
51
  },
  {
    path: AdminRoutesEnum.userCreate,
    component: AdminUserCreateRoutable,
    data: {
      breadcrumb: TRANSLATE("breadcrumb.admin.user.create"),
    },
52
    canDeactivate: [CanDeactivateGuard],
53
54
55
56
57
58
59
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
60
61
export class AdminUserRoutingModule {
}