@acorex/platform-generator 18.0.6 → 18.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/generators/app-module/files/src/app/app.routes.ts.template +6 -18
- package/src/generators/app-module/files/src/app/modules/auth/auth.strategy.ts.template +11 -3
- package/src/generators/app-module/files/src/app/modules/layout/layout-root.module.ts.template +6 -2
- package/src/generators/app-module/files/src/app/modules/root/root.module.ts.template +3 -1
- package/src/generators/app-module/files/src/app/modules/root/sample/sample.entity.ts.template +6 -7
package/package.json
CHANGED
|
@@ -2,25 +2,13 @@ import { AXPAdminLayoutComponent, AX_ADMIN_ROUTES } from '@acorex/platform/layou
|
|
|
2
2
|
import { Route } from '@angular/router';
|
|
3
3
|
|
|
4
4
|
export const appRoutes: Route[] = [
|
|
5
|
-
|
|
5
|
+
{
|
|
6
|
+
path: '<%= name %>',
|
|
7
|
+
loadChildren: () => import('./modules/<%= name %>/<%= name %>-root.module').then((c) => c.<%= upperCase(name) %>RootModule),
|
|
8
|
+
},
|
|
9
|
+
{
|
|
6
10
|
path: '',
|
|
7
11
|
pathMatch: 'full',
|
|
8
|
-
redirectTo: '<%= name %>'
|
|
12
|
+
redirectTo: '<%= name %>',
|
|
9
13
|
},
|
|
10
|
-
{
|
|
11
|
-
path: '',
|
|
12
|
-
component: AXPAdminLayoutComponent,
|
|
13
|
-
children: [
|
|
14
|
-
{
|
|
15
|
-
path: '<%= name %>',
|
|
16
|
-
loadChildren: () => import('./modules/<%= name %>/<%= name %>-root.module').then(c => c.<%= upperCase(name) %>RootModule)
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
path: '',
|
|
20
|
-
children: [
|
|
21
|
-
...AX_ADMIN_ROUTES
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
14
|
];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AXPAuthStrategy, AXPBaseCredentials, AXPRefreshTokenResult, AXPSignInResult, AXPUser } from '@acorex/platform/auth';
|
|
1
|
+
import { AXPAuthStrategy, AXPBaseCredentials, AXPRefreshTokenResult, AXPSessionContext, AXPSignInResult, AXPUser } from '@acorex/platform/auth';
|
|
2
2
|
import { AXPDataProvider } from '@acorex/platform/common';
|
|
3
3
|
import { Injectable, Injector, inject } from '@angular/core';
|
|
4
4
|
|
|
@@ -77,7 +77,15 @@ export class <%= upperCase(name) %>Strategy implements AXPAuthStrategy {
|
|
|
77
77
|
console.log('User signed out');
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
refreshToken(
|
|
81
|
-
|
|
80
|
+
async refreshToken(context: AXPSessionContext): Promise<AXPRefreshTokenResult> {
|
|
81
|
+
return {
|
|
82
|
+
succeed: true,
|
|
83
|
+
data: {
|
|
84
|
+
accessToken: 'access_token',
|
|
85
|
+
refreshToken: 'refresh_token',
|
|
86
|
+
application: context.application,
|
|
87
|
+
tenant: context.tenant,
|
|
88
|
+
}
|
|
89
|
+
}
|
|
82
90
|
}
|
|
83
91
|
}
|
package/src/generators/app-module/files/src/app/modules/layout/layout-root.module.ts.template
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AXPAdminLayoutModule,
|
|
3
|
-
AXPFooterTextSlotComponent,
|
|
4
3
|
AXPLayoutModule,
|
|
4
|
+
} from '@acorex/platform/layouts';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
AXPFooterTextSlotComponent,
|
|
5
8
|
AXPNavBarSlotComponent,
|
|
6
9
|
AXPThemeSlotComponent,
|
|
7
10
|
AXP_ENTITY_LOADER,
|
|
8
|
-
|
|
11
|
+
AXPComponentSlotModule,
|
|
12
|
+
} from '@acorex/platform/common';
|
|
9
13
|
import { NgModule, inject } from '@angular/core';
|
|
10
14
|
import { AXPRootMenuLoader } from './menu.loader';
|
|
11
15
|
import { AXPRootEntityLoader } from './entity.loader';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AXPAuthGuard, AXPPermissionGuard } from '@acorex/platform/auth';
|
|
2
|
+
import { AXPRootLayoutComponent } from '@acorex/platform/themes/default';
|
|
2
3
|
import { CommonModule } from '@angular/common';
|
|
3
4
|
import { NgModule } from '@angular/core';
|
|
4
5
|
import { RouterModule, Routes } from '@angular/router';
|
|
@@ -11,9 +12,10 @@ const routes: Routes = [
|
|
|
11
12
|
},
|
|
12
13
|
{
|
|
13
14
|
path: '',
|
|
15
|
+
component: AXPRootLayoutComponent,
|
|
14
16
|
children: [
|
|
15
17
|
{
|
|
16
|
-
|
|
18
|
+
canActivate: [AXPAuthGuard],
|
|
17
19
|
path: 'home',
|
|
18
20
|
loadComponent: () => import('./home/home.page').then((c) => c.<%= upperCase(name) %>HomePage),
|
|
19
21
|
}
|
package/src/generators/app-module/files/src/app/modules/root/sample/sample.entity.ts.template
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { AXDataSourceQuery } from '@acorex/components/common';
|
|
2
2
|
import { applyFilterArray, applySortArray } from '@acorex/modules/backend';
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from '@acorex/platform/
|
|
4
|
+
AXPEntityConfig,
|
|
5
|
+
AXPEntityListDisplayColumnConfig,
|
|
6
|
+
convertPropertiesToColumns,
|
|
7
|
+
AXPEntityPropertyConfig,
|
|
8
|
+
widgetSchemas,
|
|
9
|
+
} from '@acorex/platform/common';
|
|
10
10
|
import { Injector } from '@angular/core';
|
|
11
|
-
import { assign } from 'lodash-es';
|
|
12
11
|
|
|
13
12
|
const properties: AXPEntityPropertyConfig[] = [
|
|
14
13
|
{
|