@genesislcap/blank-app-seed 3.16.1 → 3.17.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 (137) hide show
  1. package/.genx/.genxrc.js +1 -1
  2. package/.genx/.prettierrc +5 -0
  3. package/.genx/configure.js +19 -10
  4. package/.genx/details.js +1 -1
  5. package/.genx/eslint.config.mjs +20 -0
  6. package/.genx/package-lock.json +1173 -0
  7. package/.genx/package.json +14 -1
  8. package/.genx/prompts/api.js +12 -20
  9. package/.genx/prompts/server.js +55 -54
  10. package/.genx/prompts/ui.js +40 -13
  11. package/.genx/prompts/validators.js +16 -6
  12. package/.genx/prompts.js +11 -4
  13. package/.genx/scripts/update-versions.js +9 -4
  14. package/.genx/static.js +96 -0
  15. package/.genx/templates/angular/route.hbs +14 -0
  16. package/.genx/templates/angular/route.styles.hbs +3 -0
  17. package/.genx/templates/angular/route.template.hbs +8 -0
  18. package/.genx/utils/excludeFrameworks.js +29 -0
  19. package/.genx/utils/formatJSONValue.js +9 -0
  20. package/.genx/utils/formatRouteData.js +36 -0
  21. package/.genx/utils/generateCsv.js +13 -0
  22. package/.genx/utils/generateRoute.js +64 -0
  23. package/.genx/utils/getCombinedCsvData.js +72 -0
  24. package/.genx/utils/getLayoutType.js +10 -0
  25. package/.genx/utils/gridColumnsSerializer.js +17 -0
  26. package/.genx/utils/gridOptionsSerializer.js +33 -0
  27. package/.genx/utils/index.js +25 -0
  28. package/.genx/utils/makeDirectory.js +9 -0
  29. package/.genx/utils/normalizeFrameworkAlias.js +5 -0
  30. package/.genx/utils/parseJSONArgument.js +13 -0
  31. package/.genx/utils/registerPartials.js +25 -0
  32. package/.genx/utils/validateFrameworkAlias.js +8 -0
  33. package/.genx/utils/validateRoute.js +8 -0
  34. package/.genx/versions.json +2 -2
  35. package/CHANGELOG.md +14 -0
  36. package/client-tmp/angular/README.md +27 -0
  37. package/client-tmp/angular/angular.json +136 -0
  38. package/client-tmp/angular/globals.d.ts +6 -0
  39. package/client-tmp/angular/package.json +51 -0
  40. package/client-tmp/angular/src/app/app.component.css +0 -0
  41. package/client-tmp/angular/src/app/app.component.html +3 -0
  42. package/client-tmp/angular/src/app/app.component.spec.ts +29 -0
  43. package/client-tmp/angular/src/app/app.component.ts +26 -0
  44. package/client-tmp/angular/src/app/app.config.ts +7 -0
  45. package/client-tmp/angular/src/app/app.routes.ts +28 -0
  46. package/client-tmp/angular/src/app/guards/auth.guard.ts +25 -0
  47. package/client-tmp/angular/src/app/pages/auth-login/auth-login.component.css +4 -0
  48. package/client-tmp/angular/src/app/pages/auth-login/auth-login.component.html +1 -0
  49. package/client-tmp/angular/src/app/pages/auth-login/auth-login.component.spec.ts +22 -0
  50. package/client-tmp/angular/src/app/pages/auth-login/auth-login.component.ts +12 -0
  51. package/client-tmp/angular/src/app/pages/home/home.component.css +3 -0
  52. package/client-tmp/angular/src/app/pages/home/home.component.html +1 -0
  53. package/client-tmp/angular/src/app/pages/home/home.component.ts +16 -0
  54. package/client-tmp/angular/src/app/services/auth.service.ts +14 -0
  55. package/client-tmp/angular/src/app/share/foundation-auth.ts +21 -0
  56. package/client-tmp/angular/src/app/share/foundation-login.ts +37 -0
  57. package/client-tmp/angular/src/app/share/genesis-components.ts +15 -0
  58. package/client-tmp/angular/src/assets/.gitkeep +0 -0
  59. package/client-tmp/angular/src/environments/environment.prod.ts +5 -0
  60. package/client-tmp/angular/src/environments/environment.ts +6 -0
  61. package/client-tmp/angular/src/index.html +13 -0
  62. package/client-tmp/angular/src/main.ts +6 -0
  63. package/client-tmp/angular/src/styles.css +13 -0
  64. package/client-tmp/angular/tsconfig.app.json +15 -0
  65. package/client-tmp/angular/tsconfig.json +33 -0
  66. package/client-tmp/angular/tsconfig.spec.json +14 -0
  67. package/client-tmp/angular/webpack.dev.config.js +14 -0
  68. package/client-tmp/angular/webpack.prod.config.js +14 -0
  69. package/client-tmp/angular/webpack.shared.config.js +42 -0
  70. package/client-tmp/react/react-file.ts +1 -0
  71. package/client-tmp/web-components/public/favicon.ico +0 -0
  72. package/package.json +1 -1
  73. package/.genx/utils.js +0 -212
  74. /package/.genx/templates/{route.hbs → web-components/route.hbs} +0 -0
  75. /package/.genx/templates/{route.styles.hbs → web-components/route.styles.hbs} +0 -0
  76. /package/.genx/templates/{route.template.hbs → web-components/route.template.hbs} +0 -0
  77. /package/{client/public → client-tmp/angular/src}/favicon.ico +0 -0
  78. /package/{client → client-tmp/web-components}/.editorconfig +0 -0
  79. /package/{client → client-tmp/web-components}/.prettierignore +0 -0
  80. /package/{client → client-tmp/web-components}/Dockerfile +0 -0
  81. /package/{client → client-tmp/web-components}/README.md +0 -0
  82. /package/{client → client-tmp/web-components}/build.gradle.kts +0 -0
  83. /package/{client → client-tmp/web-components}/docs/images/lsp_jetbrains_one.png +0 -0
  84. /package/{client → client-tmp/web-components}/docs/images/lsp_jetbrains_two.png +0 -0
  85. /package/{client → client-tmp/web-components}/docs/images/lsp_vscode_one.png +0 -0
  86. /package/{client → client-tmp/web-components}/docs/images/lsp_vscode_two.png +0 -0
  87. /package/{client → client-tmp/web-components}/index.html +0 -0
  88. /package/{client → client-tmp/web-components}/package.json +0 -0
  89. /package/{client → client-tmp/web-components}/playwright.config.ts +0 -0
  90. /package/{client → client-tmp/web-components}/public/initSSO.js +0 -0
  91. /package/{client → client-tmp/web-components}/settings.gradle.kts +0 -0
  92. /package/{client → client-tmp/web-components}/src/components/components.ts +0 -0
  93. /package/{client → client-tmp/web-components}/src/components/index.ts +0 -0
  94. /package/{client → client-tmp/web-components}/src/components/not-permitted-component/index.ts +0 -0
  95. /package/{client → client-tmp/web-components}/src/components/not-permitted-component/not-permitted-component.styles.ts +0 -0
  96. /package/{client → client-tmp/web-components}/src/components/not-permitted-component/not-permitted-component.template.ts +0 -0
  97. /package/{client → client-tmp/web-components}/src/components/not-permitted-component/not-permitted-component.ts +0 -0
  98. /package/{client → client-tmp/web-components}/src/index.federated.ts +0 -0
  99. /package/{client → client-tmp/web-components}/src/index.ts +0 -0
  100. /package/{client → client-tmp/web-components}/src/layouts/default.ts +0 -0
  101. /package/{client → client-tmp/web-components}/src/layouts/index.ts +0 -0
  102. /package/{client → client-tmp/web-components}/src/main/index.ts +0 -0
  103. /package/{client → client-tmp/web-components}/src/main/main.css +0 -0
  104. /package/{client → client-tmp/web-components}/src/main/main.styles.ts +0 -0
  105. /package/{client → client-tmp/web-components}/src/main/main.template.ts +0 -0
  106. /package/{client → client-tmp/web-components}/src/main/main.ts +0 -0
  107. /package/{client → client-tmp/web-components}/src/pbc/README.md +0 -0
  108. /package/{client → client-tmp/web-components}/src/routes/config.ts +0 -0
  109. /package/{client → client-tmp/web-components}/src/routes/index.ts +0 -0
  110. /package/{client → client-tmp/web-components}/src/routes/not-found/not-found.styles.ts +0 -0
  111. /package/{client → client-tmp/web-components}/src/routes/not-found/not-found.template.ts +0 -0
  112. /package/{client → client-tmp/web-components}/src/routes/not-found/not-found.ts +0 -0
  113. /package/{client → client-tmp/web-components}/src/routes/not-permitted/not-permitted.styles.ts +0 -0
  114. /package/{client → client-tmp/web-components}/src/routes/not-permitted/not-permitted.template.ts +0 -0
  115. /package/{client → client-tmp/web-components}/src/routes/not-permitted/not-permitted.ts +0 -0
  116. /package/{client → client-tmp/web-components}/src/routes/types.ts +0 -0
  117. /package/{client → client-tmp/web-components}/src/store/index.ts +0 -0
  118. /package/{client → client-tmp/web-components}/src/store/store.ts +0 -0
  119. /package/{client → client-tmp/web-components}/src/styles/design-tokens.json +0 -0
  120. /package/{client → client-tmp/web-components}/src/styles/index.ts +0 -0
  121. /package/{client → client-tmp/web-components}/src/styles/styles.ts +0 -0
  122. /package/{client → client-tmp/web-components}/src/styles/typography.ts +0 -0
  123. /package/{client → client-tmp/web-components}/src/types.ts +0 -0
  124. /package/{client → client-tmp/web-components}/src/typings.d.ts +0 -0
  125. /package/{client → client-tmp/web-components}/src/utils/fdc3.ts +0 -0
  126. /package/{client → client-tmp/web-components}/src/utils/formatters.ts +0 -0
  127. /package/{client → client-tmp/web-components}/src/utils/index.ts +0 -0
  128. /package/{client → client-tmp/web-components}/src/utils/logger.ts +0 -0
  129. /package/{client → client-tmp/web-components}/src/utils/permissions.ts +0 -0
  130. /package/{client → client-tmp/web-components}/test/README.md +0 -0
  131. /package/{client → client-tmp/web-components}/test/e2e/fixture.ts +0 -0
  132. /package/{client → client-tmp/web-components}/test/e2e/flows/001-protected.e2e.ts +0 -0
  133. /package/{client → client-tmp/web-components}/test/e2e/index.ts +0 -0
  134. /package/{client → client-tmp/web-components}/test/e2e/pages/index.ts +0 -0
  135. /package/{client → client-tmp/web-components}/test/e2e/pages/protected.ts +0 -0
  136. /package/{client → client-tmp/web-components}/test/unit/sample.test.ts +0 -0
  137. /package/{client → client-tmp/web-components}/tsconfig.json +0 -0
