@genesislcap/blank-app-seed 3.29.2 → 3.30.0-prerelease.10

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 (73) hide show
  1. package/.genx/package.json +1 -1
  2. package/.genx/scripts/update-versions.js +45 -15
  3. package/.genx/templates/angular/entityManager.hbs +3 -0
  4. package/.genx/templates/angular/route.hbs +0 -1
  5. package/.genx/templates/react/chart.hbs +9 -1
  6. package/.genx/templates/react/component/component.column.defs.hbs +4 -2
  7. package/.genx/templates/react/component/component.create.form.hbs +2 -2
  8. package/.genx/templates/react/component/component.gridOptions.hbs +5 -3
  9. package/.genx/templates/react/component/component.hbs +65 -20
  10. package/.genx/templates/react/component/component.index.hbs +1 -1
  11. package/.genx/templates/react/component/component.update.form.hbs +1 -1
  12. package/.genx/templates/react/entityManager.hbs +63 -43
  13. package/.genx/templates/react/form.hbs +9 -1
  14. package/.genx/templates/react/grid.hbs +23 -7
  15. package/.genx/templates/react/gridLayout.hbs +28 -28
  16. package/.genx/templates/react/horizontalLayout.hbs +5 -5
  17. package/.genx/templates/react/route.hbs +4 -19
  18. package/.genx/templates/react/tabsLayout.hbs +5 -5
  19. package/.genx/templates/web-components/entityManager.hbs +3 -0
  20. package/.genx/utils/formatRouteData.js +1 -1
  21. package/.genx/utils/generateRoute.js +8 -7
  22. package/.genx/utils/generateTile.js +31 -15
  23. package/.genx/versions.json +3 -3
  24. package/.github/pull_request_template.md +1 -1
  25. package/.github/workflows/build.yml +3 -2
  26. package/.github/workflows/slack.yml +1 -1
  27. package/.github/workflows/upgrade.yml +6 -1
  28. package/.github/workflows/upgrade_prerelease.yml +1 -0
  29. package/.idea/modules.xml +6 -6
  30. package/CHANGELOG.md +165 -4
  31. package/client-tmp/react/.babelrc +10 -0
  32. package/client-tmp/react/.eslintrc.cjs +4 -1
  33. package/client-tmp/react/env.development.json +3 -0
  34. package/client-tmp/react/index.html +1 -1
  35. package/client-tmp/react/jest.config.ts +15 -0
  36. package/client-tmp/react/jest.setup.ts +1 -0
  37. package/client-tmp/react/lint-css.ts +19 -0
  38. package/client-tmp/react/package.json +42 -6
  39. package/client-tmp/react/playwright.config.ts +17 -0
  40. package/client-tmp/react/src/App.tsx +34 -7
  41. package/client-tmp/react/src/components/ErrorMessage/ErrorMessage.test.tsx +95 -0
  42. package/client-tmp/react/src/components/ErrorMessage/ErrorMessage.tsx +67 -0
  43. package/client-tmp/react/src/config.ts +2 -1
  44. package/client-tmp/react/src/custom-elements.d.ts +19 -9
  45. package/client-tmp/react/src/guards/AuthGuard.tsx +1 -1
  46. package/client-tmp/react/src/guards/PermissionsGuard.tsx +37 -0
  47. package/client-tmp/react/src/index.ts +21 -0
  48. package/client-tmp/react/src/pages/AuthPage/AuthPage.test.tsx +10 -0
  49. package/client-tmp/react/src/pages/{auth/AuthPage.jsx → AuthPage/AuthPage.tsx} +3 -2
  50. package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.css +0 -0
  51. package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.test.tsx +17 -0
  52. package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.tsx +14 -0
  53. package/client-tmp/react/src/{reportWebVitals.js → reportWebVitals.ts} +1 -1
  54. package/client-tmp/react/src/share/foundation-login.ts +1 -1
  55. package/client-tmp/react/src/svg-elements.d.ts +1 -1
  56. package/client-tmp/react/src/utils/fdc3.ts +32 -0
  57. package/client-tmp/react/src/utils/history.ts +1 -3
  58. package/client-tmp/react/src/utils/index.ts +4 -0
  59. package/client-tmp/react/src/utils/permissions.ts +7 -0
  60. package/client-tmp/react/src/utils/setApiHost.ts +9 -0
  61. package/client-tmp/react/test/e2e/fixture.ts +26 -0
  62. package/client-tmp/react/test/e2e/flows/001-protected.e2e.ts +6 -0
  63. package/client-tmp/react/test/e2e/index.ts +2 -0
  64. package/client-tmp/react/test/e2e/pages/index.ts +1 -0
  65. package/client-tmp/react/test/e2e/pages/protected.ts +16 -0
  66. package/client-tmp/react/tsconfig.app.json +2 -5
  67. package/client-tmp/react/tsconfig.json +4 -1
  68. package/client-tmp/react/vite.config.ts +57 -12
  69. package/package.json +1 -1
  70. package/server/settings.gradle.kts +2 -2
  71. package/client-tmp/react/src/index.js +0 -17
  72. /package/client-tmp/react/src/pages/{auth → AuthPage}/AuthPage.css +0 -0
  73. /package/client-tmp/react/src/{setupTests.js → setupTests.ts} +0 -0
