Browse Source

Merge remote-tracking branch 'abpframework/dev' into docs

pull/3805/head
liangshiwei 6 years ago
parent
commit
af70cff904
  1. 12
      docs/en/UI/Angular/Config-State.md
  2. 199
      docs/en/UI/Angular/Modifying-the-Menu.md
  3. BIN
      docs/en/UI/Angular/images/navigation-menu-after-patching.png
  4. BIN
      docs/en/UI/Angular/images/navigation-menu-search-input.png
  5. BIN
      docs/en/UI/Angular/images/navigation-menu-via-app-routing.png
  6. BIN
      docs/en/UI/Angular/images/navigation-menu-via-config-state.png
  7. 6
      docs/en/docs-nav.json
  8. 46
      modules/docs/src/Volo.Docs.Web/HtmlConverting/HtmlNormalizer.cs
  9. 5
      modules/docs/src/Volo.Docs.Web/Markdown/MarkdownDocumentToHtmlConverter.cs
  10. 2
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs
  11. 9
      npm/ng-packs/packages/account-config/src/lib/services/account-config.service.ts
  12. 2
      npm/ng-packs/packages/account/src/lib/enums/index.ts
  13. 6
      npm/ng-packs/packages/account/src/lib/enums/route-names.ts
  14. 2
      npm/ng-packs/packages/account/src/public-api.ts
  15. 17
      npm/ng-packs/packages/core/src/lib/plugins/config.plugin.ts
  16. 11
      npm/ng-packs/packages/identity-config/src/lib/services/identity-config.service.ts
  17. 2
      npm/ng-packs/packages/identity/src/lib/enums/index.ts
  18. 6
      npm/ng-packs/packages/identity/src/lib/enums/route-names.ts
  19. 2
      npm/ng-packs/packages/identity/src/public-api.ts
  20. 3
      npm/ng-packs/packages/setting-management-config/src/lib/services/setting-management-config.service.ts
  21. 2
      npm/ng-packs/packages/setting-management/src/lib/enums/index.ts
  22. 3
      npm/ng-packs/packages/setting-management/src/lib/enums/route-names.ts
  23. 2
      npm/ng-packs/packages/setting-management/src/public-api.ts
  24. 41
      npm/ng-packs/packages/tenant-management-config/src/lib/services/tenant-management-config.service.ts
  25. 2
      npm/ng-packs/packages/tenant-management/src/lib/enums/index.ts
  26. 5
      npm/ng-packs/packages/tenant-management/src/lib/enums/route-names.ts
  27. 2
      npm/ng-packs/packages/tenant-management/src/public-api.ts
  28. 8
      npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html
  29. 7
      npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts
  30. 2
      npm/ng-packs/packages/theme-basic/src/lib/enums/index.ts
  31. 4
      npm/ng-packs/packages/theme-basic/src/lib/enums/navigation-element-names.ts
  32. 2
      npm/ng-packs/packages/theme-basic/src/lib/services/layout-state.service.ts
  33. 3
      npm/ng-packs/packages/theme-basic/src/public-api.ts
  34. 1
      npm/ng-packs/packages/theme-shared/src/public-api.ts
  35. 10
      npm/ng-packs/scripts/build.ts
  36. 5
      npm/ng-packs/scripts/prod-build.ts

12
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)
- [Modifying the Menu](./Modifying-the-Menu.md)

199
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.
<!-- TODO: Replace layout replacement document with component replacement. Layout replacement document will be created.-->
## 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<ABP.Route, 'children'>;
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<ABP.Route, 'children'>;
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<ABP.Route> = {
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: `
<!-- Added below content -->
<ng-template #search
><input type="search" placeholder="Search" class="bg-transparent border-0"
/></ng-template>
`,
})
export class AppComponent {
// Added ViewChild
@ViewChild('search', { static: false, read: TemplateRef }) searchElementRef: TemplateRef<any>;
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)

BIN
docs/en/UI/Angular/images/navigation-menu-after-patching.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
docs/en/UI/Angular/images/navigation-menu-search-input.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
docs/en/UI/Angular/images/navigation-menu-via-app-routing.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
docs/en/UI/Angular/images/navigation-menu-via-config-state.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

6
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"
},
{

46
modules/docs/src/Volo.Docs.Web/HtmlConverting/HtmlNormalizer.cs

@ -35,5 +35,51 @@ namespace Volo.Docs.HtmlConverting
{
return Regex.Replace(content, "<code class=\"" + currentLanguage + "\">", "<code class=\"" + newLanguage + "\">", RegexOptions.IgnoreCase);
}
/// <summary>
/// Wraps an image with a tag that's clickable to open the image in a new browser tab.
/// </summary>
public static string WrapImagesWithinAnchors(string html)
{
try
{
return Regex.Replace(html, "<img.+?src=[\"'](.+?)[\"'].*?>", match =>
{
var link = match.Groups[1].Value;
var imgTag = match.Groups[0].Value;
var title = GetTitleFromTag(imgTag);
return $"<a target = \"_blank\" rel=\"noopener noreferrer\" title=\"{title}\" href=\"{link}\"><img src=\"{link}\" alt=\"{title}\"></a>";
});
}
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;
}
}
}

5
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(

2
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,

9
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 },
],
});
}

2
npm/ng-packs/packages/account/src/lib/enums/index.ts

@ -0,0 +1,2 @@
export * from './components';
export * from './route-names';

6
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',
}

2
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';

17
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;
});
}

11
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',
},

