@genesislcap/blank-app-seed 3.22.0 → 3.24.0

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 (60) hide show
  1. package/.genx/package.json +1 -1
  2. package/.genx/static.js +3 -2
  3. package/.genx/templates/angular/entityManager.hbs +1 -0
  4. package/.genx/templates/angular/grid.hbs +7 -3
  5. package/.genx/templates/angular/route.hbs +2 -1
  6. package/.genx/templates/react/chart.hbs +9 -0
  7. package/.genx/templates/react/entityManager.hbs +45 -0
  8. package/.genx/templates/react/form.hbs +8 -0
  9. package/.genx/templates/react/grid.hbs +18 -0
  10. package/.genx/templates/react/gridLayout.hbs +30 -0
  11. package/.genx/templates/react/horizontalLayout.hbs +7 -0
  12. package/.genx/templates/react/route.hbs +35 -0
  13. package/.genx/templates/react/route.styles.hbs +3 -0
  14. package/.genx/templates/react/tabsLayout.hbs +7 -0
  15. package/.genx/templates/web-components/component/component.template.hbs +1 -1
  16. package/.genx/templates/web-components/entityManager.hbs +1 -0
  17. package/.genx/templates/web-components/grid.hbs +12 -3
  18. package/.genx/utils/generateRoute.js +21 -9
  19. package/CHANGELOG.md +14 -0
  20. package/client-tmp/react/.eslintrc.cjs +18 -0
  21. package/client-tmp/react/README.md +48 -0
  22. package/client-tmp/react/git +0 -0
  23. package/client-tmp/react/index.html +13 -0
  24. package/client-tmp/react/package.json +54 -0
  25. package/client-tmp/react/src/App.tsx +66 -0
  26. package/client-tmp/react/src/assets/logo-icon--light.svg +3 -0
  27. package/client-tmp/react/src/config.ts +31 -0
  28. package/client-tmp/react/src/custom-elements.d.ts +11 -0
  29. package/client-tmp/react/src/guards/AuthGuard.tsx +32 -0
  30. package/client-tmp/react/src/index.js +17 -0
  31. package/client-tmp/react/src/layouts/LayoutWrapper.tsx +20 -0
  32. package/client-tmp/react/src/layouts/blank/BlankLayout.module.css +9 -0
  33. package/client-tmp/react/src/layouts/blank/BlankLayout.tsx +26 -0
  34. package/client-tmp/react/src/layouts/default/DefaultLayout.module.css +35 -0
  35. package/client-tmp/react/src/layouts/default/DefaultLayout.tsx +80 -0
  36. package/client-tmp/react/src/main.tsx +10 -0
  37. package/client-tmp/react/src/pages/auth/AuthPage.css +0 -0
  38. package/client-tmp/react/src/pages/auth/AuthPage.jsx +11 -0
  39. package/client-tmp/react/src/reportWebVitals.js +13 -0
  40. package/client-tmp/react/src/services/auth.service.ts +13 -0
  41. package/client-tmp/react/src/services/connect.service.ts +26 -0
  42. package/client-tmp/react/src/setupTests.js +5 -0
  43. package/client-tmp/react/src/share/foundation-login.ts +21 -0
  44. package/client-tmp/react/src/share/genesis-components.ts +32 -0
  45. package/client-tmp/react/src/store/AuthContext.tsx +56 -0
  46. package/client-tmp/react/src/styles/design-tokens.json +56 -0
  47. package/client-tmp/react/src/styles/styles.css +39 -0
  48. package/client-tmp/react/src/svg-elements.d.ts +4 -0
  49. package/client-tmp/react/src/types/RouteLayouts.ts +3 -0
  50. package/client-tmp/react/src/types/layers.ts +9 -0
  51. package/client-tmp/react/src/types/menu.ts +8 -0
  52. package/client-tmp/react/src/utils/history.ts +5 -0
  53. package/client-tmp/react/src/utils/navigation.ts +5 -0
  54. package/client-tmp/react/src/vite-env.d.ts +1 -0
  55. package/client-tmp/react/tsconfig.app.json +28 -0
  56. package/client-tmp/react/tsconfig.json +11 -0
  57. package/client-tmp/react/tsconfig.node.json +13 -0
  58. package/client-tmp/react/vite.config.ts +14 -0
  59. package/package.json +1 -1
  60. package/client-tmp/react/react-file.ts +0 -1
