@genesislcap/blank-app-seed 5.22.1 → 5.23.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 (191) hide show
  1. package/.genx/configure.js +11 -1
  2. package/.genx/package.json +1 -1
  3. package/.genx/scripts/generate-test-apps.sh +124 -0
  4. package/.genx/templates/angular/chart.hbs +19 -7
  5. package/.genx/templates/angular/component/component.column.defs.hbs +16 -4
  6. package/.genx/templates/angular/component/component.create.form.hbs +10 -2
  7. package/.genx/templates/angular/component/component.events.config.hbs +31 -6
  8. package/.genx/templates/angular/component/component.filter.form.hbs +1 -2
  9. package/.genx/templates/angular/component/component.gridOptions.hbs +15 -3
  10. package/.genx/templates/angular/component/component.hbs +77 -46
  11. package/.genx/templates/angular/component/component.index.hbs +1 -1
  12. package/.genx/templates/angular/component/component.update.form.hbs +1 -1
  13. package/.genx/templates/angular/entityManager.hbs +6 -6
  14. package/{client-tmp/angular/src/app/utils/fdc3.ts → .genx/templates/angular/fdc3.ts.hbs} +6 -8
  15. package/.genx/templates/angular/form.hbs +9 -12
  16. package/.genx/templates/angular/grid.hbs +43 -40
  17. package/.genx/templates/angular/route.hbs +8 -2
  18. package/.genx/templates/angular/route.template.hbs +7 -7
  19. package/.genx/templates/angular/slices/eventing.slice.hbs +21 -10
  20. package/.genx/templates/angular/store.hbs +1 -5
  21. package/.genx/templates/angular/tabsPanel.hbs +2 -2
  22. package/.genx/templates/react/chart.hbs +6 -15
  23. package/.genx/templates/react/component/component.column.defs.hbs +16 -10
  24. package/.genx/templates/react/component/component.create.form.hbs +2 -2
  25. package/.genx/templates/react/component/component.events.config.hbs +32 -5
  26. package/.genx/templates/react/component/component.filter.form.hbs +1 -2
  27. package/.genx/templates/react/component/component.gridOptions.hbs +17 -11
  28. package/.genx/templates/react/component/component.hbs +84 -42
  29. package/.genx/templates/react/component/component.update.form.hbs +1 -1
  30. package/.genx/templates/react/entityManager.hbs +8 -16
  31. package/{client-tmp/react/src/utils/fdc3.ts → .genx/templates/react/fdc3.ts.hbs} +7 -8
  32. package/.genx/templates/react/form.hbs +1 -15
  33. package/.genx/templates/react/grid.hbs +11 -11
  34. package/.genx/templates/react/gridLayout.hbs +44 -4
  35. package/.genx/templates/react/horizontalLayout.hbs +10 -1
  36. package/.genx/templates/react/route.hbs +21 -14
  37. package/.genx/templates/react/slices/eventing.slice.hbs +19 -8
  38. package/.genx/templates/react/store.hbs +1 -5
  39. package/.genx/templates/react/tabsLayout.hbs +5 -1
  40. package/.genx/templates/web-components/chart.hbs +25 -25
  41. package/.genx/templates/web-components/component/component.column.defs.hbs +11 -3
  42. package/.genx/templates/web-components/component/component.create.form.hbs +11 -4
  43. package/.genx/templates/web-components/component/component.events.config.hbs +33 -6
  44. package/.genx/templates/web-components/component/component.filter.form.hbs +1 -2
  45. package/.genx/templates/web-components/component/component.gridOptions.hbs +12 -3
  46. package/.genx/templates/web-components/component/component.hbs +19 -20
  47. package/.genx/templates/web-components/component/component.index.hbs +1 -1
  48. package/.genx/templates/web-components/component/component.template.hbs +9 -13
  49. package/.genx/templates/web-components/component/component.update.form.hbs +1 -1
  50. package/.genx/templates/web-components/entityManager.hbs +92 -73
  51. package/{client-tmp/web-components/src/utils/fdc3.ts → .genx/templates/web-components/fdc3.ts.hbs} +6 -7
  52. package/.genx/templates/web-components/form.hbs +16 -15
  53. package/.genx/templates/web-components/grid.hbs +49 -41
  54. package/.genx/templates/web-components/gridLayout.hbs +32 -28
  55. package/.genx/templates/web-components/horizontalLayout.hbs +5 -5
  56. package/.genx/templates/web-components/route.template.hbs +4 -6
  57. package/.genx/templates/web-components/slices/eventing.slice.hbs +23 -15
  58. package/.genx/templates/web-components/store.hbs +1 -9
  59. package/.genx/templates/web-components/tabsLayout.hbs +5 -5
  60. package/.genx/tests/fixtures/routes-full.json +299 -0
  61. package/.genx/tests/fixtures/testapp/client/src/pages/Home/Home.tsx +12 -0
  62. package/.genx/utils/formatJSONValue.js +38 -2
  63. package/.genx/utils/formatRouteData.js +67 -18
  64. package/.genx/utils/generateTile.js +10 -1
  65. package/.genx/utils/gridSerializers.js +63 -23
  66. package/.genx/utils/registerPartials.js +15 -12
  67. package/.genx/utils/toJsStringLiteral.js +37 -0
  68. package/.github/workflows/build.yml +22 -1
  69. package/.github/workflows/release.yaml +96 -0
  70. package/.husky/pre-commit +8 -0
  71. package/.releaserc +1 -1
  72. package/CHANGELOG.md +23 -0
  73. package/client-tmp/angular/.oxfmtrc.json +32 -0
  74. package/client-tmp/angular/.oxlintrc.json +4 -0
  75. package/client-tmp/angular/README.md +4 -4
  76. package/client-tmp/angular/jest.config.js +1 -1
  77. package/client-tmp/angular/lint-css.js +24 -3
  78. package/client-tmp/angular/oxlint-staged.js +45 -0
  79. package/client-tmp/angular/package.json +19 -9
  80. package/client-tmp/angular/playwright.config.ts +12 -11
  81. package/client-tmp/angular/src/app/app.component.html +0 -1
  82. package/client-tmp/angular/src/app/app.component.ts +8 -9
  83. package/client-tmp/angular/src/app/app.config.ts +2 -2
  84. package/client-tmp/angular/src/app/app.module.ts +6 -5
  85. package/client-tmp/angular/src/app/components/error-message/error-message.component.html +29 -15
  86. package/client-tmp/angular/src/app/components/error-message/error-message.component.spec.ts +2 -2
  87. package/client-tmp/angular/src/app/components/error-message/error-message.component.ts +3 -5
  88. package/client-tmp/angular/src/app/directive/app-lazy-load.directive.ts +1 -0
  89. package/client-tmp/angular/src/app/guards/chained.guard.ts +19 -19
  90. package/client-tmp/angular/src/app/guards/connection.guard.ts +12 -12
  91. package/client-tmp/angular/src/app/layouts/blank/blank.layout.spec.ts +1 -1
  92. package/client-tmp/angular/src/app/layouts/blank/blank.layout.ts +1 -5
  93. package/client-tmp/angular/src/app/layouts/default/default.layout.html +3 -4
  94. package/client-tmp/angular/src/app/layouts/default/default.layout.spec.ts +4 -4
  95. package/client-tmp/angular/src/app/layouts/default/default.layout.ts +1 -1
  96. package/client-tmp/angular/src/app/pages/auth-login/auth-login.component.ts +1 -2
  97. package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.html +3 -3
  98. package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.scss +1 -1
  99. package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.spec.ts +5 -5
  100. package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.ts +3 -4
  101. package/client-tmp/angular/src/app/services/route.service.ts +79 -74
  102. package/client-tmp/angular/src/app/share/foundation-auth.ts +7 -1
  103. package/client-tmp/angular/src/app/share/genesis-components.ts +66 -68
  104. package/client-tmp/angular/src/app/utils/index.ts +3 -1
  105. package/client-tmp/angular/src/app/utils/permissions.ts +7 -7
  106. package/client-tmp/angular/src/declaration.d.ts +1 -1
  107. package/client-tmp/angular/src/environments/environment.ts +1 -1
  108. package/client-tmp/angular/src/jest.setup.ts +8 -0
  109. package/client-tmp/angular/src/main.ts +2 -2
  110. package/client-tmp/angular/src/pbc/container.ts +28 -26
  111. package/client-tmp/angular/src/pbc/elementsRenderer.ts +49 -39
  112. package/client-tmp/angular/src/pbc/utils.ts +61 -60
  113. package/client-tmp/angular/src/styles/_mixins.scss +7 -8
  114. package/client-tmp/angular/src/styles/styles.css +6 -6
  115. package/client-tmp/angular/test/e2e/fixture.ts +2 -2
  116. package/client-tmp/angular/test/e2e/flows/001-protected.e2e.ts +1 -1
  117. package/client-tmp/angular/tsconfig.app.json +2 -8
  118. package/client-tmp/angular/tsconfig.json +1 -4
  119. package/client-tmp/angular/tsconfig.spec.json +4 -11
  120. package/client-tmp/angular/webpack.dev.config.js +3 -4
  121. package/client-tmp/angular/webpack.prod.config.js +3 -4
  122. package/client-tmp/angular/webpack.shared.config.js +20 -24
  123. package/client-tmp/react/.oxfmtrc.json +30 -0
  124. package/client-tmp/react/.oxlintrc.json +4 -0
  125. package/client-tmp/react/README.md +4 -4
  126. package/client-tmp/react/jest.config.ts +8 -4
  127. package/client-tmp/react/jest.setup.ts +85 -1
  128. package/client-tmp/react/oxlint-staged.js +45 -0
  129. package/client-tmp/react/package.json +24 -9
  130. package/client-tmp/react/playwright.config.ts +11 -10
  131. package/client-tmp/react/src/App.tsx +27 -29
  132. package/client-tmp/react/src/__mocks__/fileMock.js +1 -0
  133. package/client-tmp/react/src/components/ErrorMessage/ErrorMessage.test.tsx +16 -4
  134. package/client-tmp/react/src/components/ErrorMessage/ErrorMessage.tsx +32 -29
  135. package/client-tmp/react/src/components/error-boundary/ErrorBoundary.tsx +15 -6
  136. package/client-tmp/react/src/components/routes/AppRoutes.tsx +1 -1
  137. package/client-tmp/react/src/components/single-component/registry.ts +4 -0
  138. package/client-tmp/react/src/custom-elements.d.ts +4 -2
  139. package/client-tmp/react/src/helpers/hasPermissionHelper.tsx +1 -1
  140. package/client-tmp/react/src/helpers/isAuthenticatedHelper.tsx +1 -1
  141. package/client-tmp/react/src/helpers/isConnectedHelper.tsx +3 -3
  142. package/client-tmp/react/src/layouts/blank/BlankLayout.tsx +7 -11
  143. package/client-tmp/react/src/layouts/default/DefaultLayout.tsx +8 -8
  144. package/client-tmp/react/src/main.tsx +11 -11
  145. package/client-tmp/react/src/pages/AuthPage/AuthPage.test.tsx +13 -2
  146. package/client-tmp/react/src/pages/AuthPage/AuthPage.tsx +14 -13
  147. package/client-tmp/react/src/pages/NotFoundPage/NotFoundPage.tsx +2 -7
  148. package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.test.tsx +8 -4
  149. package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.tsx +1 -1
  150. package/client-tmp/react/src/pbc/container.tsx +9 -4
  151. package/client-tmp/react/src/pbc/elementsRenderer.tsx +13 -7
  152. package/client-tmp/react/src/pbc/utils.ts +60 -59
  153. package/client-tmp/react/src/services/auth.service.ts +1 -1
  154. package/client-tmp/react/src/services/store.service.ts +5 -3
  155. package/client-tmp/react/src/share/foundation-login.ts +2 -2
  156. package/client-tmp/react/src/share/genesis-components.ts +46 -47
  157. package/client-tmp/react/src/store/AuthContext.tsx +2 -10
  158. package/client-tmp/react/src/store/RoutesContext.test.tsx +99 -0
  159. package/client-tmp/react/src/store/RoutesContext.tsx +25 -5
  160. package/client-tmp/react/src/styles/styles.css +7 -7
  161. package/client-tmp/react/src/types/LayoutName.ts +1 -1
  162. package/client-tmp/react/src/utils/getLayoutNameByRoute.ts +1 -1
  163. package/client-tmp/react/src/utils/index.ts +2 -0
  164. package/client-tmp/react/src/utils/layout.ts +8 -1
  165. package/client-tmp/react/src/utils/permissions.ts +7 -7
  166. package/client-tmp/react/src/utils/useDocumentTitle.ts +5 -6
  167. package/client-tmp/react/test/e2e/fixture.ts +5 -2
  168. package/client-tmp/react/test/e2e/flows/001-protected.e2e.ts +3 -1
  169. package/client-tmp/react/tsconfig.app.json +1 -1
  170. package/client-tmp/react/tsconfig.json +1 -5
  171. package/client-tmp/web-components/.oxfmtrc.json +30 -0
  172. package/client-tmp/web-components/.oxlintrc.json +4 -0
  173. package/client-tmp/web-components/oxlint-staged.js +45 -0
  174. package/client-tmp/web-components/package.json +14 -22
  175. package/client-tmp/web-components/src/components/components.ts +9 -7
  176. package/client-tmp/web-components/src/main/main.css +1 -2
  177. package/client-tmp/web-components/src/main/main.ts +1 -1
  178. package/client-tmp/web-components/src/routes/config.ts +4 -0
  179. package/client-tmp/web-components/src/utils/index.ts +2 -0
  180. package/client-tmp/web-components/tsconfig.json +1 -4
  181. package/package.json +1 -1
  182. package/.genx/templates/angular/gridLayout.hbs +0 -30
  183. package/.genx/templates/angular/horizontalLayout.hbs +0 -7
  184. package/.genx/templates/angular/tabsLayout.hbs +0 -7
  185. package/.genx/tests/fixtures/testapp/client/src/routes/home/home.template.ts +0 -6
  186. package/.github/workflows/release.yml +0 -50
  187. package/client-tmp/react/.babelrc +0 -10
  188. package/client-tmp/react/.eslintrc.cjs +0 -21
  189. package/client-tmp/react/git +0 -0
  190. package/client-tmp/react/webpack.config.js +0 -121
  191. package/client-tmp/web-components/.prettierignore +0 -14
