user-routing.module.ts 2.03 KB
Newer Older
1
2
3
import {AdminUserCreateRoutable} from "@admin/user/components/routables/create/admin-user-create.routable";
import {AdminUserDetailRoutable} from "@admin/user/components/routables/detail/admin-user-detail.routable";
import {AdminUserEditRoutable} from "@admin/user/components/routables/edit/admin-user-edit.routable";
4
import {AdminUserListRoutable} from "@admin/user/components/routables/list/admin-user-list-routable";
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
33
34
35
36
37
38
39
40
41
42

const routes: Routes = [
  {
    path: AppRoutesEnum.root,
    component: AdminUserListRoutable,
    data: {
      breadcrumb: TRANSLATE("breadcrumb.admin.user.list"),
      permission: ApplicationRolePermissionEnum.rootPermission,
    },
    canActivate: [ApplicationRoleGuardService],
  },
  {
    path: AdminRoutesEnum.userDetail + AppRoutesEnum.separator + AppRoutesEnum.paramId,
    component: AdminUserDetailRoutable,
    data: {
      breadcrumb: TRANSLATE("breadcrumb.admin.user.detail"),
      permission: ApplicationRolePermissionEnum.rootPermission,
    },
  },
  {
    path: AdminRoutesEnum.userCreate,
    component: AdminUserCreateRoutable,
    data: {
      breadcrumb: TRANSLATE("breadcrumb.admin.user.create"),
    },
43
    canDeactivate: [CanDeactivateGuard]
44
45
46
47
48
49
50
  },
  {
    path: AdminRoutesEnum.userEdit + AppRoutesEnum.separator + AppRoutesEnum.paramId,
    component: AdminUserEditRoutable,
    data: {
      breadcrumb: TRANSLATE("breadcrumb.admin.user.edit"),
    },
51
    canDeactivate: [CanDeactivateGuard]
52
53
54
55
56
57
58
59
  },

];

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