2
npm/ng-packs/packages/identity/src/lib/enums/index.ts

@ -0,0 +1,2 @@
export * from './components';
export * from './route-names';

6
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',
}

2
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';

3
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',

2
npm/ng-packs/packages/setting-management/src/lib/enums/index.ts

@ -0,0 +1,2 @@
export * from './components';
export * from './route-names';

3
npm/ng-packs/packages/setting-management/src/lib/enums/route-names.ts

@ -0,0 +1,3 @@
export const enum eSettingManagementRouteNames {
Settings = 'AbpSettingManagement::Settings',
}

2
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';

41
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',
},
],
},
]);
}
}

2
npm/ng-packs/packages/tenant-management/src/lib/enums/index.ts

@ -0,0 +1,2 @@
export * from './components';
export * from './route-names';

5
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',
}

2
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';

8
npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html

@ -5,7 +5,13 @@
>
<div class="container ">
<a class="navbar-brand" routerLink="/">
<img *ngIf="appInfo.logoUrl; else appName" [src]="appInfo.logoUrl" [alt]="appInfo.name" />
<img
*ngIf="appInfo.logoUrl; else appName"
[src]="appInfo.logoUrl"
[alt]="appInfo.name"
width="100%"
height="auto"
/>
</a>
<button
class="navbar-toggler"

7
npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts

@ -28,6 +28,7 @@ import snq from 'snq';
import { AddNavigationElement } from '../../actions';
import { Layout } from '../../models/layout';
import { LayoutState } from '../../states';
import { eNavigationElementNames } from '../../enums/navigation-element-names';
@Component({
selector: 'abp-layout-application',
@ -131,11 +132,11 @@ export class ApplicationLayoutComponent implements AfterViewInit, OnDestroy {
.selectSnapshot(LayoutState.getNavigationElements)
.map(({ name }) => name);
if (navigations.indexOf('LanguageRef') < 0) {
if (navigations.indexOf(eNavigationElementNames.Language) < 0) {
this.store.dispatch(
new AddNavigationElement([
{ element: this.languageRef, order: 4, name: 'LanguageRef' },
{ element: this.currentUserRef, order: 5, name: 'CurrentUserRef' },
{ element: this.languageRef, order: 4, name: eNavigationElementNames.Language },
{ element: this.currentUserRef, order: 5, name: eNavigationElementNames.User },
]),
);
}

2
npm/ng-packs/packages/theme-basic/src/lib/enums/index.ts

@ -0,0 +1,2 @@
export * from './components';
export * from './navigation-element-names';

4
npm/ng-packs/packages/theme-basic/src/lib/enums/navigation-element-names.ts

@ -0,0 +1,4 @@
export const enum eNavigationElementNames {
Language = 'LanguageRef',
User = 'CurrentUserRef',
}

2
npm/ng-packs/packages/theme-basic/src/lib/services/layout-state.service.ts

@ -4,7 +4,7 @@ import { LayoutState } from '../states/layout.state';
import { AddNavigationElement, RemoveNavigationElementByName } from '../actions';
import { Layout } from '../models/layout';
@Injectable()
@Injectable({ providedIn: 'root' })
export class LayoutStateService {
constructor(private store: Store) {}

3
npm/ng-packs/packages/theme-basic/src/public-api.ts

@ -5,6 +5,7 @@
export * from './lib/theme-basic.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';

1
npm/ng-packs/packages/theme-shared/src/public-api.ts

@ -6,6 +6,7 @@ export * from './lib/theme-shared.module';
export * from './lib/animations';
export * from './lib/components';
export * from './lib/directives';
export * from './lib/handlers';
export * from './lib/models';
export * from './lib/services';
export * from './lib/tokens';

10
npm/ng-packs/scripts/build.ts

@ -32,8 +32,9 @@ import program from 'commander';
'copy',
'--angular',
'--no-watch',
'--packages',
'@abp/ng.feature-management,@abp/ng.permission-management,@abp/ng.account.config,@abp/ng.identity.config,@abp/ng.setting-management.config,@abp/ng.tenant-management.config',
'--all-packages',
'--excluded-packages',
'@abp/ng.core,@abp/ng.theme.shared,@abp/ng.feature-management,@abp/ng.permission-management,@abp/ng.account.config,@abp/ng.identity.config,@abp/ng.setting-management.config,@abp/ng.tenant-management.config',
],
{ stdout: 'inherit', cwd: '../' },
);
@ -45,9 +46,8 @@ import program from 'commander';
'copy',
'--angular',
'--no-watch',
'--all-packages',
'--excluded-packages',
'@abp/ng.core,@abp/ng.theme.shared,@abp/ng.feature-management,@abp/ng.permission-management,@abp/ng.account.config,@abp/ng.identity.config,@abp/ng.setting-management.config,@abp/ng.tenant-management.config',
'--packages',
'@abp/ng.feature-management,@abp/ng.permission-management,@abp/ng.account.config,@abp/ng.identity.config,@abp/ng.setting-management.config,@abp/ng.tenant-management.config',
],
{ stdout: 'inherit', cwd: '../' },
);

5
npm/ng-packs/scripts/prod-build.ts

@ -2,6 +2,11 @@ import execa from 'execa';
import fse from 'fs-extra';
(async () => {
await execa('yarn', ['ng', 'build', '--prod'], {
stdout: 'inherit',
cwd: '..',
});
await execa('yarn', ['install', '--ignore-scripts'], {
stdout: 'inherit',
cwd: '../../../templates/app/angular',

Loading…
Cancel
Save