mirror of https://github.com/abpframework/abp.git
6 changed files with 106 additions and 27 deletions
@ -0,0 +1,41 @@ |
|||||
|
import { Routes } from '@angular/router'; |
||||
|
|
||||
|
import { |
||||
|
authGuard, |
||||
|
permissionGuard, |
||||
|
ReplaceableComponents, |
||||
|
ReplaceableRouteContainerComponent, |
||||
|
ReplaceableRouteContainerStandaloneComponent, |
||||
|
RouterOutletComponent, |
||||
|
RouterOutletStandaloneComponent, |
||||
|
} from '@abp/ng.core'; |
||||
|
|
||||
|
import { TenantsComponent } from './components/tenants/tenants.component'; |
||||
|
import { eTenantManagementComponents } from './enums/components'; |
||||
|
import { tenantManagementExtensionsResolver } from './resolvers'; |
||||
|
import { provideTenantManagement } from './tenant-management'; |
||||
|
|
||||
|
export const tenantManagementRoutes: Routes = [ |
||||
|
{ |
||||
|
path: '', |
||||
|
component: RouterOutletStandaloneComponent, |
||||
|
canActivate: [authGuard, permissionGuard], |
||||
|
resolve: [tenantManagementExtensionsResolver], |
||||
|
providers: [...provideTenantManagement()], |
||||
|
children: [ |
||||
|
{ path: '', redirectTo: 'tenants', pathMatch: 'full' }, |
||||
|
{ |
||||
|
path: 'tenants', |
||||
|
component: ReplaceableRouteContainerStandaloneComponent, |
||||
|
data: { |
||||
|
requiredPolicy: 'AbpTenantManagement.Tenants', |
||||
|
replaceableComponent: { |
||||
|
key: eTenantManagementComponents.Tenants, |
||||
|
defaultComponent: TenantsComponent, |
||||
|
} as ReplaceableComponents.RouteData<TenantsComponent>, |
||||
|
}, |
||||
|
title: 'AbpTenantManagement::Tenants', |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
]; |
||||
@ -0,0 +1,35 @@ |
|||||
|
import { TenantManagementExtensionsGuard } from './guards/extensions.guard'; |
||||
|
import { TenantManagementConfigOptions } from './models/config-options'; |
||||
|
import { |
||||
|
TENANT_MANAGEMENT_CREATE_FORM_PROP_CONTRIBUTORS, |
||||
|
TENANT_MANAGEMENT_EDIT_FORM_PROP_CONTRIBUTORS, |
||||
|
TENANT_MANAGEMENT_ENTITY_ACTION_CONTRIBUTORS, |
||||
|
TENANT_MANAGEMENT_ENTITY_PROP_CONTRIBUTORS, |
||||
|
TENANT_MANAGEMENT_TOOLBAR_ACTION_CONTRIBUTORS, |
||||
|
} from './tokens/extensions.token'; |
||||
|
|
||||
|
export function provideTenantManagement(options: TenantManagementConfigOptions = {}) { |
||||
|
return [ |
||||
|
{ |
||||
|
provide: TENANT_MANAGEMENT_ENTITY_ACTION_CONTRIBUTORS, |
||||
|
useValue: options.entityActionContributors, |
||||
|
}, |
||||
|
{ |
||||
|
provide: TENANT_MANAGEMENT_TOOLBAR_ACTION_CONTRIBUTORS, |
||||
|
useValue: options.toolbarActionContributors, |
||||
|
}, |
||||
|
{ |
||||
|
provide: TENANT_MANAGEMENT_ENTITY_PROP_CONTRIBUTORS, |
||||
|
useValue: options.entityPropContributors, |
||||
|
}, |
||||
|
{ |
||||
|
provide: TENANT_MANAGEMENT_CREATE_FORM_PROP_CONTRIBUTORS, |
||||
|
useValue: options.createFormPropContributors, |
||||
|
}, |
||||
|
{ |
||||
|
provide: TENANT_MANAGEMENT_EDIT_FORM_PROP_CONTRIBUTORS, |
||||
|
useValue: options.editFormPropContributors, |
||||
|
}, |
||||
|
TenantManagementExtensionsGuard, |
||||
|
]; |
||||
|
} |
||||
Loading…
Reference in new issue