mirror of https://github.com/abpframework/abp.git
committed by
GitHub
167 changed files with 1467 additions and 1096 deletions
@ -1,34 +0,0 @@ |
|||||
import { NgModule } from '@angular/core'; |
|
||||
import { RouterModule, Routes } from '@angular/router'; |
|
||||
|
|
||||
const routes: Routes = [ |
|
||||
{ |
|
||||
path: '', |
|
||||
pathMatch: 'full', |
|
||||
loadChildren: () => import('./home/home.module').then(m => m.HomeModule), |
|
||||
}, |
|
||||
{ |
|
||||
path: 'account', |
|
||||
loadChildren: () => import('@abp/ng.account').then(m => m.AccountModule.forLazy()), |
|
||||
}, |
|
||||
{ |
|
||||
path: 'identity', |
|
||||
loadChildren: () => import('@abp/ng.identity').then(m => m.IdentityModule.forLazy()), |
|
||||
}, |
|
||||
{ |
|
||||
path: 'tenant-management', |
|
||||
loadChildren: () => |
|
||||
import('@abp/ng.tenant-management').then(m => m.TenantManagementModule.forLazy()), |
|
||||
}, |
|
||||
{ |
|
||||
path: 'setting-management', |
|
||||
loadChildren: () => |
|
||||
import('@abp/ng.setting-management').then(m => m.SettingManagementModule.forLazy()), |
|
||||
}, |
|
||||
]; |
|
||||
|
|
||||
@NgModule({ |
|
||||
imports: [RouterModule.forRoot(routes, {})], |
|
||||
exports: [RouterModule], |
|
||||
}) |
|
||||
export class AppRoutingModule {} |
|
||||
@ -1,12 +1,14 @@ |
|||||
import { Component } from '@angular/core'; |
import { Component } from '@angular/core'; |
||||
|
import { InternetConnectionStatusComponent, LoaderBarComponent } from '@abp/ng.theme.shared'; |
||||
|
import { DynamicLayoutComponent } from '@abp/ng.core'; |
||||
|
|
||||
@Component({ |
@Component({ |
||||
standalone: false, |
|
||||
selector: 'app-root', |
selector: 'app-root', |
||||
template: ` |
template: ` |
||||
<abp-loader-bar></abp-loader-bar> |
<abp-loader-bar></abp-loader-bar> |
||||
<abp-dynamic-layout></abp-dynamic-layout> |
<abp-dynamic-layout></abp-dynamic-layout> |
||||
<abp-internet-status></abp-internet-status> |
<abp-internet-status></abp-internet-status> |
||||
`,
|
`,
|
||||
|
imports: [LoaderBarComponent, DynamicLayoutComponent, InternetConnectionStatusComponent], |
||||
}) |
}) |
||||
export class AppComponent {} |
export class AppComponent {} |
||||
|
|||||
@ -0,0 +1,42 @@ |
|||||
|
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core'; |
||||
|
import { provideRouter } from '@angular/router'; |
||||
|
|
||||
|
import { appRoutes } from './app.routes'; |
||||
|
import { APP_ROUTE_PROVIDER } from './route.provider'; |
||||
|
import { provideAbpCore, withOptions } from '@abp/ng.core'; |
||||
|
import { environment } from '../environments/environment'; |
||||
|
import { registerLocale } from '@abp/ng.core/locale'; |
||||
|
import { provideAbpOAuth } from '@abp/ng.oauth'; |
||||
|
import { provideAbpThemeShared } from '@abp/ng.theme.shared'; |
||||
|
import { provideSettingManagementConfig } from '@abp/ng.setting-management/config'; |
||||
|
import { provideAccountConfig } from '@abp/ng.account/config'; |
||||
|
import { provideIdentityConfig } from '@abp/ng.identity/config'; |
||||
|
import { provideTenantManagementConfig } from '@abp/ng.tenant-management/config'; |
||||
|
import { provideFeatureManagementConfig } from '@abp/ng.feature-management'; |
||||
|
import { provideThemeBasicConfig } from '@abp/ng.theme.basic'; |
||||
|
import { provideAnimations } from '@angular/platform-browser/animations'; |
||||
|
|
||||
|
export const appConfig: ApplicationConfig = { |
||||
|
providers: [ |
||||
|
provideRouter(appRoutes), |
||||
|
APP_ROUTE_PROVIDER, |
||||
|
provideAbpCore( |
||||
|
withOptions({ |
||||
|
environment, |
||||
|
registerLocaleFn: registerLocale(), |
||||
|
sendNullsAsQueryParam: false, |
||||
|
skipGetAppConfiguration: false, |
||||
|
}), |
||||
|
), |
||||
|
provideAbpOAuth(), |
||||
|
provideAbpThemeShared(), |
||||
|
provideSettingManagementConfig(), |
||||
|
provideAccountConfig(), |
||||
|
provideIdentityConfig(), |
||||
|
provideTenantManagementConfig(), |
||||
|
provideFeatureManagementConfig(), |
||||
|
provideZoneChangeDetection({ eventCoalescing: true }), |
||||
|
provideThemeBasicConfig(), |
||||
|
provideAnimations(), |
||||
|
], |
||||
|
}; |
||||
@ -1,58 +0,0 @@ |
|||||
import { NgModule } from '@angular/core'; |
|
||||
import { BrowserModule } from '@angular/platform-browser'; |
|
||||
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; |
|
||||
import { CoreModule, provideAbpCore, withOptions } from '@abp/ng.core'; |
|
||||
import { registerLocale } from '@abp/ng.core/locale'; |
|
||||
import { |
|
||||
InternetConnectionStatusComponent, |
|
||||
ThemeSharedModule, |
|
||||
provideAbpThemeShared, |
|
||||
} from '@abp/ng.theme.shared'; |
|
||||
import { ThemeLeptonXModule } from '@abp/ng.theme.lepton-x'; |
|
||||
import { SideMenuLayoutModule } from '@abp/ng.theme.lepton-x/layouts'; |
|
||||
import { provideAbpOAuth } from '@abp/ng.oauth'; |
|
||||
import { provideSettingManagementConfig } from '@abp/ng.setting-management/config'; |
|
||||
import { provideAccountConfig } from '@abp/ng.account/config'; |
|
||||
import { provideIdentityConfig } from '@abp/ng.identity/config'; |
|
||||
import { provideTenantManagementConfig } from '@abp/ng.tenant-management/config'; |
|
||||
import { provideFeatureManagementConfig } from '@abp/ng.feature-management'; |
|
||||
import { AccountLayoutModule } from '@abp/ng.theme.lepton-x/account'; |
|
||||
import { environment } from '../environments/environment'; |
|
||||
import { AppRoutingModule } from './app-routing.module'; |
|
||||
import { AppComponent } from './app.component'; |
|
||||
import { APP_ROUTE_PROVIDER } from './route.provider'; |
|
||||
|
|
||||
@NgModule({ |
|
||||
imports: [ |
|
||||
BrowserModule, |
|
||||
BrowserAnimationsModule, |
|
||||
AppRoutingModule, |
|
||||
CoreModule, |
|
||||
ThemeSharedModule, |
|
||||
ThemeLeptonXModule.forRoot(), |
|
||||
SideMenuLayoutModule.forRoot(), |
|
||||
AccountLayoutModule.forRoot(), |
|
||||
InternetConnectionStatusComponent, |
|
||||
], |
|
||||
providers: [ |
|
||||
APP_ROUTE_PROVIDER, |
|
||||
provideAbpCore( |
|
||||
withOptions({ |
|
||||
environment, |
|
||||
registerLocaleFn: registerLocale(), |
|
||||
sendNullsAsQueryParam: false, |
|
||||
skipGetAppConfiguration: false, |
|
||||
}), |
|
||||
), |
|
||||
provideAbpOAuth(), |
|
||||
provideAbpThemeShared(), |
|
||||
provideSettingManagementConfig(), |
|
||||
provideAccountConfig(), |
|
||||
provideIdentityConfig(), |
|
||||
provideTenantManagementConfig(), |
|
||||
provideFeatureManagementConfig(), |
|
||||
], |
|
||||
declarations: [AppComponent], |
|
||||
bootstrap: [AppComponent], |
|
||||
}) |
|
||||
export class AppModule {} |
|
||||
@ -0,0 +1,25 @@ |
|||||
|
import { Routes } from '@angular/router'; |
||||
|
|
||||
|
export const appRoutes: Routes = [ |
||||
|
{ |
||||
|
path: '', |
||||
|
pathMatch: 'full', |
||||
|
loadComponent: () => import('./home/home.component').then(m => m.HomeComponent), |
||||
|
}, |
||||
|
{ |
||||
|
path: 'account', |
||||
|
loadChildren: () => import('@abp/ng.account').then(m => m.createRoutes()), |
||||
|
}, |
||||
|
{ |
||||
|
path: 'identity', |
||||
|
loadChildren: () => import('@abp/ng.identity').then(m => m.createRoutes()), |
||||
|
}, |
||||
|
{ |
||||
|
path: 'tenant-management', |
||||
|
loadChildren: () => import('@abp/ng.tenant-management').then(m => m.createRoutes()), |
||||
|
}, |
||||
|
{ |
||||
|
path: 'setting-management', |
||||
|
loadChildren: () => import('@abp/ng.setting-management').then(m => m.createRoutes()), |
||||
|
}, |
||||
|
]; |
||||
@ -1,11 +0,0 @@ |
|||||
import { NgModule } from '@angular/core'; |
|
||||
import { Routes, RouterModule } from '@angular/router'; |
|
||||
import { HomeComponent } from './home.component'; |
|
||||
|
|
||||
const routes: Routes = [{ path: '', component: HomeComponent }]; |
|
||||
|
|
||||
@NgModule({ |
|
||||
imports: [RouterModule.forChild(routes)], |
|
||||
exports: [RouterModule], |
|
||||
}) |
|
||||
export class HomeRoutingModule {} |
|
||||
@ -1,10 +0,0 @@ |
|||||
import { NgModule } from '@angular/core'; |
|
||||
import { SharedModule } from '../shared/shared.module'; |
|
||||
import { HomeRoutingModule } from './home-routing.module'; |
|
||||
import { HomeComponent } from './home.component'; |
|
||||
|
|
||||
@NgModule({ |
|
||||
declarations: [HomeComponent], |
|
||||
imports: [SharedModule, HomeRoutingModule], |
|
||||
}) |
|
||||
export class HomeModule {} |
|
||||
@ -1,13 +0,0 @@ |
|||||
import { CoreModule } from '@abp/ng.core'; |
|
||||
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; |
|
||||
import { NgModule } from '@angular/core'; |
|
||||
import { ThemeSharedModule } from '@abp/ng.theme.shared'; |
|
||||
import { NgxValidateCoreModule } from '@ngx-validate/core'; |
|
||||
|
|
||||
@NgModule({ |
|
||||
declarations: [], |
|
||||
imports: [CoreModule, ThemeSharedModule, NgbDropdownModule, NgxValidateCoreModule], |
|
||||
exports: [CoreModule, ThemeSharedModule, NgbDropdownModule, NgxValidateCoreModule], |
|
||||
providers: [], |
|
||||
}) |
|
||||
export class SharedModule {} |
|
||||
@ -1,13 +1,5 @@ |
|||||
import { enableProdMode } from '@angular/core'; |
import { bootstrapApplication } from '@angular/platform-browser'; |
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; |
import { appConfig } from './app/app.config'; |
||||
|
import { AppComponent } from './app/app.component'; |
||||
|
|
||||
import { AppModule } from './app/app.module'; |
bootstrapApplication(AppComponent, appConfig).catch(err => console.error(err)); |
||||
import { environment } from './environments/environment'; |
|
||||
|
|
||||
if (environment.production) { |
|
||||
enableProdMode(); |
|
||||
} |
|
||||
|
|
||||
platformBrowserDynamic() |
|
||||
.bootstrapModule(AppModule) |
|
||||
.catch(err => console.error(err)); |
|
||||
|
|||||
@ -0,0 +1,119 @@ |
|||||
|
import { Routes } from '@angular/router'; |
||||
|
import { |
||||
|
ForgotPasswordComponent, |
||||
|
LoginComponent, |
||||
|
RegisterComponent, |
||||
|
ResetPasswordComponent, |
||||
|
ManageProfileComponent, |
||||
|
} from './components'; |
||||
|
import { eAccountComponents } from './enums'; |
||||
|
import { authenticationFlowGuard } from './guards'; |
||||
|
import { accountExtensionsResolver } from './resolvers'; |
||||
|
import { |
||||
|
RE_LOGIN_CONFIRMATION_TOKEN, |
||||
|
ACCOUNT_CONFIG_OPTIONS, |
||||
|
ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS, |
||||
|
} from './tokens'; |
||||
|
import { AccountConfigOptions } from './models'; |
||||
|
import { accountConfigOptionsFactory } from './utils'; |
||||
|
import { |
||||
|
authGuard, |
||||
|
ReplaceableComponents, |
||||
|
ReplaceableRouteContainerComponent, |
||||
|
RouterOutletComponent, |
||||
|
} from '@abp/ng.core'; |
||||
|
|
||||
|
export function provideAccount(options: AccountConfigOptions = {}) { |
||||
|
return [ |
||||
|
{ provide: ACCOUNT_CONFIG_OPTIONS, useValue: options }, |
||||
|
{ |
||||
|
provide: 'ACCOUNT_OPTIONS', |
||||
|
useFactory: accountConfigOptionsFactory, |
||||
|
deps: [ACCOUNT_CONFIG_OPTIONS], |
||||
|
}, |
||||
|
{ |
||||
|
provide: RE_LOGIN_CONFIRMATION_TOKEN, |
||||
|
useValue: options.isPersonalSettingsChangedConfirmationActive ?? true, |
||||
|
}, |
||||
|
{ |
||||
|
provide: ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS, |
||||
|
useValue: options.editFormPropContributors, |
||||
|
}, |
||||
|
]; |
||||
|
} |
||||
|
|
||||
|
const canActivate = [authenticationFlowGuard]; |
||||
|
|
||||
|
export const createRoutes = (options: AccountConfigOptions = {}): Routes => [ |
||||
|
{ |
||||
|
path: '', |
||||
|
component: RouterOutletComponent, |
||||
|
providers: provideAccount(options), |
||||
|
children: [ |
||||
|
{ path: '', pathMatch: 'full', redirectTo: 'login' }, |
||||
|
{ |
||||
|
path: 'login', |
||||
|
component: ReplaceableRouteContainerComponent, |
||||
|
canActivate, |
||||
|
data: { |
||||
|
replaceableComponent: { |
||||
|
key: eAccountComponents.Login, |
||||
|
defaultComponent: LoginComponent, |
||||
|
} as ReplaceableComponents.RouteData<LoginComponent>, |
||||
|
}, |
||||
|
title: 'AbpAccount::Login', |
||||
|
}, |
||||
|
{ |
||||
|
path: 'register', |
||||
|
component: ReplaceableRouteContainerComponent, |
||||
|
canActivate, |
||||
|
data: { |
||||
|
replaceableComponent: { |
||||
|
key: eAccountComponents.Register, |
||||
|
defaultComponent: RegisterComponent, |
||||
|
} as ReplaceableComponents.RouteData<RegisterComponent>, |
||||
|
}, |
||||
|
title: 'AbpAccount::Register', |
||||
|
}, |
||||
|
{ |
||||
|
path: 'forgot-password', |
||||
|
component: ReplaceableRouteContainerComponent, |
||||
|
canActivate, |
||||
|
|
||||
|
data: { |
||||
|
replaceableComponent: { |
||||
|
key: eAccountComponents.ForgotPassword, |
||||
|
defaultComponent: ForgotPasswordComponent, |
||||
|
} as ReplaceableComponents.RouteData<ForgotPasswordComponent>, |
||||
|
}, |
||||
|
title: 'AbpAccount::ForgotPassword', |
||||
|
}, |
||||
|
{ |
||||
|
path: 'reset-password', |
||||
|
component: ReplaceableRouteContainerComponent, |
||||
|
canActivate: [], |
||||
|
data: { |
||||
|
tenantBoxVisible: false, |
||||
|
replaceableComponent: { |
||||
|
key: eAccountComponents.ResetPassword, |
||||
|
defaultComponent: ResetPasswordComponent, |
||||
|
} as ReplaceableComponents.RouteData<ResetPasswordComponent>, |
||||
|
}, |
||||
|
title: 'AbpAccount::ResetPassword', |
||||
|
}, |
||||
|
{ |
||||
|
path: 'manage', |
||||
|
component: ReplaceableRouteContainerComponent, |
||||
|
canActivate: [authGuard], |
||||
|
resolve: [accountExtensionsResolver], |
||||
|
data: { |
||||
|
replaceableComponent: { |
||||
|
key: eAccountComponents.ManageProfile, |
||||
|
defaultComponent: ManageProfileComponent, |
||||
|
} as ReplaceableComponents.RouteData<ManageProfileComponent>, |
||||
|
}, |
||||
|
title: 'AbpAccount::MyAccount', |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
]; |
||||
@ -1,11 +1,10 @@ |
|||||
import { CommonModule } from '@angular/common'; |
|
||||
import { NgModule } from '@angular/core'; |
import { NgModule } from '@angular/core'; |
||||
import { ChartComponent } from './chart.component'; |
import { ChartComponent } from './chart.component'; |
||||
|
|
||||
@NgModule({ |
@NgModule({ |
||||
imports: [CommonModule], |
imports: [ChartComponent], |
||||
exports: [ChartComponent], |
exports: [ChartComponent], |
||||
declarations: [ChartComponent], |
declarations: [], |
||||
providers: [], |
providers: [], |
||||
}) |
}) |
||||
export class ChartModule {} |
export class ChartModule {} |
||||
|
|||||
@ -1,19 +1,11 @@ |
|||||
import { CoreModule } from '@abp/ng.core'; |
|
||||
import { NgModule } from '@angular/core'; |
import { NgModule } from '@angular/core'; |
||||
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; |
|
||||
import { NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation'; |
|
||||
import { NzTreeModule } from 'ng-zorro-antd/tree'; |
|
||||
import { TreeComponent } from './components/tree.component'; |
import { TreeComponent } from './components/tree.component'; |
||||
import { ExpandedIconTemplateDirective } from './templates/expanded-icon-template.directive'; |
import { ExpandedIconTemplateDirective } from './templates/expanded-icon-template.directive'; |
||||
import { TreeNodeTemplateDirective } from './templates/tree-node-template.directive'; |
import { TreeNodeTemplateDirective } from './templates/tree-node-template.directive'; |
||||
|
|
||||
const templates = [TreeNodeTemplateDirective, ExpandedIconTemplateDirective]; |
|
||||
|
|
||||
const exported = [...templates, TreeComponent]; |
|
||||
|
|
||||
@NgModule({ |
@NgModule({ |
||||
imports: [CoreModule, NzTreeModule, NgbDropdownModule, NzNoAnimationModule], |
imports: [TreeComponent, TreeNodeTemplateDirective, ExpandedIconTemplateDirective], |
||||
exports: [...exported], |
exports: [TreeComponent, TreeNodeTemplateDirective, ExpandedIconTemplateDirective], |
||||
declarations: [...exported], |
declarations: [], |
||||
}) |
}) |
||||
export class TreeModule {} |
export class TreeModule {} |
||||
|
|||||
@ -1,8 +1,9 @@ |
|||||
import { Component } from '@angular/core'; |
import { Component } from '@angular/core'; |
||||
|
import { RouterModule } from '@angular/router'; |
||||
|
|
||||
@Component({ |
@Component({ |
||||
standalone: false, |
|
||||
selector: 'abp-router-outlet', |
selector: 'abp-router-outlet', |
||||
template: ` <router-outlet></router-outlet> `, |
template: ` <router-outlet></router-outlet> `, |
||||
|
imports: [RouterModule], |
||||
}) |
}) |
||||
export class RouterOutletComponent {} |
export class RouterOutletComponent {} |
||||
|
|||||
@ -0,0 +1,82 @@ |
|||||
|
import { Provider } from '@angular/core'; |
||||
|
import { Routes } from '@angular/router'; |
||||
|
import { |
||||
|
IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS, |
||||
|
IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS, |
||||
|
IDENTITY_ENTITY_ACTION_CONTRIBUTORS, |
||||
|
IDENTITY_ENTITY_PROP_CONTRIBUTORS, |
||||
|
IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS, |
||||
|
} from './tokens'; |
||||
|
import { IdentityConfigOptions } from './models'; |
||||
|
import { |
||||
|
authGuard, |
||||
|
permissionGuard, |
||||
|
ReplaceableComponents, |
||||
|
ReplaceableRouteContainerComponent, |
||||
|
RouterOutletComponent, |
||||
|
} from '@abp/ng.core'; |
||||
|
import { RolesComponent, UsersComponent } from './components'; |
||||
|
import { identityExtensionsResolver } from './resolvers'; |
||||
|
import { eIdentityComponents } from './enums'; |
||||
|
|
||||
|
export function provideIdentity(options: IdentityConfigOptions = {}): Provider[] { |
||||
|
return [ |
||||
|
{ |
||||
|
provide: IDENTITY_ENTITY_ACTION_CONTRIBUTORS, |
||||
|
useValue: options.entityActionContributors, |
||||
|
}, |
||||
|
{ |
||||
|
provide: IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS, |
||||
|
useValue: options.toolbarActionContributors, |
||||
|
}, |
||||
|
{ |
||||
|
provide: IDENTITY_ENTITY_PROP_CONTRIBUTORS, |
||||
|
useValue: options.entityPropContributors, |
||||
|
}, |
||||
|
{ |
||||
|
provide: IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS, |
||||
|
useValue: options.createFormPropContributors, |
||||
|
}, |
||||
|
{ |
||||
|
provide: IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS, |
||||
|
useValue: options.editFormPropContributors, |
||||
|
}, |
||||
|
]; |
||||
|
} |
||||
|
|
||||
|
export const createRoutes = (options: IdentityConfigOptions = {}): Routes => [ |
||||
|
{ |
||||
|
path: '', |
||||
|
component: RouterOutletComponent, |
||||
|
canActivate: [authGuard, permissionGuard], |
||||
|
resolve: [identityExtensionsResolver], |
||||
|
providers: provideIdentity(options), |
||||
|
children: [ |
||||
|
{ path: '', redirectTo: 'roles', pathMatch: 'full' }, |
||||
|
{ |
||||
|
path: 'roles', |
||||
|
component: ReplaceableRouteContainerComponent, |
||||
|
data: { |
||||
|
requiredPolicy: 'AbpIdentity.Roles', |
||||
|
replaceableComponent: { |
||||
|
key: eIdentityComponents.Roles, |
||||
|
defaultComponent: RolesComponent, |
||||
|
} as ReplaceableComponents.RouteData<RolesComponent>, |
||||
|
}, |
||||
|
title: 'AbpIdentity::Roles', |
||||
|
}, |
||||
|
{ |
||||
|
path: 'users', |
||||
|
component: ReplaceableRouteContainerComponent, |
||||
|
data: { |
||||
|
requiredPolicy: 'AbpIdentity.Users', |
||||
|
replaceableComponent: { |
||||
|
key: eIdentityComponents.Users, |
||||
|
defaultComponent: UsersComponent, |
||||
|
} as ReplaceableComponents.RouteData<UsersComponent>, |
||||
|
}, |
||||
|
title: 'AbpIdentity::Users', |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
]; |
||||
@ -1,11 +1,9 @@ |
|||||
import { CoreModule } from '@abp/ng.core'; |
|
||||
import { ThemeSharedModule } from '@abp/ng.theme.shared'; |
|
||||
import { NgModule } from '@angular/core'; |
import { NgModule } from '@angular/core'; |
||||
import { PermissionManagementComponent } from './components/permission-management.component'; |
import { PermissionManagementComponent } from './components'; |
||||
|
|
||||
@NgModule({ |
@NgModule({ |
||||
declarations: [PermissionManagementComponent], |
declarations: [], |
||||
imports: [CoreModule, ThemeSharedModule], |
imports: [PermissionManagementComponent], |
||||
exports: [PermissionManagementComponent], |
exports: [PermissionManagementComponent], |
||||
}) |
}) |
||||
export class PermissionManagementModule {} |
export class PermissionManagementModule {} |
||||
|
|||||
@ -0,0 +1,36 @@ |
|||||
|
import { Routes } from '@angular/router'; |
||||
|
import { |
||||
|
authGuard, |
||||
|
ReplaceableComponents, |
||||
|
ReplaceableRouteContainerComponent, |
||||
|
RouterOutletComponent, |
||||
|
} from '@abp/ng.core'; |
||||
|
import { SettingManagementComponent } from './components/setting-management.component'; |
||||
|
import { eSettingManagementComponents } from './enums/components'; |
||||
|
|
||||
|
export function provideSettingManagement() { |
||||
|
return []; |
||||
|
} |
||||
|
|
||||
|
export const createRoutes = (): Routes => [ |
||||
|
{ |
||||
|
path: '', |
||||
|
component: RouterOutletComponent, |
||||
|
canActivate: [authGuard], |
||||
|
providers: provideSettingManagement(), |
||||
|
children: [ |
||||
|
{ |
||||
|
path: '', |
||||
|
component: ReplaceableRouteContainerComponent, |
||||
|
data: { |
||||
|
requiredPolicy: 'AbpAccount.SettingManagement', |
||||
|
replaceableComponent: { |
||||
|
key: eSettingManagementComponents.SettingManagement, |
||||
|
defaultComponent: SettingManagementComponent, |
||||
|
} as ReplaceableComponents.RouteData, |
||||
|
}, |
||||
|
}, |
||||
|
], |
||||
|
title: 'AbpSettingManagement::Settings', |
||||
|
}, |
||||
|
]; |
||||
@ -1,3 +1,4 @@ |
|||||
export * from './lib/setting-management.module'; |
export * from './lib/setting-management.module'; |
||||
export * from './lib/components/setting-management.component'; |
export * from './lib/components/setting-management.component'; |
||||
export * from './lib/enums'; |
export * from './lib/enums'; |
||||
|
export * from './lib/setting-management.routes'; |
||||
|
|||||
@ -0,0 +1,70 @@ |
|||||
|
import { Routes } from '@angular/router'; |
||||
|
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'; |
||||
|
|
||||
|
import { |
||||
|
authGuard, |
||||
|
permissionGuard, |
||||
|
ReplaceableComponents, |
||||
|
ReplaceableRouteContainerComponent, |
||||
|
RouterOutletComponent, |
||||
|
} from '@abp/ng.core'; |
||||
|
import { TenantsComponent } from './components'; |
||||
|
import { eTenantManagementComponents } from './enums'; |
||||
|
import { tenantManagementExtensionsResolver } from './resolvers'; |
||||
|
|
||||
|
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, |
||||
|
}, |
||||
|
]; |
||||
|
} |
||||
|
|
||||
|
export const createRoutes = (options: TenantManagementConfigOptions = {}): Routes => [ |
||||
|
{ |
||||
|
path: '', |
||||
|
component: RouterOutletComponent, |
||||
|
canActivate: [authGuard, permissionGuard], |
||||
|
resolve: [tenantManagementExtensionsResolver], |
||||
|
providers: provideTenantManagement(options), |
||||
|
children: [ |
||||
|
{ path: '', redirectTo: 'tenants', pathMatch: 'full' }, |
||||
|
{ |
||||
|
path: 'tenants', |
||||
|
component: ReplaceableRouteContainerComponent, |
||||
|
data: { |
||||
|
requiredPolicy: 'AbpTenantManagement.Tenants', |
||||
|
replaceableComponent: { |
||||
|
key: eTenantManagementComponents.Tenants, |
||||
|
defaultComponent: TenantsComponent, |
||||
|
} as ReplaceableComponents.RouteData<TenantsComponent>, |
||||
|
}, |
||||
|
title: 'AbpTenantManagement::Tenants', |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
]; |
||||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue