@acorex/platform-generator 18.0.7 → 18.0.8
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/README.md +11 -11
- package/generators.json +9 -9
- package/package.json +1 -1
- package/src/generators/app-module/files/.eslintrc.json.template +40 -40
- package/src/generators/app-module/files/jest.config.ts.template +22 -22
- package/src/generators/app-module/files/project.json.template +308 -308
- package/src/generators/app-module/files/src/app/app.component.ts.template +10 -10
- package/src/generators/app-module/files/src/app/app.module.ts.template +99 -99
- package/src/generators/app-module/files/src/app/app.routes.ts.template +13 -13
- package/src/generators/app-module/files/src/app/header-interceptor.interceptor.ts.template +33 -33
- package/src/generators/app-module/files/src/app/modules/auth/application.loader.ts.template +34 -34
- package/src/generators/app-module/files/src/app/modules/auth/auth-root.module.ts.template +52 -52
- package/src/generators/app-module/files/src/app/modules/auth/auth.strategy.ts.template +91 -91
- package/src/generators/app-module/files/src/app/modules/auth/feature.loader.ts.template +17 -17
- package/src/generators/app-module/files/src/app/modules/auth/permission.loader.ts.template +21 -21
- package/src/generators/app-module/files/src/app/modules/auth/tenant.loader.ts.template +32 -32
- package/src/generators/app-module/files/src/app/modules/common/translation-root.module.ts.template +45 -45
- package/src/generators/app-module/files/src/app/modules/layout/entity.loader.ts.template +21 -21
- package/src/generators/app-module/files/src/app/modules/layout/layout-root.module.ts.template +79 -79
- package/src/generators/app-module/files/src/app/modules/layout/menu.loader.ts.template +159 -159
- package/src/generators/app-module/files/src/app/modules/root/home/home.page.html.template +2 -2
- package/src/generators/app-module/files/src/app/modules/root/home/home.page.ts.template +9 -9
- package/src/generators/app-module/files/src/app/modules/root/root.module.ts.template +32 -32
- package/src/generators/app-module/files/src/app/modules/root/sample/sample.entity.ts.template +184 -184
- package/src/generators/app-module/files/src/assets/auth-background.svg +6 -6
- package/src/generators/app-module/files/src/assets/documents.svg +9 -9
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/css/brands.min.css +1457 -1457
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/css/fontawesome.min.css +11291 -11291
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/css/light.min.css +22 -22
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/css/regular.min.css +22 -22
- package/src/generators/app-module/files/src/assets/fonts/font-awesome/css/solid.min.css +5 -5
- package/src/generators/app-module/files/src/assets/i18n/en/auth.json +49 -49
- package/src/generators/app-module/files/src/assets/i18n/en/common.json +179 -179
- package/src/generators/app-module/files/src/assets/images/error/error-404.svg +336 -336
- package/src/generators/app-module/files/src/assets/images/error/error-offline.svg +133 -133
- package/src/generators/app-module/files/src/assets/logos/logo-colored.svg +18 -18
- package/src/generators/app-module/files/src/assets/logos/logo-white.svg +17 -17
- package/src/generators/app-module/files/src/assets/themes/default/default.scss.template +141 -141
- package/src/generators/app-module/files/src/environments/environment.dev.ts.template +19 -19
- package/src/generators/app-module/files/src/environments/environment.local.ts.template +19 -19
- package/src/generators/app-module/files/src/environments/environment.prod.ts.template +19 -19
- package/src/generators/app-module/files/src/environments/environment.test.local.ts.template +19 -19
- package/src/generators/app-module/files/src/environments/environment.test.ts.template +19 -19
- package/src/generators/app-module/files/src/environments/environment.ts.template +19 -19
- package/src/generators/app-module/files/src/index.html.template +34 -34
- package/src/generators/app-module/files/src/main.ts.template +6 -6
- package/src/generators/app-module/files/src/styles.scss.template +188 -188
- package/src/generators/app-module/files/src/test-setup.ts.template +7 -7
- package/src/generators/app-module/files/tailwind.config.js.template +18 -18
- package/src/generators/app-module/files/tsconfig.app.json.template +10 -10
- package/src/generators/app-module/files/tsconfig.editor.json.template +7 -7
- package/src/generators/app-module/files/tsconfig.json.template +34 -34
- package/src/generators/app-module/files/tsconfig.spec.json.template +11 -11
- package/src/generators/app-module/schema.d.ts +4 -4
- package/src/generators/app-module/schema.json +27 -27
|
@@ -1,159 +1,159 @@
|
|
|
1
|
-
import { AXPMenuItem, AXPMenuLoader } from '@acorex/platform/common';
|
|
2
|
-
import { Injectable } from '@angular/core';
|
|
3
|
-
import { Router } from '@angular/router';
|
|
4
|
-
import { cloneDeep, omit } from 'lodash-es';
|
|
5
|
-
import { Observable, of } from 'rxjs';
|
|
6
|
-
|
|
7
|
-
@Injectable()
|
|
8
|
-
export class AXPRootMenuLoader implements AXPMenuLoader {
|
|
9
|
-
private initialMenu: AXPMenuItem[] = [
|
|
10
|
-
{
|
|
11
|
-
text: 'Home',
|
|
12
|
-
path: '/<%= name %>/home',
|
|
13
|
-
icon: 'fa-solid fa-grid-2',
|
|
14
|
-
data: {
|
|
15
|
-
//requiredPermission: '',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
text: 'Administration',
|
|
20
|
-
type: 'group',
|
|
21
|
-
data: {
|
|
22
|
-
requiredPermission: 'admin',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
text: 'General Settings',
|
|
27
|
-
icon: 'fa-solid fa-gear',
|
|
28
|
-
data: {
|
|
29
|
-
requiredPermission: '<%= name %>.admin.settings',
|
|
30
|
-
},
|
|
31
|
-
children: [
|
|
32
|
-
{
|
|
33
|
-
text: 'Sample Dynamic Entity',
|
|
34
|
-
path: '/<%= name %>/sample/e/sample/list',
|
|
35
|
-
},
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
text: 'Security Management',
|
|
40
|
-
path: '/security',
|
|
41
|
-
icon: 'fa-solid fa-lock',
|
|
42
|
-
data: {
|
|
43
|
-
requiredPermission: '<%= name %>.admin.settings',
|
|
44
|
-
},
|
|
45
|
-
opened: false,
|
|
46
|
-
children: [
|
|
47
|
-
{
|
|
48
|
-
text: 'User Management',
|
|
49
|
-
icon: 'fa-solid fa-users',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
text: 'Roles Management',
|
|
53
|
-
icon: 'fa-solid fa-key',
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
text: 'Security Management',
|
|
59
|
-
path: '/security',
|
|
60
|
-
icon: 'fa-solid fa-lock',
|
|
61
|
-
data: {
|
|
62
|
-
requiredPermission: 'platform.admin.settings',
|
|
63
|
-
},
|
|
64
|
-
opened: false,
|
|
65
|
-
children: [
|
|
66
|
-
{
|
|
67
|
-
text: 'User Management',
|
|
68
|
-
icon: 'fa-solid fa-users',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
text: 'Roles Management',
|
|
72
|
-
icon: 'fa-solid fa-key',
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
text: 'Tenant Management',
|
|
78
|
-
path: '/tenant-managemenet',
|
|
79
|
-
icon: 'fa-solid fa-sitemap',
|
|
80
|
-
data: {
|
|
81
|
-
requiredPermission: 'platform.admin.settings',
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
text: 'Reports',
|
|
86
|
-
type: 'group',
|
|
87
|
-
data: {
|
|
88
|
-
requiredPermission: 'platform.admin.reports',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
text: 'log Management',
|
|
93
|
-
path: '/log-managemenet',
|
|
94
|
-
icon: 'fa-solid fa-file-lines',
|
|
95
|
-
data: {
|
|
96
|
-
requiredPermission: 'platform.admin.reports',
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
];
|
|
100
|
-
|
|
101
|
-
constructor(private router: Router) { }
|
|
102
|
-
|
|
103
|
-
getItems(depth: number | null = null): Observable<AXPMenuItem[]> {
|
|
104
|
-
const menuClone = cloneDeep(this.initialMenu);
|
|
105
|
-
const result = this.internalGetMenuItemsByDepth(menuClone, depth);
|
|
106
|
-
return of(result);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
private internalGetMenuItemsByDepth(menuItems: AXPMenuItem[], depth: number | null, parent: AXPMenuItem | undefined = undefined): AXPMenuItem[] {
|
|
110
|
-
return menuItems.map((item) => {
|
|
111
|
-
// Create a new item with parent set
|
|
112
|
-
const newItem: AXPMenuItem = { ...item, parent: parent };
|
|
113
|
-
|
|
114
|
-
if (depth !== null) {
|
|
115
|
-
if (depth === 0) {
|
|
116
|
-
// If depth is 0, return the item without children
|
|
117
|
-
return omit(newItem, 'children');
|
|
118
|
-
} else if (item.children) {
|
|
119
|
-
// If the item has children, recursively set their parent and limit depth
|
|
120
|
-
newItem.children = this.internalGetMenuItemsByDepth(item.children, depth - 1, newItem);
|
|
121
|
-
}
|
|
122
|
-
} else if (item.children) {
|
|
123
|
-
// If depth is null, process all children without depth limit
|
|
124
|
-
newItem.children = this.internalGetMenuItemsByDepth(item.children, null, newItem);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return newItem;
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
currentMenuItem(): AXPMenuItem | null {
|
|
132
|
-
return this.internalCurrentMenuItem(this.internalGetMenuItemsByDepth(this.initialMenu, null), this.getCurrentRoutePath());
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
private internalCurrentMenuItem(menuItems: AXPMenuItem[], currentPath: string): AXPMenuItem | null {
|
|
136
|
-
for (const item of menuItems) {
|
|
137
|
-
// Check if the current item's path matches the current path
|
|
138
|
-
if (item.path === currentPath) {
|
|
139
|
-
return item;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// If the current item has children, search recursively in the children
|
|
143
|
-
if (item.children && item.children.length > 0) {
|
|
144
|
-
const found = this.internalCurrentMenuItem(item.children, currentPath);
|
|
145
|
-
if (found) {
|
|
146
|
-
return found;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// Return null if no matching item is found
|
|
152
|
-
return null;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
private getCurrentRoutePath(): string {
|
|
156
|
-
// Using window.location to get the current browser URL
|
|
157
|
-
return window.location.pathname;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
1
|
+
import { AXPMenuItem, AXPMenuLoader } from '@acorex/platform/common';
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
import { Router } from '@angular/router';
|
|
4
|
+
import { cloneDeep, omit } from 'lodash-es';
|
|
5
|
+
import { Observable, of } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
@Injectable()
|
|
8
|
+
export class AXPRootMenuLoader implements AXPMenuLoader {
|
|
9
|
+
private initialMenu: AXPMenuItem[] = [
|
|
10
|
+
{
|
|
11
|
+
text: 'Home',
|
|
12
|
+
path: '/<%= name %>/home',
|
|
13
|
+
icon: 'fa-solid fa-grid-2',
|
|
14
|
+
data: {
|
|
15
|
+
//requiredPermission: '',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
text: 'Administration',
|
|
20
|
+
type: 'group',
|
|
21
|
+
data: {
|
|
22
|
+
requiredPermission: 'admin',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
text: 'General Settings',
|
|
27
|
+
icon: 'fa-solid fa-gear',
|
|
28
|
+
data: {
|
|
29
|
+
requiredPermission: '<%= name %>.admin.settings',
|
|
30
|
+
},
|
|
31
|
+
children: [
|
|
32
|
+
{
|
|
33
|
+
text: 'Sample Dynamic Entity',
|
|
34
|
+
path: '/<%= name %>/sample/e/sample/list',
|
|
35
|
+
},
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
text: 'Security Management',
|
|
40
|
+
path: '/security',
|
|
41
|
+
icon: 'fa-solid fa-lock',
|
|
42
|
+
data: {
|
|
43
|
+
requiredPermission: '<%= name %>.admin.settings',
|
|
44
|
+
},
|
|
45
|
+
opened: false,
|
|
46
|
+
children: [
|
|
47
|
+
{
|
|
48
|
+
text: 'User Management',
|
|
49
|
+
icon: 'fa-solid fa-users',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
text: 'Roles Management',
|
|
53
|
+
icon: 'fa-solid fa-key',
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
text: 'Security Management',
|
|
59
|
+
path: '/security',
|
|
60
|
+
icon: 'fa-solid fa-lock',
|
|
61
|
+
data: {
|
|
62
|
+
requiredPermission: 'platform.admin.settings',
|
|
63
|
+
},
|
|
64
|
+
opened: false,
|
|
65
|
+
children: [
|
|
66
|
+
{
|
|
67
|
+
text: 'User Management',
|
|
68
|
+
icon: 'fa-solid fa-users',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
text: 'Roles Management',
|
|
72
|
+
icon: 'fa-solid fa-key',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
text: 'Tenant Management',
|
|
78
|
+
path: '/tenant-managemenet',
|
|
79
|
+
icon: 'fa-solid fa-sitemap',
|
|
80
|
+
data: {
|
|
81
|
+
requiredPermission: 'platform.admin.settings',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
text: 'Reports',
|
|
86
|
+
type: 'group',
|
|
87
|
+
data: {
|
|
88
|
+
requiredPermission: 'platform.admin.reports',
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
text: 'log Management',
|
|
93
|
+
path: '/log-managemenet',
|
|
94
|
+
icon: 'fa-solid fa-file-lines',
|
|
95
|
+
data: {
|
|
96
|
+
requiredPermission: 'platform.admin.reports',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
constructor(private router: Router) { }
|
|
102
|
+
|
|
103
|
+
getItems(depth: number | null = null): Observable<AXPMenuItem[]> {
|
|
104
|
+
const menuClone = cloneDeep(this.initialMenu);
|
|
105
|
+
const result = this.internalGetMenuItemsByDepth(menuClone, depth);
|
|
106
|
+
return of(result);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
private internalGetMenuItemsByDepth(menuItems: AXPMenuItem[], depth: number | null, parent: AXPMenuItem | undefined = undefined): AXPMenuItem[] {
|
|
110
|
+
return menuItems.map((item) => {
|
|
111
|
+
// Create a new item with parent set
|
|
112
|
+
const newItem: AXPMenuItem = { ...item, parent: parent };
|
|
113
|
+
|
|
114
|
+
if (depth !== null) {
|
|
115
|
+
if (depth === 0) {
|
|
116
|
+
// If depth is 0, return the item without children
|
|
117
|
+
return omit(newItem, 'children');
|
|
118
|
+
} else if (item.children) {
|
|
119
|
+
// If the item has children, recursively set their parent and limit depth
|
|
120
|
+
newItem.children = this.internalGetMenuItemsByDepth(item.children, depth - 1, newItem);
|
|
121
|
+
}
|
|
122
|
+
} else if (item.children) {
|
|
123
|
+
// If depth is null, process all children without depth limit
|
|
124
|
+
newItem.children = this.internalGetMenuItemsByDepth(item.children, null, newItem);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return newItem;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
currentMenuItem(): AXPMenuItem | null {
|
|
132
|
+
return this.internalCurrentMenuItem(this.internalGetMenuItemsByDepth(this.initialMenu, null), this.getCurrentRoutePath());
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
private internalCurrentMenuItem(menuItems: AXPMenuItem[], currentPath: string): AXPMenuItem | null {
|
|
136
|
+
for (const item of menuItems) {
|
|
137
|
+
// Check if the current item's path matches the current path
|
|
138
|
+
if (item.path === currentPath) {
|
|
139
|
+
return item;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// If the current item has children, search recursively in the children
|
|
143
|
+
if (item.children && item.children.length > 0) {
|
|
144
|
+
const found = this.internalCurrentMenuItem(item.children, currentPath);
|
|
145
|
+
if (found) {
|
|
146
|
+
return found;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Return null if no matching item is found
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
private getCurrentRoutePath(): string {
|
|
156
|
+
// Using window.location to get the current browser URL
|
|
157
|
+
return window.location.pathname;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<div class="ax-flex ax-p-7">
|
|
2
|
-
<div class="ax-font-bold ax-text-3xl">Welcome to ACoreX Platform</div>
|
|
1
|
+
<div class="ax-flex ax-p-7">
|
|
2
|
+
<div class="ax-font-bold ax-text-3xl">Welcome to ACoreX Platform</div>
|
|
3
3
|
</div>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Component({
|
|
4
|
-
templateUrl: 'home.page.html',
|
|
5
|
-
standalone: true
|
|
6
|
-
})
|
|
7
|
-
|
|
8
|
-
export class <%= upperCase(name) %>HomePage {
|
|
9
|
-
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
templateUrl: 'home.page.html',
|
|
5
|
+
standalone: true
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
export class <%= upperCase(name) %>HomePage {
|
|
9
|
+
|
|
10
10
|
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { AXPAuthGuard, AXPPermissionGuard } from '@acorex/platform/auth';
|
|
2
|
-
import { AXPRootLayoutComponent } from '@acorex/platform/themes/default';
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
-
import { NgModule } from '@angular/core';
|
|
5
|
-
import { RouterModule, Routes } from '@angular/router';
|
|
6
|
-
|
|
7
|
-
const routes: Routes = [
|
|
8
|
-
{
|
|
9
|
-
path: '',
|
|
10
|
-
redirectTo: 'home',
|
|
11
|
-
pathMatch: 'full',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
path: '',
|
|
15
|
-
component: AXPRootLayoutComponent,
|
|
16
|
-
children: [
|
|
17
|
-
{
|
|
18
|
-
canActivate: [AXPAuthGuard],
|
|
19
|
-
path: 'home',
|
|
20
|
-
loadComponent: () => import('./home/home.page').then((c) => c.<%= upperCase(name) %>HomePage),
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
@NgModule({
|
|
27
|
-
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
28
|
-
exports: [RouterModule],
|
|
29
|
-
providers: [],
|
|
30
|
-
declarations: [],
|
|
31
|
-
})
|
|
32
|
-
export class <%= upperCase(name) %>RootModule { }
|
|
1
|
+
import { AXPAuthGuard, AXPPermissionGuard } from '@acorex/platform/auth';
|
|
2
|
+
import { AXPRootLayoutComponent } from '@acorex/platform/themes/default';
|
|
3
|
+
import { CommonModule } from '@angular/common';
|
|
4
|
+
import { NgModule } from '@angular/core';
|
|
5
|
+
import { RouterModule, Routes } from '@angular/router';
|
|
6
|
+
|
|
7
|
+
const routes: Routes = [
|
|
8
|
+
{
|
|
9
|
+
path: '',
|
|
10
|
+
redirectTo: 'home',
|
|
11
|
+
pathMatch: 'full',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
path: '',
|
|
15
|
+
component: AXPRootLayoutComponent,
|
|
16
|
+
children: [
|
|
17
|
+
{
|
|
18
|
+
canActivate: [AXPAuthGuard],
|
|
19
|
+
path: 'home',
|
|
20
|
+
loadComponent: () => import('./home/home.page').then((c) => c.<%= upperCase(name) %>HomePage),
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
@NgModule({
|
|
27
|
+
imports: [CommonModule, RouterModule.forChild(routes)],
|
|
28
|
+
exports: [RouterModule],
|
|
29
|
+
providers: [],
|
|
30
|
+
declarations: [],
|
|
31
|
+
})
|
|
32
|
+
export class <%= upperCase(name) %>RootModule { }
|