@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
@@ -7,6 +7,7 @@ import {
7
7
  SimpleChanges,
8
8
  } from '@angular/core';
9
9
  import { layoutComponentImportsByName } from '../app.config';
10
+
10
11
  @Directive({
11
12
  selector: '[appLayoutLazyLoad]',
12
13
  })
@@ -6,28 +6,28 @@ import { ConnectionGuard } from './connection.guard';
6
6
  import { PermissionsGuard } from './permissions.guard';
7
7
 
8
8
  @Injectable({
9
- providedIn: 'root',
9
+ providedIn: 'root',
10
10
  })
11
11
  export class ChainedGuard implements CanActivate {
12
- protected user = getUser();
12
+ protected user = getUser();
13
13
 
14
- constructor(
15
- protected router: Router,
16
- protected connectionGuard: ConnectionGuard,
17
- protected authGuard: AuthGuard,
18
- protected permissionsGuard: PermissionsGuard
19
- ) {}
14
+ constructor(
15
+ protected router: Router,
16
+ protected connectionGuard: ConnectionGuard,
17
+ protected authGuard: AuthGuard,
18
+ protected permissionsGuard: PermissionsGuard,
19
+ ) {}
20
20
 
21
- async canActivate(route: ActivatedRouteSnapshot): Promise<boolean> {
22
- let result = await this.connectionGuard.canActivate();
23
- if (!result) {
24
- return false;
25
- }
26
- result = await this.authGuard.canActivate();
27
- if (!result) {
28
- return false;
29
- }
30
- result = await this.permissionsGuard.canActivate(route);
31
- return result;
21
+ async canActivate(route: ActivatedRouteSnapshot): Promise<boolean> {
22
+ let result = await this.connectionGuard.canActivate();
23
+ if (!result) {
24
+ return false;
32
25
  }
26
+ result = await this.authGuard.canActivate();
27
+ if (!result) {
28
+ return false;
29
+ }
30
+ result = await this.permissionsGuard.canActivate(route);
31
+ return result;
32
+ }
33
33
  }
@@ -1,21 +1,21 @@
1
1
  import { Injectable } from '@angular/core';
2
- import { CanActivate} from '@angular/router';
2
+ import { CanActivate } from '@angular/router';
3
3
  import { getConnect } from '@genesislcap/foundation-comms';
4
4
 
5
5
  @Injectable({
6
- providedIn: 'root'
6
+ providedIn: 'root',
7
7
  })
8
8
  export class ConnectionGuard implements CanActivate {
9
- protected connect = getConnect();
9
+ protected connect = getConnect();
10
10
 
11
- async canActivate(): Promise<boolean> {
12
- if (this.connect.isConnected) {
13
- return true;
14
- }
15
- const hostUrl = sessionStorage.getItem('hostUrl');
16
- if (!hostUrl) {
17
- return false;
18
- }
19
- return this.connect.connect(hostUrl);
11
+ async canActivate(): Promise<boolean> {
12
+ if (this.connect.isConnected) {
13
+ return true;
20
14
  }
15
+ const hostUrl = sessionStorage.getItem('hostUrl');
16
+ if (!hostUrl) {
17
+ return false;
18
+ }
19
+ return this.connect.connect(hostUrl);
20
+ }
21
21
  }
@@ -10,7 +10,7 @@ describe('BlankLayoutComponent', () => {
10
10
  beforeEach(() => {
11
11
  TestBed.configureTestingModule({
12
12
  declarations: [BlankLayoutComponent],
13
- schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
13
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
14
14
  });
15
15
  fixture = TestBed.createComponent(BlankLayoutComponent);
16
16
  component = fixture.componentInstance;
@@ -1,9 +1,5 @@
1
1
  import { Component, ElementRef, ViewChild, AfterViewInit } from '@angular/core';
2
- import {
3
- applyMode,
4
- injectThemeStyles,
5
- resolveInitialMode,
6
- } from '@genesislcap/rapid-design-system';
2
+ import { applyMode, injectThemeStyles, resolveInitialMode } from '@genesislcap/rapid-design-system';
7
3
  import { activeTheme } from '../../../styles/active-theme';
8
4
 
9
5
  @Component({
@@ -1,9 +1,9 @@
1
1
  <rapid-design-system-provider #designSystemProvider>
2
2
  <pbc-elements-renderer [target]="['layout-start']"></pbc-elements-renderer>
3
3
  <foundation-header
4
- {{#if headerLogoSrc}}
4
+ {{#if headerLogoSrc~}}
5
5
  logo-src="assets/{{headerLogoSrc}}"
6
- {{/if}}
6
+ {{~/if}}
7
7
  #foundationHeader
8
8
  [attr.show-luminance-toggle-button]="modeToggleEnabled"
9
9
  show-misc-toggle-button
@@ -11,8 +11,7 @@
11
11
  (logout-clicked)="onLogout()"
12
12
  [navigateTo]="navigateAngular"
13
13
  [routeNavItems]="navItems"
14
- >
15
- </foundation-header>
14
+ ></foundation-header>
16
15
  <section class="content">
17
16
  <pbc-elements-renderer [target]="['content-start']"></pbc-elements-renderer>
18
17
  <router-outlet></router-outlet>
@@ -1,7 +1,7 @@
1
+ import { ElementRef, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
1
2
  import { ComponentFixture, TestBed } from '@angular/core/testing';
2
3
  import { Router } from '@angular/router';
3
4
  import { DefaultLayoutComponent } from './default.layout';
4
- import { ElementRef, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
5
5
 
6
6
  class MockRouter {
7
7
  navigate = jest.fn();
@@ -22,9 +22,9 @@ describe('DefaultLayoutComponent', () => {
22
22
  declarations: [DefaultLayoutComponent],
23
23
  providers: [
24
24
  { provide: Router, useClass: MockRouter },
25
- { provide: ElementRef, useClass: MockElementRef }
25
+ { provide: ElementRef, useClass: MockElementRef },
26
26
  ],
27
- schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
27
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
28
28
  }).compileComponents();
29
29
  });
30
30
 
@@ -46,4 +46,4 @@ describe('DefaultLayoutComponent', () => {
46
46
  component.navigateAngular(path);
47
47
  expect(router.navigate).toHaveBeenCalledWith([path]);
48
48
  });
49
- });
49
+ });
@@ -7,10 +7,10 @@ import {
7
7
  nextMode,
8
8
  resolveInitialMode,
9
9
  } from '@genesislcap/rapid-design-system';
10
+ import { registerStylesTarget } from '../../../pbc/utils';
10
11
  import { activeTheme, modeToggleEnabled } from '../../../styles/active-theme';
11
12
  import { RouteService } from '../../services/route.service';
12
13
  import BaseLayout from '../base.layout';
13
- import { registerStylesTarget } from '../../../pbc/utils';
14
14
 
15
15
  @Component({
16
16
  selector: 'app-default-layout',
@@ -8,5 +8,4 @@ import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
8
8
  styleUrl: './auth-login.component.css',
9
9
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
10
10
  })
11
- export class AuthLoginComponent {
12
- }
11
+ export class AuthLoginComponent {}
@@ -1,4 +1,4 @@
1
1
  <app-error-message
2
- elementType="h1"
3
- message="You do not have permission to access this part of the application, please contact your administrator.">
4
- </app-error-message>
2
+ elementType="h1"
3
+ message="You do not have permission to access this part of the application, please contact your administrator."
4
+ ></app-error-message>
@@ -9,4 +9,4 @@
9
9
  h1 {
10
10
  text-align: center;
11
11
  color: var(--neutral-foreground-rest);
12
- }
12
+ }
@@ -1,7 +1,8 @@
1
1
  import { ComponentFixture, TestBed } from '@angular/core/testing';
2
2
  import { NotPermittedComponent } from './not-permitted.component';
3
3
 
4
- const MESSAGE_NOT_PERMITTED = 'You do not have permission to access this part of the application, please contact your administrator.';
4
+ const MESSAGE_NOT_PERMITTED =
5
+ 'You do not have permission to access this part of the application, please contact your administrator.';
5
6
 
6
7
  describe('NotPermittedComponent', () => {
7
8
  let component: NotPermittedComponent;
@@ -9,9 +10,8 @@ describe('NotPermittedComponent', () => {
9
10
 
10
11
  beforeEach(async () => {
11
12
  await TestBed.configureTestingModule({
12
- imports: [ NotPermittedComponent ]
13
- })
14
- .compileComponents();
13
+ imports: [NotPermittedComponent],
14
+ }).compileComponents();
15
15
  });
16
16
 
17
17
  beforeEach(() => {
@@ -29,4 +29,4 @@ describe('NotPermittedComponent', () => {
29
29
  const errorMessageElement = compiled.querySelector('app-error-message h1');
30
30
  expect(errorMessageElement.textContent).toBe(MESSAGE_NOT_PERMITTED);
31
31
  });
32
- });
32
+ });
@@ -4,10 +4,9 @@ import { ErrorMessageComponent } from '../../components/error-message/error-mess
4
4
  @Component({
5
5
  selector: 'app-not-permitted',
6
6
  standalone: true,
7
- imports: [ ErrorMessageComponent ],
7
+ imports: [ErrorMessageComponent],
8
8
  templateUrl: './not-permitted.component.html',
9
9
  styleUrls: ['./not-permitted.component.scss'],
10
- schemas: [ CUSTOM_ELEMENTS_SCHEMA ],
10
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
11
11
  })
12
- export class NotPermittedComponent {
13
- }
12
+ export class NotPermittedComponent {}
@@ -7,89 +7,94 @@ import { AUTH_PATH, NOT_PERMITTED_PATH } from '../app.config';
7
7
  import { ChainedGuard } from '../guards/chained.guard';
8
8
  import { AuthLoginComponent } from '../pages/auth-login/auth-login.component';
9
9
  import { NotPermittedComponent } from '../pages/not-permitted/not-permitted.component';
10
+ {{#if routes.length}}
11
+ // Route page imports are emitted in the order the routes are declared in the app definition.
12
+ /* eslint-disable import-es/order */
10
13
  {{#each routes}}
11
14
  import { {{pascalCase this.name}}Component } from '../pages/{{kebabCase this.name}}/{{kebabCase this.name}}.component';
12
15
  {{/each}}
16
+ /* eslint-enable import-es/order */
17
+ {{/if}}
13
18
 
14
19
  @Injectable({
15
- providedIn: 'root'
20
+ providedIn: 'root',
16
21
  })
17
22
  export class RouteService {
18
- static routes: Routes = [
19
- {
20
- path: '',
21
- redirectTo: `${AUTH_PATH}`,
22
- pathMatch: 'full',
23
- },
24
- {
25
- path: `${AUTH_PATH}`,
26
- component: AuthLoginComponent,
27
- },
28
- {
29
- path: `${NOT_PERMITTED_PATH}`,
30
- component: NotPermittedComponent,
31
- },
32
- {{#each routes}}
33
- {
34
- path: '{{kebabCase this.name}}',
35
- canActivate: [ChainedGuard],
36
- component: {{pascalCase this.name}}Component,
37
- data: {
38
- permissionCode: '{{this.permissions.viewRight}}',
39
- navItems: [
40
- {
41
- navId: 'header',
42
- title: '{{#if this.title}}{{sentenceCase this.title}}{{else}}{{sentenceCase this.name}}{{/if}}',
43
- icon: {
44
- name: '{{this.icon}}',
45
- variant: 'solid',
46
- },
47
- },
48
- ],
23
+ static routes: Routes = [
24
+ {
25
+ path: '',
26
+ redirectTo: `${AUTH_PATH}`,
27
+ pathMatch: 'full',
28
+ },
29
+ {
30
+ path: `${AUTH_PATH}`,
31
+ component: AuthLoginComponent,
32
+ },
33
+ {
34
+ path: `${NOT_PERMITTED_PATH}`,
35
+ component: NotPermittedComponent,
36
+ },
37
+ {{#each routes}}
38
+ {
39
+ path: '{{kebabCase this.name}}',
40
+ canActivate: [ChainedGuard],
41
+ component: {{pascalCase this.name}}Component,
42
+ data: {
43
+ permissionCode: '{{this.permissions.viewRight}}',
44
+ navItems: [
45
+ {
46
+ navId: 'header',
47
+ title: '{{#if this.title}}{{sentenceCase this.title}}{{else}}{{sentenceCase this.name}}{{/if}}',
48
+ icon: {
49
+ name: '{{this.icon}}',
50
+ variant: 'solid',
49
51
  },
50
- },
51
- {{/each}}
52
- ];
52
+ },
53
+ ],
54
+ },
55
+ },
56
+ {{/each}}
57
+ ];
53
58
 
54
- /**
55
- * @privateRemarks
56
- * The shell has access to context, so it's possible for it to return a pre-mapped framework variant of routes.
57
- * In this iteration we're doing it inline, given the angular version may move and here we know the shape we need.
58
- */
59
- pbcRoutes(): Routes {
60
- return getApp().routes.map((route) => {
61
- return <Route>{
62
- title: route.title,
63
- path: route.path,
64
- /**
65
- * Ask about permissions.viewRight in PBC context, as we may need to apply a data.permissionCode here.
66
- * Not sure if they are added to the filesystem prior to handlebars template processing across the files.
67
- */
68
- canActivate: [ChainedGuard],
69
- component: PBCContainer,
70
- data: {
71
- ...route.settings,
72
- pbcElement: route.element,
73
- // @ts-ignore
74
- pbcElementTag: route.elementTag,
75
- navItems: route.navItems
76
- },
77
- };
78
- })
79
- }
59
+ /**
60
+ * @privateRemarks
61
+ * The shell has access to context, so it's possible for it to return a pre-mapped framework variant of routes.
62
+ * In this iteration we're doing it inline, given the angular version may move and here we know the shape we need.
63
+ */
64
+ pbcRoutes(): Routes {
65
+ return getApp().routes.map((route) => {
66
+ return <Route>{
67
+ title: route.title,
68
+ path: route.path,
69
+ /**
70
+ * Ask about permissions.viewRight in PBC context, as we may need to apply a data.permissionCode here.
71
+ * Not sure if they are added to the filesystem prior to handlebars template processing across the files.
72
+ */
73
+ canActivate: [ChainedGuard],
74
+ component: PBCContainer,
75
+ data: {
76
+ ...route.settings,
77
+ pbcElement: route.element,
78
+ // @ts-ignore
79
+ pbcElementTag: route.elementTag,
80
+ navItems: route.navItems,
81
+ },
82
+ };
83
+ });
84
+ }
80
85
 
81
- allRoutes(): Routes {
82
- return [
83
- ...RouteService.routes,
84
- ...this.pbcRoutes(),
85
- ];
86
- }
86
+ allRoutes(): Routes {
87
+ return [...RouteService.routes, ...this.pbcRoutes()];
88
+ }
87
89
 
88
- getNavItems(): FoundationRouteNavItem[] {
89
- const allNavItems = this.allRoutes().flatMap(route => (<FoundationRoute>{
90
- path: route.path as string,
91
- navItems: route.data?.['navItems'],
92
- }));
93
- return getNavItems(allNavItems);
94
- }
90
+ getNavItems(): FoundationRouteNavItem[] {
91
+ const allNavItems = this.allRoutes().flatMap(
92
+ (route) =>
93
+ <FoundationRoute>{
94
+ path: route.path as string,
95
+ navItems: route.data?.['navItems'],
96
+ },
97
+ );
98
+ return getNavItems(allNavItems);
99
+ }
95
100
  }
@@ -7,7 +7,13 @@ import { AUTH_PATH } from '../app.config';
7
7
  /**
8
8
  * Configure the micro frontend
9
9
  */
10
- export const configureFoundationAuth = ({ router, connectService,}: { router: Router; connectService: Connect; }) => {
10
+ export const configureFoundationAuth = ({
11
+ router,
12
+ connectService,
13
+ }: {
14
+ router: Router;
15
+ connectService: Connect;
16
+ }) => {
11
17
  const baseElement = document.querySelector('base');
12
18
  const basePath = baseElement?.getAttribute('href') || '';
13
19
 
@@ -1,68 +1,66 @@
1
- import { EntityManagement } from '@genesislcap/foundation-entity-management';
2
- import { Filters, Form } from '@genesislcap/foundation-forms';
3
- import { foundationLayoutComponents } from '@genesislcap/foundation-layout';
4
- import { getApp } from '@genesislcap/foundation-shell/app';
5
- import * as zeroDesignSystem from '@genesislcap/foundation-zero';
6
- import { g2plotChartsComponents } from '@genesislcap/g2plot-chart';
7
- import * as rapidDesignSystem from '@genesislcap/rapid-design-system';
8
- import { rapidGridComponents, rapidGridPro, rapidGridProStyles } from '@genesislcap/rapid-grid-pro';
9
- import { css } from "@genesislcap/web-core";
10
-
11
- /**
12
- * Ensure tree shaking doesn't remove these.
13
- */
14
- EntityManagement;
15
- Filters;
16
- Form;
17
-
18
- /**
19
- * registerComponents.
20
- * @public
21
- */
22
- export async function registerComponents() {
23
- const { configure: configureHeader } = await import('@genesislcap/foundation-header/config');
24
- /**
25
- * Register any PBC components with the design system
26
- */
27
- getApp().registerComponents({
28
- designSystem: rapidDesignSystem,
29
- });
30
-
31
- rapidDesignSystem
32
- .provideDesignSystem()
33
- .register(
34
- rapidDesignSystem.baseComponents,
35
- rapidGridPro({
36
- styles: css`
37
- ${rapidGridProStyles}
38
- .ag-theme-genesis-rapid,
39
- .ag-theme-genesis-rapid-dark,
40
- .ag-theme-genesis-rapid-light {
41
- --ag-selected-row-background-color: var(--accent-fill-rest);
42
- }
43
- `,
44
- }),
45
- rapidGridComponents,
46
- g2plotChartsComponents,
47
- foundationLayoutComponents,
48
- );
49
-
50
- configureHeader({
51
- templateOptions: {
52
- provider: 'template',
53
- icon: 'rapid-icon',
54
- button: 'rapid-button',
55
- connectionIndicator: 'rapid-connection-indicator',
56
- select: 'rapid-select',
57
- option: 'rapid-option',
58
- flyout: 'rapid-flyout',
59
- },
60
- });
61
-
62
- /**
63
- * May be still required while we transition all PBCs to rapid. Remove when complete.
64
- */
65
- zeroDesignSystem
66
- .provideDesignSystem()
67
- .register(zeroDesignSystem.baseComponents, g2plotChartsComponents, foundationLayoutComponents);
68
- }
1
+ import { EntityManagement } from '@genesislcap/foundation-entity-management';
2
+ import { Filters, Form } from '@genesislcap/foundation-forms';
3
+ import { foundationLayoutComponents } from '@genesislcap/foundation-layout';
4
+ import { getApp } from '@genesislcap/foundation-shell/app';
5
+ import * as zeroDesignSystem from '@genesislcap/foundation-zero';
6
+ import { g2plotChartsComponents } from '@genesislcap/g2plot-chart';
7
+ import * as rapidDesignSystem from '@genesislcap/rapid-design-system';
8
+ import { rapidGridComponents, rapidGridPro, rapidGridProStyles } from '@genesislcap/rapid-grid-pro';
9
+ import { css } from '@genesislcap/web-core';
10
+
11
+ /**
12
+ * Ensure tree shaking doesn't remove these.
13
+ */
14
+ EntityManagement;
15
+ Filters;
16
+ Form;
17
+
18
+ /**
19
+ * registerComponents.
20
+ * @public
21
+ */
22
+ export async function registerComponents() {
23
+ const { configure: configureHeader } = await import('@genesislcap/foundation-header/config');
24
+ /**
25
+ * Register any PBC components with the design system
26
+ */
27
+ getApp().registerComponents({
28
+ designSystem: rapidDesignSystem,
29
+ });
30
+
31
+ rapidDesignSystem.provideDesignSystem().register(
32
+ rapidDesignSystem.baseComponents,
33
+ rapidGridPro({
34
+ styles: css`
35
+ ${rapidGridProStyles}
36
+ .ag-theme-genesis-rapid,
37
+ .ag-theme-genesis-rapid-dark,
38
+ .ag-theme-genesis-rapid-light {
39
+ --ag-selected-row-background-color: var(--accent-fill-rest);
40
+ }
41
+ `,
42
+ }),
43
+ rapidGridComponents,
44
+ g2plotChartsComponents,
45
+ foundationLayoutComponents,
46
+ );
47
+
48
+ configureHeader({
49
+ templateOptions: {
50
+ provider: 'template',
51
+ icon: 'rapid-icon',
52
+ button: 'rapid-button',
53
+ connectionIndicator: 'rapid-connection-indicator',
54
+ select: 'rapid-select',
55
+ option: 'rapid-option',
56
+ flyout: 'rapid-flyout',
57
+ },
58
+ });
59
+
60
+ /**
61
+ * May be still required while we transition all PBCs to rapid. Remove when complete.
62
+ */
63
+ zeroDesignSystem
64
+ .provideDesignSystem()
65
+ .register(zeroDesignSystem.baseComponents, g2plotChartsComponents, foundationLayoutComponents);
66
+ }
@@ -1,3 +1,5 @@
1
+ {{#if FDC3.includeDependencies}}
2
+ export * from './fdc3';
3
+ {{/if}}
1
4
  export * from './getLayoutNameByRoute';
2
5
  export * from './permissions';
3
- export * from './fdc3';
@@ -1,7 +1,7 @@
1
- import { User } from '@genesislcap/foundation-user';
2
-
3
- export const getViewUpdateRightComponent = (
4
- user: User,
5
- right: string,
6
- event: string | boolean = true,
7
- ) => (!right || user.hasPermission(right) ? event : '');
1
+ import { User } from '@genesislcap/foundation-user';
2
+
3
+ export const getViewUpdateRightComponent = (
4
+ user: User,
5
+ right: string,
6
+ event: string | boolean = true,
7
+ ) => (!right || user.hasPermission(right) ? event : '');
@@ -1,4 +1,4 @@
1
- declare module "*.svg" {
1
+ declare module '*.svg' {
2
2
  const content: any;
3
3
  export default content;
4
4
  }
@@ -5,5 +5,5 @@ export const environment = {
5
5
  ENABLE_SSO: {{enableSSO}},
6
6
  HOST: 'localhost',
7
7
  PROTOCOL: 'http',
8
- BUILDER: 'webpack'
8
+ BUILDER: 'webpack',
9
9
  };
@@ -64,3 +64,11 @@ if (!('adoptedStyleSheets' in document)) {
64
64
  value: [],
65
65
  });
66
66
  }
67
+
68
+ // jsdom lacks structuredClone, which the design-system theme merge uses
69
+ if (typeof globalThis.structuredClone === 'undefined') {
70
+ Object.defineProperty(globalThis, 'structuredClone', {
71
+ writable: true,
72
+ value: (value: unknown) => JSON.parse(JSON.stringify(value)),
73
+ });
74
+ }
@@ -12,6 +12,6 @@ function bootstrapApp() {
12
12
  }
13
13
 
14
14
  registerPBCs()
15
- .then(hasAssets => logger.debug(hasAssets ? 'PBCs registered' : 'No PBCs detected'))
15
+ .then((hasAssets) => logger.debug(hasAssets ? 'PBCs registered' : 'No PBCs detected'))
16
16
  .catch((err) => logger.error(err))
17
- .finally(bootstrapApp)
17
+ .finally(bootstrapApp);