@@ -0,0 +1,72 @@
1
+ const { readFileSync } = require('node:fs');
2
+ const { resolve } = require('node:path');
3
+
4
+ function csvToObject(csv) {
5
+ const lines = csv
6
+ .split('\n')
7
+ .map((x) => x.replaceAll('"', ''))
8
+ .filter((line) => line.trim() !== '');
9
+ const fieldsRow = lines[0].split(',').map((field) => field.trim());
10
+ const fields = fieldsRow.map((field, index) => ({
11
+ name: field.toUpperCase(),
12
+ isLast: index === fieldsRow.length - 1,
13
+ }));
14
+
15
+ const data = lines.slice(1).map((line) => {
16
+ const rows = line.split(',').map((value, index) => ({
17
+ name: value.trim(),
18
+ isLast: index === fieldsRow.length - 1,
19
+ }));
20
+ return { rows };
21
+ });
22
+
23
+ return { fields, data };
24
+ }
25
+
26
+ const prepareCsvData = (entity) => {
27
+ if (!entity.data?.length) return null;
28
+
29
+ const data = entity.data.map((rows) => ({
30
+ rows: rows?.map((x, index) => ({
31
+ name: x,
32
+ isLast: index === rows.length - 1,
33
+ })),
34
+ }));
35
+
36
+ return data;
37
+ };
38
+
39
+ const getCombinedCsvData = (entity) => {
40
+ let csvFile;
41
+ const combinedCsv = {
42
+ name: entity.name.toUpperCase(),
43
+ fields: entity.fields?.map((field, index) => ({
44
+ name: field.toUpperCase(),
45
+ isLast: index === entity.fields.length - 1,
46
+ })),
47
+ data: prepareCsvData(entity),
48
+ };
49
+
50
+ if (entity.mode?.toLowerCase() === 'append') {
51
+ const path = resolve(
52
+ __dirname,
53
+ `../../server/{{appName}}-app/src/main/genesis/data/${entity.name}.csv`,
54
+ );
55
+
56
+ try {
57
+ csvFile = readFileSync(path, 'utf8');
58
+ } catch {
59
+ console.log('File to append not found - creating a new CSV file');
60
+ }
61
+
62
+ if (csvFile) {
63
+ const existingCsv = csvToObject(csvFile);
64
+ combinedCsv.fields = existingCsv.fields;
65
+ combinedCsv.data = [...existingCsv.data, ...prepareCsvData(entity)];
66
+ }
67
+ }
68
+
69
+ return combinedCsv;
70
+ };
71
+
72
+ module.exports = getCombinedCsvData;
@@ -0,0 +1,10 @@
1
+ const getLayoutType = (route) => {
2
+ if (route?.tiles?.length < 4) {
3
+ return 'horizontal-layout';
4
+ } else if (route?.tiles?.length === 4) {
5
+ return 'grid-layout';
6
+ }
7
+ return 'tabs-layout';
8
+ };
9
+
10
+ module.exports = getLayoutType;
@@ -0,0 +1,17 @@
1
+ const gridOptionsSerializer = require('./gridOptionsSerializer');
2
+
3
+ const gridColumnsSerializer = (columns, pad = ' ') => {
4
+ if (!columns) {
5
+ return undefined;
6
+ }
7
+ try {
8
+ const columnsSerialized = columns.map((column) =>
9
+ gridOptionsSerializer(column),
10
+ );
11
+ return `[\n${pad}${columnsSerialized}]`;
12
+ } catch {
13
+ return undefined;
14
+ }
15
+ };
16
+
17
+ module.exports = gridColumnsSerializer;
@@ -0,0 +1,33 @@
1
+ const formatJSONValue = require('./formatJSONValue');
2
+ const gridColumnsSerializer = require('./gridColumnsSerializer');
3
+
4
+ const gridOptionsSerializer = (options, pad = ' ') => {
5
+ if (!options) {
6
+ return undefined;
7
+ }
8
+ try {
9
+ let output = `{\n`;
10
+ Object.keys(options).forEach((key) => {
11
+ const value = options[key];
12
+ if (key === 'columns') {
13
+ output += `${pad}${'columnDefs'}: ${gridColumnsSerializer(value)},\n`;
14
+ } else if (
15
+ value?.type === 'function' ||
16
+ value?.type === 'valueFormatter'
17
+ ) {
18
+ const args = value.arguments?.map(JSON.stringify).join(', ');
19
+ output += `${pad}${key}: ${value.name}(${args}),\n`;
20
+ } else if (key === 'hide') {
21
+ output += `${pad}${key}: ${value},\n`;
22
+ } else {
23
+ output += `${pad}${key}: ${formatJSONValue(value)},\n`;
24
+ }
25
+ });
26
+ output += `${pad}}\n`;
27
+ return output;
28
+ } catch {
29
+ return undefined;
30
+ }
31
+ };
32
+
33
+ module.exports = gridOptionsSerializer;
@@ -0,0 +1,25 @@
1
+ const excludeFrameworks = require('./excludeFrameworks');
2
+ const formatRouteData = require('./formatRouteData');
3
+ const generateRoute = require('./generateRoute');
4
+ const generateCsv = require('./generateCsv');
5
+ const getCombinedCsvData = require('./getCombinedCsvData');
6
+ const makeDirectory = require('./makeDirectory');
7
+ const normalizeFrameworkAlias = require('./normalizeFrameworkAlias');
8
+ const parseJSONArgument = require('./parseJSONArgument');
9
+ const registerPartials = require('./registerPartials');
10
+ const validateRoute = require('./validateRoute');
11
+ const validateFrameworkAlias = require('./validateFrameworkAlias');
12
+
13
+ module.exports = {
14
+ excludeFrameworks,
15
+ formatRouteData,
16
+ generateRoute,
17
+ generateCsv,
18
+ getCombinedCsvData,
19
+ makeDirectory,
20
+ normalizeFrameworkAlias,
21
+ parseJSONArgument,
22
+ registerPartials,
23
+ validateFrameworkAlias,
24
+ validateRoute,
25
+ };
@@ -0,0 +1,9 @@
1
+ const { existsSync, mkdirSync } = require('node:fs');
2
+
3
+ const makeDirectory = (directory) => {
4
+ if (!existsSync(directory)) {
5
+ mkdirSync(directory);
6
+ }
7
+ };
8
+
9
+ module.exports = makeDirectory;
@@ -0,0 +1,5 @@
1
+ const normalizeFrameworkAlias = (source) => {
2
+ return source?.replace(/\s+/g, '').toLowerCase();
3
+ };
4
+
5
+ module.exports = normalizeFrameworkAlias;
@@ -0,0 +1,13 @@
1
+ const parseJSONArgument = (name, defaultValue) => (value) => {
2
+ if (!value) {
3
+ return defaultValue;
4
+ }
5
+ try {
6
+ return JSON.parse(value);
7
+ } catch (error) {
8
+ console.error(`Error parsing "${name}" parameter as JSON:`, error.message);
9
+ return defaultValue;
10
+ }
11
+ };
12
+
13
+ module.exports = parseJSONArgument;
@@ -0,0 +1,25 @@
1
+ const { resolve } = require('node:path');
2
+
3
+ const registerPartials = ({ registerPartial }) => {
4
+ registerPartial(
5
+ 'grid-layout',
6
+ resolve(__dirname, '../templates/gridLayout.hbs'),
7
+ );
8
+ registerPartial(
9
+ 'tabs-layout',
10
+ resolve(__dirname, '../templates/tabsLayout.hbs'),
11
+ );
12
+ registerPartial(
13
+ 'horizontal-layout',
14
+ resolve(__dirname, '../templates/horizontalLayout.hbs'),
15
+ );
16
+ registerPartial('smart-form', resolve(__dirname, '../templates/form.hbs'));
17
+ registerPartial('chart', resolve(__dirname, '../templates/chart.hbs'));
18
+ registerPartial(
19
+ 'entity-manager',
20
+ resolve(__dirname, '../templates/entityManager.hbs'),
21
+ );
22
+ registerPartial('grid-pro', resolve(__dirname, '../templates/grid.hbs'));
23
+ };
24
+
25
+ module.exports = registerPartials;
@@ -0,0 +1,8 @@
1
+ const { FRAMEWORKS_ALIAS } = require('../static');
2
+ const normalizeFrameworkAlias = require('./normalizeFrameworkAlias');
3
+
4
+ const validateFrameworkAlias = (alias) => {
5
+ return FRAMEWORKS_ALIAS.includes(normalizeFrameworkAlias(alias));
6
+ };
7
+
8
+ module.exports = validateFrameworkAlias;
@@ -0,0 +1,8 @@
1
+ const validateRoute = (route) => {
2
+ if (!route.name) {
3
+ console.warn('Invalid route - missing name', route);
4
+ }
5
+ return !!route.name;
6
+ };
7
+
8
+ module.exports = validateRoute;
@@ -1,5 +1,5 @@
1
1
  {
2
- "UI": "14.188.0",
3
- "GSF": "8.0.1",
2
+ "UI": "14.192.0",
3
+ "GSF": "8.0.2",
4
4
  "Auth": "8.0.0"
5
5
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.17.1](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.17.0...v3.17.1) (2024-06-25)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * automated dependency version update [skip-ci] [PSD-9](https://github.com/genesiscommunitysuccess/blank-app-seed/issues/9) (#263) 656d2d2
9
+
10
+ ## [3.17.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.16.1...v3.17.0) (2024-06-21)
11
+
12
+
13
+ ### Features
14
+
15
+ * initial angular support [FUI-1967](https://github.com/genesiscommunitysuccess/blank-app-seed/issues/1967) (#211) 9dac381
16
+
3
17
  ## [3.16.1](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.16.0...v3.16.1) (2024-06-21)
4
18
 
5
19
 
@@ -0,0 +1,27 @@
1
+ # {{capitalCase appName}}
2
+
3
+ This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.1.0.
4
+
5
+ ## Development server
6
+
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
+
9
+ ## Code scaffolding
10
+
11
+ Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12
+
13
+ ## Build
14
+
15
+ Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
16
+
17
+ ## Running unit tests
18
+
19
+ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20
+
21
+ ## Running end-to-end tests
22
+
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
+
25
+ ## Further help
26
+
27
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
@@ -0,0 +1,136 @@
1
+ {
2
+ "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3
+ "version": 1,
4
+ "newProjectRoot": "projects",
5
+ "projects": {
6
+ "{{pkgName}}": {
7
+ "projectType": "application",
8
+ "schematics": {},
9
+ "root": "",
10
+ "sourceRoot": "src",
11
+ "prefix": "app",
12
+ "architect": {
13
+ "build": {
14
+ "builder": "@angular-builders/custom-webpack:browser",
15
+ "options": {
16
+ "customWebpackConfig": {
17
+ "path": "./custom-webpack.config.js",
18
+ "mergeStrategies": {
19
+ "externals": "replace"
20
+ }
21
+ },
22
+ "outputPath": "dist/{{pkgName}}",
23
+ "index": "src/index.html",
24
+ "main": "src/main.ts",
25
+ "polyfills": ["zone.js"],
26
+ "tsConfig": "tsconfig.app.json",
27
+ "assets": ["src/favicon.ico", "src/assets"],
28
+ "styles": ["src/styles.css"],
29
+ "scripts": [],
30
+ "allowedCommonJsDependencies": [
31
+ "lodash",
32
+ "dayjs",
33
+ "bowser",
34
+ "fast-safe-stringify",
35
+ "dlv",
36
+ "consola",
37
+ "lodash.debounce",
38
+ "d3-regression",
39
+ "size-sensor",
40
+ "pdfast",
41
+ "fmin",
42
+ "@json-schema-tools/dereferencer"
43
+ ]
44
+ },
45
+ "configurations": {
46
+ "production": {
47
+ "customWebpackConfig": {
48
+ "path": "./webpack.prod.config.js"
49
+ },
50
+ "fileReplacements": [
51
+ {
52
+ "replace": "src/environments/environment.ts",
53
+ "with": "src/environments/environment.prod.ts"
54
+ }
55
+ ],
56
+ "budgets": [
57
+ {
58
+ "type": "initial",
59
+ "maximumWarning": "500kb",
60
+ "maximumError": "1mb"
61
+ },
62
+ {
63
+ "type": "anyComponentStyle",
64
+ "maximumWarning": "2kb",
65
+ "maximumError": "4kb"
66
+ }
67
+ ],
68
+ "outputHashing": "all"
69
+ },
70
+ "development": {
71
+ "customWebpackConfig": {
72
+ "path": "./webpack.dev.config.js"
73
+ },
74
+ "fileReplacements": [
75
+ {
76
+ "replace": "src/environments/environment.ts",
77
+ "with": "src/environments/environment.ts"
78
+ }
79
+ ],
80
+ "buildOptimizer": false,
81
+ "optimization": false,
82
+ "vendorChunk": true,
83
+ "extractLicenses": false,
84
+ "sourceMap": true,
85
+ "namedChunks": true
86
+ }
87
+ },
88
+ "defaultConfiguration": "production"
89
+ },
90
+ "serve": {
91
+ "builder": "@angular-builders/custom-webpack:dev-server",
92
+ "configurations": {
93
+ "production": {
94
+ "buildTarget": "{{pkgName}}:build:production"
95
+ },
96
+ "development": {
97
+ "buildTarget": "{{pkgName}}:build:development"
98
+ }
99
+ },
100
+ "defaultConfiguration": "development"
101
+ },
102
+ "extract-i18n": {
103
+ "builder": "@angular-devkit/build-angular:extract-i18n",
104
+ "options": {
105
+ "buildTarget": "{{pkgName}}:build"
106
+ }
107
+ },
108
+ "test": {
109
+ "builder": "@angular-builders/custom-webpack:karma",
110
+ "options": {
111
+ "customWebpackConfig": {
112
+ "path": "./custom-webpack.config.js",
113
+ "mergeStrategies": {
114
+ "externals": "replace"
115
+ }
116
+ },
117
+ "polyfills": ["zone.js", "zone.js/testing"],
118
+ "tsConfig": "tsconfig.spec.json",
119
+ "assets": ["src/favicon.ico", "src/assets"],
120
+ "styles": ["src/styles.css"],
121
+ "scripts": []
122
+ }
123
+ },
124
+ "lint": {
125
+ "builder": "@angular-eslint/builder:lint",
126
+ "options": {
127
+ "lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
128
+ }
129
+ }
130
+ }
131
+ }
132
+ },
133
+ "cli": {
134
+ "schematicCollections": ["@angular-eslint/schematics"]
135
+ }
136
+ }
@@ -0,0 +1,6 @@
1
+ declare global {
2
+ const API_HOST: string;
3
+ const GENX_ENABLE_SSO: boolean;
4
+ }
5
+
6
+ export {};
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "{{pkgName}}",
3
+ "version": "{{applicationVersionWeb}}",
4
+ "scripts": {
5
+ "ng": "ng",
6
+ "bootstrap": "npm install --no-fund --no-audit",
7
+ "dev": "ng serve --configuration=development",
8
+ "build": "ng build --configuration=production",
9
+ "watch": "ng build --watch --configuration development",
10
+ "test": "ng test"
11
+ },
12
+ "private": true,
13
+ "dependencies": {
14
+ "@angular/animations": "^17.1.0",
15
+ "@angular/common": "^17.1.0",
16
+ "@angular/compiler": "^17.1.0",
17
+ "@angular/core": "^17.1.0",
18
+ "@angular/forms": "^17.1.0",
19
+ "@angular/platform-browser": "^17.1.0",
20
+ "@angular/platform-browser-dynamic": "^17.1.0",
21
+ "@angular/router": "^17.1.0",
22
+ "@genesislcap/foundation-ui": "{{versions.UI}}",
23
+ "@genesislcap/foundation-comms": "{{versions.UI}}",
24
+ "@genesislcap/foundation-login": "{{versions.UI}}",
25
+ "@genesislcap/foundation-zero": "{{versions.UI}}",
26
+ "@genesislcap/foundation-entity-management": "{{versions.UI}}",
27
+ "@genesislcap/foundation-zero-grid-pro": "{{versions.UI}}",
28
+ "@genesislcap/g2plot-chart": "{{versions.UI}}",
29
+ "rxjs": "~7.8.0",
30
+ "tslib": "^2.3.0",
31
+ "zone.js": "~0.14.3"
32
+ },
33
+ "devDependencies": {
34
+ "@angular-builders/custom-webpack": "^17.0.0",
35
+ "@angular-devkit/build-angular": "^17.1.0",
36
+ "@angular/cli": "^17.1.0",
37
+ "@angular/compiler-cli": "^17.1.0",
38
+ "@genesislcap/build-kit": "{{versions.UI}}",
39
+ "@types/jasmine": "~5.1.0",
40
+ "file-loader": "^6.2.0",
41
+ "jasmine-core": "~5.1.0",
42
+ "karma": "~6.4.0",
43
+ "karma-chrome-launcher": "~3.2.0",
44
+ "karma-coverage": "~2.2.0",
45
+ "karma-jasmine": "~5.1.0",
46
+ "karma-jasmine-html-reporter": "~2.1.0",
47
+ "svg-url-loader": "^8.0.0",
48
+ "typescript": "~5.3.2",
49
+ "ts-node": "10.9.2"
50
+ }
51
+ }
File without changes
@@ -0,0 +1,3 @@
1
+ <zero-design-system-provider>
2
+ <router-outlet />
3
+ </zero-design-system-provider>
@@ -0,0 +1,29 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+ import { AppComponent } from './app.component';
3
+
4
+ describe('AppComponent', () => {
5
+ beforeEach(async () => {
6
+ await TestBed.configureTestingModule({
7
+ imports: [AppComponent],
8
+ }).compileComponents();
9
+ });
10
+
11
+ it('should create the app', () => {
12
+ const fixture = TestBed.createComponent(AppComponent);
13
+ const app = fixture.componentInstance;
14
+ expect(app).toBeTruthy();
15
+ });
16
+
17
+ it(`should have the '{{capitalCase appName}}' title`, () => {
18
+ const fixture = TestBed.createComponent(AppComponent);
19
+ const app = fixture.componentInstance;
20
+ expect(app.title).toEqual('{{capitalCase appName}}');
21
+ });
22
+
23
+ it('should render title', () => {
24
+ const fixture = TestBed.createComponent(AppComponent);
25
+ fixture.detectChanges();
26
+ const compiled = fixture.nativeElement as HTMLElement;
27
+ expect(compiled.querySelector('h1')?.textContent).toContain('Hello, {{capitalCase appName}}');
28
+ });
29
+ });
@@ -0,0 +1,26 @@
1
+ import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+ import { RouterOutlet } from '@angular/router';
3
+ import { Router } from '@angular/router';
4
+ import { configureFoundationLogin } from './share/foundation-login';
5
+
6
+ // Genesis Components
7
+ import './share/genesis-components';
8
+
9
+
10
+ @Component({
11
+ selector: '{{rootElement}}',
12
+ standalone: true,
13
+ imports: [RouterOutlet],
14
+ templateUrl: './app.component.html',
15
+ styleUrl: './app.component.css',
16
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
17
+ })
18
+ export class AppComponent {
19
+ title = '{{capitalCase appName}}';
20
+
21
+ constructor(
22
+ private router: Router,
23
+ ) {
24
+ configureFoundationLogin({ router });
25
+ }
26
+ }
@@ -0,0 +1,7 @@
1
+ import { ApplicationConfig } from '@angular/core';
2
+ import { provideRouter } from '@angular/router';
3
+ import { routes } from './app.routes';
4
+
5
+ export const appConfig: ApplicationConfig = {
6
+ providers: [provideRouter(routes)]
7
+ };
@@ -0,0 +1,28 @@
1
+ import { Routes } from '@angular/router';
2
+ import { AuthGuard } from './guards/auth.guard';
3
+ import { AuthLoginComponent } from './pages/auth-login/auth-login.component';
4
+ import { HomeComponent } from './pages/home/home.component';
5
+
6
+ export const INTERNAL_URLS = {
7
+ auth: 'auth',
8
+ homepage: 'home',
9
+ };
10
+
11
+ export const AUTH_PATH = INTERNAL_URLS.auth;
12
+
13
+ export const routes: Routes = [
14
+ {
15
+ path: '',
16
+ redirectTo: `/${INTERNAL_URLS.homepage}`,
17
+ pathMatch: 'full',
18
+ },
19
+ {
20
+ path: INTERNAL_URLS.homepage,
21
+ canActivate: [AuthGuard],
22
+ component: HomeComponent,
23
+ },
24
+ {
25
+ path: INTERNAL_URLS.auth,
26
+ component: AuthLoginComponent,
27
+ },
28
+ ];
@@ -0,0 +1,25 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { CanActivate, Router } from '@angular/router';
3
+ import { AUTH_PATH } from '../app.routes';
4
+ import { AuthService } from '../services/auth.service';
5
+
6
+
7
+ @Injectable({
8
+ providedIn: 'root',
9
+ })
10
+ export class AuthGuard implements CanActivate {
11
+ constructor(
12
+ private authService: AuthService,
13
+ private router: Router,
14
+ ) {}
15
+
16
+ async canActivate(): Promise<boolean> {
17
+ const isUserAuthenticated = await this.authService.isUserAuthenticated();
18
+
19
+ if (!isUserAuthenticated) {
20
+ await this.router.navigate([`/${AUTH_PATH}`]);
21
+ return false;
22
+ }
23
+ return true;
24
+ }
25
+ }
@@ -0,0 +1,4 @@
1
+ :host {
2
+ height: 100%;
3
+ width: 100%;
4
+ }
@@ -0,0 +1 @@
1
+ <client-app-login></client-app-login>
@@ -0,0 +1,22 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { AuthMockComponent } from './auth-mock.component';
4
+
5
+ describe('AuthMockComponent', () => {
6
+ let component: AuthMockComponent;
7
+ let fixture: ComponentFixture<AuthMockComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ imports: [AuthMockComponent],
12
+ }).compileComponents();
13
+
14
+ fixture = TestBed.createComponent(AuthMockComponent);
15
+ component = fixture.componentInstance;
16
+ fixture.detectChanges();
17
+ });
18
+
19
+ it('should create', () => {
20
+ expect(component).toBeTruthy();
21
+ });
22
+ });
@@ -0,0 +1,12 @@
1
+ import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'app-auth-login',
5
+ standalone: true,
6
+ imports: [],
7
+ templateUrl: './auth-login.component.html',
8
+ styleUrl: './auth-login.component.css',
9
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
10
+ })
11
+ export class AuthLoginComponent {
12
+ }