@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.
- package/.genx/configure.js +11 -1
- package/.genx/package.json +1 -1
- package/.genx/scripts/generate-test-apps.sh +124 -0
- package/.genx/templates/angular/chart.hbs +19 -7
- package/.genx/templates/angular/component/component.column.defs.hbs +16 -4
- package/.genx/templates/angular/component/component.create.form.hbs +10 -2
- package/.genx/templates/angular/component/component.events.config.hbs +31 -6
- package/.genx/templates/angular/component/component.filter.form.hbs +1 -2
- package/.genx/templates/angular/component/component.gridOptions.hbs +15 -3
- package/.genx/templates/angular/component/component.hbs +77 -46
- package/.genx/templates/angular/component/component.index.hbs +1 -1
- package/.genx/templates/angular/component/component.update.form.hbs +1 -1
- package/.genx/templates/angular/entityManager.hbs +6 -6
- package/{client-tmp/angular/src/app/utils/fdc3.ts → .genx/templates/angular/fdc3.ts.hbs} +6 -8
- package/.genx/templates/angular/form.hbs +9 -12
- package/.genx/templates/angular/grid.hbs +43 -40
- package/.genx/templates/angular/route.hbs +8 -2
- package/.genx/templates/angular/route.template.hbs +7 -7
- package/.genx/templates/angular/slices/eventing.slice.hbs +21 -10
- package/.genx/templates/angular/store.hbs +1 -5
- package/.genx/templates/angular/tabsPanel.hbs +2 -2
- package/.genx/templates/react/chart.hbs +6 -15
- package/.genx/templates/react/component/component.column.defs.hbs +16 -10
- package/.genx/templates/react/component/component.create.form.hbs +2 -2
- package/.genx/templates/react/component/component.events.config.hbs +32 -5
- package/.genx/templates/react/component/component.filter.form.hbs +1 -2
- package/.genx/templates/react/component/component.gridOptions.hbs +17 -11
- package/.genx/templates/react/component/component.hbs +84 -42
- package/.genx/templates/react/component/component.update.form.hbs +1 -1
- package/.genx/templates/react/entityManager.hbs +8 -16
- package/{client-tmp/react/src/utils/fdc3.ts → .genx/templates/react/fdc3.ts.hbs} +7 -8
- package/.genx/templates/react/form.hbs +1 -15
- package/.genx/templates/react/grid.hbs +11 -11
- package/.genx/templates/react/gridLayout.hbs +44 -4
- package/.genx/templates/react/horizontalLayout.hbs +10 -1
- package/.genx/templates/react/route.hbs +21 -14
- package/.genx/templates/react/slices/eventing.slice.hbs +19 -8
- package/.genx/templates/react/store.hbs +1 -5
- package/.genx/templates/react/tabsLayout.hbs +5 -1
- package/.genx/templates/web-components/chart.hbs +25 -25
- package/.genx/templates/web-components/component/component.column.defs.hbs +11 -3
- package/.genx/templates/web-components/component/component.create.form.hbs +11 -4
- package/.genx/templates/web-components/component/component.events.config.hbs +33 -6
- package/.genx/templates/web-components/component/component.filter.form.hbs +1 -2
- package/.genx/templates/web-components/component/component.gridOptions.hbs +12 -3
- package/.genx/templates/web-components/component/component.hbs +19 -20
- package/.genx/templates/web-components/component/component.index.hbs +1 -1
- package/.genx/templates/web-components/component/component.template.hbs +9 -13
- package/.genx/templates/web-components/component/component.update.form.hbs +1 -1
- package/.genx/templates/web-components/entityManager.hbs +92 -73
- package/{client-tmp/web-components/src/utils/fdc3.ts → .genx/templates/web-components/fdc3.ts.hbs} +6 -7
- package/.genx/templates/web-components/form.hbs +16 -15
- package/.genx/templates/web-components/grid.hbs +49 -41
- package/.genx/templates/web-components/gridLayout.hbs +32 -28
- package/.genx/templates/web-components/horizontalLayout.hbs +5 -5
- package/.genx/templates/web-components/route.template.hbs +4 -6
- package/.genx/templates/web-components/slices/eventing.slice.hbs +23 -15
- package/.genx/templates/web-components/store.hbs +1 -9
- package/.genx/templates/web-components/tabsLayout.hbs +5 -5
- package/.genx/tests/fixtures/routes-full.json +299 -0
- package/.genx/tests/fixtures/testapp/client/src/pages/Home/Home.tsx +12 -0
- package/.genx/utils/formatJSONValue.js +38 -2
- package/.genx/utils/formatRouteData.js +67 -18
- package/.genx/utils/generateTile.js +10 -1
- package/.genx/utils/gridSerializers.js +63 -23
- package/.genx/utils/registerPartials.js +15 -12
- package/.genx/utils/toJsStringLiteral.js +37 -0
- package/.github/workflows/build.yml +22 -1
- package/.github/workflows/release.yaml +96 -0
- package/.husky/pre-commit +8 -0
- package/.releaserc +1 -1
- package/CHANGELOG.md +23 -0
- package/client-tmp/angular/.oxfmtrc.json +32 -0
- package/client-tmp/angular/.oxlintrc.json +4 -0
- package/client-tmp/angular/README.md +4 -4
- package/client-tmp/angular/jest.config.js +1 -1
- package/client-tmp/angular/lint-css.js +24 -3
- package/client-tmp/angular/oxlint-staged.js +45 -0
- package/client-tmp/angular/package.json +19 -9
- package/client-tmp/angular/playwright.config.ts +12 -11
- package/client-tmp/angular/src/app/app.component.html +0 -1
- package/client-tmp/angular/src/app/app.component.ts +8 -9
- package/client-tmp/angular/src/app/app.config.ts +2 -2
- package/client-tmp/angular/src/app/app.module.ts +6 -5
- package/client-tmp/angular/src/app/components/error-message/error-message.component.html +29 -15
- package/client-tmp/angular/src/app/components/error-message/error-message.component.spec.ts +2 -2
- package/client-tmp/angular/src/app/components/error-message/error-message.component.ts +3 -5
- package/client-tmp/angular/src/app/directive/app-lazy-load.directive.ts +1 -0
- package/client-tmp/angular/src/app/guards/chained.guard.ts +19 -19
- package/client-tmp/angular/src/app/guards/connection.guard.ts +12 -12
- package/client-tmp/angular/src/app/layouts/blank/blank.layout.spec.ts +1 -1
- package/client-tmp/angular/src/app/layouts/blank/blank.layout.ts +1 -5
- package/client-tmp/angular/src/app/layouts/default/default.layout.html +3 -4
- package/client-tmp/angular/src/app/layouts/default/default.layout.spec.ts +4 -4
- package/client-tmp/angular/src/app/layouts/default/default.layout.ts +1 -1
- package/client-tmp/angular/src/app/pages/auth-login/auth-login.component.ts +1 -2
- package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.html +3 -3
- package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.scss +1 -1
- package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.spec.ts +5 -5
- package/client-tmp/angular/src/app/pages/not-permitted/not-permitted.component.ts +3 -4
- package/client-tmp/angular/src/app/services/route.service.ts +79 -74
- package/client-tmp/angular/src/app/share/foundation-auth.ts +7 -1
- package/client-tmp/angular/src/app/share/genesis-components.ts +66 -68
- package/client-tmp/angular/src/app/utils/index.ts +3 -1
- package/client-tmp/angular/src/app/utils/permissions.ts +7 -7
- package/client-tmp/angular/src/declaration.d.ts +1 -1
- package/client-tmp/angular/src/environments/environment.ts +1 -1
- package/client-tmp/angular/src/jest.setup.ts +8 -0
- package/client-tmp/angular/src/main.ts +2 -2
- package/client-tmp/angular/src/pbc/container.ts +28 -26
- package/client-tmp/angular/src/pbc/elementsRenderer.ts +49 -39
- package/client-tmp/angular/src/pbc/utils.ts +61 -60
- package/client-tmp/angular/src/styles/_mixins.scss +7 -8
- package/client-tmp/angular/src/styles/styles.css +6 -6
- package/client-tmp/angular/test/e2e/fixture.ts +2 -2
- package/client-tmp/angular/test/e2e/flows/001-protected.e2e.ts +1 -1
- package/client-tmp/angular/tsconfig.app.json +2 -8
- package/client-tmp/angular/tsconfig.json +1 -4
- package/client-tmp/angular/tsconfig.spec.json +4 -11
- package/client-tmp/angular/webpack.dev.config.js +3 -4
- package/client-tmp/angular/webpack.prod.config.js +3 -4
- package/client-tmp/angular/webpack.shared.config.js +20 -24
- package/client-tmp/react/.oxfmtrc.json +30 -0
- package/client-tmp/react/.oxlintrc.json +4 -0
- package/client-tmp/react/README.md +4 -4
- package/client-tmp/react/jest.config.ts +8 -4
- package/client-tmp/react/jest.setup.ts +85 -1
- package/client-tmp/react/oxlint-staged.js +45 -0
- package/client-tmp/react/package.json +24 -9
- package/client-tmp/react/playwright.config.ts +11 -10
- package/client-tmp/react/src/App.tsx +27 -29
- package/client-tmp/react/src/__mocks__/fileMock.js +1 -0
- package/client-tmp/react/src/components/ErrorMessage/ErrorMessage.test.tsx +16 -4
- package/client-tmp/react/src/components/ErrorMessage/ErrorMessage.tsx +32 -29
- package/client-tmp/react/src/components/error-boundary/ErrorBoundary.tsx +15 -6
- package/client-tmp/react/src/components/routes/AppRoutes.tsx +1 -1
- package/client-tmp/react/src/components/single-component/registry.ts +4 -0
- package/client-tmp/react/src/custom-elements.d.ts +4 -2
- package/client-tmp/react/src/helpers/hasPermissionHelper.tsx +1 -1
- package/client-tmp/react/src/helpers/isAuthenticatedHelper.tsx +1 -1
- package/client-tmp/react/src/helpers/isConnectedHelper.tsx +3 -3
- package/client-tmp/react/src/layouts/blank/BlankLayout.tsx +7 -11
- package/client-tmp/react/src/layouts/default/DefaultLayout.tsx +8 -8
- package/client-tmp/react/src/main.tsx +11 -11
- package/client-tmp/react/src/pages/AuthPage/AuthPage.test.tsx +13 -2
- package/client-tmp/react/src/pages/AuthPage/AuthPage.tsx +14 -13
- package/client-tmp/react/src/pages/NotFoundPage/NotFoundPage.tsx +2 -7
- package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.test.tsx +8 -4
- package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.tsx +1 -1
- package/client-tmp/react/src/pbc/container.tsx +9 -4
- package/client-tmp/react/src/pbc/elementsRenderer.tsx +13 -7
- package/client-tmp/react/src/pbc/utils.ts +60 -59
- package/client-tmp/react/src/services/auth.service.ts +1 -1
- package/client-tmp/react/src/services/store.service.ts +5 -3
- package/client-tmp/react/src/share/foundation-login.ts +2 -2
- package/client-tmp/react/src/share/genesis-components.ts +46 -47
- package/client-tmp/react/src/store/AuthContext.tsx +2 -10
- package/client-tmp/react/src/store/RoutesContext.test.tsx +99 -0
- package/client-tmp/react/src/store/RoutesContext.tsx +25 -5
- package/client-tmp/react/src/styles/styles.css +7 -7
- package/client-tmp/react/src/types/LayoutName.ts +1 -1
- package/client-tmp/react/src/utils/getLayoutNameByRoute.ts +1 -1
- package/client-tmp/react/src/utils/index.ts +2 -0
- package/client-tmp/react/src/utils/layout.ts +8 -1
- package/client-tmp/react/src/utils/permissions.ts +7 -7
- package/client-tmp/react/src/utils/useDocumentTitle.ts +5 -6
- package/client-tmp/react/test/e2e/fixture.ts +5 -2
- package/client-tmp/react/test/e2e/flows/001-protected.e2e.ts +3 -1
- package/client-tmp/react/tsconfig.app.json +1 -1
- package/client-tmp/react/tsconfig.json +1 -5
- package/client-tmp/web-components/.oxfmtrc.json +30 -0
- package/client-tmp/web-components/.oxlintrc.json +4 -0
- package/client-tmp/web-components/oxlint-staged.js +45 -0
- package/client-tmp/web-components/package.json +14 -22
- package/client-tmp/web-components/src/components/components.ts +9 -7
- package/client-tmp/web-components/src/main/main.css +1 -2
- package/client-tmp/web-components/src/main/main.ts +1 -1
- package/client-tmp/web-components/src/routes/config.ts +4 -0
- package/client-tmp/web-components/src/utils/index.ts +2 -0
- package/client-tmp/web-components/tsconfig.json +1 -4
- package/package.json +1 -1
- package/.genx/templates/angular/gridLayout.hbs +0 -30
- package/.genx/templates/angular/horizontalLayout.hbs +0 -7
- package/.genx/templates/angular/tabsLayout.hbs +0 -7
- package/.genx/tests/fixtures/testapp/client/src/routes/home/home.template.ts +0 -6
- package/.github/workflows/release.yml +0 -50
- package/client-tmp/react/.babelrc +0 -10
- package/client-tmp/react/.eslintrc.cjs +0 -21
- package/client-tmp/react/git +0 -0
- package/client-tmp/react/webpack.config.js +0 -121
- package/client-tmp/web-components/.prettierignore +0 -14
|
@@ -6,28 +6,28 @@ import { ConnectionGuard } from './connection.guard';
|
|
|
6
6
|
import { PermissionsGuard } from './permissions.guard';
|
|
7
7
|
|
|
8
8
|
@Injectable({
|
|
9
|
-
|
|
9
|
+
providedIn: 'root',
|
|
10
10
|
})
|
|
11
11
|
export class ChainedGuard implements CanActivate {
|
|
12
|
-
|
|
12
|
+
protected user = getUser();
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
constructor(
|
|
15
|
+
protected router: Router,
|
|
16
|
+
protected connectionGuard: ConnectionGuard,
|
|
17
|
+
protected authGuard: AuthGuard,
|
|
18
|
+
protected permissionsGuard: PermissionsGuard,
|
|
19
|
+
) {}
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
6
|
+
providedIn: 'root',
|
|
7
7
|
})
|
|
8
8
|
export class ConnectionGuard implements CanActivate {
|
|
9
|
-
|
|
9
|
+
protected connect = getConnect();
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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: [
|
|
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
|
-
{{
|
|
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: [
|
|
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',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
<app-error-message
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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>
|
|
@@ -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 =
|
|
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: [
|
|
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: [
|
|
7
|
+
imports: [ErrorMessageComponent],
|
|
8
8
|
templateUrl: './not-permitted.component.html',
|
|
9
9
|
styleUrls: ['./not-permitted.component.scss'],
|
|
10
|
-
schemas: [
|
|
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
|
-
|
|
20
|
+
providedIn: 'root',
|
|
16
21
|
})
|
|
17
22
|
export class RouteService {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
52
|
-
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{{/each}}
|
|
57
|
+
];
|
|
53
58
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
...this.pbcRoutes(),
|
|
85
|
-
];
|
|
86
|
-
}
|
|
86
|
+
allRoutes(): Routes {
|
|
87
|
+
return [...RouteService.routes, ...this.pbcRoutes()];
|
|
88
|
+
}
|
|
87
89
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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 = ({
|
|
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
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
.ag-theme-genesis-rapid
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
zeroDesignSystem
|
|
66
|
-
|
|
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,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 : '');
|
|
@@ -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);
|