@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.
Files changed (42) hide show
  1. package/.genx/package.json +1 -1
  2. package/.genx/templates/angular/chart.hbs +1 -1
  3. package/.genx/templates/angular/component/component.column.defs.hbs +9 -0
  4. package/.genx/templates/angular/component/component.create.form.hbs +8 -0
  5. package/.genx/templates/angular/component/component.gridOptions.hbs +9 -0
  6. package/.genx/templates/angular/component/component.hbs +48 -0
  7. package/.genx/templates/angular/component/component.index.hbs +1 -0
  8. package/.genx/templates/angular/component/component.styles.hbs +3 -0
  9. package/.genx/templates/angular/component/component.template.hbs +1 -0
  10. package/.genx/templates/angular/component/component.update.form.hbs +5 -0
  11. package/.genx/templates/angular/entityManager.hbs +4 -4
  12. package/.genx/templates/angular/form.hbs +1 -1
  13. package/.genx/templates/angular/grid.hbs +3 -3
  14. package/.genx/templates/angular/gridLayout.hbs +4 -4
  15. package/.genx/templates/angular/horizontalLayout.hbs +1 -1
  16. package/.genx/templates/angular/route.hbs +8 -30
  17. package/.genx/utils/generateRoute.js +7 -2
  18. package/.genx/utils/generateTile.js +55 -54
  19. package/.genx/utils/isString.js +8 -0
  20. package/.genx/utils/validateFrameworkAlias.js +5 -0
  21. package/.genx/versions.json +3 -3
  22. package/CHANGELOG.md +14 -0
  23. package/client-tmp/angular/README.md +35 -4
  24. package/client-tmp/angular/angular.json +0 -12
  25. package/client-tmp/angular/globals.d.ts +1 -1
  26. package/client-tmp/angular/karma.conf.js +9 -0
  27. package/client-tmp/angular/lint-css.js +18 -0
  28. package/client-tmp/angular/package.json +42 -5
  29. package/client-tmp/angular/playwright.config.ts +21 -0
  30. package/client-tmp/angular/src/app/share/foundation-login.ts +2 -2
  31. package/client-tmp/angular/src/environments/environment.prod.ts +4 -2
  32. package/client-tmp/angular/src/environments/environment.ts +5 -3
  33. package/client-tmp/angular/src/styles/styles.css +1 -0
  34. package/client-tmp/angular/test/e2e/fixture.ts +25 -0
  35. package/client-tmp/angular/test/e2e/flows/001-protected.e2e.ts +6 -0
  36. package/client-tmp/angular/test/e2e/index.ts +2 -0
  37. package/client-tmp/angular/test/e2e/pages/index.ts +1 -0
  38. package/client-tmp/angular/test/e2e/pages/protected.ts +16 -0
  39. package/client-tmp/angular/tsconfig.app.json +1 -1
  40. package/client-tmp/angular/tsconfig.json +1 -1
  41. package/package.json +1 -1
  42. package/server/build.gradle.kts +2 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/blank-app-seed-config",
3
3
  "description": "Genesis Blank App Seed Configuration",
4
- "version": "3.26.0",
4
+ "version": "3.27.1",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
7
  "lint": "eslint .",
@@ -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]="tile{{ config.index }}.chartConfig"
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,3 @@
1
+ :host {
2
+ /* insert css styles here */
3
+ }
@@ -0,0 +1 @@
1
+ {{> (lookup tile 'type') tile}}
@@ -0,0 +1,5 @@
1
+ import { UiSchema } from '@genesislcap/foundation-forms';
2
+
3
+ {{#if tile.config.updateFormUiSchema}}
4
+ export const updateFormSchema: UiSchema = {{{ tile.config.updateFormUiSchema }}}
5
+ {{/if}}
@@ -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]="tile{{ config.index }}.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]="tile{{ config.index }}.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]="tile{{ config.index }}.reqrep"
34
+ [datasourceConfig]="reqrep"
35
35
  {{/if}}
36
36
  {{#if config.columns}}
37
- [columns]="tile{{ config.index }}.columns"
37
+ [columns]="columnDefs"
38
38
  {{/if}}
39
39
  {{#if config.modalPosition}}
40
40
  modal-position="{{ config.modalPosition }}"
@@ -4,7 +4,7 @@
4
4
  design-system-prefix="rapid"
5
5
  resourceName="{{config.resourceName}}"
6
6
  {{#if config.uischema}}
7
- [uischema]="tile{{ config.index }}.uischema"
7
+ [uischema]="uischema"
8
8
  {{/if}}
9
9
  >
10
10
  </foundation-form>
@@ -11,14 +11,14 @@
11
11
  isSnapshot="{{config.snapshot}}"
12
12
  {{/if}}
13
13
  {{#if config.reqrep}}
14
- [datasourceConfig]="tile{{ config.index }}.reqrep"
14
+ [datasourceConfig]="reqrep"
15
15
  {{/if}}
16
16
  {{#if config.gridOptions}}
17
- [deferredGridOptions]="{ onRowClicked: tile{{ config.index }}.gridOptions.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 tile{{ config.index }}.gridOptions?.columnDefs" [definition]="columnDef"></grid-pro-column>
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
- {{> (lookup ../this 'type') ../this}}
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
- {{> (lookup ../this 'type') ../this}}
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
- {{> (lookup ../this 'type') ../this}}
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
- {{> (lookup ../this 'type') ../this}}
25
+ <app-{{kebabCase ../componentName}}></app-{{kebabCase ../componentName}}>
26
26
  </rapid-layout-item>
27
27
  {{/ifEquals}}
28
28
  {{/each}}
@@ -1,7 +1,7 @@
1
1
  <rapid-layout-region>
2
2
  {{#each route.tiles}}
3
3
  <rapid-layout-item title="{{this.title}}">
4
- {{> (lookup . 'type') }}
4
+ <app-{{kebabCase this.componentName}}></app-{{kebabCase this.componentName}}>
5
5
  </rapid-layout-item>
6
6
  {{/each}}
7
7
  </rapid-layout-region>
@@ -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
- {{#if route.FDC3EventHandlersEnabled}}
10
- import { sendEventOnChannel } from '../../utils';
11
- {{/if}}
8
+
12
9
 
13
10
  @Component({
14
- selector: 'app-{{pascalCase route.name}}',
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 angular & react
77
- if (framework === FRAMEWORK_WEB_COMPONENTS_ALIAS && route?.tiles?.length) {
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, tileName, tileType, routeName) =>
13
- `${clientSrcPath}/${routeName}/${tileName}-${tileType}`,
14
- index: (componentPath) => `${componentPath}/index.ts`,
15
- component: (componentPath, tileName) => `${componentPath}/${tileName}.ts`,
16
- template: (componentPath, tileName) =>
17
- `${componentPath}/${tileName}.template.ts`,
18
- style: (componentPath, tileName) =>
19
- `${componentPath}/${tileName}.styles.ts`,
20
- addForm: (componentPath, tileName) =>
21
- `${componentPath}/${tileName}.create.form.schema.ts`,
22
- updateForm: (componentPath, tileName) =>
23
- `${componentPath}/${tileName}.update.form.schema.ts`,
24
- columnDefs: (componentPath, tileName) =>
25
- `${componentPath}/${tileName}.column.defs.ts`,
26
- gridOptions: (componentPath, tileName) =>
27
- `${componentPath}/${tileName}.gridOptions.ts`,
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, tileName),
64
+ target: getComponentIndexTarget(routeDir, tileData),
63
65
  };
64
66
 
65
67
  const componentFile = {
66
68
  source: `${sourceTemplateDir}/component/component.hbs`,
67
- target: getComponentTarget(routeDir, tileName),
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, tileName),
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, tileName),
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, tileName),
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, tileName),
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, tileName),
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, tileName),
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 (tile.type) {
109
+ switch (tileData.type) {
108
110
  case 'entity-manager':
109
- if (tile.config?.columns) {
111
+ if (tileData.config?.columns) {
110
112
  filesToWrite.push(componentColumnsFile);
111
113
  }
112
- if (tile.config?.gridOptions) {
114
+ if (tileData.config?.gridOptions) {
113
115
  filesToWrite.push(componentGridOptionsFile);
114
116
  }
115
- if (tile.config?.createFormUiSchema) {
117
+ if (tileData.config?.createFormUiSchema) {
116
118
  filesToWrite.push(componentAddFormFile);
117
119
  }
118
- if (tile.config?.updateFormUiSchema) {
120
+ if (tileData.config?.updateFormUiSchema) {
119
121
  filesToWrite.push(componentUpdateFormFile);
120
122
  }
121
123
  break;
122
124
  case 'grid-pro':
123
- if (tile.config?.gridOptions) {
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 tileName = changeCase.paramCase(tile.title);
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
- tile,
156
- tileName,
157
+ tileData,
157
158
  routeName,
158
159
  getPathByFramework[framework],
159
160
  sourceTemplateDir,
@@ -0,0 +1,8 @@
1
+ const isString = (input) => {
2
+ return (
3
+ typeof input === 'string' &&
4
+ Object.prototype.toString.call(input) === '[object String]'
5
+ );
6
+ };
7
+
8
+ module.exports = isString;
@@ -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
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "UI": "14.197.0",
3
- "GSF": "8.1.3",
4
- "Auth": "8.1.0"
2
+ "UI": "14.198.0",
3
+ "GSF": "8.1.4",
4
+ "Auth": "8.1.1"
5
5
  }
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 `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
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 `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
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 `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
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 `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
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": {
@@ -1,6 +1,6 @@
1
1
  declare global {
2
2
  const API_HOST: string;
3
- const GENX_ENABLE_SSO: boolean;
3
+ const ENABLE_SSO: boolean;
4
4
  }
5
5
 
6
6
  export {};
@@ -0,0 +1,9 @@
1
+ module.exports = function(config) {
2
+ config.set({
3
+ browsers: ['Chrome'],
4
+ browserDisconnectTimeout: 60000,
5
+ browserDisconnectTolerance: 3,
6
+ browserNoActivityTimeout: 60000,
7
+ captureTimeout: 120000,
8
+ });
9
+ };
@@ -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
- "ng": "ng",
13
+ "baseline": "npm run clean && npm run bootstrap",
9
14
  "bootstrap": "npm install --no-fund --no-audit",
10
- "dev": "ng serve --configuration=development --open",
15
+ "bootstrap:ci": "npm ci --no-fund --no-audit",
11
16
  "build": "ng build --configuration=production",
12
- "watch": "ng build --watch --configuration development",
13
- "test": "ng test"
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 GENX_ENABLE_SSO: boolean;
9
+ declare var ENABLE_SSO: boolean;
10
10
 
11
11
  const ssoSettings =
12
- typeof GENX_ENABLE_SSO !== 'undefined' && GENX_ENABLE_SSO === true
12
+ typeof ENABLE_SSO !== 'undefined' && ENABLE_SSO === true
13
13
  ? {
14
14
  autoAuth: true,
15
15
  sso: {
@@ -1,5 +1,7 @@
1
1
  export const environment = {
2
2
  production: true,
3
- PORT: 6060,
4
- GENX_ENABLE_SSO: {{enableSSO}}
3
+ PORT: 4200,
4
+ ENABLE_SSO: {{enableSSO}},
5
+ HOST: 'localhost',
6
+ PROTOCOL: 'http',
5
7
  };
@@ -1,6 +1,8 @@
1
1
  export const environment = {
2
2
  production: false,
3
3
  API_HOST: '{{apiHost}}',
4
- PORT: 6060,
5
- GENX_ENABLE_SSO: {{enableSSO}}
6
- };
4
+ PORT: 4200,
5
+ ENABLE_SSO: {{enableSSO}},
6
+ HOST: 'localhost',
7
+ PROTOCOL: 'http',
8
+ };
@@ -16,6 +16,7 @@ body {
16
16
  height: 100%;
17
17
  padding: 0;
18
18
  margin: 0;
19
+ overflow: hidden;
19
20
 
20
21
  --nav-height: 60px;
21
22
  }
@@ -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,6 @@
1
+ import { expect } from '@genesislcap/foundation-testing/e2e';
2
+ import { test } from '../fixture';
3
+
4
+ test('expected page title', async ({ page }: { page: any }) => {
5
+ await expect(page).toHaveTitle(/{{capitalCase appName}}/);
6
+ });
@@ -0,0 +1,2 @@
1
+ export * from './fixture';
2
+ export * from './pages';
@@ -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
+ }
@@ -3,7 +3,7 @@
3
3
  "extends": "./tsconfig.json",
4
4
  "compilerOptions": {
5
5
  "outDir": "./out-tsc/app",
6
- "types": []
6
+ "types": ["node"],
7
7
  },
8
8
  "files": [
9
9
  "src/main.ts"
@@ -23,7 +23,7 @@
23
23
  "ES2022",
24
24
  "dom"
25
25
  ],
26
- "resolveJsonModule": true
26
+ "resolveJsonModule": true,
27
27
  },
28
28
  "angularCompilerOptions": {
29
29
  "enableI18nLegacyMessageIdFormat": false,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/blank-app-seed",
3
3
  "description": "Genesis Blank App Seed",
4
- "version": "3.26.0",
4
+ "version": "3.27.1",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
7
  "release": "semantic-release"
@@ -8,8 +8,8 @@ subprojects {
8
8
  apply(plugin = "org.gradle.maven-publish")
9
9
 
10
10
  dependencies {
11
- implementation("com.h2database:h2:2.2.224")
12
- testImplementation("org.jetbrains.kotlin:kotlin-test-junit5:1.9.0")
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> {