@@ -1 +1 @@
1
- export * from './{{kebabCase tile.title}}';
1
+ export * from './{{kebabCase tile.title}}';
@@ -1,26 +1,22 @@
1
- import { html, whenElse, repeat } from '@genesislcap/web-core';
1
+ import { html, whenElse{{#ifEquals tile.componentType "grid"}}{{#if tile.config.gridOptions}}, repeat{{/if}}{{/ifEquals}} } from '@genesislcap/web-core';
2
2
  import { getViewUpdateRightComponent } from '../../../utils';
3
3
  import type { {{pascalCase tile.componentName}} } from './{{kebabCase tile.title}}';
4
- {{#if tile.config.createFormUiSchema}}
4
+ {{#ifAny tile.config.createFormUiSchema tile.config.uischema}}
5
5
  import { createFormSchema } from './{{kebabCase tile.title}}.create.form.schema';
6
- {{/if}}
7
- {{#if tile.config.uischema}}
8
- import { createFormSchema } from './{{kebabCase tile.title}}.create.form.schema';
9
- {{/if}}
10
- {{#if tile.config.updateFormUiSchema}}
11
- import { updateFormSchema } from './{{kebabCase tile.title}}.update.form.schema';
6
+ {{/ifAny}}
7
+ {{#if tile.config.customEvents}}
8
+ import { customActions } from './{{kebabCase tile.title}}.events.config';
12
9
  {{/if}}
13
10
  {{#if tile.config.filterFormUiSchema}}
14
11
  import { filterFormSchema } from './{{kebabCase tile.title}}.filter.form.schema';
15
12
  {{/if}}
16
- {{#if tile.config.customEvents}}
17
- import { customActions } from './{{kebabCase tile.title}}.events.config';
18
- {{/if}}
19
13
  {{#if tile.config.gridOptions}}
20
14
  import { gridOptions } from './{{kebabCase tile.title}}.gridOptions';
21
15
  {{/if}}
22
-
16
+ {{#if tile.config.updateFormUiSchema}}
17
+ import { updateFormSchema } from './{{kebabCase tile.title}}.update.form.schema';
18
+ {{/if}}
23
19
 
24
20
  export const {{pascalCase tile.title}}Template = html<{{pascalCase tile.componentName}}>`
25
- {{> (lookup tile 'type') tile}}
21
+ {{> (lookup tile 'type') tile}}
26
22
  `;
@@ -1,5 +1,5 @@
1
1
  import { UiSchema } from '@genesislcap/foundation-forms';
2
2
 
3
3
  {{#if tile.config.updateFormUiSchema}}
4
- export const updateFormSchema: UiSchema = {{{ tile.config.updateFormUiSchema }}}
4
+ export const updateFormSchema: UiSchema = {{{ tile.config.updateFormUiSchema }}};
5
5
  {{/if}}
@@ -1,75 +1,94 @@
1
1
  ${whenElse(
2
- (x) => getViewUpdateRightComponent(x.user, '{{config.permissions.viewRight}}'),
3
- html<{{pascalCase componentName}}>`
4
- <entity-management
5
- design-system-prefix="rapid"
6
- header-case-type="capitalCase"
7
- enable-row-flashing
8
- enable-cell-flashing
9
- {{#if config.title}}
10
- title="{{ config.title }}"
11
- {{/if}}
12
- resourceName="{{ config.resourceName }}"
13
- {{#if config.createEvent}}
14
- createEvent="${(x) => getViewUpdateRightComponent(x.user, '{{config.permissions.updateRight}}', '{{ config.createEvent }}')}"
15
- {{#if config.createFormUiSchema}}
16
- :createFormUiSchema=${() => createFormSchema }
17
- {{/if}}
18
- {{/if}}
19
- {{#if config.updateEvent}}
20
- updateEvent="${(x) => getViewUpdateRightComponent(x.user, '{{config.permissions.updateRight}}', '{{ config.updateEvent }}')}"
21
- {{#if config.updateFormUiSchema}}
22
- :updateFormUiSchema=${() => updateFormSchema}
23
- {{/if}}
24
- {{/if}}
25
- {{#if config.deleteEvent}}
26
- deleteEvent="${(x) => getViewUpdateRightComponent(x.user, '{{config.permissions.updateRight}}', '{{ config.deleteEvent }}')}"
27
- {{/if}}
28
- {{#ifAny config.gridOptions config.eventing.publishEventName}}
29
- :gridOptions=${(x) => ({
30
- {{#if config.gridOptions}}
31
- ...gridOptions,{{/if}}{{#if config.eventing.publishEventName}}
32
- onSelectionChanged: x.handleRowSelection,
33
- {{/if}}
34
- })}
35
- {{/ifAny}}
36
- {{#ifAny config.reqrep config.eventing.listener}}
37
- :datasourceConfig=${(x) => ({
38
- {{#if config.reqrep}}
39
- pollingInterval: 5000,
40
- requestAutoSetup: false,{{/if}}{{#if config.eventing.listener}}
41
- criteria: x.getCriteria(),
42
- {{/if}}
43
- })}
44
- {{/ifAny}}
45
- {{#if config.entityName}}
46
- entityLabel="{{ config.entityName }}"
47
- {{/if}}
48
- {{#if config.columns}}
49
- :columns=${(x) => x.columns}
50
- {{/if}}
51
- {{#if config.modalPosition}}
52
- modal-position="{{ config.modalPosition }}"
53
- {{/if}}
54
- {{#if config.sizeColumnsToFit}}
55
- size-columns-to-fit
56
- size-columns-to-content
57
- {{/if}}
58
- {{#if config.enableSearchBar}}
59
- enable-search-bar
60
- {{/if}}
61
- {{#if config.enableFilters}}
62
- enable-filters
63
- {{#if config.filterFormUiSchema}}
64
- :filtersUiSchema=${() => filterFormSchema}
65
- {{/if}}
66
- {{/if}}
67
- {{#if config.customEvents}}
68
- :customActions=${() => customActions}
69
- {{/if}}
70
- ></entity-management>
71
- `,
72
- html`
73
- <not-permitted-component></not-permitted-component>
74
- `,
2
+ (x) => getViewUpdateRightComponent(x.user, '{{config.permissions.viewRight}}'),
3
+ html<{{pascalCase componentName}}>`
4
+ <entity-management
5
+ design-system-prefix="rapid"
6
+ header-case-type="capitalCase"
7
+ enable-row-flashing
8
+ enable-cell-flashing
9
+ {{#if config.title}}
10
+ title="{{ config.title }}"
11
+ {{/if}}
12
+ resourceName="{{ config.resourceName }}"
13
+ {{#if config.createEvent}}
14
+ {{#if config.permissions.updateRight}}
15
+ createEvent="${(x) =>
16
+ getViewUpdateRightComponent(x.user, '{{config.permissions.updateRight}}', '{{ config.createEvent }}')}"
17
+ {{else}}
18
+ createEvent="{{ config.createEvent }}"
19
+ {{/if}}
20
+ {{#if config.createFormUiSchema}}
21
+ :createFormUiSchema=${() => createFormSchema}
22
+ {{/if}}
23
+ {{/if}}
24
+ {{#if config.updateEvent}}
25
+ {{#if config.permissions.updateRight}}
26
+ updateEvent="${(x) =>
27
+ getViewUpdateRightComponent(x.user, '{{config.permissions.updateRight}}', '{{ config.updateEvent }}')}"
28
+ {{else}}
29
+ updateEvent="{{ config.updateEvent }}"
30
+ {{/if}}
31
+ {{#if config.updateFormUiSchema}}
32
+ :updateFormUiSchema=${() => updateFormSchema}
33
+ {{/if}}
34
+ {{/if}}
35
+ {{#if config.deleteEvent}}
36
+ {{#if config.permissions.updateRight}}
37
+ deleteEvent="${(x) =>
38
+ getViewUpdateRightComponent(x.user, '{{config.permissions.updateRight}}', '{{ config.deleteEvent }}')}"
39
+ {{else}}
40
+ deleteEvent="{{ config.deleteEvent }}"
41
+ {{/if}}
42
+ {{/if}}
43
+ {{#ifAny config.gridOptions config.eventing.publishEventName}}
44
+ :gridOptions=${(x) => ({
45
+ {{#if config.gridOptions}}
46
+ ...gridOptions,
47
+ {{/if}}
48
+ {{#if config.eventing.publishEventName}}
49
+ onSelectionChanged: x.handleRowSelection,
50
+ {{/if}}
51
+ })}
52
+ {{/ifAny}}
53
+ {{#ifAny config.reqrep config.eventing.listener}}
54
+ :datasourceConfig=${(x) => ({
55
+ {{#if config.reqrep}}
56
+ pollingInterval: 5000,
57
+ requestAutoSetup: false,
58
+ {{/if}}
59
+ {{#if config.eventing.listener}}
60
+ criteria: x.getCriteria(),
61
+ {{/if}}
62
+ })}
63
+ {{/ifAny}}
64
+ {{#if config.entityName}}
65
+ entityLabel="{{ config.entityName }}"
66
+ {{/if}}
67
+ {{#if config.columns}}
68
+ :columns=${(x) => x.columns}
69
+ {{/if}}
70
+ {{#if config.modalPosition}}
71
+ modal-position="{{ config.modalPosition }}"
72
+ {{/if}}
73
+ {{#if config.sizeColumnsToFit}}
74
+ size-columns-to-fit
75
+ size-columns-to-content
76
+ {{/if}}
77
+ {{#if config.enableSearchBar}}
78
+ enable-search-bar
79
+ {{/if}}
80
+ {{#if config.enableFilters}}
81
+ enable-filters
82
+ {{#if config.filterFormUiSchema}}
83
+ :filtersUiSchema=${() => filterFormSchema}
84
+ {{/if}}
85
+ {{/if}}
86
+ {{#if config.customEvents}}
87
+ :customActions=${() => customActions}
88
+ {{/if}}
89
+ ></entity-management>
90
+ `,
91
+ html`
92
+ <not-permitted-component></not-permitted-component>
93
+ `,
75
94
  )}
@@ -1,16 +1,16 @@
1
- {{#if FDC3.includeDependencies}}
2
1
  import { DefaultFDC3 } from '@genesislcap/foundation-fdc3';
3
- {{/if}}
2
+
4
3
  export const isFDC3 = (): boolean => !!(window as any).fdc3;
5
- {{#if FDC3.includeDependencies}}
6
4
  const fdc3Service = new DefaultFDC3();
7
5
 
8
6
  export const onFDC3Ready = async (FDC3ReadyCb: () => any): Promise<void> => {
9
- isFDC3()
10
- ? await FDC3ReadyCb()
11
- : window.addEventListener('fdc3Ready', async () => {
7
+ if (isFDC3()) {
8
+ await FDC3ReadyCb();
9
+ } else {
10
+ window.addEventListener('fdc3Ready', async () => {
12
11
  await FDC3ReadyCb();
13
12
  });
13
+ }
14
14
  };
15
15
 
16
16
  export const listenToChannel = async (
@@ -28,4 +28,3 @@ export const sendEventOnChannel = (channelName: string, type: string) => {
28
28
  await fdc3Service.broadcastOnChannel(channelName, type, payload);
29
29
  };
30
30
  };
31
- {{/if}}
@@ -1,16 +1,17 @@
1
1
  ${whenElse(
2
- (x) => getViewUpdateRightComponent(x.user, '{{config.permissions.updateRight}}'),
3
- html`
4
- <foundation-form
5
- design-system-prefix="rapid"
6
- resourceName="{{config.resourceName}}"
7
- {{#if config.uischema}}
8
- :uischema=${() => createFormSchema }
9
- {{/if}}
10
- >
11
- </foundation-form>
12
- `,
13
- html`
14
- <not-permitted-component></not-permitted-component>
15
- `,
16
- )}
2
+ (x) => getViewUpdateRightComponent(x.user, '{{config.permissions.updateRight}}'),
3
+ html`
4
+ {{#if config.uischema}}
5
+ <foundation-form
6
+ design-system-prefix="rapid"
7
+ resourceName="{{config.resourceName}}"
8
+ :uischema=${() => createFormSchema}
9
+ ></foundation-form>
10
+ {{else}}
11
+ <foundation-form design-system-prefix="rapid" resourceName="{{config.resourceName}}"></foundation-form>
12
+ {{/if}}
13
+ `,
14
+ html`
15
+ <not-permitted-component></not-permitted-component>
16
+ `,
17
+ )}
@@ -1,44 +1,52 @@
1
1
  ${whenElse(
2
- (x) => getViewUpdateRightComponent(x.user, '{{config.permissions.viewRight}}'),
3
- html`
4
- <rapid-grid-pro
5
- header-case-type="capitalCase"{{#if config.useOnlyTemplateCols}}
6
- only-template-col-defs{{/if}}
7
- enable-row-flashing
8
- enable-cell-flashing
9
- >
10
- <grid-pro-genesis-datasource
11
- resource-name="{{config.resourceName}}"
12
- {{#if config.reqrep}}
13
- request-auto-setup="false"
14
- polling-interval="5000"
2
+ (x) => getViewUpdateRightComponent(x.user, '{{config.permissions.viewRight}}'),
3
+ html`
4
+ {{#if config.useOnlyTemplateCols}}
5
+ <rapid-grid-pro
6
+ header-case-type="capitalCase"
7
+ only-template-col-defs
8
+ enable-row-flashing
9
+ enable-cell-flashing
10
+ >
11
+ {{else}}
12
+ <rapid-grid-pro header-case-type="capitalCase" enable-row-flashing enable-cell-flashing>
13
+ {{/if}}
14
+ {{#ifAny config.reqrep config.eventing.listener config.gridOptions config.eventing.publishEventName}}
15
+ <grid-pro-genesis-datasource
16
+ resource-name="{{config.resourceName}}"
17
+ {{#if config.reqrep}}
18
+ request-auto-setup="false"
19
+ polling-interval="5000"
20
+ {{/if}}
21
+ {{#if config.eventing.listener}}
22
+ criteria=${(x) => x.getCriteria()}
23
+ {{/if}}
24
+ {{#ifAny config.gridOptions config.eventing.publishEventName}}
25
+ :deferredGridOptions=${(x) => ({
26
+ {{#if config.gridOptions}}
27
+ onRowClicked: gridOptions?.onRowClicked,
15
28
  {{/if}}
16
- {{#if config.eventing.listener}}
17
- criteria=${(x) => x.getCriteria()}
29
+ {{#if config.eventing.publishEventName}}
30
+ onSelectionChanged: x.handleRowSelection,
31
+ rowSelection: 'single',
18
32
  {{/if}}
19
- {{#ifAny config.gridOptions config.eventing.publishEventName}}
20
- :deferredGridOptions=${(x) => ({
21
- {{#if config.gridOptions}}
22
- onRowClicked: gridOptions?.onRowClicked,
23
- {{/if}}
24
- {{#if config.eventing.publishEventName}}
25
- onSelectionChanged: x.handleRowSelection,
26
- rowSelection: 'single',
27
- {{/if}}
28
- })}
29
- {{/ifAny}}
30
- ></grid-pro-genesis-datasource>
31
- {{#if config.gridOptions}}
32
- ${repeat(
33
- (x) => gridOptions?.columnDefs,
34
- html`
35
- <grid-pro-column :definition=${(x) => x}></grid-pro-column>
36
- `,
37
- )}
38
- {{/if}}
39
- </rapid-grid-pro>
40
- `,
41
- html`
42
- <not-permitted-component></not-permitted-component>
43
- `,
44
- )}
33
+ })}
34
+ {{/ifAny}}
35
+ ></grid-pro-genesis-datasource>
36
+ {{else}}
37
+ <grid-pro-genesis-datasource resource-name="{{config.resourceName}}"></grid-pro-genesis-datasource>
38
+ {{/ifAny}}
39
+ {{#if config.gridOptions}}
40
+ ${repeat(
41
+ (x) => gridOptions?.columnDefs,
42
+ html`
43
+ <grid-pro-column :definition=${(x) => x}></grid-pro-column>
44
+ `,
45
+ )}
46
+ {{/if}}
47
+ </rapid-grid-pro>
48
+ `,
49
+ html`
50
+ <not-permitted-component></not-permitted-component>
51
+ `,
52
+ )}
@@ -1,30 +1,34 @@
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="{{this.title}}">
6
- <{{kebabCase this.componentName}}></{{kebabCase this.componentName}}>
7
- </rapid-layout-item>
8
- {{/ifEquals}}
9
- {{#ifEquals @index 1}}
10
- <rapid-layout-item title="{{this.title}}">
11
- <{{kebabCase this.componentName}}></{{kebabCase this.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="{{this.title}}">
20
- <{{kebabCase this.componentName}}></{{kebabCase this.componentName}}>
21
- </rapid-layout-item>
22
- {{/ifEquals}}
23
- {{#ifEquals @index 3}}
24
- <rapid-layout-item title="{{this.title}}">
25
- <{{kebabCase this.componentName}}></{{kebabCase this.componentName}}>
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="{{this.title}}">
6
+ <{{kebabCase this.componentName}}></{{kebabCase this.componentName}}>
7
+ </rapid-layout-item>
8
+ {{/ifEquals}}
9
+ {{#ifEquals @index 1}}
10
+ <rapid-layout-item title="{{this.title}}">
11
+ <{{kebabCase this.componentName}}></{{kebabCase this.componentName}}>
12
+ </rapid-layout-item>
13
+ {{/ifEquals}}
14
+ {{/each}}
15
+ </rapid-layout-region>
16
+ {{#if route.tiles.[2]}}
17
+ <rapid-layout-region type="vertical">
18
+ {{#each route.tiles}}
19
+ {{#ifEquals @index 2}}
20
+ <rapid-layout-item title="{{this.title}}">
21
+ <{{kebabCase this.componentName}}></{{kebabCase this.componentName}}>
22
+ </rapid-layout-item>
23
+ {{/ifEquals}}
24
+ {{#ifEquals @index 3}}
25
+ <rapid-layout-item title="{{this.title}}">
26
+ <{{kebabCase this.componentName}}></{{kebabCase this.componentName}}>
27
+ </rapid-layout-item>
28
+ {{/ifEquals}}
29
+ {{/each}}
30
+ </rapid-layout-region>
31
+ {{else}}
32
+ <rapid-layout-region type="vertical"></rapid-layout-region>
33
+ {{/if}}
30
34
  </rapid-layout-region>
@@ -1,7 +1,7 @@
1
1
  <rapid-layout-region>
2
- {{#each route.tiles}}
3
- <rapid-layout-item title="{{this.title}}">
4
- <{{kebabCase this.componentName}}></{{kebabCase this.componentName}}>
5
- </rapid-layout-item>
6
- {{/each}}
2
+ {{#each route.tiles}}
3
+ <rapid-layout-item title="{{this.title}}">
4
+ <{{kebabCase this.componentName}}></{{kebabCase this.componentName}}>
5
+ </rapid-layout-item>
6
+ {{/each}}
7
7
  </rapid-layout-region>
@@ -1,18 +1,16 @@
1
1
  import { html } from '@genesislcap/web-core';
2
+ {{#if route.tiles}}
2
3
  import { persistLayout } from '../../utils';
4
+ {{/if}}
3
5
  import type { {{pascalCase route.name}} } from './{{kebabCase route.name}}';
4
6
  {{#each route.tiles}}
5
- import { {{pascalCase this.componentName}} } from './{{kebabCase this.title}}-{{this.componentType}}';
6
- {{/each}}
7
-
8
- {{#each route.tiles}}
9
- {{pascalCase this.componentName}};
7
+ import './{{kebabCase this.title}}-{{this.componentType}}';
10
8
  {{/each}}
11
9
 
12
10
  export const {{pascalCase route.name}}Template = html<{{pascalCase route.name}}>`
13
11
  {{#if route.tiles}}
14
12
  <rapid-layout auto-save-key="${() => persistLayout('{{route.layoutKey}}')}">
15
- {{> (lookup ./route 'layoutType') }}
13
+ {{> (lookup ./route 'layoutType') }}
16
14
  </rapid-layout>
17
15
  {{else}}
18
16
  <!-- insert template code here -->
@@ -1,20 +1,28 @@
1
+ {{#if listeners.length}}
1
2
  import { CriteriaBuilder, ExpressionBuilder, Serialisers } from '@genesislcap/foundation-criteria';
3
+ {{/if}}
2
4
  import { createSlice } from '@genesislcap/foundation-redux';
3
5
 
4
6
  export const eventingSlice = createSlice({
5
7
  name: 'eventing',
6
- {{#if events}}
7
- initialState: {
8
+ {{#if events.length}}
9
+ initialState: {
8
10
  {{#each events}}
9
- {{this}}: null{{#unless @last}},{{/unless}}
10
- {{/each}} },
11
+ {{this}}: null as Record<string, any> | null,
12
+ {{/each}}
13
+ },
11
14
  reducers: {
12
15
  {{#each events}}
13
16
  publish{{pascalCase this}}: (state, action) => {
14
17
  state.{{this}} = action.payload;
15
- }{{#unless @last}},{{/unless}}
18
+ },
16
19
  {{/each}}
17
20
  },
21
+ {{else}}
22
+ initialState: {},
23
+ reducers: {},
24
+ {{/if}}
25
+ {{#if listeners.length}}
18
26
  selectors: {
19
27
  {{#each listeners}}
20
28
  getCriteriaFor{{pascalCase tileName}}: (state) => {
@@ -24,21 +32,21 @@ export const eventingSlice = createSlice({
24
32
 
25
33
  {{#each mappings}}
26
34
  if (data.{{sourceField}}) {
27
- criteriaBuilder.And(new ExpressionBuilder()
28
- .withField('{{targetField}}')
29
- .withValue(data.{{sourceField}})
30
- .withSerialiser(Serialisers.EQ)
31
- .build());
35
+ criteriaBuilder.And(
36
+ new ExpressionBuilder()
37
+ .withField('{{targetField}}')
38
+ .withValue(data.{{sourceField}})
39
+ .withSerialiser(Serialisers.EQ)
40
+ .build(),
41
+ );
32
42
  }
33
43
  {{/each}}
34
44
 
35
45
  return criteriaBuilder.build();
36
- }{{#unless @last}},{{/unless}}
46
+ },
37
47
  {{/each}}
38
48
  },
39
- {{else}}
40
- initialState: {},
41
- reducers: {},
49
+ {{else}}
42
50
  selectors: {},
43
- {{/if}}
51
+ {{/if}}
44
52
  });
@@ -2,15 +2,7 @@ import { createStore } from '@genesislcap/foundation-redux';
2
2
  import { eventingSlice } from './slices/eventing.slice';
3
3
 
4
4
  export const { store, actions, selectors } = createStore([eventingSlice], {
5
- {{#if events}}
6
- eventing: {
7
- {{#each events}}
8
- {{this}}: null{{#unless @last}},{{/unless}}
9
- {{/each}}
10
- },
11
- {{else}}
12
- eventing: {},
13
- {{/if}}
5
+ eventing: eventingSlice.getInitialState(),
14
6
  });
15
7
 
16
8
  export type Store = typeof store;
@@ -1,7 +1,7 @@
1
1
  <rapid-layout-region type="tabs">
2
- {{#each route.tiles}}
3
- <rapid-layout-item title="{{this.title}}">
4
- <{{kebabCase this.componentName}}></{{kebabCase this.componentName}}>
5
- </rapid-layout-item>
6
- {{/each}}
2
+ {{#each route.tiles}}
3
+ <rapid-layout-item title="{{this.title}}">
4
+ <{{kebabCase this.componentName}}></{{kebabCase this.componentName}}>
5
+ </rapid-layout-item>
6
+ {{/each}}
7
7
  </rapid-layout-region>