@genesislcap/blank-app-seed 3.26.0 → 3.27.1
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/.genx/package.json +1 -1
- package/.genx/templates/angular/chart.hbs +1 -1
- package/.genx/templates/angular/component/component.column.defs.hbs +9 -0
- package/.genx/templates/angular/component/component.create.form.hbs +8 -0
- package/.genx/templates/angular/component/component.gridOptions.hbs +9 -0
- package/.genx/templates/angular/component/component.hbs +48 -0
- package/.genx/templates/angular/component/component.index.hbs +1 -0
- package/.genx/templates/angular/component/component.styles.hbs +3 -0
- package/.genx/templates/angular/component/component.template.hbs +1 -0
- package/.genx/templates/angular/component/component.update.form.hbs +5 -0
- package/.genx/templates/angular/entityManager.hbs +4 -4
- package/.genx/templates/angular/form.hbs +1 -1
- package/.genx/templates/angular/grid.hbs +3 -3
- package/.genx/templates/angular/gridLayout.hbs +4 -4
- package/.genx/templates/angular/horizontalLayout.hbs +1 -1
- package/.genx/templates/angular/route.hbs +8 -30
- package/.genx/utils/generateRoute.js +7 -2
- package/.genx/utils/generateTile.js +55 -54
- package/.genx/utils/isString.js +8 -0
- package/.genx/utils/validateFrameworkAlias.js +5 -0
- package/.genx/versions.json +3 -3
- package/CHANGELOG.md +14 -0
- package/client-tmp/angular/README.md +35 -4
- package/client-tmp/angular/angular.json +0 -12
- package/client-tmp/angular/globals.d.ts +1 -1
- package/client-tmp/angular/karma.conf.js +9 -0
- package/client-tmp/angular/lint-css.js +18 -0
- package/client-tmp/angular/package.json +42 -5
- package/client-tmp/angular/playwright.config.ts +21 -0
- package/client-tmp/angular/src/app/share/foundation-login.ts +2 -2
- package/client-tmp/angular/src/environments/environment.prod.ts +4 -2
- package/client-tmp/angular/src/environments/environment.ts +5 -3
- package/client-tmp/angular/src/styles/styles.css +1 -0
- package/client-tmp/angular/test/e2e/fixture.ts +25 -0
- package/client-tmp/angular/test/e2e/flows/001-protected.e2e.ts +6 -0
- package/client-tmp/angular/test/e2e/index.ts +2 -0
- package/client-tmp/angular/test/e2e/pages/index.ts +1 -0
- package/client-tmp/angular/test/e2e/pages/protected.ts +16 -0
- package/client-tmp/angular/tsconfig.app.json +1 -1
- package/client-tmp/angular/tsconfig.json +1 -1
- package/package.json +1 -1
- package/server/build.gradle.kts +2 -2
package/.genx/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<ng-container *ngIf="hasUserPermission('{{config.permissions.viewRight}}'); else notPermitted{{ config.index }}">
|
|
3
3
|
<rapid-g2plot-chart
|
|
4
4
|
type="{{ config.type }}"
|
|
5
|
-
[config]="
|
|
5
|
+
[config]="chartConfig"
|
|
6
6
|
>
|
|
7
7
|
<chart-datasource
|
|
8
8
|
resourceName="{{ config.resourceName }}"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColDef } from '@ag-grid-community/core';
|
|
2
|
+
import { getNumberFormatter, getDateFormatter } from '@genesislcap/foundation-utils';
|
|
3
|
+
{{#if route.FDC3EventHandlersEnabled}}
|
|
4
|
+
import { sendEventOnChannel } from '../../../utils';
|
|
5
|
+
{{/if}}
|
|
6
|
+
|
|
7
|
+
{{#if tile.config.columns}}
|
|
8
|
+
export const columnDefs: ColDef[] = {{{ tile.config.columns }}}
|
|
9
|
+
{{/if}}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UiSchema } from '@genesislcap/foundation-forms';
|
|
2
|
+
|
|
3
|
+
{{#if tile.config.createFormUiSchema}}
|
|
4
|
+
export const createFormSchema: UiSchema = {{{ tile.config.createFormUiSchema }}}
|
|
5
|
+
{{/if}}
|
|
6
|
+
{{#if tile.config.uischema}}
|
|
7
|
+
export const createFormSchema: UiSchema = {{{ tile.config.uischema }}}
|
|
8
|
+
{{/if}}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GridOptionsConfig } from '@genesislcap/rapid-grid-pro';
|
|
2
|
+
import { getNumberFormatter, getDateFormatter } from '@genesislcap/foundation-utils';
|
|
3
|
+
{{#if route.FDC3EventHandlersEnabled}}
|
|
4
|
+
import { sendEventOnChannel } from '../../../utils';
|
|
5
|
+
{{/if}}
|
|
6
|
+
|
|
7
|
+
{{#if tile.config.gridOptions}}
|
|
8
|
+
export const gridOptions: GridOptionsConfig = {{{ tile.config.gridOptions }}}
|
|
9
|
+
{{/if}}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Component, Input, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { getUser } from '@genesislcap/foundation-user';
|
|
4
|
+
import { GridOptionsConfig } from "@genesislcap/rapid-grid-pro";
|
|
5
|
+
import { getViewUpdateRightComponent } from '../../../utils';
|
|
6
|
+
{{#if tile.config.createFormUiSchema}}
|
|
7
|
+
import { createFormSchema } from './{{kebabCase tile.title}}.create.form.schema';
|
|
8
|
+
{{/if}}
|
|
9
|
+
{{#if tile.config.uischema}}
|
|
10
|
+
import { createFormSchema } from './{{kebabCase tile.title}}.create.form.schema';
|
|
11
|
+
{{/if}}
|
|
12
|
+
{{#if tile.config.updateFormUiSchema}}
|
|
13
|
+
import { updateFormSchema } from './{{kebabCase tile.title}}.update.form.schema';
|
|
14
|
+
{{/if}}
|
|
15
|
+
{{#if tile.config.columns}}
|
|
16
|
+
import { columnDefs } from './{{kebabCase tile.title}}.column.defs';
|
|
17
|
+
{{/if}}
|
|
18
|
+
{{#if tile.config.gridOptions}}
|
|
19
|
+
import { gridOptions } from './{{kebabCase tile.title}}.gridOptions';
|
|
20
|
+
{{/if}}
|
|
21
|
+
|
|
22
|
+
@Component({
|
|
23
|
+
selector: 'app-{{kebabCase tile.componentName}}',
|
|
24
|
+
templateUrl: './{{kebabCase tile.title}}.component.html',
|
|
25
|
+
styleUrl: './{{kebabCase tile.title}}.component.css',
|
|
26
|
+
standalone: true,
|
|
27
|
+
imports: [
|
|
28
|
+
CommonModule,
|
|
29
|
+
],
|
|
30
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
31
|
+
})
|
|
32
|
+
export class {{pascalCase tile.componentName}} {
|
|
33
|
+
hasUserPermission = (permissionCode: string) => getViewUpdateRightComponent(getUser(), permissionCode);{{#if tile.config.createFormUiSchema}}
|
|
34
|
+
createFormSchema = createFormSchema;{{/if}}{{#if tile.config.uischema}}
|
|
35
|
+
uischema = createFormSchema;{{/if}}{{#if tile.config.updateFormUiSchema}}
|
|
36
|
+
updateFormSchema = updateFormSchema;{{/if}}{{#if tile.config.columns}}
|
|
37
|
+
columnDefs = columnDefs;{{/if}}{{#if tile.config.gridOptions}}
|
|
38
|
+
gridOptions = gridOptions as GridOptionsConfig;{{/if}}{{#if tile.config.reqrep}}
|
|
39
|
+
reqrep = { pollingInterval: 5000 };{{/if}}{{#if tile.config.type}}
|
|
40
|
+
chartConfig = { {{#ifEquals this.config.type 'pie'}}
|
|
41
|
+
"radius": 0.75,
|
|
42
|
+
"angleField": "value",
|
|
43
|
+
"colorField": "groupBy",{{else}}
|
|
44
|
+
"xField": "groupBy",
|
|
45
|
+
"yField": "value",{{/ifEquals}}
|
|
46
|
+
};{{/if}}
|
|
47
|
+
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './{{kebabCase tile.title}}.component';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{> (lookup tile 'type') tile}}
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
{{#if config.createEvent}}
|
|
13
13
|
[createEvent]="hasUserPermission('{{config.permissions.updateRight}}') ? '{{ config.createEvent }}' : undefined"
|
|
14
14
|
{{#if config.createFormUiSchema}}
|
|
15
|
-
[createFormUiSchema]="
|
|
15
|
+
[createFormUiSchema]="createFormSchema"
|
|
16
16
|
{{/if}}
|
|
17
17
|
{{/if}}
|
|
18
18
|
{{#if config.updateEvent}}
|
|
19
19
|
[updateEvent]="hasUserPermission('{{config.permissions.updateRight}}') ? '{{ config.updateEvent }}' : undefined"
|
|
20
20
|
{{#if config.updateFormUiSchema}}
|
|
21
|
-
[updateFormUiSchema]="
|
|
21
|
+
[updateFormUiSchema]="updateFormSchema"
|
|
22
22
|
{{/if}}
|
|
23
23
|
{{/if}}
|
|
24
24
|
{{#if config.deleteEvent}}
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
[datasourceConfig]="{ isSnapshot: {{ config.snapshot }} }"
|
|
32
32
|
{{/if}}
|
|
33
33
|
{{#if config.reqrep}}
|
|
34
|
-
[datasourceConfig]="
|
|
34
|
+
[datasourceConfig]="reqrep"
|
|
35
35
|
{{/if}}
|
|
36
36
|
{{#if config.columns}}
|
|
37
|
-
[columns]="
|
|
37
|
+
[columns]="columnDefs"
|
|
38
38
|
{{/if}}
|
|
39
39
|
{{#if config.modalPosition}}
|
|
40
40
|
modal-position="{{ config.modalPosition }}"
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
isSnapshot="{{config.snapshot}}"
|
|
12
12
|
{{/if}}
|
|
13
13
|
{{#if config.reqrep}}
|
|
14
|
-
[datasourceConfig]="
|
|
14
|
+
[datasourceConfig]="reqrep"
|
|
15
15
|
{{/if}}
|
|
16
16
|
{{#if config.gridOptions}}
|
|
17
|
-
[deferredGridOptions]="{ onRowClicked:
|
|
17
|
+
[deferredGridOptions]="{ onRowClicked: gridOptions.onRowClicked }"
|
|
18
18
|
{{/if}}
|
|
19
19
|
></grid-pro-genesis-datasource>
|
|
20
20
|
{{#if config.gridOptions}}
|
|
21
|
-
<grid-pro-column *ngFor="let columnDef of
|
|
21
|
+
<grid-pro-column *ngFor="let columnDef of gridOptions?.columnDefs" [definition]="columnDef"></grid-pro-column>
|
|
22
22
|
{{/if}}
|
|
23
23
|
</rapid-grid-pro>
|
|
24
24
|
<section
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
{{#each route.tiles}}
|
|
4
4
|
{{#ifEquals @index 0}}
|
|
5
5
|
<rapid-layout-item title="{{../title}}">
|
|
6
|
-
{{
|
|
6
|
+
<app-{{kebabCase ../componentName}}></app-{{kebabCase ../componentName}}>
|
|
7
7
|
</rapid-layout-item>
|
|
8
8
|
{{/ifEquals}}
|
|
9
9
|
{{#ifEquals @index 1}}
|
|
10
10
|
<rapid-layout-item title="{{../title}}">
|
|
11
|
-
{{
|
|
11
|
+
<app-{{kebabCase ../componentName}}></app-{{kebabCase ../componentName}}>
|
|
12
12
|
</rapid-layout-item>
|
|
13
13
|
{{/ifEquals}}
|
|
14
14
|
{{/each}}
|
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
{{#each route.tiles}}
|
|
18
18
|
{{#ifEquals @index 2}}
|
|
19
19
|
<rapid-layout-item title="{{../title}}">
|
|
20
|
-
{{
|
|
20
|
+
<app-{{kebabCase ../componentName}}></app-{{kebabCase ../componentName}}>
|
|
21
21
|
</rapid-layout-item>
|
|
22
22
|
{{/ifEquals}}
|
|
23
23
|
{{#ifEquals @index 3}}
|
|
24
24
|
<rapid-layout-item title="{{../title}}">
|
|
25
|
-
{{
|
|
25
|
+
<app-{{kebabCase ../componentName}}></app-{{kebabCase ../componentName}}>
|
|
26
26
|
</rapid-layout-item>
|
|
27
27
|
{{/ifEquals}}
|
|
28
28
|
{{/each}}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { User, getUser } from '@genesislcap/foundation-user';
|
|
4
|
-
import { GridOptionsConfig } from '@genesislcap/rapid-grid-pro';
|
|
5
|
-
import { getNumberFormatter, getDateFormatter } from '@genesislcap/foundation-utils';
|
|
6
|
-
import { getViewUpdateRightComponent } from '../../utils';
|
|
7
3
|
import { ErrorMessageComponent } from '../../components/error-message/error-message.component';
|
|
4
|
+
{{#each route.tiles}}
|
|
5
|
+
import { {{pascalCase this.componentName}} } from './{{kebabCase this.title}}-{{this.componentType}}';
|
|
6
|
+
{{/each}}
|
|
8
7
|
import { environment } from '../../../environments/environment';
|
|
9
|
-
|
|
10
|
-
import { sendEventOnChannel } from '../../utils';
|
|
11
|
-
{{/if}}
|
|
8
|
+
|
|
12
9
|
|
|
13
10
|
@Component({
|
|
14
|
-
selector: 'app-{{
|
|
11
|
+
selector: 'app-{{kebabCase route.name}}',
|
|
15
12
|
standalone: true,
|
|
16
13
|
imports: [
|
|
17
14
|
ErrorMessageComponent,
|
|
15
|
+
{{#each route.tiles}}
|
|
16
|
+
{{pascalCase this.componentName}},
|
|
17
|
+
{{/each}}
|
|
18
18
|
CommonModule,
|
|
19
19
|
],
|
|
20
20
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
@@ -23,26 +23,4 @@ import { sendEventOnChannel } from '../../utils';
|
|
|
23
23
|
})
|
|
24
24
|
export class {{pascalCase route.name}}Component {
|
|
25
25
|
environment = environment;
|
|
26
|
-
hasUserPermission = (permissionCode: string) => getViewUpdateRightComponent(getUser(), permissionCode);
|
|
27
|
-
{{#if route.FDC3EventHandlersEnabled}}
|
|
28
|
-
sendEventOnChannel = sendEventOnChannel;
|
|
29
|
-
{{/if}}
|
|
30
|
-
|
|
31
|
-
{{#each route.tiles}}
|
|
32
|
-
tile{{this.config.index}} = { {{#if this.config.createFormUiSchema}}
|
|
33
|
-
"createFormUiSchema": {{{ this.config.createFormUiSchema }}},{{/if}}{{#if this.config.updateFormUiSchema}}
|
|
34
|
-
"updateFormUiSchema": {{{ this.config.updateFormUiSchema }}},{{/if}}{{#if this.config.uischema}}
|
|
35
|
-
"uischema": {{{ this.config.uischema }}},{{/if}}{{#if this.config.gridOptions}}
|
|
36
|
-
"gridOptions": {{{ this.config.gridOptions }}} as GridOptionsConfig,{{/if}}{{#if this.config.reqrep}}
|
|
37
|
-
"reqrep": {{{ this.config.reqrep }}},{{/if}}{{#if this.config.columns}}
|
|
38
|
-
"columns": {{{ this.config.columns }}},{{/if}}{{#if this.config.type}}
|
|
39
|
-
"chartConfig": { {{#ifEquals this.config.type 'pie'}}
|
|
40
|
-
"radius": 0.75,
|
|
41
|
-
"angleField": "value",
|
|
42
|
-
"colorField": "groupBy",{{else}}
|
|
43
|
-
"xField": "groupBy",
|
|
44
|
-
"yField": "value",{{/ifEquals}}
|
|
45
|
-
},{{/if}}
|
|
46
|
-
}{{#unless @last}};{{/unless}}
|
|
47
|
-
{{/each}}
|
|
48
26
|
}
|
|
@@ -73,8 +73,13 @@ const generateRoute = (route, { changeCase, writeFileWithData }, framework) => {
|
|
|
73
73
|
);
|
|
74
74
|
});
|
|
75
75
|
|
|
76
|
-
// Remove condition after adding changes for
|
|
77
|
-
if (
|
|
76
|
+
// Remove condition after adding changes for react
|
|
77
|
+
if (
|
|
78
|
+
[FRAMEWORK_WEB_COMPONENTS_ALIAS, FRAMEWORK_ANGULAR_ALIAS].includes(
|
|
79
|
+
framework,
|
|
80
|
+
) &&
|
|
81
|
+
route?.tiles?.length
|
|
82
|
+
) {
|
|
78
83
|
route.tiles.forEach((tile) => {
|
|
79
84
|
generateTile(tile, route, { changeCase, writeFileWithData }, framework);
|
|
80
85
|
});
|
|
@@ -6,37 +6,44 @@ const {
|
|
|
6
6
|
DIR_TEMPLATE_BY_FRAMEWORK,
|
|
7
7
|
} = require('../static');
|
|
8
8
|
|
|
9
|
+
const defaultPathGetters = {
|
|
10
|
+
index: (componentPath) => `${componentPath}/index.ts`,
|
|
11
|
+
addForm: (componentPath, tile) =>
|
|
12
|
+
`${componentPath}/${tile.name}.create.form.schema.ts`,
|
|
13
|
+
updateForm: (componentPath, tile) =>
|
|
14
|
+
`${componentPath}/${tile.name}.update.form.schema.ts`,
|
|
15
|
+
columnDefs: (componentPath, tile) =>
|
|
16
|
+
`${componentPath}/${tile.name}.column.defs.ts`,
|
|
17
|
+
gridOptions: (componentPath, tile) =>
|
|
18
|
+
`${componentPath}/${tile.name}.gridOptions.ts`,
|
|
19
|
+
};
|
|
20
|
+
|
|
9
21
|
const getPathByFramework = {
|
|
10
22
|
[FRAMEWORK_WEB_COMPONENTS_ALIAS]: {
|
|
23
|
+
...defaultPathGetters,
|
|
11
24
|
clientSrcPath: `../../client/src/routes`,
|
|
12
|
-
route: (clientSrcPath,
|
|
13
|
-
`${clientSrcPath}/${routeName}/${
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
`${
|
|
24
|
-
|
|
25
|
-
`${componentPath}/${
|
|
26
|
-
|
|
27
|
-
`${componentPath}/${
|
|
25
|
+
route: (clientSrcPath, tile, routeName) =>
|
|
26
|
+
`${clientSrcPath}/${routeName}/${tile.name}-${tile.componentType}`,
|
|
27
|
+
component: (componentPath, tile) => `${componentPath}/${tile.name}.ts`,
|
|
28
|
+
template: (componentPath, tile) =>
|
|
29
|
+
`${componentPath}/${tile.name}.template.ts`,
|
|
30
|
+
style: (componentPath, tile) => `${componentPath}/${tile.name}.styles.ts`,
|
|
31
|
+
},
|
|
32
|
+
[FRAMEWORK_ANGULAR_ALIAS]: {
|
|
33
|
+
...defaultPathGetters,
|
|
34
|
+
clientSrcPath: `../../client/src/app/pages`,
|
|
35
|
+
route: (clientSrcPath, tile, routeName) =>
|
|
36
|
+
`${clientSrcPath}/${routeName}/${tile.name}-${tile.componentType}`,
|
|
37
|
+
component: (componentPath, tile) =>
|
|
38
|
+
`${componentPath}/${tile.name}.component.ts`,
|
|
39
|
+
template: (componentPath, tile) =>
|
|
40
|
+
`${componentPath}/${tile.name}.component.html`,
|
|
41
|
+
style: (componentPath, tile) =>
|
|
42
|
+
`${componentPath}/${tile.name}.component.css`,
|
|
28
43
|
},
|
|
29
|
-
// Placeholder for angular part
|
|
30
|
-
[FRAMEWORK_ANGULAR_ALIAS]: {},
|
|
31
44
|
};
|
|
32
45
|
|
|
33
|
-
const getFilesToWrite = (
|
|
34
|
-
tile,
|
|
35
|
-
tileName,
|
|
36
|
-
routeName,
|
|
37
|
-
path,
|
|
38
|
-
sourceTemplateDir,
|
|
39
|
-
) => {
|
|
46
|
+
const getFilesToWrite = (tileData, routeName, path, sourceTemplateDir) => {
|
|
40
47
|
const {
|
|
41
48
|
clientSrcPath,
|
|
42
49
|
route: getRouteDir,
|
|
@@ -50,51 +57,46 @@ const getFilesToWrite = (
|
|
|
50
57
|
gridOptions: getGridOptionsTarget,
|
|
51
58
|
} = path;
|
|
52
59
|
|
|
53
|
-
const routeDir = getRouteDir(
|
|
54
|
-
clientSrcPath,
|
|
55
|
-
tileName,
|
|
56
|
-
tile.componentType,
|
|
57
|
-
routeName,
|
|
58
|
-
);
|
|
60
|
+
const routeDir = getRouteDir(clientSrcPath, tileData, routeName);
|
|
59
61
|
|
|
60
62
|
const componentIndexFile = {
|
|
61
63
|
source: `${sourceTemplateDir}/component/component.index.hbs`,
|
|
62
|
-
target: getComponentIndexTarget(routeDir,
|
|
64
|
+
target: getComponentIndexTarget(routeDir, tileData),
|
|
63
65
|
};
|
|
64
66
|
|
|
65
67
|
const componentFile = {
|
|
66
68
|
source: `${sourceTemplateDir}/component/component.hbs`,
|
|
67
|
-
target: getComponentTarget(routeDir,
|
|
69
|
+
target: getComponentTarget(routeDir, tileData),
|
|
68
70
|
};
|
|
69
71
|
|
|
70
72
|
const componentTemplateFile = {
|
|
71
73
|
source: `${sourceTemplateDir}/component/component.template.hbs`,
|
|
72
|
-
target: getTemplateTarget(routeDir,
|
|
74
|
+
target: getTemplateTarget(routeDir, tileData),
|
|
73
75
|
};
|
|
74
76
|
|
|
75
77
|
const componentStylesFile = {
|
|
76
78
|
source: `${sourceTemplateDir}/component/component.styles.hbs`,
|
|
77
|
-
target: getStyleTarget(routeDir,
|
|
79
|
+
target: getStyleTarget(routeDir, tileData),
|
|
78
80
|
};
|
|
79
81
|
|
|
80
82
|
const componentAddFormFile = {
|
|
81
83
|
source: `${sourceTemplateDir}/component/component.create.form.hbs`,
|
|
82
|
-
target: getAddFormTarget(routeDir,
|
|
84
|
+
target: getAddFormTarget(routeDir, tileData),
|
|
83
85
|
};
|
|
84
86
|
|
|
85
87
|
const componentUpdateFormFile = {
|
|
86
88
|
source: `${sourceTemplateDir}/component/component.update.form.hbs`,
|
|
87
|
-
target: getUpdateFormTarget(routeDir,
|
|
89
|
+
target: getUpdateFormTarget(routeDir, tileData),
|
|
88
90
|
};
|
|
89
91
|
|
|
90
92
|
const componentColumnsFile = {
|
|
91
93
|
source: `${sourceTemplateDir}/component/component.column.defs.hbs`,
|
|
92
|
-
target: getColumnDefsTarget(routeDir,
|
|
94
|
+
target: getColumnDefsTarget(routeDir, tileData),
|
|
93
95
|
};
|
|
94
96
|
|
|
95
97
|
const componentGridOptionsFile = {
|
|
96
98
|
source: `${sourceTemplateDir}/component/component.gridOptions.hbs`,
|
|
97
|
-
target: getGridOptionsTarget(routeDir,
|
|
99
|
+
target: getGridOptionsTarget(routeDir, tileData),
|
|
98
100
|
};
|
|
99
101
|
|
|
100
102
|
const filesToWrite = [
|
|
@@ -104,23 +106,23 @@ const getFilesToWrite = (
|
|
|
104
106
|
componentStylesFile,
|
|
105
107
|
];
|
|
106
108
|
|
|
107
|
-
switch (
|
|
109
|
+
switch (tileData.type) {
|
|
108
110
|
case 'entity-manager':
|
|
109
|
-
if (
|
|
111
|
+
if (tileData.config?.columns) {
|
|
110
112
|
filesToWrite.push(componentColumnsFile);
|
|
111
113
|
}
|
|
112
|
-
if (
|
|
114
|
+
if (tileData.config?.gridOptions) {
|
|
113
115
|
filesToWrite.push(componentGridOptionsFile);
|
|
114
116
|
}
|
|
115
|
-
if (
|
|
117
|
+
if (tileData.config?.createFormUiSchema) {
|
|
116
118
|
filesToWrite.push(componentAddFormFile);
|
|
117
119
|
}
|
|
118
|
-
if (
|
|
120
|
+
if (tileData.config?.updateFormUiSchema) {
|
|
119
121
|
filesToWrite.push(componentUpdateFormFile);
|
|
120
122
|
}
|
|
121
123
|
break;
|
|
122
124
|
case 'grid-pro':
|
|
123
|
-
if (
|
|
125
|
+
if (tileData.config?.gridOptions) {
|
|
124
126
|
filesToWrite.push(componentGridOptionsFile);
|
|
125
127
|
}
|
|
126
128
|
break;
|
|
@@ -140,20 +142,19 @@ const generateTile = (
|
|
|
140
142
|
{ changeCase, writeFileWithData },
|
|
141
143
|
framework,
|
|
142
144
|
) => {
|
|
143
|
-
const
|
|
145
|
+
const tileData = {
|
|
146
|
+
...tile,
|
|
147
|
+
name: changeCase.paramCase(tile.title),
|
|
148
|
+
componentType: tile.componentType,
|
|
149
|
+
config: tile.config,
|
|
150
|
+
};
|
|
144
151
|
const routeName = changeCase.paramCase(route.name);
|
|
145
152
|
const sourceTemplateDir = `../${DIR_TEMPLATE_BY_FRAMEWORK[framework]}`;
|
|
146
153
|
const { clientSrcPath, route: getRouteDir } = getPathByFramework[framework];
|
|
147
|
-
const routeDir = getRouteDir(
|
|
148
|
-
clientSrcPath,
|
|
149
|
-
tileName,
|
|
150
|
-
tile.componentType,
|
|
151
|
-
routeName,
|
|
152
|
-
);
|
|
154
|
+
const routeDir = getRouteDir(clientSrcPath, tileData, routeName);
|
|
153
155
|
|
|
154
156
|
const filesToWrite = getFilesToWrite(
|
|
155
|
-
|
|
156
|
-
tileName,
|
|
157
|
+
tileData,
|
|
157
158
|
routeName,
|
|
158
159
|
getPathByFramework[framework],
|
|
159
160
|
sourceTemplateDir,
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
const { FRAMEWORKS_ALIAS } = require('../static');
|
|
2
2
|
const normalizeFrameworkAlias = require('./normalizeFrameworkAlias');
|
|
3
|
+
const isString = require('./isString');
|
|
3
4
|
|
|
4
5
|
const validateFrameworkAlias = (alias) => {
|
|
6
|
+
if (!isString(alias)) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
return FRAMEWORKS_ALIAS.includes(normalizeFrameworkAlias(alias));
|
|
6
11
|
};
|
|
7
12
|
|
package/.genx/versions.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.27.1](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.27.0...v3.27.1) (2024-07-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* automated dependency version update [skip-ci] [PSD-9](https://github.com/genesiscommunitysuccess/blank-app-seed/issues/9) (#292) 33cf11d
|
|
9
|
+
|
|
10
|
+
## [3.27.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.26.0...v3.27.0) (2024-07-25)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* Implement the generated UI code structure proposal (angular) (#287) 6d61502, closes FUI-2099 FUI-2099 FUI-2099
|
|
16
|
+
|
|
3
17
|
## [3.26.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.25.2...v3.26.0) (2024-07-24)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
|
|
1
2
|
# {{capitalCase appName}}
|
|
2
3
|
|
|
3
4
|
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) v18 (18.0.4).
|
|
4
5
|
|
|
5
6
|
## Development server
|
|
6
7
|
|
|
7
|
-
Run `
|
|
8
|
+
Run `npm run dev` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
|
|
8
9
|
|
|
9
10
|
## Code scaffolding
|
|
10
11
|
|
|
@@ -12,15 +13,45 @@ Run `ng generate component component-name` to generate a new component. You can
|
|
|
12
13
|
|
|
13
14
|
## Build
|
|
14
15
|
|
|
15
|
-
Run `
|
|
16
|
+
Run `npm run build` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
16
17
|
|
|
17
18
|
## Running unit tests
|
|
18
19
|
|
|
19
|
-
Run `
|
|
20
|
+
Run `npm run test` to execute the unit tests via [Karma](https://karma-runner.github.io).
|
|
20
21
|
|
|
21
22
|
## Running end-to-end tests
|
|
22
23
|
|
|
23
|
-
Run `
|
|
24
|
+
Run `npm run test:e2e` to execute the end-to-end tests via a platform of your choice.
|
|
25
|
+
|
|
26
|
+
## Linting
|
|
27
|
+
|
|
28
|
+
Run `npm run lint` to lint the project.
|
|
29
|
+
|
|
30
|
+
## NPM Scripts
|
|
31
|
+
|
|
32
|
+
- `npm run baseline`: Cleans the project and installs dependencies.
|
|
33
|
+
- `npm run bootstrap`: Installs dependencies without auditing or funding checks.
|
|
34
|
+
- `npm run bootstrap:ci`: Installs dependencies in CI environment without auditing or funding checks.
|
|
35
|
+
- `npm run build`: Builds the project in production configuration.
|
|
36
|
+
- `npm run build:stats`: Builds the project and generates a stats JSON file.
|
|
37
|
+
- `npm run clean`: Cleans the `dist` and `node_modules` directories.
|
|
38
|
+
- `npm run dev`: Serves the project in development mode.
|
|
39
|
+
- `npm run dev:docker`: Serves the project in development mode, accessible from any network interface.
|
|
40
|
+
- `npm run dev:no-open`: Serves the project in development mode without automatically opening the browser.
|
|
41
|
+
- `npm run dev:intellij`: Serves the project in development mode (specific for IntelliJ).
|
|
42
|
+
- `npm run dev:https`: Serves the project in development mode with HTTPS.
|
|
43
|
+
- `npm run dev:webpack`: Serves the project in development mode (specific for webpack configuration).
|
|
44
|
+
- `npm run dsconfig`: Configures design system based on `src/styles/design-tokens.json`.
|
|
45
|
+
- `npm run lint`: Lints the project using the specified profile.
|
|
46
|
+
- `npm run lint:fix`: Fixes linting errors in the project.
|
|
47
|
+
- `npm run lint:eslint`: Lints the project using ESLint and the specified profile.
|
|
48
|
+
- `npm run lint:stylelint`: Lints CSS using a custom script.
|
|
49
|
+
- `npm run test`: Runs unit tests.
|
|
50
|
+
- `npm run test:e2e`: Runs end-to-end tests.
|
|
51
|
+
- `npm run test:e2e:debug`: Runs end-to-end tests in debug mode.
|
|
52
|
+
- `npm run test:e2e:ui`: Runs end-to-end tests in interactive mode.
|
|
53
|
+
- `npm run test:coverage`: Runs unit tests and generates a code coverage report.
|
|
54
|
+
- `npm run test:unit:watch`: Runs unit tests in watch mode.
|
|
24
55
|
|
|
25
56
|
## Further help
|
|
26
57
|
|
|
@@ -49,18 +49,6 @@
|
|
|
49
49
|
"with": "src/environments/environment.prod.ts"
|
|
50
50
|
}
|
|
51
51
|
],
|
|
52
|
-
"budgets": [
|
|
53
|
-
{
|
|
54
|
-
"type": "initial",
|
|
55
|
-
"maximumWarning": "500kb",
|
|
56
|
-
"maximumError": "1mb"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"type": "anyComponentStyle",
|
|
60
|
-
"maximumWarning": "2kb",
|
|
61
|
-
"maximumError": "4kb"
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
52
|
"outputHashing": "all"
|
|
65
53
|
},
|
|
66
54
|
"development": {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const glob = require('glob');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const cssFiles = glob.sync(path.join(__dirname, '**/*.css'));
|
|
5
|
+
|
|
6
|
+
if (cssFiles.length === 0) {
|
|
7
|
+
console.log('No CSS files found.');
|
|
8
|
+
process.exit(0);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const command = `genx lint -l stylelint ${cssFiles.join(' ')}`;
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
execSync(command, { stdio: 'inherit' });
|
|
15
|
+
} catch (error) {
|
|
16
|
+
console.error('Error running stylelint:', error);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
@@ -4,19 +4,54 @@
|
|
|
4
4
|
"version": "{{applicationVersionWeb}}",
|
|
5
5
|
"private": true,
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
|
+
"genx": {
|
|
8
|
+
"app": {
|
|
9
|
+
"rootElement": "{{rootElement}}"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
7
12
|
"scripts": {
|
|
8
|
-
"
|
|
13
|
+
"baseline": "npm run clean && npm run bootstrap",
|
|
9
14
|
"bootstrap": "npm install --no-fund --no-audit",
|
|
10
|
-
"
|
|
15
|
+
"bootstrap:ci": "npm ci --no-fund --no-audit",
|
|
11
16
|
"build": "ng build --configuration=production",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
17
|
+
"build:stats": "npm run build --stats-json",
|
|
18
|
+
"clean": "genx clean dist node_modules",
|
|
19
|
+
"dev": "ng serve --configuration=development --open",
|
|
20
|
+
"dev:docker": "npm run dev -- --host 0.0.0.0",
|
|
21
|
+
"dev:no-open": "npm run dev -- --no-open",
|
|
22
|
+
"dev:intellij": "npm run dev",
|
|
23
|
+
"dev:https": "npm run dev -- --https",
|
|
24
|
+
"dev:webpack": "npm run dev",
|
|
25
|
+
"dsconfig": "dsconfig --path src/styles/design-tokens.json",
|
|
26
|
+
"lint": "genx lint --profile",
|
|
27
|
+
"lint:fix": "genx lint --fix",
|
|
28
|
+
"lint:eslint": "genx lint -l eslint --profile",
|
|
29
|
+
"lint:stylelint": "node lint-css.js",
|
|
30
|
+
"test": "ng test",
|
|
31
|
+
"test:e2e": "genx test --e2e",
|
|
32
|
+
"test:e2e:debug": "genx test --e2e --debug",
|
|
33
|
+
"test:e2e:ui": "genx test --e2e --interactive",
|
|
34
|
+
"test:coverage": "ng test --no-watch --code-coverage",
|
|
35
|
+
"test:unit:watch": "ng test --watch"
|
|
36
|
+
},
|
|
37
|
+
"eslintConfig": {
|
|
38
|
+
"extends": "@genesislcap/eslint-config",
|
|
39
|
+
"ignorePatterns": ["**/dist/**", "**/public/**", "**/coverage/**", "**/test/**", "playwright.config.ts"]
|
|
40
|
+
},
|
|
41
|
+
"stylelint": {
|
|
42
|
+
"extends": "@genesislcap/stylelint-config"
|
|
14
43
|
},
|
|
44
|
+
"prettier": "@genesislcap/prettier-config",
|
|
15
45
|
"devDependencies": {
|
|
16
46
|
"@angular-builders/custom-webpack": "^18.0.0",
|
|
17
47
|
"@angular-devkit/build-angular": "^18.0.4",
|
|
18
48
|
"@angular/cli": "^18.0.4",
|
|
19
49
|
"@angular/compiler-cli": "^18.0.4",
|
|
50
|
+
"@genesislcap/design-system-configurator": "{{versions.UI}}",
|
|
51
|
+
"@genesislcap/eslint-config": "{{versions.UI}}",
|
|
52
|
+
"@genesislcap/prettier-config": "{{versions.UI}}",
|
|
53
|
+
"@genesislcap/foundation-testing": "{{versions.UI}}",
|
|
54
|
+
"@genesislcap/genx": "{{versions.UI}}",
|
|
20
55
|
"@genesislcap/build-kit": "{{versions.UI}}",
|
|
21
56
|
"@types/jasmine": "~5.1.0",
|
|
22
57
|
"@types/numeral": "^2.0.5",
|
|
@@ -29,7 +64,9 @@
|
|
|
29
64
|
"karma-jasmine-html-reporter": "~2.1.0",
|
|
30
65
|
"svg-url-loader": "^8.0.0",
|
|
31
66
|
"typescript": "~5.4.5",
|
|
32
|
-
"ts-node": "10.9.2"
|
|
67
|
+
"ts-node": "10.9.2",
|
|
68
|
+
"dotenv": "16.4.5",
|
|
69
|
+
"@types/node": "20.14.11"
|
|
33
70
|
},
|
|
34
71
|
"dependencies": {
|
|
35
72
|
"@angular/animations": "^18.0.4",
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { configDefaults } from '@genesislcap/foundation-testing/e2e';
|
|
2
|
+
import { environment } from './src/environments/environment';
|
|
3
|
+
import * as dotenv from 'dotenv';
|
|
4
|
+
|
|
5
|
+
dotenv.config();
|
|
6
|
+
|
|
7
|
+
const PROTOCOL = process.env['PROTOCOL'] || environment.PROTOCOL || 'http';
|
|
8
|
+
const HOST = process.env['HOST'] || environment.HOST || 'localhost';
|
|
9
|
+
const PORT = process.env['PORT'] || environment.PORT || 4200;
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
...configDefaults,
|
|
13
|
+
webServer: {
|
|
14
|
+
...configDefaults.webServer,
|
|
15
|
+
url: `${PROTOCOL}://${HOST}:${PORT}`,
|
|
16
|
+
},
|
|
17
|
+
use: {
|
|
18
|
+
...configDefaults.use,
|
|
19
|
+
baseURL: `${PROTOCOL}://${HOST}:${PORT}`,
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -6,10 +6,10 @@ import { DI } from '@microsoft/fast-foundation';
|
|
|
6
6
|
import logo from '../../assets/logo.svg';
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line
|
|
9
|
-
declare var
|
|
9
|
+
declare var ENABLE_SSO: boolean;
|
|
10
10
|
|
|
11
11
|
const ssoSettings =
|
|
12
|
-
typeof
|
|
12
|
+
typeof ENABLE_SSO !== 'undefined' && ENABLE_SSO === true
|
|
13
13
|
? {
|
|
14
14
|
autoAuth: true,
|
|
15
15
|
sso: {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { base, Page } from '@genesislcap/foundation-testing/e2e';
|
|
2
|
+
import { ProtectedPage } from './pages';
|
|
3
|
+
import { environment } from '../../src/environments/environment'
|
|
4
|
+
|
|
5
|
+
export type FixtureConfig = {
|
|
6
|
+
API_HOST: string;
|
|
7
|
+
DEFAULT_USER: string;
|
|
8
|
+
DEFAULT_PASSWORD: string;
|
|
9
|
+
PORT: number;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type Fixture = {
|
|
13
|
+
config: FixtureConfig;
|
|
14
|
+
protectedPage: ProtectedPage;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const { PORT, API_HOST } = environment;
|
|
18
|
+
export const test = base.extend<Fixture>({
|
|
19
|
+
config: [{ PORT, API_HOST, DEFAULT_PASSWORD: '', DEFAULT_USER: '' }, { option: true }],
|
|
20
|
+
protectedPage: async ({ config, page }: { config: FixtureConfig, page: Page }, use: any) => {
|
|
21
|
+
const protectedPage = new ProtectedPage(config, page);
|
|
22
|
+
await protectedPage.goto();
|
|
23
|
+
await use(protectedPage);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './protected';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Page } from '@genesislcap/foundation-testing/e2e';
|
|
2
|
+
import type { FixtureConfig } from '../fixture';
|
|
3
|
+
|
|
4
|
+
export class ProtectedPage {
|
|
5
|
+
config: FixtureConfig;
|
|
6
|
+
page: Page;
|
|
7
|
+
|
|
8
|
+
constructor(config: FixtureConfig, page: Page) {
|
|
9
|
+
this.config = config;
|
|
10
|
+
this.page = page;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async goto() {
|
|
14
|
+
await this.page.goto('/');
|
|
15
|
+
}
|
|
16
|
+
}
|
package/package.json
CHANGED
package/server/build.gradle.kts
CHANGED
|
@@ -8,8 +8,8 @@ subprojects {
|
|
|
8
8
|
apply(plugin = "org.gradle.maven-publish")
|
|
9
9
|
|
|
10
10
|
dependencies {
|
|
11
|
-
implementation("com.h2database:h2
|
|
12
|
-
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5
|
|
11
|
+
implementation("com.h2database:h2")
|
|
12
|
+
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
|
|
13
13
|
}
|
|
14
14
|
tasks {
|
|
15
15
|
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|