@@ -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.29.2",
4
+ "version": "3.30.0-prerelease.10",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
7
  "lint": "eslint .",
@@ -4,23 +4,30 @@ const { resolve } = require('node:path');
4
4
  const current = require('../versions.json');
5
5
 
6
6
  const args = process.argv.slice(2);
7
- const patchOnly = args.indexOf("--patch-only") >= 0;
8
- const dryRun = args.indexOf("--dry-run") >= 0;
9
7
 
10
- const VERSION_REGEX = /\d+$/;
8
+ const argDefined = (name) => args.indexOf(name) >= 0;
9
+
10
+ const patchOnly = argDefined("--patch-only");
11
+ const dryRun = argDefined("--dry-run");
12
+ const skipServer = argDefined("--skip-server");
11
13
 
12
- const jfrogVersionMatcher = patchOnly ? current.GSF.replace(VERSION_REGEX, '*') : undefined;
14
+ const VERSION_REGEX = /\d+$/;
15
+ const JFROG_BASE_EXCLUSIONS = '*-SNAPSHOT*;*maven-metadata*;*test*;*TEST*';
13
16
 
14
- const npmVersionMatcher = patchOnly ? current.UI.replace(VERSION_REGEX, 'x') : 'latest';
17
+ const { jfrogVersionMatcher, jfrogExclusionsMatcher, npmVersionMatcher } = patchOnly
18
+ ? { jfrogVersionMatcher: current.GSF.replace(VERSION_REGEX, '*'), jfrogExclusionsMatcher: `*-beta*;*-RC*;${JFROG_BASE_EXCLUSIONS}`, npmVersionMatcher: current.UI.replace(VERSION_REGEX, 'x') }
19
+ : { jfrogVersionMatcher: undefined, jfrogExclusionsMatcher: JFROG_BASE_EXCLUSIONS, npmVersionMatcher: 'latest' };
15
20
 
16
- console.log('Running with: ', {patchOnly, dryRun, npmVersionMatcher, jfrogVersionMatcher})
21
+ console.log('Running with: ', { patchOnly, skipServer, dryRun, npmVersionMatcher, jfrogVersionMatcher, jfrogExclusionsMatcher });
17
22
 
