Browse Source
Merge pull request #10164 from abpframework/feat/10061
Angular UI: Move SettingTabsService to @abp/ng.setting-management/config package from @abp/ng.core
pull/10194/head
Mehmet Erim
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with
27 additions and
10 deletions
-
docs/en/Modules/Setting-Management.md
-
docs/zh-Hans/Modules/Setting-Management.md
-
npm/ng-packs/packages/core/src/lib/services/routes.service.ts
-
npm/ng-packs/packages/setting-management/config/src/providers/route.provider.ts
-
npm/ng-packs/packages/setting-management/config/src/providers/setting-tab.provider.ts
-
npm/ng-packs/packages/setting-management/config/src/public-api.ts
-
npm/ng-packs/packages/setting-management/config/src/services/index.ts
-
npm/ng-packs/packages/setting-management/config/src/services/settings-tabs.service.ts
-
npm/ng-packs/packages/setting-management/src/lib/components/setting-management.component.ts
|
|
|
@ -278,7 +278,7 @@ Open the `app.component.ts` and modify the file as shown below: |
|
|
|
|
|
|
|
```js |
|
|
|
import { Component } from '@angular/core'; |
|
|
|
import { SettingTabsService } from '@abp/ng.core'; // imported SettingTabsService |
|
|
|
import { SettingTabsService } from '@abp/ng.setting-management/config'; // imported SettingTabsService |
|
|
|
import { MySettingsComponent } from './my-settings/my-settings.component'; // imported MySettingsComponent |
|
|
|
|
|
|
|
@Component(/* component metadata */) |
|
|
|
|
|
|
|
@ -249,7 +249,7 @@ yarn ng generate component my-settings |
|
|
|
|
|
|
|
```js |
|
|
|
import { Component } from '@angular/core'; |
|
|
|
import { SettingTabsService } from '@abp/ng.core'; // imported SettingTabsService |
|
|
|
import { SettingTabsService } from '@abp/ng.setting-management/config'; // imported SettingTabsService |
|
|
|
import { MySettingsComponent } from './my-settings/my-settings.component'; // imported MySettingsComponent |
|
|
|
|
|
|
|
@Component(/* component metadata */) |
|
|
|
@ -273,4 +273,4 @@ export class AppComponent { |
|
|
|
|
|
|
|
导航到 `/setting-management` 路由你会看到以下变化: |
|
|
|
|
|
|
|
 |
|
|
|
 |
|
|
|
|
|
|
|
@ -181,6 +181,3 @@ export abstract class AbstractNavTreeService<T extends ABP.Nav> |
|
|
|
|
|
|
|
@Injectable({ providedIn: 'root' }) |
|
|
|
export class RoutesService extends AbstractNavTreeService<ABP.Route> {} |
|
|
|
|
|
|
|
@Injectable({ providedIn: 'root' }) |
|
|
|
export class SettingTabsService extends AbstractNavTreeService<ABP.Tab> {} |
|
|
|
|
|
|
|
@ -3,8 +3,19 @@ import { eThemeSharedRouteNames } from '@abp/ng.theme.shared'; |
|
|
|
import { APP_INITIALIZER, inject, InjectionToken } from '@angular/core'; |
|
|
|
import { debounceTime, map } from 'rxjs/operators'; |
|
|
|
import { eSettingManagementRouteNames } from '../enums/route-names'; |
|
|
|
import { SettingTabsService } from '../services/settings-tabs.service'; |
|
|
|
import { Observable } from 'rxjs'; |
|
|
|
|
|
|
|
export const SETTING_MANAGEMENT_ROUTE_PROVIDERS = [ |
|
|
|
{ provide: APP_INITIALIZER, useFactory: configureRoutes, deps: [RoutesService], multi: true }, |
|
|
|
{ |
|
|
|
provide: APP_INITIALIZER, |
|
|
|
useFactory: hideRoutes, |
|
|
|
deps: [RoutesService, SettingTabsService], |
|
|
|
multi: true, |
|
|
|
}, |
|
|
|
]; |
|
|
|
|
|
|
|
export function configureRoutes(routesService: RoutesService) { |
|
|
|
return () => { |
|
|
|
routesService.add([ |
|
|
|
@ -19,6 +30,7 @@ export function configureRoutes(routesService: RoutesService) { |
|
|
|
]); |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
export const SETTING_MANAGEMENT_HAS_SETTING = new InjectionToken<Observable<boolean>>( |
|
|
|
'SETTING_MANAGEMENT_HAS_SETTING', |
|
|
|
{ |
|
|
|
|
|
|
|
@ -1,7 +1,7 @@ |
|
|
|
import { SettingTabsService } from '@abp/ng.core'; |
|
|
|
import { APP_INITIALIZER } from '@angular/core'; |
|
|
|
import { EmailSettingGroupComponent } from '../components/email-setting-group/email-setting-group.component'; |
|
|
|
import { eSettingManamagementSettingTabNames } from '../enums/setting-tab-names'; |
|
|
|
import { SettingTabsService } from '../services/settings-tabs.service'; |
|
|
|
|
|
|
|
export const SETTING_MANAGEMENT_SETTING_TAB_PROVIDERS = [ |
|
|
|
{ |
|
|
|
|
|
|
|
@ -1,5 +1,6 @@ |
|
|
|
export * from './components/email-setting-group/email-setting-group.component'; |
|
|
|
export * from './enums'; |
|
|
|
export * from './providers'; |
|
|
|
export * from './setting-management-config.module'; |
|
|
|
export * from './proxy'; |
|
|
|
export * from './components/email-setting-group/email-setting-group.component'; |
|
|
|
export * from './services'; |
|
|
|
export * from './setting-management-config.module'; |
|
|
|
|
|
|
|
@ -0,0 +1 @@ |
|
|
|
export * from './settings-tabs.service'; |
|
|
|
@ -0,0 +1,5 @@ |
|
|
|
import { Injectable } from '@angular/core'; |
|
|
|
import { ABP, AbstractNavTreeService } from '@abp/ng.core'; |
|
|
|
|
|
|
|
@Injectable({ providedIn: 'root' }) |
|
|
|
export class SettingTabsService extends AbstractNavTreeService<ABP.Tab> {} |
|
|
|
@ -1,5 +1,6 @@ |
|
|
|
import { ABP, SettingTabsService } from '@abp/ng.core'; |
|
|
|
import { ABP } from '@abp/ng.core'; |
|
|
|
import { Component, OnDestroy, OnInit, TrackByFunction } from '@angular/core'; |
|
|
|
import { SettingTabsService } from '@abp/ng.setting-management/config'; |
|
|
|
import { Subscription } from 'rxjs'; |
|
|
|
|
|
|
|
@Component({ |
|
|
|
|