user-routing.module.ts 1.74 KB
Newer Older
1
import {AdminUserCreateRoutable} from "@admin/user/components/routables/admin-user-create/admin-user-create.routable";
2
import {AdminUserDetailEditRoutable} from "@admin/user/components/routables/admin-user-detail-edit/admin-user-detail-edit.routable";
3
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
10
11
12
13
import {NgModule} from "@angular/core";
import {
  RouterModule,
  Routes,
} from "@angular/router";
import {
  AdminRoutesEnum,
  AppRoutesEnum,
} from "@shared/enums/routes.enum";
14
import {ApplicationRoleGuardService} from "@shared/guards/application-role-guard.service";
15
import {CanDeactivateGuard} from "@shared/services/can-deactivate-guard.service";
16
import {TRANSLATE} from "solidify-frontend";
17
18
19
20
21
22
23
24
25
26
27

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

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