@@ -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.22.0",
4
+ "version": "3.24.0",
5
5
  "license": "Apache-2.0",
6
6
  "scripts": {
7
7
  "lint": "eslint .",
package/.genx/static.js CHANGED
@@ -52,14 +52,15 @@ const DIR_TEMPLATE_BY_FRAMEWORK = {
52
52
  DIR_TEMPLATE_WEB_COMPONENT_ALIAS,
53
53
  ),
54
54
  [FRAMEWORK_ANGULAR_ALIAS]: DIRS_MAP.get(DIR_TEMPLATE_ANGULAR_ALIAS),
55
+ [FRAMEWORK_REACT_ALIAS]: DIRS_MAP.get(FRAMEWORK_REACT_ALIAS),
55
56
  };
56
57
 
57
58
  const COMPONENT_TYPE = {
58
59
  'entity-manager': 'manager',
59
60
  'grid-pro': 'grid',
60
61
  'smart-form': 'form',
61
- 'chart': 'chart'
62
- }
62
+ chart: 'chart',
63
+ };
63
64
 
64
65
  const TEXTS = {
65
66
  INTRO_API_HOST:
@@ -2,6 +2,7 @@
2
2
  <ng-container *ngIf="hasUserPermission('{{config.permissions.viewRight}}'); else notPermitted{{ config.index }}">
3
3
  <entity-management
4
4
  design-system-prefix="rapid"
5
+ header-case-type="capitalCase"
5
6
  enable-row-flashing
6
7
  enable-cell-flashing
7
8
  {{#if config.title}}
@@ -1,6 +1,8 @@
1
1
  <section style="height: 100%; width: 100%;">
2
2
  <ng-container *ngIf="hasUserPermission('{{config.permissions.viewRight}}'); else notPermitted{{ config.index }}">
3
3
  <rapid-grid-pro
4
+ header-case-type="capitalCase"
5
+ only-template-col-defs
4
6
  enable-row-flashing
5
7
  enable-cell-flashing
6
8
  >
@@ -13,10 +15,12 @@
13
15
  [datasourceConfig]="tile{{ config.index }}.reqrep"
14
16
  {{/if}}
15
17
  {{#if config.gridOptions}}
16
- [deferredGridOptions]="tile{{ config.index }}.gridOptions"
18
+ [deferredGridOptions]="{ onRowClicked: tile{{ config.index }}.gridOptions.onRowClicked }"
17
19
  {{/if}}
18
- >
19
- </grid-pro-genesis-datasource>
20
+ ></grid-pro-genesis-datasource>
21
+ {{#if config.gridOptions}}
22
+ <grid-pro-column *ngFor="let columnDef of tile{{ config.index }}.gridOptions?.columnDefs" [definition]="columnDef"></grid-pro-column>
23
+ {{/if}}
20
24
  </rapid-grid-pro>
21
25
  </ng-container>
22
26
 
@@ -1,6 +1,7 @@
1
1
  import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
3
  import { User, getUser } from '@genesislcap/foundation-user';
4
+ import { GridOptionsConfig } from "@genesislcap/rapid-grid-pro";
4
5
  import { getDateFormatter, getNumberFormatter, getViewUpdateRightComponent } from '../../utils';
5
6
  import { ErrorMessageComponent } from '../../components/error-message/error-message.component';
6
7
 
@@ -23,7 +24,7 @@ export class {{pascalCase route.name}}Component {
23
24
  "createFormUiSchema": {{{ this.config.createFormUiSchema }}},{{/if}}{{#if this.config.updateFormUiSchema}}
24
25
  "updateFormUiSchema": {{{ this.config.updateFormUiSchema }}},{{/if}}{{#if this.config.uischema}}
25
26
  "uischema": {{{ this.config.uischema }}},{{/if}}{{#if this.config.gridOptions}}
26
- "gridOptions": {{{ this.config.gridOptions }}},{{/if}}{{#if this.config.reqrep}}
27
+ "gridOptions": {{{ this.config.gridOptions }}} as GridOptionsConfig,{{/if}}{{#if this.config.reqrep}}
27
28
  "reqrep": {{{ this.config.reqrep }}},{{/if}}{{#if this.config.columns}}
28
29
  "columns": {{{ this.config.columns }}},{{/if}}{{#if this.config.type}}
29
30
  "chartConfig": { {{#ifEquals this.config.type 'pie'}}
@@ -0,0 +1,9 @@
1
+ <rapid-g2plot-chart
2
+ type="{{ config.type }}"
3
+ config={tile{{ config.index }}.chartConfig}
4
+ >
5
+ <chart-datasource
6
+ resourceName="{{ config.resourceName }}"
7
+ server-fields="{{ config.xField }} {{ config.yField }}"
8
+ ></chart-datasource>
9
+ </rapid-g2plot-chart>
@@ -0,0 +1,45 @@
1
+ <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}}
45
+ ></entity-management>
@@ -0,0 +1,8 @@
1
+ <foundation-form
2
+ design-system-prefix="rapid"
3
+ resourceName="{{config.resourceName}}"
4
+ {{#if config.uischema}}
5
+ uischema={tile{{ config.index }}.uischema}
6
+ {{/if}}
7
+ >
8
+ </foundation-form>
@@ -0,0 +1,18 @@
1
+ <rapid-grid-pro
2
+ enable-row-flashing
3
+ enable-cell-flashing
4
+ >
5
+ <grid-pro-genesis-datasource
6
+ resource-name="{{config.resourceName}}"
7
+ {{#if config.snapshot}}
8
+ isSnapshot="{{config.snapshot}}"
9
+ {{/if}}
10
+ {{#if config.reqrep}}
11
+ [datasourceConfig]="tile{{ config.index }}.reqrep"
12
+ {{/if}}
13
+ {{#if config.gridOptions}}
14
+ [deferredGridOptions]="tile{{ config.index }}.gridOptions"
15
+ {{/if}}
16
+ >
17
+ </grid-pro-genesis-datasource>
18
+ </rapid-grid-pro>
@@ -0,0 +1,30 @@
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>
30
+ </rapid-layout-region>
@@ -0,0 +1,7 @@
1
+ <rapid-layout-region>
2
+ {{#each route.tiles}}
3
+ <rapid-layout-item title="{{this.title}}">
4
+ {{> (lookup . 'type') }}
5
+ </rapid-layout-item>
6
+ {{/each}}
7
+ </rapid-layout-region>
@@ -0,0 +1,35 @@
1
+ import './{{pascalCase route.name}}.css';
2
+
3
+ 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
+ return (
23
+ <section className="{{kebabCase route.name}}-page">
24
+ {{#if route.tiles}}
25
+ <rapid-layout auto-save-key="{{route.layoutKey}}">
26
+ {{> (lookup ./route 'layoutType') }}
27
+ </rapid-layout>
28
+ {{else}}
29
+ Welcome to {{sentenceCase route.name}}
30
+ {{/if}}
31
+ </section>
32
+ );
33
+ };
34
+
35
+ export default {{pascalCase route.name}};
@@ -0,0 +1,3 @@
1
+ :host {
2
+ height: 100%;
3
+ }
@@ -0,0 +1,7 @@
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}}
7
+ </rapid-layout-region>
@@ -1,4 +1,4 @@
1
- import { html, whenElse } from '@genesislcap/web-core';
1
+ import { html, whenElse, repeat } from '@genesislcap/web-core';
2
2
  import { getViewUpdateRightComponent } from '../../../utils';
3
3
  import type { {{pascalCase tile.componentName}} } from './{{kebabCase tile.title}}';
4
4
  {{#if tile.config.createFormUiSchema}}
@@ -3,6 +3,7 @@ ${whenElse(
3
3
  html`
4
4
  <entity-management
5
5
  design-system-prefix="rapid"
6
+ header-case-type="capitalCase"
6
7
  enable-row-flashing
7
8
  enable-cell-flashing
8
9
  {{#if config.title}}
@@ -2,6 +2,8 @@ ${whenElse(
2
2
  (x) => getViewUpdateRightComponent(x.user, '{{config.permissions.viewRight}}'),
3
3
  html`
4
4
  <rapid-grid-pro
5
+ header-case-type="capitalCase"
6
+ only-template-col-defs
5
7
  enable-row-flashing
6
8
  enable-cell-flashing
7
9
  >
@@ -14,10 +16,17 @@ ${whenElse(
14
16
  :datasourceConfig=${() => ({pollingInterval: 5000 })}
15
17
  {{/if}}
16
18
  {{#if config.gridOptions}}
17
- :deferredGridOptions=${() => gridOptions}
19
+ :deferredGridOptions=${() => ({ onRowClicked: gridOptions?.onRowClicked })}
18
20
  {{/if}}
19
- >
20
- </grid-pro-genesis-datasource>
21
+ ></grid-pro-genesis-datasource>
22
+ {{#if config.gridOptions}}
23
+ ${repeat(
24
+ (x) => gridOptions?.columnDefs,
25
+ html`
26
+ <grid-pro-column :definition=${(x) => x}></grid-pro-column>
27
+ `,
28
+ )}
29
+ {{/if}}
21
30
  </rapid-grid-pro>
22
31
  `,
23
32
  html`
@@ -4,6 +4,7 @@ const generateTile = require('./generateTile');
4
4
  const {
5
5
  FRAMEWORK_WEB_COMPONENTS_ALIAS,
6
6
  FRAMEWORK_ANGULAR_ALIAS,
7
+ FRAMEWORK_REACT_ALIAS,
7
8
  DIR_TEMPLATE_BY_FRAMEWORK,
8
9
  } = require('../static');
9
10
 
@@ -23,11 +24,17 @@ const getPathByFramework = {
23
24
  `${routeDir}/${routeName}.component.html`,
24
25
  style: (routePath, routeName) => `${routePath}/${routeName}.component.css`,
25
26
  },
27
+ [FRAMEWORK_REACT_ALIAS]: {
28
+ clientSrcPath: `../../client/src/pages`,
29
+ route: (clientSrcPath, routeName) => `${clientSrcPath}/${routeName}`,
30
+ component: (routeDir, routeName, changeCase) =>
31
+ `${routeDir}/${changeCase.pascalCase(routeName)}.jsx`,
32
+ style: (routePath, routeName, changeCase) =>
33
+ `${routePath}/${changeCase.pascalCase(routeName)}.css`,
34
+ },
26
35
  };
27
36
 
28
37
  const generateRoute = (route, { changeCase, writeFileWithData }, framework) => {
29
- const routeName = changeCase.paramCase(route.name);
30
- const sourceTemplateDir = `../${DIR_TEMPLATE_BY_FRAMEWORK[framework]}`;
31
38
  const {
32
39
  clientSrcPath,
33
40
  route: getRouteDir,
@@ -35,23 +42,28 @@ const generateRoute = (route, { changeCase, writeFileWithData }, framework) => {
35
42
  template: getTemplateTarget,
36
43
  style: getStyleTarget,
37
44
  } = getPathByFramework[framework];
45
+ const routeName = changeCase.paramCase(route.name);
46
+ const sourceTemplateDir = `../${DIR_TEMPLATE_BY_FRAMEWORK[framework]}`;
38
47
  const routeDir = getRouteDir(clientSrcPath, routeName);
39
48
 
40
49
  const filesToWrite = [
41
50
  {
42
51
  source: `${sourceTemplateDir}/route.hbs`,
43
- target: getComponentTarget(routeDir, routeName),
44
- },
45
- {
46
- source: `${sourceTemplateDir}/route.template.hbs`,
47
- target: getTemplateTarget(routeDir, routeName),
52
+ target: getComponentTarget(routeDir, routeName, changeCase),
48
53
  },
49
54
  {
50
55
  source: `${sourceTemplateDir}/route.styles.hbs`,
51
- target: getStyleTarget(routeDir, routeName),
56
+ target: getStyleTarget(routeDir, routeName, changeCase),
52
57
  },
53
58
  ];
54
59
 
60
+ if (getTemplateTarget) {
61
+ filesToWrite.push({
62
+ source: `${sourceTemplateDir}/route.template.hbs`,
63
+ target: getTemplateTarget(routeDir, routeName),
64
+ });
65
+ }
66
+
55
67
  makeDirectory(resolve(__dirname, routeDir));
56
68
  filesToWrite.forEach(({ source, target }) => {
57
69
  writeFileWithData(
@@ -61,7 +73,7 @@ const generateRoute = (route, { changeCase, writeFileWithData }, framework) => {
61
73
  );
62
74
  });
63
75
 
64
- // Remove condition after adding changes for angular
76
+ // Remove condition after adding changes for angular & react
65
77
  if (framework === FRAMEWORK_WEB_COMPONENTS_ALIAS && route?.tiles?.length) {
66
78
  route.tiles.forEach((tile) => {
67
79
  generateTile(tile, route, { changeCase, writeFileWithData }, framework);
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.24.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.23.0...v3.24.0) (2024-07-16)
4
+
5
+
6
+ ### Features
7
+
8
+ * add auto headerCaseType to grid/entity-manager GENC-654 (#280) 47b0520
9
+
10
+ ## [3.23.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.22.0...v3.23.0) (2024-07-15)
11
+
12
+
13
+ ### Features
14
+
15
+ * react blank-app-seed (#278) 83b1767
16
+
3
17
  ## [3.22.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.21.0...v3.22.0) (2024-07-15)
4
18
 
5
19
 
@@ -0,0 +1,18 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: { browser: true, es2020: true },
4
+ extends: [
5
+ 'eslint:recommended',
6
+ 'plugin:@typescript-eslint/recommended',
7
+ 'plugin:react-hooks/recommended',
8
+ ],
9
+ ignorePatterns: ['dist', '.eslintrc.cjs'],
10
+ parser: '@typescript-eslint/parser',
11
+ plugins: ['react-refresh'],
12
+ rules: {
13
+ 'react-refresh/only-export-components': [
14
+ 'warn',
15
+ { allowConstantExport: true },
16
+ ],
17
+ },
18
+ }
@@ -0,0 +1,48 @@
1
+
2
+ # {{capitalCase appName}}
3
+
4
+ This project is built with React.
5
+
6
+ ## Development
7
+
8
+ 1. Install dependencies:
9
+
10
+ ```shell
11
+ npm run bootstrap
12
+ ```
13
+
14
+ 2. Start the development server:
15
+
16
+ ```shell
17
+ npm run start
18
+ ```
19
+
20
+ 3. Build for production:
21
+
22
+ ```shell
23
+ npm run build
24
+ ```
25
+
26
+ Preview the production build:
27
+
28
+ ```shell
29
+ npm run serve
30
+ ```
31
+
32
+ ## Clean
33
+
34
+ Remove `build` and `node_modules` directories:
35
+
36
+ ```shell
37
+ npm run clean
38
+ ```
39
+
40
+ Baseline task combines `clean` and `install` tasks into a single command:
41
+
42
+ ```shell
43
+ npm run baseline
44
+ ```
45
+
46
+ ## Further help
47
+
48
+ To get more help on React, check out the [React documentation](https://reactjs.org/docs/getting-started.html).
File without changes
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>{{pkgName}}</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.tsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "{{pkgName}}",
3
+ "version": "{{applicationVersionWeb}}",
4
+ "private": true,
5
+ "scripts": {
6
+ "baseline": "npm run clean && npm run bootstrap",
7
+ "bootstrap": "npm i --legacy-peer-deps",
8
+ "dev": "vite",
9
+ "build": "tsc -b && vite build",
10
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
11
+ "serve": "vite preview",
12
+ "clean": "rm -rf node_modules dist",
13
+
14
+ "lint:fix": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix"
15
+ },
16
+ "dependencies": {
17
+ "@ag-grid-community/client-side-row-model": "29.2.0",
18
+ "@ag-grid-community/core": "29.2.0",
19
+ "@ag-grid-community/csv-export": "29.2.0",
20
+ "@ag-grid-enterprise/core": "29.2.0",
21
+ "@ag-grid-enterprise/row-grouping": "29.2.0",
22
+ "@ag-grid-enterprise/server-side-row-model": "29.2.0",
23
+ "@genesislcap/foundation-comms": "{{versions.UI}}",
24
+ "@genesislcap/foundation-login": "{{versions.UI}}",
25
+ "@genesislcap/foundation-entity-management": "{{versions.UI}}",
26
+ "@genesislcap/foundation-header": "{{versions.UI}}",
27
+ "@genesislcap/foundation-ui": "{{versions.UI}}",
28
+ "@genesislcap/rapid-design-system": "{{versions.UI}}",
29
+ "@genesislcap/rapid-grid-pro": "{{versions.UI}}",
30
+ "@genesislcap/foundation-layout": "{{versions.UI}}",
31
+ "@genesislcap/g2plot-chart": "{{versions.UI}}",
32
+ "history": "^5.3.0",
33
+ "react": "^19.0.0-beta-94eed63c49-20240425",
34
+ "react-dom": "^19.0.0-beta-94eed63c49-20240425",
35
+ "react-router-dom": "6.24.1"
36
+ },
37
+ "devDependencies": {
38
+ "@types/node": "^20.14.10",
39
+ "@types/react": "npm:types-react@alpha",
40
+ "@types/react-dom": "npm:types-react-dom@alpha",
41
+ "@typescript-eslint/eslint-plugin": "^7.13.1",
42
+ "@typescript-eslint/parser": "^7.13.1",
43
+ "@vitejs/plugin-react": "^4.3.1",
44
+ "eslint": "^8.57.0",
45
+ "eslint-plugin-react-hooks": "^4.6.2",
46
+ "eslint-plugin-react-refresh": "^0.4.7",
47
+ "typescript": "^5.2.2",
48
+ "vite": "^5.3.1"
49
+ },
50
+ "overrides": {
51
+ "@types/react": "npm:types-react@alpha",
52
+ "@types/react-dom": "npm:types-react-dom@alpha"
53
+ }
54
+ }
@@ -0,0 +1,66 @@
1
+ import React from 'react';
2
+ import {
3
+ unstable_HistoryRouter as HistoryRouter,
4
+ Routes,
5
+ Route,
6
+ useLocation,
7
+ } from 'react-router-dom';
8
+ import history from './utils/history';
9
+ import LayoutWrapper from './layouts/LayoutWrapper';
10
+ import { routeLayouts } from './config';
11
+ import AuthGuard from './guards/AuthGuard';
12
+ import { AuthProvider } from './store/AuthContext';
13
+ // Pages Components
14
+ import AuthPage from './pages/auth/AuthPage';
15
+ {{#each routes}}
16
+ import {{pascalCase this.name}} from './pages/{{kebabCase this.name}}/{{pascalCase this.name}}';
17
+ {{/each}}
18
+ // Genesis Components
19
+ import './share/genesis-components';
20
+
21
+ const LayoutWithLocation = () => {
22
+ const location = useLocation();
23
+ const layout = routeLayouts[location.pathname] || 'default';
24
+
25
+ let pageComponent;
26
+
27
+ switch (location.pathname) {
28
+ case '/auth':
29
+ pageComponent = <AuthPage />;
30
+ break;
31
+ {{#each routes}}
32
+ case '/{{kebabCase this.name}}':
33
+ pageComponent = <{{pascalCase this.name}} />;
34
+ break;
35
+ {{/each}}
36
+ default:
37
+ pageComponent = <AuthPage />;
38
+ }
39
+
40
+ if (
41
+ location.pathname === '/auth' ||
42
+ location.pathname === '/'
43
+ ) {
44
+ return <LayoutWrapper layout={layout}>{pageComponent}</LayoutWrapper>;
45
+ } else {
46
+ return (
47
+ <AuthGuard>
48
+ <LayoutWrapper layout={layout}>{pageComponent}</LayoutWrapper>
49
+ </AuthGuard>
50
+ );
51
+ }
52
+ };
53
+
54
+ const App: React.FC = () => {
55
+ return (
56
+ <AuthProvider>
57
+ <HistoryRouter history={history}>
58
+ <Routes>
59
+ <Route path="*" element={<LayoutWithLocation />} />
60
+ </Routes>
61
+ </HistoryRouter>
62
+ </AuthProvider>
63
+ );
64
+ };
65
+
66
+ export default App;
@@ -0,0 +1,3 @@
1
+ <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M18.7702 23.0437C18.7702 22.4675 18.8526 21.8089 19.0995 21.3149C19.3465 20.7386 19.6758 20.2447 20.0874 19.833C20.4991 19.4214 20.993 19.0921 21.5693 18.8451C22.1456 18.5982 22.7219 18.5158 23.2981 18.5158H25.9326V11.6828H19.1819V14.3172C19.1819 15.5521 18.6879 16.7047 17.8647 17.5279C17.0414 18.3512 15.8888 18.8451 14.7363 18.9275H6.7507V6.99025H16.4651V0.157227H3.54C2.63442 0.157227 1.72884 0.568855 1.07023 1.22746C0.411628 1.88606 0 2.79165 0 3.77955V22.2205C0 23.1261 0.411628 24.0316 1.07023 24.7726C1.72884 25.4312 2.63442 25.8428 3.54 25.8428H18.7702V23.0437Z" fill="white"/>
3
+ </svg>
@@ -0,0 +1,31 @@
1
+ import { RouteLayouts } from './types/RouteLayouts';
2
+
3
+ export const routeLayouts: RouteLayouts = {
4
+ '/auth-mock': 'blank',
5
+ '/auth': 'blank',
6
+ '/': 'blank',
7
+ };
8
+
9
+ import type { MainMenu } from './types/menu';
10
+
11
+ export const AUTH_PATH = 'auth';
12
+
13
+ export const API_DATA = {
14
+ URL: '',
15
+ AUTH: {
16
+ username: '', // provide login to a user in given environment
17
+ password: '', // provide password to a user in given environment
18
+ },
19
+ };
20
+
21
+ export const mainMenu: MainMenu = [
22
+ {{#each routes}}
23
+ {
24
+ index: {{@index}},
25
+ path: '{{kebabCase this.name}}',
26
+ title: '{{#if this.title}}{{this.title}}{{else}}{{this.name}}{{/if}}',
27
+ icon: '{{this.icon}}',
28
+ variant: 'solid'
29
+ }{{#unless @last}},{{/unless}}
30
+ {{/each}}
31
+ ];
@@ -0,0 +1,11 @@
1
+ declare namespace JSX {
2
+ interface IntrinsicElements {
3
+ // Wildcard for all webcomponents:
4
+ [elemName: string]: any;
5
+ }
6
+ }
7
+
8
+ declare module '*.module.css' {
9
+ const classes: { [key: string]: string };
10
+ export default classes;
11
+ }