diff --git a/docs/en/UI/Angular/Config-State.md b/docs/en/UI/Angular/Config-State.md index 7fc202982c..71a5da01f0 100644 --- a/docs/en/UI/Angular/Config-State.md +++ b/docs/en/UI/Angular/Config-State.md @@ -236,7 +236,7 @@ const newRoute: ABP.Route = { path: "page", invisible: false, order: 2, - requiredPolicy: "MyProjectName::MyNewPage" + requiredPolicy: "MyProjectName.MyNewPage" }; this.config.dispatchAddRoute(newRoute); @@ -248,23 +248,25 @@ The `newRoute` will be placed as at root level, i.e. without any parent routes a If you want **to add a child route, you can do this:** ```js +import { eIdentityRouteNames } from '@abp/ng.identity'; + // this.config is instance of ConfigStateService const newRoute: ABP.Route = { - parentName: "AbpAccount::Login", + parentName: eIdentityRouteNames.IdentityManagement, name: "My New Page", iconClass: "fa fa-dashboard", path: "page", invisible: false, order: 2, - requiredPolicy: "MyProjectName::MyNewPage" + requiredPolicy: "MyProjectName.MyNewPage" }; this.config.dispatchAddRoute(newRoute); // returns a state stream which emits after dispatch action is complete ``` -The `newRoute` will then be placed as a child of the parent route named `'AbpAccount::Login'` and its url will be set as `'/account/login/page'`. +The `newRoute` will then be placed as a child of the parent route named `eIdentityRouteNames.IdentityManagement` and its url will be set as `'/identity/page'`. #### Route Configuration Properties @@ -291,4 +293,4 @@ Please refer to `Config.Environment` type for all the properties you can pass to ## What's Next? -* [Component Replacement](./Component-Replacement.md) \ No newline at end of file +- [Modifying the Menu](./Modifying-the-Menu.md) \ No newline at end of file diff --git a/docs/en/UI/Angular/Modifying-the-Menu.md b/docs/en/UI/Angular/Modifying-the-Menu.md new file mode 100644 index 0000000000..450a5aecd1 --- /dev/null +++ b/docs/en/UI/Angular/Modifying-the-Menu.md @@ -0,0 +1,199 @@ +# Modifying the Menu + +The menu is inside the `ApplicationLayoutComponent` in the @abp/ng.theme.basic package. There are several methods for modifying the menu elements. This document covers these methods. If you would like to replace the menu completely, please refer to [Component Replacement documentation](./Component-Replacement.md) and learn how to replace a layout. + + + + + +## How to Add a Logo + +The `logoUrl` property in the environment variables is the url of the logo. + +You can add your logo to `src/assets` folder and set the `logoUrl` as shown below: + +```js +export const environment = { + // other configurations + application: { + name: 'MyProjectName', + logoUrl: 'assets/logo.png', + }, + // other configurations +}; +``` + +## How to Add a Navigation Element + +### Via `routes` Property in `AppRoutingModule` + +You can define your routes by adding `routes` as a child property to `data` property of a route configuration in the `app-routing.module`. The `@abp/ng.core` package organizes your routes and stores them in the `ConfigState`. `ApplicationLayoutComponent` gets routes from store and displays them on the menu. + +You can add the `routes` property like below: + +```js +{ + path: 'your-path', + data: { + routes: { + name: 'Your navigation', + order: 3, + iconClass: 'fas fa-question-circle', + requiredPolicy: 'permission key here', + children: [ + { + path: 'child', + name: 'Your child navigation', + order: 1, + requiredPolicy: 'permission key here', + }, + ], + } as ABP.Route, // can be imported from @abp/ng.core + } +} +``` + +- `name` is the label of the navigation element. A localization key or a localization object can be passed. +- `order` is the order of the navigation element. +- `iconClass` is the class of the `i` tag, which is placed to the left of the navigation label. +- `requiredPolicy` is the permission key to access the page. See the [Permission Management document](./Permission-Management.md) +- `children` is an array and is used for declaring child navigation elements. The child navigation element will be placed as a child route which will be available at `'/your-path/child'` based on the given `path` property. + +After adding the `routes` property as described above, the navigation menu looks like this: + +![navigation-menu-via-app-routing](./images/navigation-menu-via-app-routing.png) + +## Via ConfigState + +The `dispatchAddRoute` method of `ConfigStateService` adds a new navigation element to the menu. + +```js +// this.config is instance of ConfigStateService + +const newRoute: ABP.Route = { + name: 'My New Page', + iconClass: 'fa fa-dashboard', + path: 'page', + invisible: false, + order: 2, + requiredPolicy: 'MyProjectName.MyNewPage', +} as Omit; + +this.config.dispatchAddRoute(newRoute); +// returns a state stream which emits after dispatch action is complete +``` + +The `newRoute` will be placed as at root level, i.e. without any parent routes, and its url will be stored as `'/path'`. + +If you want **to add a child route, you can do this:** + +```js +// this.config is instance of ConfigStateService +// eIdentityRouteNames enum can be imported from @abp/ng.identity + +const newRoute: ABP.Route = { + parentName: eIdentityRouteNames.IdentityManagement, + name: 'My New Page', + iconClass: 'fa fa-dashboard', + path: 'page', + invisible: false, + order: 3, + requiredPolicy: 'MyProjectName.MyNewPage' +} as Omit; + +this.config.dispatchAddRoute(newRoute); +// returns a state stream which emits after dispatch action is complete +``` + +The `newRoute` will then be placed as a child of the parent route named `eIdentityRouteNames.IdentityManagement` and its url will be set as `'/identity/page'`. + +The new route will be added like below: + +![navigation-menu-via-config-state](./images/navigation-menu-via-config-state.png) + +## How to Patch a Navigation Element + +The `dispatchPatchRouteByName` method finds a route by its name and replaces its configuration in the store with the new configuration passed as the second parameter. + +```js +// this.config is instance of ConfigStateService +// eIdentityRouteNames enum can be imported from @abp/ng.identity + +const newRouteConfig: Partial = { + iconClass: 'fas fa-home', + parentName: eIdentityRouteNames.Administration, + order: 0, + children: [ + { + name: 'Dashboard', + path: 'dashboard', + }, + ], +}; + +this.config.dispatchPatchRouteByName('::Menu:Home', newRouteConfig); +// returns a state stream which emits after dispatch action is complete +``` + +* Moved the _Home_ navigation under the _Administration_ dropdown based on given `parentName`. +* Added an icon. +* Specified the order. +* Added a child route named _Dashboard_. + +After the patch above, navigation elements looks like below: + +![navigation-menu-after-patching](./images/navigation-menu-after-patching.png) + + +## How to Add an Element to Right Part of the Menu + +The right part elements are stored in the `LayoutState` that is in the @abp/ng.theme.basic package. + +The `dispatchAddNavigationElement` method of the `LayoutStateService` adds an element to the right part of the menu. + +You can insert an element by adding your template to `app.component` and calling the `dispatchAddNavigationElement` method: + +```js +import { Layout, LayoutStateService } from '@abp/ng.theme.basic'; // added this line + +@Component({ + selector: 'app-root', + template: ` + + + + `, +}) +export class AppComponent { + // Added ViewChild + @ViewChild('search', { static: false, read: TemplateRef }) searchElementRef: TemplateRef; + + constructor(private layout: LayoutStateService) {} // injected LayoutStateService + + // Added ngAfterViewInit + ngAfterViewInit() { + const newElement = { + name: 'Search', + element: this.searchElementRef, + order: 1, + } as Layout.NavigationElement; + + this.layout.dispatchAddNavigationElement(newElement); + } +} +``` + +This inserts a search input to the menu. The final UI looks like below: + +![navigation-menu-search-input](./images/navigation-menu-search-input.png) + +## How to Remove an Element From Right Part of the Menu + +TODO + + +## What's Next + +* [Component Replacement](./Component-Replacement.md) diff --git a/docs/en/UI/Angular/images/navigation-menu-after-patching.png b/docs/en/UI/Angular/images/navigation-menu-after-patching.png new file mode 100644 index 0000000000..2f6bf08c88 Binary files /dev/null and b/docs/en/UI/Angular/images/navigation-menu-after-patching.png differ diff --git a/docs/en/UI/Angular/images/navigation-menu-search-input.png b/docs/en/UI/Angular/images/navigation-menu-search-input.png new file mode 100644 index 0000000000..ebdc05e3e0 Binary files /dev/null and b/docs/en/UI/Angular/images/navigation-menu-search-input.png differ diff --git a/docs/en/UI/Angular/images/navigation-menu-via-app-routing.png b/docs/en/UI/Angular/images/navigation-menu-via-app-routing.png new file mode 100644 index 0000000000..4d5f61301c Binary files /dev/null and b/docs/en/UI/Angular/images/navigation-menu-via-app-routing.png differ diff --git a/docs/en/UI/Angular/images/navigation-menu-via-config-state.png b/docs/en/UI/Angular/images/navigation-menu-via-config-state.png new file mode 100644 index 0000000000..19944f154d Binary files /dev/null and b/docs/en/UI/Angular/images/navigation-menu-via-config-state.png differ diff --git a/docs/en/docs-nav.json b/docs/en/docs-nav.json index 53caea554b..c0515c18de 100644 --- a/docs/en/docs-nav.json +++ b/docs/en/docs-nav.json @@ -352,6 +352,10 @@ "text": "Config State", "path": "UI/Angular/Config-State.md" }, + { + "text": "Modifying the Menu", + "path": "UI/Angular/Modifying-the-Menu.md" + }, { "text": "Component Replacement", "path": "UI/Angular/Component-Replacement.md" @@ -398,7 +402,7 @@ "text": "Data Access", "items": [ { - "text": "Overall", + "text": "Overall", "path": "Data-Access.md" }, { diff --git a/modules/docs/src/Volo.Docs.Web/HtmlConverting/HtmlNormalizer.cs b/modules/docs/src/Volo.Docs.Web/HtmlConverting/HtmlNormalizer.cs index 6f0a680ce2..1689a209fe 100644 --- a/modules/docs/src/Volo.Docs.Web/HtmlConverting/HtmlNormalizer.cs +++ b/modules/docs/src/Volo.Docs.Web/HtmlConverting/HtmlNormalizer.cs @@ -35,5 +35,51 @@ namespace Volo.Docs.HtmlConverting { return Regex.Replace(content, "", "", RegexOptions.IgnoreCase); } + + /// + /// Wraps an image with a tag that's clickable to open the image in a new browser tab. + /// + public static string WrapImagesWithinAnchors(string html) + { + try + { + return Regex.Replace(html, "", match => + { + var link = match.Groups[1].Value; + var imgTag = match.Groups[0].Value; + var title = GetTitleFromTag(imgTag); + + return $"\"{title}\""; + }); + + } + catch + { + // ignored + return html; + } + } + + private static string GetTitleFromTag(string imgTag) + { + if (string.IsNullOrWhiteSpace(imgTag)) + { + return null; + } + + var match = Regex.Match(imgTag, @"\stitle\s?\=\s?(\""|')(.+?)(\""|')", RegexOptions.Multiline); + if (match.Success && match.Groups.Count > 2) + { + return match.Groups[2].ToString().Trim(); + } + + match = Regex.Match(imgTag, @"\salt\s*\=\s*(\""|')(.*?)(\""|')", RegexOptions.Multiline); + if (match.Success && match.Groups.Count > 2) + { + return match.Groups[2].ToString().Trim(); + } + + return null; + } } } \ No newline at end of file diff --git a/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs b/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs index 12dec9b304..9942c52309 100644 --- a/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs +++ b/modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs @@ -44,7 +44,10 @@ namespace Volo.Docs.Markdown languageCode ); - return _markdownConverter.ConvertToHtml(content); + var html = _markdownConverter.ConvertToHtml(content); + + return html; + // return HtmlNormalizer.WrapImagesWithinAnchors(html); } protected virtual string NormalizeLinks( diff --git a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs index b1d1c021f1..0acd12531f 100644 --- a/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs +++ b/modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs @@ -400,6 +400,8 @@ namespace Volo.Docs.Pages.Documents.Project Document.LocalDirectory ); + content = HtmlNormalizer.WrapImagesWithinAnchors(content); + //todo find a way to make it on client in prismJS configuration (eg: map C# => csharp) content = HtmlNormalizer.ReplaceCodeBlocksLanguage( content, diff --git a/npm/ng-packs/packages/account-config/src/lib/services/account-config.service.ts b/npm/ng-packs/packages/account-config/src/lib/services/account-config.service.ts index 0add43bc33..d94935c071 100644 --- a/npm/ng-packs/packages/account-config/src/lib/services/account-config.service.ts +++ b/npm/ng-packs/packages/account-config/src/lib/services/account-config.service.ts @@ -1,5 +1,6 @@ import { addAbpRoutes, eLayoutType } from '@abp/ng.core'; import { Injectable } from '@angular/core'; +import { eAccountRouteNames } from '@abp/ng.account'; @Injectable({ providedIn: 'root', @@ -7,14 +8,14 @@ import { Injectable } from '@angular/core'; export class AccountConfigService { constructor() { addAbpRoutes({ - name: 'AbpAccount::Menu:Account', + name: eAccountRouteNames.Account, path: 'account', invisible: true, layout: eLayoutType.application, children: [ - { path: 'login', name: 'AbpAccount::Login', order: 1 }, - { path: 'register', name: 'AbpAccount::Register', order: 2 }, - { path: 'manage-profile', name: 'AbpAccount::ManageYourProfile', order: 3 }, + { path: 'login', name: eAccountRouteNames.Login, order: 1 }, + { path: 'register', name: eAccountRouteNames.Register, order: 2 }, + { path: 'manage-profile', name: eAccountRouteNames.ManageProfile, order: 3 }, ], }); } diff --git a/npm/ng-packs/packages/account/src/lib/enums/index.ts b/npm/ng-packs/packages/account/src/lib/enums/index.ts new file mode 100644 index 0000000000..5ac9b6e8fa --- /dev/null +++ b/npm/ng-packs/packages/account/src/lib/enums/index.ts @@ -0,0 +1,2 @@ +export * from './components'; +export * from './route-names'; diff --git a/npm/ng-packs/packages/account/src/lib/enums/route-names.ts b/npm/ng-packs/packages/account/src/lib/enums/route-names.ts new file mode 100644 index 0000000000..810985e027 --- /dev/null +++ b/npm/ng-packs/packages/account/src/lib/enums/route-names.ts @@ -0,0 +1,6 @@ +export const enum eAccountRouteNames { + Account = 'AbpAccount::Menu:Account', + Login = 'AbpAccount::Login', + Register = 'AbpAccount::Register', + ManageProfile = 'AbpAccount::ManageYourProfile', +} diff --git a/npm/ng-packs/packages/account/src/public-api.ts b/npm/ng-packs/packages/account/src/public-api.ts index 63cb476f9b..8d1ef3c43a 100644 --- a/npm/ng-packs/packages/account/src/public-api.ts +++ b/npm/ng-packs/packages/account/src/public-api.ts @@ -1,6 +1,6 @@ export * from './lib/account.module'; export * from './lib/components'; -export * from './lib/enums/components'; +export * from './lib/enums'; export * from './lib/tokens'; export * from './lib/models'; export * from './lib/services'; diff --git a/npm/ng-packs/packages/core/src/lib/plugins/config.plugin.ts b/npm/ng-packs/packages/core/src/lib/plugins/config.plugin.ts index f9c8f45423..b2afab6072 100644 --- a/npm/ng-packs/packages/core/src/lib/plugins/config.plugin.ts +++ b/npm/ng-packs/packages/core/src/lib/plugins/config.plugin.ts @@ -10,7 +10,7 @@ import { } from '@ngxs/store'; import clone from 'just-clone'; import snq from 'snq'; -import { ABP } from '../models'; +import { ABP } from '../models/common'; import { getAbpRoutes, organizeRoutes } from '../utils/route-utils'; export const NGXS_CONFIG_PLUGIN_OPTIONS = new InjectionToken('NGXS_CONFIG_PLUGIN_OPTIONS'); @@ -30,8 +30,8 @@ export class ConfigPlugin implements NgxsPlugin { if (isInitAction && !this.initialized) { const transformedRoutes = transformRoutes(this.router.config); - let { routes } = transformedRoutes; - const { wrappers } = transformedRoutes; + let { routes, wrappers } = transformedRoutes; + wrappers = reduceWrappers(wrappers); routes = organizeRoutes(routes, wrappers); const flattedRoutes = flatRoutes(clone(routes)); @@ -118,3 +118,14 @@ function flatRoutes(routes: ABP.FullRoute[]): ABP.FullRoute[] { return flat(routes); } + +function reduceWrappers(wrappers: ABP.FullRoute[] = []) { + const existingWrappers = new Set(); + + return wrappers.filter(wrapper => { + if (existingWrappers.has(wrapper.name)) return false; + + existingWrappers.add(wrapper.name); + return true; + }); +} diff --git a/npm/ng-packs/packages/identity-config/src/lib/services/identity-config.service.ts b/npm/ng-packs/packages/identity-config/src/lib/services/identity-config.service.ts index d1b52fed8b..c1fdbb102d 100644 --- a/npm/ng-packs/packages/identity-config/src/lib/services/identity-config.service.ts +++ b/npm/ng-packs/packages/identity-config/src/lib/services/identity-config.service.ts @@ -1,5 +1,6 @@ import { addAbpRoutes, eLayoutType } from '@abp/ng.core'; import { Injectable } from '@angular/core'; +import { eIdentityRouteNames } from '@abp/ng.identity'; @Injectable({ providedIn: 'root', @@ -8,29 +9,29 @@ export class IdentityConfigService { constructor() { addAbpRoutes([ { - name: 'AbpUiNavigation::Menu:Administration', + name: eIdentityRouteNames.Administration, path: '', order: 1, wrapper: true, iconClass: 'fa fa-wrench', }, { - name: 'AbpIdentity::Menu:IdentityManagement', + name: eIdentityRouteNames.IdentityManagement, path: 'identity', order: 1, - parentName: 'AbpUiNavigation::Menu:Administration', + parentName: eIdentityRouteNames.Administration, layout: eLayoutType.application, iconClass: 'fa fa-id-card-o', children: [ { path: 'roles', - name: 'AbpIdentity::Roles', + name: eIdentityRouteNames.Roles, order: 1, requiredPolicy: 'AbpIdentity.Roles', }, { path: 'users', - name: 'AbpIdentity::Users', + name: eIdentityRouteNames.Users, order: 2, requiredPolicy: 'AbpIdentity.Users', }, diff --git a/npm/ng-packs/packages/identity/src/lib/enums/index.ts b/npm/ng-packs/packages/identity/src/lib/enums/index.ts new file mode 100644 index 0000000000..5ac9b6e8fa --- /dev/null +++ b/npm/ng-packs/packages/identity/src/lib/enums/index.ts @@ -0,0 +1,2 @@ +export * from './components'; +export * from './route-names'; diff --git a/npm/ng-packs/packages/identity/src/lib/enums/route-names.ts b/npm/ng-packs/packages/identity/src/lib/enums/route-names.ts new file mode 100644 index 0000000000..15933a5b77 --- /dev/null +++ b/npm/ng-packs/packages/identity/src/lib/enums/route-names.ts @@ -0,0 +1,6 @@ +export const enum eIdentityRouteNames { + Administration = 'AbpUiNavigation::Menu:Administration', + IdentityManagement = 'AbpIdentity::Menu:IdentityManagement', + Roles = 'AbpIdentity::Roles', + Users = 'AbpIdentity::Users', +} diff --git a/npm/ng-packs/packages/identity/src/public-api.ts b/npm/ng-packs/packages/identity/src/public-api.ts index 1a2b217931..fd26c8a649 100644 --- a/npm/ng-packs/packages/identity/src/public-api.ts +++ b/npm/ng-packs/packages/identity/src/public-api.ts @@ -4,7 +4,7 @@ export * from './lib/identity.module'; export * from './lib/actions/identity.actions'; -export * from './lib/enums/components'; +export * from './lib/enums'; export * from './lib/components'; export * from './lib/models/identity'; export * from './lib/services'; diff --git a/npm/ng-packs/packages/setting-management-config/src/lib/services/setting-management-config.service.ts b/npm/ng-packs/packages/setting-management-config/src/lib/services/setting-management-config.service.ts index 721a5a5991..a5b319ccb1 100644 --- a/npm/ng-packs/packages/setting-management-config/src/lib/services/setting-management-config.service.ts +++ b/npm/ng-packs/packages/setting-management-config/src/lib/services/setting-management-config.service.ts @@ -2,6 +2,7 @@ import { Injectable, Injector } from '@angular/core'; import { addAbpRoutes, eLayoutType, PatchRouteByName, ABP } from '@abp/ng.core'; import { getSettingTabs } from '@abp/ng.theme.shared'; import { Store } from '@ngxs/store'; +import { eSettingManagementRouteNames } from '@abp/ng.setting-management'; @Injectable({ providedIn: 'root', @@ -13,7 +14,7 @@ export class SettingManagementConfigService { constructor(private injector: Injector) { const route = { - name: 'AbpSettingManagement::Settings', + name: eSettingManagementRouteNames.Settings, path: 'setting-management', parentName: 'AbpUiNavigation::Menu:Administration', requiredPolicy: 'AbpAccount.SettingManagement', diff --git a/npm/ng-packs/packages/setting-management/src/lib/enums/index.ts b/npm/ng-packs/packages/setting-management/src/lib/enums/index.ts new file mode 100644 index 0000000000..5ac9b6e8fa --- /dev/null +++ b/npm/ng-packs/packages/setting-management/src/lib/enums/index.ts @@ -0,0 +1,2 @@ +export * from './components'; +export * from './route-names'; diff --git a/npm/ng-packs/packages/setting-management/src/lib/enums/route-names.ts b/npm/ng-packs/packages/setting-management/src/lib/enums/route-names.ts new file mode 100644 index 0000000000..86ad145f5f --- /dev/null +++ b/npm/ng-packs/packages/setting-management/src/lib/enums/route-names.ts @@ -0,0 +1,3 @@ +export const enum eSettingManagementRouteNames { + Settings = 'AbpSettingManagement::Settings', +} diff --git a/npm/ng-packs/packages/setting-management/src/public-api.ts b/npm/ng-packs/packages/setting-management/src/public-api.ts index ac030c3ccf..24e62d4da1 100644 --- a/npm/ng-packs/packages/setting-management/src/public-api.ts +++ b/npm/ng-packs/packages/setting-management/src/public-api.ts @@ -1,3 +1,3 @@ export * from './lib/setting-management.module'; export * from './lib/components/setting-management.component'; -export * from './lib/enums/components'; +export * from './lib/enums'; diff --git a/npm/ng-packs/packages/tenant-management-config/src/lib/services/tenant-management-config.service.ts b/npm/ng-packs/packages/tenant-management-config/src/lib/services/tenant-management-config.service.ts index 48a6d31c84..ab5ca4a081 100644 --- a/npm/ng-packs/packages/tenant-management-config/src/lib/services/tenant-management-config.service.ts +++ b/npm/ng-packs/packages/tenant-management-config/src/lib/services/tenant-management-config.service.ts @@ -1,25 +1,34 @@ import { Injectable } from '@angular/core'; import { addAbpRoutes, eLayoutType } from '@abp/ng.core'; - +import { eTenantManagementRouteNames } from '@abp/ng.tenant-management'; @Injectable({ providedIn: 'root', }) export class TenantManagementConfigService { constructor() { - addAbpRoutes({ - name: 'AbpTenantManagement::Menu:TenantManagement', - path: 'tenant-management', - parentName: 'AbpUiNavigation::Menu:Administration', - layout: eLayoutType.application, - iconClass: 'fa fa-users', - children: [ - { - path: 'tenants', - name: 'AbpTenantManagement::Tenants', - order: 1, - requiredPolicy: 'AbpTenantManagement.Tenants', - }, - ], - }); + addAbpRoutes([ + { + name: eTenantManagementRouteNames.Administration, + path: '', + order: 1, + wrapper: true, + iconClass: 'fa fa-wrench', + }, + { + name: eTenantManagementRouteNames.TenantManagement, + path: 'tenant-management', + parentName: eTenantManagementRouteNames.Administration, + layout: eLayoutType.application, + iconClass: 'fa fa-users', + children: [ + { + path: 'tenants', + name: eTenantManagementRouteNames.Tenants, + order: 1, + requiredPolicy: 'AbpTenantManagement.Tenants', + }, + ], + }, + ]); } } diff --git a/npm/ng-packs/packages/tenant-management/src/lib/enums/index.ts b/npm/ng-packs/packages/tenant-management/src/lib/enums/index.ts new file mode 100644 index 0000000000..5ac9b6e8fa --- /dev/null +++ b/npm/ng-packs/packages/tenant-management/src/lib/enums/index.ts @@ -0,0 +1,2 @@ +export * from './components'; +export * from './route-names'; diff --git a/npm/ng-packs/packages/tenant-management/src/lib/enums/route-names.ts b/npm/ng-packs/packages/tenant-management/src/lib/enums/route-names.ts new file mode 100644 index 0000000000..8125e28a4f --- /dev/null +++ b/npm/ng-packs/packages/tenant-management/src/lib/enums/route-names.ts @@ -0,0 +1,5 @@ +export const enum eTenantManagementRouteNames { + Administration = 'AbpUiNavigation::Menu:Administration', + TenantManagement = 'AbpTenantManagement::Menu:TenantManagement', + Tenants = 'AbpTenantManagement::Tenants', +} diff --git a/npm/ng-packs/packages/tenant-management/src/public-api.ts b/npm/ng-packs/packages/tenant-management/src/public-api.ts index 003074b2c4..3fc7cf90d5 100644 --- a/npm/ng-packs/packages/tenant-management/src/public-api.ts +++ b/npm/ng-packs/packages/tenant-management/src/public-api.ts @@ -1,7 +1,7 @@ export * from './lib/tenant-management.module'; export * from './lib/actions'; export * from './lib/components'; -export * from './lib/enums/components'; +export * from './lib/enums'; export * from './lib/models'; export * from './lib/services'; export * from './lib/states'; diff --git a/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html b/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html index 2687c2cf81..438c315c16 100644 --- a/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html +++ b/npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html @@ -5,7 +5,13 @@ >
- +