18
- const run = (command) =>
19
- execSync(command, {
23
+ const run = (command) => {
24
+ console.debug('running:', command);
25
+ return execSync(command, {
20
26
  stdio: ['pipe', 'pipe', 'ignore'],
21
27
  })
22
28
  .toString('utf8')
23
29
  .trim();
30
+ };
24
31
 
25
32
  const writeJSON = (json, path) => {
26
33
  const data = JSON.stringify(json, null, 2) + '\n';
@@ -32,15 +39,38 @@ const writeJSON = (json, path) => {
32
39
  }
33
40
  };
34
41
 
35
- const UI = run(`npm info @genesislcap/foundation-ui@${npmVersionMatcher} version`);
42
+ /**
43
+ * NPM Info returns a string if there's only one version in the channel;, otherwise it returns a valid json array,
44
+ * where the most recent version will be the last value;
45
+ * @param {*} output
46
+ * @returns
47
+ */
48
+ const parseNpmInfo = (output) => {
49
+ try {
50
+ const versions = JSON.parse(output);
51
+ return Array.isArray(versions) ? versions[versions.length-1] : versions;
52
+ } catch (err) {
53
+ return output;
54
+ }
55
+ }
56
+
57
+ const npmInfo = run(`npm info @genesislcap/foundation-ui@${npmVersionMatcher} version --json`);
58
+ console.debug('Npm raw output:', npmInfo);
59
+ const UI = parseNpmInfo(npmInfo);
60
+
61
+ const serverOsCommandPipeline = `grep path | tr -s ' ' | sed 's/"path": //g' | awk -F'/' '{print $(NF-1)}' | sort -V | tail -n 1`;
36
62
 
37
- const GSF = run(
38
- `jf rt s "libs-release-client/global/genesis/genesis-distribution/${jfrogVersionMatcher ?? ''}" --exclusions="*-RC*;*-SNAPSHOT*;*maven-metadata*;*test*;*TEST*" | grep path | tr -s ' ' | sed 's/"path": //g' | awk -F'/' '{print $(NF-1)}' | sort -V | tail -n 1`,
39
- );
63
+ const { GSF, Auth } = skipServer
64
+ ? { GSF: current.GSF, Auth: current.Auth }
65
+ : {
66
+ GSF: run(
67
+ `jf rt s "libs-release-client/global/genesis/genesis-distribution/${jfrogVersionMatcher ?? ''}" --exclusions="${jfrogExclusionsMatcher}" | ${serverOsCommandPipeline}`
68
+ ),
69
+ Auth: run(
70
+ `jf rt s "libs-release-client/global/genesis/auth-distribution/${jfrogVersionMatcher ?? ''}" --exclusions="${jfrogExclusionsMatcher}" | ${serverOsCommandPipeline}`,
71
+ )
72
+ };
40
73
 
41
- const Auth = run(
42
- `jf rt s "libs-release-client/global/genesis/auth-distribution/${jfrogVersionMatcher ?? ''}" --exclusions="*-RC*;*-SNAPSHOT*;*maven-metadata*;*test*;*TEST*" | grep path | tr -s ' ' | sed 's/"path": //g' | awk -F'/' '{print $(NF-1)}' | sort -V | tail -n 1`,
43
- );
44
74
  const latest = { UI, GSF, Auth };
45
75
 
46
76
  console.log('Current:', current);
@@ -33,6 +33,9 @@
33
33
  {{#if config.reqrep}}
34
34
  [datasourceConfig]="reqrep"
35
35
  {{/if}}
36
+ {{#if config.entityName}}
37
+ entityLabel="{{ config.entityName }}"
38
+ {{/if}}
36
39
  {{#if config.columns}}
37
40
  [columns]="columnDefs"
38
41
  {{/if}}
@@ -5,7 +5,6 @@ import { {{pascalCase this.componentName}} } from './{{kebabCase this.title}}-{{
5
5
  {{/each}}
6
6
  import { environment } from '../../../environments/environment';
7
7
 
8
-
9
8
  @Component({
10
9
  selector: 'app-{{kebabCase route.name}}',
11
10
  standalone: true,
@@ -1,9 +1,17 @@
1
+ {{#if config.permissions.viewRight~}}
2
+ hasUserPermission('{{config.permissions.viewRight}}') ? (
3
+ {{/if}}
1
4
  <rapid-g2plot-chart
2
5
  type="{{ config.type }}"
3
- config={tile{{ config.index }}.chartConfig}
6
+ config={chartConfig}
4
7
  >
5
8
  <chart-datasource
6
9
  resourceName="{{ config.resourceName }}"
7
10
  server-fields="{{ config.xField }} {{ config.yField }}"
8
11
  ></chart-datasource>
9
12
  </rapid-g2plot-chart>
13
+ {{#if config.permissions.viewRight~}}
14
+ ) : (
15
+ <ErrorMessage elementType="h3" message="You do not have access to view this component." />
16
+ )
17
+ {{/if}}
@@ -1,9 +1,11 @@
1
+ {{#if tile.config.columns~}}
1
2
  import { ColDef } from '@ag-grid-community/core';
3
+ {{/if}}
2
4
  import { getNumberFormatter, getDateFormatter } from '@genesislcap/foundation-utils';
3
- {{#if route.FDC3EventHandlersEnabled}}
5
+ {{#if route.FDC3EventHandlersEnabled~}}
4
6
  import { sendEventOnChannel } from '../../../utils';
5
7
  {{/if}}
6
8
 
7
- {{#if tile.config.columns}}
9
+ {{#if tile.config.columns~}}
8
10
  export const columnDefs: ColDef[] = {{{ tile.config.columns }}}
9
11
  {{/if}}
@@ -1,8 +1,8 @@
1
1
  import { UiSchema } from '@genesislcap/foundation-forms';
2
2
 
3
- {{#if tile.config.createFormUiSchema}}
3
+ {{#if tile.config.createFormUiSchema~}}
4
4
  export const createFormSchema: UiSchema = {{{ tile.config.createFormUiSchema }}}
5
5
  {{/if}}
6
- {{#if tile.config.uischema}}
6
+ {{#if tile.config.uischema~}}
7
7
  export const createFormSchema: UiSchema = {{{ tile.config.uischema }}}
8
8
  {{/if}}
@@ -1,9 +1,11 @@
1
+ {{#if tile.config.gridOptions~}}
1
2
  import { GridOptionsConfig } from '@genesislcap/rapid-grid-pro';
3
+ {{/if}}
2
4
  import { getNumberFormatter, getDateFormatter } from '@genesislcap/foundation-utils';
3
- {{#if route.FDC3EventHandlersEnabled}}
5
+ {{#if route.FDC3EventHandlersEnabled~}}
4
6
  import { sendEventOnChannel } from '../../../utils';
5
7
  {{/if}}
6
8
 
7
- {{#if tile.config.gridOptions}}
9
+ {{#if tile.config.gridOptions~}}
8
10
  export const gridOptions: GridOptionsConfig = {{{ tile.config.gridOptions }}}
9
- {{/if}}
11
+ {{/if}}
@@ -1,32 +1,77 @@
1
- import { Component, Input, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
1
+ {{#if tile.config.permissions.viewRight~}}
3
2
  import { getUser } from '@genesislcap/foundation-user';
4
- import { ErrorMessageComponent } from '../../../components/error-message/error-message.component';
5
3
  import { getViewUpdateRightComponent } from '../../../utils';
6
- {{#if tile.config.gridOptions}}
7
- import { GridOptionsConfig } from "@genesislcap/rapid-grid-pro";
4
+ import ErrorMessage from '../../../components/ErrorMessage/ErrorMessage';
5
+ {{else if tile.config.permissions.updateRight~}}
6
+ import { getUser } from '@genesislcap/foundation-user';
7
+ import { getViewUpdateRightComponent } from '../../../utils';
8
+ import ErrorMessage from '../../../components/ErrorMessage/ErrorMessage';
8
9
  {{/if}}
9
- {{#if tile.config.createFormUiSchema}}
10
- import { createFormSchema } from './{{kebabCase tile.title}}.create.form.schema';
10
+ {{#if tile.config.createFormUiSchema~}}
11
+ import { createFormSchema as createFormSchemaTile } from './{{pascalCase tile.title}}CreateFormSchema';
11
12
  {{/if}}
12
- {{#if tile.config.uischema}}
13
- import { createFormSchema } from './{{kebabCase tile.title}}.create.form.schema';
13
+ {{#if tile.config.uischema~}}
14
+ import { createFormSchema as createFormSchemaTile } from './{{pascalCase tile.title}}CreateFormSchema';
14
15
  {{/if}}
15
- {{#if tile.config.updateFormUiSchema}}
16
- import { updateFormSchema } from './{{kebabCase tile.title}}.update.form.schema';
16
+ {{#if tile.config.updateFormUiSchema~}}
17
+ import { updateFormSchema as updateFormSchemaTile } from './{{pascalCase tile.title}}UpdateFormSchema';
17
18
  {{/if}}
18
- {{#if tile.config.columns}}
19
- import { columnDefs } from './{{kebabCase tile.title}}.column.defs';
19
+ {{#if tile.config.columns~}}
20
+ import { columnDefs as columnDefsTile } from './{{pascalCase tile.title}}ColumnDefs';
20
21
  {{/if}}
21
- {{#if tile.config.gridOptions}}
22
- import { gridOptions } from './{{kebabCase tile.title}}.gridOptions';
22
+ {{#if tile.config.gridOptions~}}
23
+ import { GridOptionsConfig } from '@genesislcap/rapid-grid-pro';
24
+ import { gridOptions as gridOptionsTile } from './{{pascalCase tile.title}}GridOptions';
23
25
  {{/if}}
24
- import './{{kebabCase tile.title}}.component.css';
26
+ import './{{pascalCase tile.title}}Component.css';
27
+
28
+ export const {{pascalCase tile.componentName}}: React.FC = () => {
29
+ {{#if tile.config.permissions.viewRight~}}
30
+ const hasUserPermission = (permissionCode: string): boolean => getViewUpdateRightComponent(getUser(), permissionCode);
31
+ {{else if tile.config.permissions.updateRight~}}
32
+ const hasUserPermission = (permissionCode: string): boolean => getViewUpdateRightComponent(getUser(), permissionCode);
33
+ {{/if}}
34
+ {{#if tile.config.createFormUiSchema~}}
35
+ const createFormSchema: typeof createFormSchemaTile = createFormSchemaTile;
36
+ {{/if}}
37
+ {{#if tile.config.uischema~}}
38
+ const uischema: typeof createFormSchemaTile = createFormSchemaTile;
39
+ {{/if}}
40
+ {{#if tile.config.updateFormUiSchema~}}
41
+ const updateFormSchema: typeof updateFormSchemaTile = updateFormSchemaTile;
42
+ {{/if}}
43
+ {{#if tile.config.columns~}}
44
+ const columnDefs: typeof columnDefsTile = columnDefsTile;
45
+ {{/if}}
46
+ {{#if tile.config.gridOptions~}}
47
+ const deferredGridOptions: { onRowClicked: GridOptionsConfig.onRowClicked } = { onRowClicked: gridOptionsTile?.onRowClicked }
48
+ {{/if}}
49
+ {{#if tile.config.reqrep~}}
50
+ const reqrep: { pollingInterval: number } = { pollingInterval: 5000 };
51
+ {{/if}}
52
+ {{#if tile.config.type~}}
53
+ const chartConfig: {
54
+ {{#ifEquals tile.config.type 'pie'~}}
55
+ radius: number;
56
+ angleField: string;
57
+ colorField: string;
58
+ {{else~}}
59
+ xField: string;
60
+ yField: string;
61
+ {{/ifEquals}}
62
+ } = {
63
+ {{#ifEquals tile.config.type 'pie'~}}
64
+ radius: 0.75,
65
+ angleField: 'value',
66
+ colorField: 'groupBy',
67
+ {{else~}}
68
+ xField: 'groupBy',
69
+ yField: 'value',
70
+ {{/ifEquals}}
71
+ };
72
+ {{/if}}
25
73
 
26
- const {{pascalCase tile.componentName}} = () => {
27
74
  return (
28
75
  {{> (lookup tile 'type') tile}}
29
76
  );
30
- };
31
-
32
- export default {{pascalCase tile.componentName}};
77
+ };
@@ -1 +1 @@
1
- export * from './{{kebabCase tile.title}}.component';
1
+ export * from './{{pascalCase tile.title}}Component.tsx';
@@ -1,5 +1,5 @@
1
1
  import { UiSchema } from '@genesislcap/foundation-forms';
2
2
 
3
- {{#if tile.config.updateFormUiSchema}}
3
+ {{#if tile.config.updateFormUiSchema~}}
4
4
  export const updateFormSchema: UiSchema = {{{ tile.config.updateFormUiSchema }}}
5
5
  {{/if}}
@@ -1,45 +1,65 @@
1
+ {{#if config.permissions.viewRight~}}
2
+ hasUserPermission('{{config.permissions.viewRight}}') ? (
3
+ {{/if}}
1
4
  <entity-management
2
- design-system-prefix="rapid"
3
- enable-row-flashing
4
- enable-cell-flashing
5
- {{#if config.title}}
6
- title="{{ config.title }}"
7
- {{/if}}
8
- resourceName="{{ config.resourceName }}"
9
- {{#if config.createEvent}}
10
- createEvent="{{ config.createEvent }}"
11
- {{#if config.createFormUiSchema}}
12
- createFormUiSchema={tile{{ config.index }}.createFormUiSchema}
13
- {{/if}}
14
- {{/if}}
15
- {{#if config.updateEvent}}
16
- updateEvent="{{ config.updateEvent }}"
17
- {{#if config.updateFormUiSchema}}
18
- updateFormUiSchema={tile{{ config.index }}.updateFormUiSchema}
19
- {{/if}}
20
- {{/if}}
21
- {{#if config.deleteEvent}}
22
- deleteEvent="{{ config.deleteEvent }}"
23
- {{/if}}
24
- {{#if config.gridOptions}}
25
- gridOptions={{{ config.gridOptions }}}
26
- {{/if}}
27
- {{#if config.snapshot}}
28
- datasourceConfig={ isSnapshot: {{ config.snapshot }} }
29
- {{/if}}
30
- {{#if config.reqrep}}
31
- datasourceConfig={tile{{ config.index }}.reqrep}
32
- {{/if}}
33
- {{#if config.columns}}
34
- columns={tile{{ config.index }}.columns}
35
- {{/if}}
36
- {{#if config.modalPosition}}
37
- modal-position="{{ config.modalPosition }}"
38
- {{/if}}
39
- {{#if config.sizeColumnsToFit}}
40
- size-columns-to-fit
41
- {{/if}}
42
- {{#if config.enableSearchBar}}
43
- enable-search-bar
44
- {{/if}}
5
+ design-system-prefix="rapid"
6
+ enable-row-flashing
7
+ enable-cell-flashing
8
+ {{#if config.title~}}
9
+ title="{{ config.title }}"
10
+ {{/if}}
11
+ resourceName="{{ config.resourceName }}"
12
+ {{#if config.createEvent~}}
13
+ {{#if config.permissions.updateRight~}}
14
+ createEvent={hasUserPermission('{{config.permissions.updateRight}}') ? '{{ config.createEvent }}' : undefined}
15
+ {{else~}}
16
+ createEvent="{{ config.updateEvent }}"
17
+ {{/if}}
18
+ {{#if config.createFormUiSchema~}}
19
+ createFormUiSchema={createFormSchema}
20
+ {{/if}}
21
+ {{/if}}
22
+ {{#if config.updateEvent~}}
23
+ {{#if config.permissions.updateRight~}}
24
+ updateEvent={hasUserPermission('{{config.permissions.updateRight}}') ? '{{ config.updateEvent }}' : undefined}
25
+ {{else~}}
26
+ updateEvent="{{ config.updateEvent }}"
27
+ {{/if}}
28
+ {{#if config.updateFormUiSchema~}}
29
+ updateFormUiSchema={updateFormSchema}
30
+ {{/if}}
31
+ {{/if}}
32
+ {{#if config.deleteEvent~}}
33
+ {{#if config.permissions.updateRight~}}
34
+ deleteEvent={hasUserPermission('{{config.permissions.updateRight}}') ? '{{ config.deleteEvent }}' : undefined}
35
+ {{else~}}
36
+ deleteEvent="{{ config.deleteEvent }}"
37
+ {{/if}}
38
+ {{/if}}
39
+ {{#if config.gridOptions~}}
40
+ gridOptions={gridOptions}
41
+ {{/if}}
42
+ {{#if config.snapshot~}}
43
+ datasourceConfig={ isSnapshot: {{ config.snapshot }} }
44
+ {{/if}}
45
+ {{#if config.reqrep~}}
46
+ datasourceConfig={reqrep}
47
+ {{/if}}
48
+ {{#if config.columns~}}
49
+ columns={columnDefs}
50
+ {{/if}}
51
+ {{#if config.modalPosition~}}
52
+ modal-position="{{ config.modalPosition }}"
53
+ {{/if}}
54
+ {{#if config.sizeColumnsToFit~}}
55
+ size-columns-to-fit
56
+ {{/if}}
57
+ {{#if config.enableSearchBar~}}
58
+ enable-search-bar
59
+ {{/if}}
45
60
  ></entity-management>
61
+ {{#if config.permissions.viewRight~}}
62
+ ) : (
63
+ <ErrorMessage elementType="h3" message="You do not have access to view this component." />
64
+ )
65
+ {{/if}}
@@ -1,8 +1,16 @@
1
+ {{#if config.permissions.updateRight~}}
2
+ hasUserPermission('{{config.permissions.updateRight}}') ? (
3
+ {{/if}}
1
4
  <foundation-form
2
5
  design-system-prefix="rapid"
3
6
  resourceName="{{config.resourceName}}"
4
7
  {{#if config.uischema}}
5
- uischema={tile{{ config.index }}.uischema}
8
+ uischema={uischema}
6
9
  {{/if}}
7
10
  >
8
11
  </foundation-form>
12
+ {{#if config.permissions.updateRight~}}
13
+ ) : (
14
+ <ErrorMessage elementType="h3" message="You do not have access to view this component." />
15
+ )
16
+ {{/if}}
@@ -1,18 +1,34 @@
1
+ {{#if config.permissions.viewRight~}}
2
+ hasUserPermission('{{config.permissions.viewRight}}') ? (
3
+ {{/if}}
1
4
  <rapid-grid-pro
5
+ header-case-type="capitalCase"
6
+ {{#if config.useOnlyTemplateCols~}}
7
+ only-template-col-defs
8
+ {{/if}}
2
9
  enable-row-flashing
3
10
  enable-cell-flashing
4
11
  >
5
12
  <grid-pro-genesis-datasource
6
13
  resource-name="{{config.resourceName}}"
7
- {{#if config.snapshot}}
14
+ {{#if config.snapshot~}}
8
15
  isSnapshot="{{config.snapshot}}"
9
16
  {{/if}}
10
- {{#if config.reqrep}}
11
- datasourceConfig={tile{{ config.index }}.reqrep}
17
+ {{#if config.reqrep~}}
18
+ datasourceConfig="reqrep"
12
19
  {{/if}}
13
- {{#if config.gridOptions}}
14
- deferredGridOptions={tile{{ config.index }}.gridOptions}
20
+ {{#if config.gridOptions~}}
21
+ deferredGridOptions={deferredGridOptions}
15
22
  {{/if}}
16
- >
17
- </grid-pro-genesis-datasource>
23
+ ></grid-pro-genesis-datasource>
24
+ {{#if config.gridOptions}}
25
+ {gridOptionsTile?.columnDefs?.map((columnDef, index) => (
26
+ <grid-pro-column key={index} definition={columnDef}></grid-pro-column>
27
+ ))}
28
+ {{/if}}
18
29
  </rapid-grid-pro>
30
+ {{#if config.permissions.viewRight~}}
31
+ ) : (
32
+ <ErrorMessage elementType="h3" message="You do not have access to view this component." />
33
+ )
34
+ {{/if}}
@@ -1,30 +1,30 @@
1
1
  <rapid-layout-region type="horizontal">
2
- <rapid-layout-region type="vertical">
3
- {{#each route.tiles}}
4
- {{#ifEquals @index 0}}
5
- <rapid-layout-item title="{{../title}}">
6
- {{> (lookup ../this 'type') ../this}}
7
- </rapid-layout-item>
8
- {{/ifEquals}}
9
- {{#ifEquals @index 1}}
10
- <rapid-layout-item title="{{../title}}">
11
- {{> (lookup ../this 'type') ../this}}
12
- </rapid-layout-item>
13
- {{/ifEquals}}
14
- {{/each}}
15
- </rapid-layout-region>
16
- <rapid-layout-region type="vertical">
17
- {{#each route.tiles}}
18
- {{#ifEquals @index 2}}
19
- <rapid-layout-item title="{{../title}}">
20
- {{> (lookup ../this 'type') ../this}}
21
- </rapid-layout-item>
22
- {{/ifEquals}}
23
- {{#ifEquals @index 3}}
24
- <rapid-layout-item title="{{../title}}">
25
- {{> (lookup ../this 'type') ../this}}
26
- </rapid-layout-item>
27
- {{/ifEquals}}
28
- {{/each}}
29
- </rapid-layout-region>
2
+ <rapid-layout-region type="vertical">
3
+ {{#each route.tiles}}
4
+ {{#ifEquals @index 0}}
5
+ <rapid-layout-item title="{{../title}}">
6
+ <{{pascalCase ../componentName}}></{{pascalCase ../componentName}}>
7
+ </rapid-layout-item>
8
+ {{/ifEquals}}
9
+ {{#ifEquals @index 1}}
10
+ <rapid-layout-item title="{{../title}}">
11
+ <{{pascalCase ../componentName}}></{{pascalCase ../componentName}}>
12
+ </rapid-layout-item>
13
+ {{/ifEquals}}
14
+ {{/each}}
15
+ </rapid-layout-region>
16
+ <rapid-layout-region type="vertical">
17
+ {{#each route.tiles}}
18
+ {{#ifEquals @index 2}}
19
+ <rapid-layout-item title="{{../title}}">
20
+ <{{pascalCase ../componentName}}></{{pascalCase ../componentName}}>
21
+ </rapid-layout-item>
22
+ {{/ifEquals}}
23
+ {{#ifEquals @index 3}}
24
+ <rapid-layout-item title="{{../title}}">
25
+ <{{pascalCase ../componentName}}></{{pascalCase ../componentName}}>
26
+ </rapid-layout-item>
27
+ {{/ifEquals}}
28
+ {{/each}}
29
+ </rapid-layout-region>
30
30
  </rapid-layout-region>
@@ -1,7 +1,7 @@
1
1
  <rapid-layout-region>
2
- {{#each route.tiles}}
3
- <rapid-layout-item title="{{this.title}}">
4
- {{> (lookup . 'type') }}
5
- </rapid-layout-item>
6
- {{/each}}
2
+ {{#each route.tiles}}
3
+ <rapid-layout-item title="{{this.title}}">
4
+ <{{pascalCase this.componentName}}></{{pascalCase this.componentName}}>
5
+ </rapid-layout-item>
6
+ {{/each}}
7
7
  </rapid-layout-region>
@@ -1,28 +1,13 @@
1
1
  import './{{pascalCase route.name}}.css';
2
+ {{#each route.tiles}}
3
+ import { {{pascalCase this.componentName}} } from './{{pascalCase this.title}}{{pascalCase this.componentType}}';
4
+ {{/each}}
2
5
 
3
6
  const {{pascalCase route.name}} = () => {
4
- {{#each route.tiles}}
5
- const tile{{this.config.index}} = { {{#if this.config.createFormUiSchema}}
6
- "createFormUiSchema": {{{ this.config.createFormUiSchema }}},{{/if}}{{#if this.config.updateFormUiSchema}}
7
- "updateFormUiSchema": {{{ this.config.updateFormUiSchema }}},{{/if}}{{#if this.config.uischema}}
8
- "uischema": {{{ this.config.uischema }}},{{/if}}{{#if this.config.gridOptions}}
9
- "gridOptions": {{{ this.config.gridOptions }}},{{/if}}{{#if this.config.reqrep}}
10
- "reqrep": {{{ this.config.reqrep }}},{{/if}}{{#if this.config.columns}}
11
- "columns": {{{ this.config.columns }}},{{/if}}{{#if this.config.type}}
12
- "chartConfig": { {{#ifEquals this.config.type 'pie'}}
13
- "radius": 0.75,
14
- "angleField": "value",
15
- "colorField": "groupBy",{{else}}
16
- "xField": "groupBy",
17
- "yField": "value",{{/ifEquals}}
18
- },{{/if}}
19
- };
20
- {{/each}}
21
-
22
7
  return (
23
8
  <section className="{{kebabCase route.name}}-page">
24
9
  {{#if route.tiles}}
25
- <rapid-layout auto-save-key="{{route.layoutKey}}">
10
+ <rapid-layout auto-save-key={process.env.NODE_ENV === 'production' ? "{{route.layoutKey}}" : null}>
26
11
  {{> (lookup ./route 'layoutType') }}
27
12
  </rapid-layout>
28
13
  {{else}}
@@ -1,7 +1,7 @@
1
1
  <rapid-layout-region type="tabs">
2
- {{#each route.tiles}}
3
- <rapid-layout-item title="{{this.title}}">
4
- {{> (lookup . 'type') }}
5
- </rapid-layout-item>
6
- {{/each}}
2
+ {{#each route.tiles}}
3
+ <rapid-layout-item title="{{this.title}}">
4
+ {{> (lookup . 'type') }}
5
+ </rapid-layout-item>
6
+ {{/each}}
7
7
  </rapid-layout-region>
@@ -34,6 +34,9 @@ ${whenElse(
34
34
  {{#if config.reqrep}}
35
35
  :datasourceConfig=${() => ({pollingInterval: 5000 })}
36
36
  {{/if}}
37
+ {{#if config.entityName}}
38
+ entityLabel="{{ config.entityName }}"
39
+ {{/if}}
37
40
  {{#if config.columns}}
38
41
  :columns=${() => columnDefs }
39
42
  {{/if}}
@@ -37,7 +37,7 @@ const formatRouteData = (framework, route) => {
37
37
  ...config,
38
38
  index,
39
39
  gridOptions: gridOptionsSerializer(gridOptions),
40
- useOnlyTemplateCols: !!gridOptions?.columnDefs,
40
+ useOnlyTemplateCols: !!gridOptions?.columns,
41
41
  createFormUiSchema: formatJSONValue(createFormUiSchema),
42
42
  updateFormUiSchema: formatJSONValue(updateFormUiSchema),
43
43
  uischema: formatJSONValue(uischema),
@@ -14,7 +14,7 @@ const getPathByFramework = {
14
14
  route: (clientSrcPath, routeName) => `${clientSrcPath}/${routeName}`,
15
15
  component: (routeDir, routeName) => `${routeDir}/${routeName}.ts`,
16
16
  template: (routeDir, routeName) => `${routeDir}/${routeName}.template.ts`,
17
- style: (routePath, routeName) => `${routePath}/${routeName}.styles.ts`,
17
+ style: (routeDir, routeName) => `${routeDir}/${routeName}.styles.ts`,
18
18
  },
19
19
  [FRAMEWORK_ANGULAR_ALIAS]: {
20
20
  clientSrcPath: `../../client/src/app/pages`,
@@ -22,15 +22,16 @@ const getPathByFramework = {
22
22
  component: (routeDir, routeName) => `${routeDir}/${routeName}.component.ts`,
23
23
  template: (routeDir, routeName) =>
24
24
  `${routeDir}/${routeName}.component.html`,
25
- style: (routePath, routeName) => `${routePath}/${routeName}.component.css`,
25
+ style: (routeDir, routeName) => `${routeDir}/${routeName}.component.css`,
26
26
  },
27
27
  [FRAMEWORK_REACT_ALIAS]: {
28
28
  clientSrcPath: `../../client/src/pages`,
29
- route: (clientSrcPath, routeName) => `${clientSrcPath}/${routeName}`,
29
+ route: (clientSrcPath, routeName, changeCase) =>
30
+ `${clientSrcPath}/${changeCase.pascalCase(routeName)}`,
30
31
  component: (routeDir, routeName, changeCase) =>
31
- `${routeDir}/${changeCase.pascalCase(routeName)}.jsx`,
32
- style: (routePath, routeName, changeCase) =>
33
- `${routePath}/${changeCase.pascalCase(routeName)}.css`,
32
+ `${routeDir}/${changeCase.pascalCase(routeName)}.tsx`,
33
+ style: (routeDir, routeName, changeCase) =>
34
+ `${routeDir}/${changeCase.pascalCase(routeName)}.css`,
34
35
  },
35
36
  };
36
37
 
@@ -44,7 +45,7 @@ const generateRoute = (route, { changeCase, writeFileWithData }, framework) => {
44
45
  } = getPathByFramework[framework];
45
46
  const routeName = changeCase.paramCase(route.name);
46
47
  const sourceTemplateDir = `../${DIR_TEMPLATE_BY_FRAMEWORK[framework]}`;
47
- const routeDir = getRouteDir(clientSrcPath, routeName);
48
+ const routeDir = getRouteDir(clientSrcPath, routeName, changeCase);
48
49
 
49
50
  const filesToWrite = [
50
51
  {