|
@@ -13,6 +13,7 @@ import { EditPlantComponent } from '@app/components/plants/edit-plant/edit-plant
|
|
|
import { NewPlantComponent } from '@app/components/plants/new-plant/new-plant.component';
|
|
import { NewPlantComponent } from '@app/components/plants/new-plant/new-plant.component';
|
|
|
import { UsersComponent } from '@app/components/users/users.component';
|
|
import { UsersComponent } from '@app/components/users/users.component';
|
|
|
import { NewUserComponent } from '@app/components/users/new-user/new-user.component';
|
|
import { NewUserComponent } from '@app/components/users/new-user/new-user.component';
|
|
|
|
|
+import { AuthGuard } from '@app/services/auth.guard';
|
|
|
|
|
|
|
|
|
|
|
|
|
export const AdminLayoutRoutes: Routes = [
|
|
export const AdminLayoutRoutes: Routes = [
|
|
@@ -31,71 +32,90 @@ export const AdminLayoutRoutes: Routes = [
|
|
|
// General management
|
|
// General management
|
|
|
{ path: 'plants',
|
|
{ path: 'plants',
|
|
|
component: PlantsComponent,
|
|
component: PlantsComponent,
|
|
|
|
|
+ canActivate: [AuthGuard],
|
|
|
data: {
|
|
data: {
|
|
|
title: "Listado de plantas",
|
|
title: "Listado de plantas",
|
|
|
- breadcrumb: "Plantas"
|
|
|
|
|
|
|
+ breadcrumb: "Plantas",
|
|
|
|
|
+ roles: [2,3]
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
{ path: 'plants/new',
|
|
{ path: 'plants/new',
|
|
|
component: NewPlantComponent,
|
|
component: NewPlantComponent,
|
|
|
|
|
+ canActivate: [AuthGuard],
|
|
|
data: {
|
|
data: {
|
|
|
title: "Nueva planta",
|
|
title: "Nueva planta",
|
|
|
- breadcrumb: "Nueva planta"
|
|
|
|
|
|
|
+ breadcrumb: "Nueva planta",
|
|
|
|
|
+ roles: [3]
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
{ path: 'plant/:id/edit',
|
|
{ path: 'plant/:id/edit',
|
|
|
component: EditPlantComponent,
|
|
component: EditPlantComponent,
|
|
|
|
|
+ canActivate: [AuthGuard],
|
|
|
data: {
|
|
data: {
|
|
|
title: "Editar planta",
|
|
title: "Editar planta",
|
|
|
- breadcrumb: "Editar planta"
|
|
|
|
|
|
|
+ breadcrumb: "Editar planta",
|
|
|
|
|
+ roles: [2,3]
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
{ path: 'users',
|
|
{ path: 'users',
|
|
|
component: UsersComponent,
|
|
component: UsersComponent,
|
|
|
|
|
+ canActivate: [AuthGuard],
|
|
|
data: {
|
|
data: {
|
|
|
title: "Listado de usuarios",
|
|
title: "Listado de usuarios",
|
|
|
- breadcrumb: "Usuarios"
|
|
|
|
|
|
|
+ breadcrumb: "Usuarios",
|
|
|
|
|
+ roles: [3]
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
{ path: 'users/new',
|
|
{ path: 'users/new',
|
|
|
component: NewUserComponent,
|
|
component: NewUserComponent,
|
|
|
|
|
+ canActivate: [AuthGuard],
|
|
|
data: {
|
|
data: {
|
|
|
title: "Nuevo usuario",
|
|
title: "Nuevo usuario",
|
|
|
- breadcrumb: "Nuevo usuario"
|
|
|
|
|
|
|
+ breadcrumb: "Nuevo usuario",
|
|
|
|
|
+ roles: [3]
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// Organizations actions
|
|
// Organizations actions
|
|
|
{ path: 'organizations',
|
|
{ path: 'organizations',
|
|
|
component: OrganizationsComponent,
|
|
component: OrganizationsComponent,
|
|
|
|
|
+ canActivate: [AuthGuard],
|
|
|
data: {
|
|
data: {
|
|
|
title: "Listado de organizaciones",
|
|
title: "Listado de organizaciones",
|
|
|
- breadcrumb: "Organizaciones"
|
|
|
|
|
|
|
+ breadcrumb: "Organizaciones",
|
|
|
|
|
+ roles: [2,3]
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
path: 'organizations/new',
|
|
path: 'organizations/new',
|
|
|
component: NewOrganizationComponent,
|
|
component: NewOrganizationComponent,
|
|
|
|
|
+ canActivate: [AuthGuard],
|
|
|
data: {
|
|
data: {
|
|
|
title: 'Nueva organización',
|
|
title: 'Nueva organización',
|
|
|
- breadcrumb:'Nueva organización'
|
|
|
|
|
|
|
+ breadcrumb:'Nueva organización',
|
|
|
|
|
+ roles: [3]
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
path: 'organization/:id',
|
|
path: 'organization/:id',
|
|
|
component: OrganizationComponent,
|
|
component: OrganizationComponent,
|
|
|
|
|
+ canActivate: [AuthGuard],
|
|
|
data: {
|
|
data: {
|
|
|
- title: 'Organización'
|
|
|
|
|
|
|
+ title: 'Organización',
|
|
|
|
|
+ breadcrumb: 'Detalle',
|
|
|
|
|
+ roles: [2,3]
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
path: 'organization/:id/edit',
|
|
path: 'organization/:id/edit',
|
|
|
|
|
+ canActivate: [AuthGuard],
|
|
|
component: EditOrganizationComponent,
|
|
component: EditOrganizationComponent,
|
|
|
data: {
|
|
data: {
|
|
|
title: 'Editar organización',
|
|
title: 'Editar organización',
|
|
|
-
|
|
|
|
|
|
|
+ breadcrumb: 'Editar organización',
|
|
|
|
|
+ roles: [3]
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|