Browse Source
Merge pull request #9291 from abpframework/refactor/9289
Angular UI: Hide navigation elements which have not path
pull/9302/head
Bunyamin Coskuner
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with
15 additions and
12 deletions
-
npm/ng-packs/apps/dev-app/src/app/app.module.ts
-
npm/ng-packs/apps/dev-app/src/app/route.provider.ts
-
npm/ng-packs/packages/account/config/src/providers/route.provider.ts
-
npm/ng-packs/packages/core/src/lib/services/routes.service.ts
-
npm/ng-packs/packages/identity/config/src/providers/route.provider.ts
-
npm/ng-packs/packages/tenant-management/config/src/providers/route.provider.ts
-
npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.html
|
|
|
@ -1,3 +1,4 @@ |
|
|
|
import { AccountConfigModule } from '@abp/ng.account/config'; |
|
|
|
import { CoreModule } from '@abp/ng.core'; |
|
|
|
import { registerLocale } from '@abp/ng.core/locale'; |
|
|
|
import { IdentityConfigModule } from '@abp/ng.identity/config'; |
|
|
|
@ -11,7 +12,6 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; |
|
|
|
import { InspectorModule } from '@ngneat/inspector'; |
|
|
|
import { NgxsLoggerPluginModule } from '@ngxs/logger-plugin'; |
|
|
|
import { NgxsModule } from '@ngxs/store'; |
|
|
|
import { AccountConfigModule } from '@abp/ng.account/config'; |
|
|
|
import { environment } from '../environments/environment'; |
|
|
|
import { AppRoutingModule } from './app-routing.module'; |
|
|
|
import { AppComponent } from './app.component'; |
|
|
|
|
|
|
|
@ -1,4 +1,4 @@ |
|
|
|
import { RoutesService, eLayoutType } from '@abp/ng.core'; |
|
|
|
import { eLayoutType, RoutesService } from '@abp/ng.core'; |
|
|
|
import { APP_INITIALIZER } from '@angular/core'; |
|
|
|
|
|
|
|
export const APP_ROUTE_PROVIDER = [ |
|
|
|
|
|
|
|
@ -10,7 +10,7 @@ export function configureRoutes(routes: RoutesService) { |
|
|
|
return () => { |
|
|
|
routes.add([ |
|
|
|
{ |
|
|
|
path: '/account', |
|
|
|
path: undefined, |
|
|
|
name: eAccountRouteNames.Account, |
|
|
|
invisible: true, |
|
|
|
layout: eLayoutType.application, |
|
|
|
|
|
|
|
@ -135,7 +135,8 @@ export abstract class AbstractTreeService<T extends object> { |
|
|
|
@Injectable() |
|
|
|
export abstract class AbstractNavTreeService<T extends ABP.Nav> |
|
|
|
extends AbstractTreeService<T> |
|
|
|
implements OnDestroy { |
|
|
|
implements OnDestroy |
|
|
|
{ |
|
|
|
private subscription: Subscription; |
|
|
|
private permissionService: PermissionService; |
|
|
|
readonly id = 'name'; |
|
|
|
|
|
|
|
@ -12,7 +12,7 @@ export function configureRoutes(routesService: RoutesService) { |
|
|
|
return () => { |
|
|
|
routesService.add([ |
|
|
|
{ |
|
|
|
path: '/identity', |
|
|
|
path: undefined, |
|
|
|
name: eIdentityRouteNames.IdentityManagement, |
|
|
|
parentName: eThemeSharedRouteNames.Administration, |
|
|
|
requiredPolicy: eIdentityPolicyNames.IdentityManagement, |
|
|
|
|
|
|
|
@ -12,7 +12,7 @@ export function configureRoutes(routes: RoutesService) { |
|
|
|
return () => { |
|
|
|
routes.add([ |
|
|
|
{ |
|
|
|
path: '/tenant-management', |
|
|
|
path: undefined, |
|
|
|
name: eTenantManagementRouteNames.TenantManagement, |
|
|
|
parentName: eThemeSharedRouteNames.Administration, |
|
|
|
requiredPolicy: eTenantManagementPolicyNames.TenantManagement, |
|
|
|
|
|
|
|
@ -62,12 +62,14 @@ |
|
|
|
</ng-template> |
|
|
|
|
|
|
|
<ng-template #defaultChild let-child> |
|
|
|
<div class="dropdown-submenu" *abpPermission="child.requiredPolicy"> |
|
|
|
<a class="dropdown-item" [routerLink]="[child.path]" (click)="closeDropdown()"> |
|
|
|
<i *ngIf="child.iconClass" [ngClass]="child.iconClass"></i> |
|
|
|
{{ child.name | abpLocalization }}</a |
|
|
|
> |
|
|
|
</div> |
|
|
|
<ng-container *ngIf="child.path"> |
|
|
|
<div class="dropdown-submenu" *abpPermission="child.requiredPolicy"> |
|
|
|
<a class="dropdown-item" [routerLink]="[child.path]" (click)="closeDropdown()"> |
|
|
|
<i *ngIf="child.iconClass" [ngClass]="child.iconClass"></i> |
|
|
|
{{ child.name | abpLocalization }}</a |
|
|
|
> |
|
|
|
</div> |
|
|
|
</ng-container> |
|
|
|
</ng-template> |
|
|
|
|
|
|
|
<ng-template #dropdownChild let-child> |
|
|
|
|