@genesislcap/blank-app-seed 5.7.0-prerelease.4 → 5.7.0-prerelease.40
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 +114 -0
- package/.genx/package.json +5 -2
- package/.genx/prompts/api.js +25 -0
- package/.genx/prompts/ui.js +12 -0
- package/.genx/prompts.js +8 -2
- package/.genx/static.js +1 -0
- package/.genx/templates/angular/component/component.hbs +31 -3
- package/.genx/templates/angular/entityManager.hbs +17 -6
- package/.genx/templates/angular/grid.hbs +5 -2
- package/.genx/templates/angular/slices/eventing.slice.hbs +41 -0
- package/.genx/templates/angular/store.hbs +14 -0
- package/.genx/templates/angular/tabsLayout.hbs +1 -1
- package/.genx/templates/react/component/component.hbs +84 -15
- package/.genx/templates/react/entityManager.hbs +11 -17
- package/.genx/templates/react/grid.hbs +5 -9
- package/.genx/templates/react/gridLayout.hbs +4 -4
- package/.genx/templates/react/horizontalLayout.hbs +1 -1
- package/.genx/templates/react/route.hbs +12 -1
- package/.genx/templates/react/slices/eventing.slice.hbs +39 -0
- package/.genx/templates/react/store.hbs +22 -0
- package/.genx/templates/react/tabsLayout.hbs +2 -2
- package/.genx/templates/web-components/component/component.hbs +26 -0
- package/.genx/templates/web-components/entityManager.hbs +17 -9
- package/.genx/templates/web-components/grid.hbs +13 -5
- package/.genx/templates/web-components/slices/eventing.slice.hbs +44 -0
- package/.genx/templates/web-components/store.hbs +18 -0
- package/.genx/utils/fontUtils.js +75 -0
- package/.genx/utils/formatRouteData.js +5 -0
- package/.genx/utils/generateRoute.js +1 -1
- package/.genx/utils/generateStore.js +98 -0
- package/.genx/utils/index.js +4 -0
- package/.genx/versions.json +3 -3
- package/.github/CODEOWNERS +1 -1
- package/.github/pull_request_template.md +6 -0
- package/.github/workflows/upgrade.yml +0 -1
- package/CHANGELOG.md +299 -0
- package/client-tmp/angular/package.json +5 -0
- package/client-tmp/angular/src/app/app.component.ts +2 -31
- package/client-tmp/angular/src/app/app.module.ts +3 -0
- package/client-tmp/angular/src/app/layouts/default/default.layout.css +8 -0
- package/client-tmp/angular/src/app/layouts/default/default.layout.html +3 -0
- package/client-tmp/angular/src/app/share/genesis-components.ts +12 -1
- package/client-tmp/angular/src/styles/design-tokens.json +5 -1
- package/client-tmp/angular/src/styles/styles.css +15 -1
- package/client-tmp/react/index.html +0 -1
- package/client-tmp/react/package.json +17 -28
- package/client-tmp/react/public/index.html +3 -1
- package/client-tmp/react/src/App.tsx +40 -20
- package/client-tmp/react/src/components/routes/AppRoutes.tsx +4 -4
- package/client-tmp/react/src/config.ts +1 -1
- package/client-tmp/react/src/layouts/blank/BlankLayout.tsx +1 -1
- package/client-tmp/react/src/layouts/default/DefaultLayout.module.css +8 -0
- package/client-tmp/react/src/layouts/default/DefaultLayout.tsx +15 -4
- package/client-tmp/react/src/main.tsx +1 -1
- package/client-tmp/react/src/pages/AuthPage/AuthPage.tsx +1 -1
- package/client-tmp/react/src/pages/NotFoundPage/NotFoundPage.tsx +1 -1
- package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.test.tsx +1 -1
- package/client-tmp/react/src/pages/NotPermittedPage/NotPermittedPage.tsx +1 -1
- package/client-tmp/react/src/pbc/container.tsx +1 -1
- package/client-tmp/react/src/services/store.service.ts +20 -9
- package/client-tmp/react/src/share/foundation-login.ts +2 -2
- package/client-tmp/react/src/share/genesis-components.ts +12 -1
- package/client-tmp/react/src/store/RoutesContext.tsx +8 -7
- package/client-tmp/react/src/styles/design-tokens.json +5 -1
- package/client-tmp/react/src/styles/styles.css +15 -1
- package/client-tmp/react/src/utils/getLayoutNameByRoute.ts +1 -1
- package/client-tmp/react/src/utils/goldenLayout.helper.ts +59 -0
- package/client-tmp/react/src/utils/useDocumentTitle.ts +46 -0
- package/client-tmp/react/test/e2e/fixture.ts +1 -1
- package/client-tmp/web-components/package.json +4 -0
- package/client-tmp/web-components/src/components/components.ts +18 -9
- package/client-tmp/web-components/src/layouts/default.ts +12 -2
- package/client-tmp/web-components/src/main/main.css +12 -0
- package/client-tmp/web-components/src/main/main.template.ts +0 -1
- package/client-tmp/web-components/src/main/main.ts +1 -34
- package/client-tmp/web-components/src/routes/config.ts +5 -6
- package/client-tmp/web-components/src/styles/design-tokens.json +5 -1
- package/client-tmp/web-components/src/styles/typography.ts +6 -4
- package/package.json +1 -1
- package/server/settings.gradle.kts +0 -3
- package/client-tmp/angular/src/app/store/store.ts +0 -34
- package/client-tmp/react/lint-css.ts +0 -19
- package/client-tmp/react/vite.config.ts +0 -70
- package/client-tmp/web-components/src/store/store.ts +0 -29
|
@@ -7,26 +7,20 @@ import {
|
|
|
7
7
|
onFDC3Ready,
|
|
8
8
|
{{/if}}
|
|
9
9
|
} from './utils';
|
|
10
|
-
import { customEventFactory, registerStylesTarget } from '
|
|
10
|
+
import { customEventFactory, registerStylesTarget } from './pbc/utils';
|
|
11
11
|
import { RoutesProvider } from './store/RoutesContext';
|
|
12
12
|
import { registerComponents as genesisRegisterComponents } from './share/genesis-components';
|
|
13
|
-
import { storeService } from '
|
|
13
|
+
import { storeService } from './services/store.service';
|
|
14
14
|
import AppRoutes from './components/routes/AppRoutes';
|
|
15
15
|
import NotFoundPage from "@/pages/NotFoundPage/NotFoundPage.tsx";
|
|
16
|
-
|
|
16
|
+
import { reduxStore } from './store/store';
|
|
17
|
+
import { Provider } from 'react-redux';
|
|
17
18
|
|
|
18
19
|
interface AppProps {
|
|
19
20
|
rootElement: HTMLElement;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
const App: React.FC<AppProps> = ({ rootElement }) => {
|
|
23
|
-
const [isStoreConnected, setIsStoreConnected] = useState(false);
|
|
24
|
-
const dispatchCustomEvent = (type: string, detail?: any) => {
|
|
25
|
-
rootElement.dispatchEvent(customEventFactory(type, detail));
|
|
26
|
-
};
|
|
27
|
-
const handleStoreConnected = (event: CustomEvent) => {
|
|
28
|
-
storeService.onConnected(event);
|
|
29
|
-
};
|
|
30
24
|
{{#if FDC3.channels.length~}}
|
|
31
25
|
const FDC3ReadyHandler = () => {
|
|
32
26
|
{{#each FDC3.channels}}
|
|
@@ -38,15 +32,31 @@ const App: React.FC<AppProps> = ({ rootElement }) => {
|
|
|
38
32
|
{{/each}}
|
|
39
33
|
};
|
|
40
34
|
{{/if}}
|
|
35
|
+
const [isStoreConnected, setIsStoreConnected] = useState(false);
|
|
36
|
+
const [componentsReady, setComponentsReady] = useState(false);
|
|
37
|
+
const dispatchCustomEvent = (type: string, detail?: any) => {
|
|
38
|
+
rootElement.dispatchEvent(customEventFactory(type, detail));
|
|
39
|
+
};
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
const handleStoreConnected = (event: CustomEvent) => {
|
|
42
|
+
storeService.onConnected(event);
|
|
43
|
+
};
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
let mounted = true;
|
|
46
|
+
setApiHost();
|
|
47
|
+
(async () => {
|
|
48
|
+
await genesisRegisterComponents();
|
|
49
|
+
if (mounted) {
|
|
50
|
+
setComponentsReady(true);
|
|
51
|
+
}
|
|
52
|
+
})();
|
|
53
|
+
return () => {
|
|
54
|
+
mounted = false;
|
|
55
|
+
};
|
|
56
|
+
}, []);
|
|
44
57
|
|
|
45
58
|
useEffect(() => {
|
|
46
59
|
registerStylesTarget(document.body, 'main');
|
|
47
|
-
{{#if FDC3.channels.length~}}
|
|
48
|
-
onFDC3Ready(FDC3ReadyHandler);
|
|
49
|
-
{{/if}}
|
|
50
60
|
if (!isStoreConnected) {
|
|
51
61
|
rootElement.addEventListener('store-connected', handleStoreConnected);
|
|
52
62
|
dispatchCustomEvent('store-connected', rootElement);
|
|
@@ -60,17 +70,27 @@ const App: React.FC<AppProps> = ({ rootElement }) => {
|
|
|
60
70
|
dispatchCustomEvent('store-disconnected');
|
|
61
71
|
}
|
|
62
72
|
};
|
|
73
|
+
{{#if FDC3.channels.length~}}
|
|
74
|
+
onFDC3Ready(FDC3ReadyHandler);
|
|
75
|
+
{{/if}}
|
|
76
|
+
|
|
63
77
|
}, [isStoreConnected]);
|
|
64
78
|
|
|
65
79
|
const baseElement = document.querySelector('base');
|
|
66
80
|
const basePath = baseElement?.getAttribute('href') || '';
|
|
67
81
|
|
|
82
|
+
if (!componentsReady) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
68
86
|
return (
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
87
|
+
<Provider store={reduxStore}>
|
|
88
|
+
<RoutesProvider>
|
|
89
|
+
<Router basename={basePath}>
|
|
90
|
+
<AppRoutes />
|
|
91
|
+
</Router>
|
|
92
|
+
</RoutesProvider>
|
|
93
|
+
</Provider>
|
|
74
94
|
);
|
|
75
95
|
};
|
|
76
96
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Routes, Route, Navigate } from 'react-router-dom';
|
|
2
2
|
import AuthPage from '../../pages/AuthPage/AuthPage';
|
|
3
|
-
import {{pascalCase routes.[0].name}} from '
|
|
3
|
+
import {{pascalCase routes.[0].name}} from '../../pages/{{pascalCase routes.[0].name}}/{{pascalCase routes.[0].name}}';
|
|
4
4
|
import DefaultLayout from '../../layouts/default/DefaultLayout';
|
|
5
5
|
import ProtectedRoute from './ProtectedRoute';
|
|
6
|
-
import { useRoutesContext } from '
|
|
7
|
-
import PBCContainer from '
|
|
8
|
-
import NotFoundPage from '
|
|
6
|
+
import { useRoutesContext } from '../../store/RoutesContext';
|
|
7
|
+
import PBCContainer from '../../pbc/container';
|
|
8
|
+
import NotFoundPage from '../../pages/NotFoundPage/NotFoundPage.tsx';
|
|
9
9
|
|
|
10
10
|
const AppRoutes = () => {
|
|
11
11
|
const routes = useRoutesContext();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { ReactNode, useEffect, useRef } from 'react';
|
|
2
2
|
import { configureDesignSystem } from '@genesislcap/foundation-ui';
|
|
3
3
|
import styles from './BlankLayout.module.css';
|
|
4
|
-
import * as designTokens from '
|
|
4
|
+
import * as designTokens from '../../styles/design-tokens.json';
|
|
5
5
|
|
|
6
6
|
interface BlankLayoutProps {
|
|
7
7
|
children: ReactNode;
|
|
@@ -17,6 +17,14 @@
|
|
|
17
17
|
border: none;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
.default-layout foundation-header::part(logo) {
|
|
21
|
+
max-width: 50px;
|
|
22
|
+
max-height: 24px;
|
|
23
|
+
width: auto;
|
|
24
|
+
height: auto;
|
|
25
|
+
object-fit: contain;
|
|
26
|
+
}
|
|
27
|
+
|
|
20
28
|
.routes-wrapper {
|
|
21
29
|
display: flex;
|
|
22
30
|
gap: calc(var(--design-unit) * 2px);
|
|
@@ -6,10 +6,12 @@ import {
|
|
|
6
6
|
StandardLuminance,
|
|
7
7
|
} from '@microsoft/fast-components';
|
|
8
8
|
import styles from './DefaultLayout.module.css';
|
|
9
|
-
import PBCElementsRenderer from '
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
9
|
+
import PBCElementsRenderer from '../../pbc/elementsRenderer';
|
|
10
|
+
import { registerStylesTarget } from '../../pbc/utils';
|
|
11
|
+
import * as designTokens from '../../styles/design-tokens.json';
|
|
12
|
+
import { useRoutesContext } from '../../store/RoutesContext';
|
|
13
|
+
import { useDocumentTitle } from '../../utils/useDocumentTitle';
|
|
14
|
+
import { AUTH_PATH } from '../../config';
|
|
13
15
|
import { LOGOUT_URL } from '@genesislcap/foundation-utils';
|
|
14
16
|
|
|
15
17
|
interface DefaultLayoutProps {}
|
|
@@ -30,6 +32,8 @@ const DefaultLayout: React.FC<DefaultLayoutProps> = () => {
|
|
|
30
32
|
navItems: route.data?.navItems,
|
|
31
33
|
})));
|
|
32
34
|
|
|
35
|
+
useDocumentTitle();
|
|
36
|
+
|
|
33
37
|
const onLuminanceToggle = (): void => {
|
|
34
38
|
if (designSystemProviderRef.current) {
|
|
35
39
|
baseLayerLuminance.setValueFor(
|
|
@@ -45,6 +49,9 @@ const DefaultLayout: React.FC<DefaultLayoutProps> = () => {
|
|
|
45
49
|
useEffect(() => {
|
|
46
50
|
if (designSystemProviderRef.current) {
|
|
47
51
|
configureDesignSystem(designSystemProviderRef.current, designTokens);
|
|
52
|
+
registerStylesTarget(document.body, 'layout');
|
|
53
|
+
registerStylesTarget(document.body, 'header');
|
|
54
|
+
registerStylesTarget(document.body, 'content');
|
|
48
55
|
}
|
|
49
56
|
|
|
50
57
|
return () => {
|
|
@@ -57,6 +64,9 @@ const DefaultLayout: React.FC<DefaultLayoutProps> = () => {
|
|
|
57
64
|
<rapid-design-system-provider ref={designSystemProviderRef} class={className}>
|
|
58
65
|
<PBCElementsRenderer target={['layout-start']} />
|
|
59
66
|
<foundation-header
|
|
67
|
+
{{#if headerLogoSrc}}
|
|
68
|
+
logo-src="{{headerLogoSrc}}"
|
|
69
|
+
{{/if}}
|
|
60
70
|
onluminance-icon-clicked={onLuminanceToggle}
|
|
61
71
|
logout={async () => {
|
|
62
72
|
await fetch(LOGOUT_URL);
|
|
@@ -67,6 +77,7 @@ const DefaultLayout: React.FC<DefaultLayoutProps> = () => {
|
|
|
67
77
|
routeNavItems={navItems}
|
|
68
78
|
navigateTo={(path: string) => navigate(path)}
|
|
69
79
|
>
|
|
80
|
+
<PBCElementsRenderer target={['header', 'nav-start', 'nav-end']} />
|
|
70
81
|
</foundation-header>
|
|
71
82
|
<section className={styles['content']}>
|
|
72
83
|
<PBCElementsRenderer target={['content-start']} />
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import ReactDOM from 'react-dom/client'
|
|
3
3
|
import App from './App.tsx'
|
|
4
4
|
|
|
5
|
-
import { registerPBCs } from '
|
|
5
|
+
import { registerPBCs } from './pbc/utils';
|
|
6
6
|
import { createLogger } from '@genesislcap/foundation-logger';
|
|
7
7
|
|
|
8
8
|
import './styles/styles.css'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, {useEffect} from 'react';
|
|
2
2
|
import './AuthPage.css';
|
|
3
|
-
import { configureFoundationLogin } from
|
|
3
|
+
import { configureFoundationLogin } from '../../share/foundation-login.ts';
|
|
4
4
|
import { useNavigate, useLocation } from 'react-router-dom';
|
|
5
5
|
|
|
6
6
|
const AuthPage: React.FC = () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
2
|
import NotPermittedPage from './NotPermittedPage';
|
|
3
3
|
|
|
4
|
-
jest.mock('
|
|
4
|
+
jest.mock('../../components/ErrorMessage/ErrorMessage', () => {
|
|
5
5
|
return jest.fn((props: { message: string }) => <h1 data-testid="error-message">{props.message}</h1>);
|
|
6
6
|
});
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import { deriveElementTag } from './utils';
|
|
3
|
-
import { useRoutesContext } from '
|
|
3
|
+
import { useRoutesContext } from '../store/RoutesContext';
|
|
4
4
|
import { useLocation, RouteObject } from 'react-router-dom';
|
|
5
5
|
|
|
6
6
|
type ExtendedRouteObject = RouteObject & {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
import { CustomEventMap } from '@genesislcap/foundation-events';
|
|
3
2
|
import { getApp } from '@genesislcap/foundation-shell/app';
|
|
4
3
|
import {
|
|
@@ -9,28 +8,38 @@ import {
|
|
|
9
8
|
} from '@genesislcap/foundation-store';
|
|
10
9
|
import { DI } from '@genesislcap/web-core';
|
|
11
10
|
|
|
12
|
-
interface Store extends StoreRoot {
|
|
13
|
-
|
|
11
|
+
interface Store extends StoreRoot {
|
|
12
|
+
connected: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type StoreEventDetailMap = StoreRootEventDetailMap & {
|
|
16
|
+
'connected-changed': { connected: boolean };
|
|
17
|
+
};
|
|
14
18
|
|
|
15
19
|
declare global {
|
|
16
20
|
interface HTMLElementEventMap extends CustomEventMap<StoreEventDetailMap> {}
|
|
17
21
|
}
|
|
18
22
|
|
|
19
23
|
class DefaultStore extends AbstractStoreRoot<Store, StoreEventDetailMap> implements Store {
|
|
24
|
+
connected: boolean = false;
|
|
25
|
+
|
|
20
26
|
constructor() {
|
|
21
27
|
super();
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Register the store root
|
|
25
|
-
*/
|
|
26
28
|
getApp().registerStoreRoot(this);
|
|
27
29
|
}
|
|
30
|
+
|
|
31
|
+
setConnected(connected: boolean) {
|
|
32
|
+
this.connected = connected;
|
|
33
|
+
document.dispatchEvent(new CustomEvent('connected-changed', {
|
|
34
|
+
detail: { connected }
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
28
37
|
}
|
|
29
38
|
|
|
30
39
|
const Store = registerStore(DefaultStore, 'Store');
|
|
31
40
|
|
|
32
41
|
class StoreService {
|
|
33
|
-
private store:
|
|
42
|
+
private store: Store;
|
|
34
43
|
|
|
35
44
|
constructor() {
|
|
36
45
|
this.store = DI.getOrCreateDOMContainer().get(Store) as Store;
|
|
@@ -41,7 +50,9 @@ class StoreService {
|
|
|
41
50
|
}
|
|
42
51
|
|
|
43
52
|
onConnected(event?: CustomEvent) {
|
|
44
|
-
|
|
53
|
+
if (event) {
|
|
54
|
+
this.store.onConnected(event as any);
|
|
55
|
+
}
|
|
45
56
|
}
|
|
46
57
|
}
|
|
47
58
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { configure, defaultAuthConfig } from '@genesislcap/foundation-auth/config';
|
|
2
|
-
import { AUTH_PATH } from '
|
|
3
|
-
import { environment } from
|
|
2
|
+
import { AUTH_PATH } from '../config';
|
|
3
|
+
import { environment } from '../environments/environment.ts';
|
|
4
4
|
import { Connect } from '@genesislcap/foundation-comms';
|
|
5
5
|
import { DI } from '@genesislcap/web-core';
|
|
6
6
|
import type { NavigateFunction, Location as RouterLocation } from 'react-router-dom';
|
|
@@ -4,8 +4,9 @@ import { foundationLayoutComponents } from '@genesislcap/foundation-layout';
|
|
|
4
4
|
import { getApp } from '@genesislcap/foundation-shell/app';
|
|
5
5
|
import { g2plotChartsComponents } from '@genesislcap/g2plot-chart';
|
|
6
6
|
import * as rapidDesignSystem from '@genesislcap/rapid-design-system';
|
|
7
|
-
import { rapidGridComponents } from '@genesislcap/rapid-grid-pro';
|
|
7
|
+
import { rapidGridComponents, rapidGridPro, rapidGridProStyles } from '@genesislcap/rapid-grid-pro';
|
|
8
8
|
import { FoundationRouter } from '@genesislcap/foundation-ui';
|
|
9
|
+
import { css } from "@genesislcap/web-core";
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Ensure tree shaking doesn't remove these.
|
|
@@ -32,6 +33,16 @@ export async function registerComponents() {
|
|
|
32
33
|
.provideDesignSystem()
|
|
33
34
|
.register(
|
|
34
35
|
rapidDesignSystem.baseComponents,
|
|
36
|
+
rapidGridPro({
|
|
37
|
+
styles: css`
|
|
38
|
+
${rapidGridProStyles}
|
|
39
|
+
.ag-theme-genesis-rapid,
|
|
40
|
+
.ag-theme-genesis-rapid-dark,
|
|
41
|
+
.ag-theme-genesis-rapid-light {
|
|
42
|
+
--ag-selected-row-background-color: var(--accent-fill-rest);
|
|
43
|
+
}
|
|
44
|
+
`,
|
|
45
|
+
}),
|
|
35
46
|
rapidGridComponents,
|
|
36
47
|
g2plotChartsComponents,
|
|
37
48
|
foundationLayoutComponents,
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React, { createContext, useContext, ReactNode } from 'react';
|
|
2
2
|
import { RouteObject, Navigate } from 'react-router-dom';
|
|
3
3
|
import { getApp } from '@genesislcap/foundation-shell/app';
|
|
4
|
-
import AuthPage from '
|
|
5
|
-
import NotFoundPage from '
|
|
6
|
-
import NotPermittedPage from '
|
|
4
|
+
import AuthPage from '../pages/AuthPage/AuthPage';
|
|
5
|
+
import NotFoundPage from '../pages/NotFoundPage/NotFoundPage';
|
|
6
|
+
import NotPermittedPage from '../pages/NotPermittedPage/NotPermittedPage';
|
|
7
7
|
{{#each routes}}
|
|
8
|
-
import {{pascalCase this.name}} from '
|
|
8
|
+
import {{pascalCase this.name}} from '../pages/{{pascalCase this.name}}/{{pascalCase this.name}}';
|
|
9
9
|
{{/each}}
|
|
10
|
-
import PBCContainer from '
|
|
11
|
-
import { AUTH_PATH, NOT_PERMITTED_PATH } from '
|
|
10
|
+
import PBCContainer from '../pbc/container';
|
|
11
|
+
import { AUTH_PATH, NOT_PERMITTED_PATH } from '../config';
|
|
12
|
+
import * as changeCase from 'change-case';
|
|
12
13
|
|
|
13
14
|
const routes = [
|
|
14
15
|
{
|
|
@@ -52,7 +53,7 @@ const RoutesContext = createContext<RouteObject[]>([]);
|
|
|
52
53
|
|
|
53
54
|
export const RoutesProvider: React.FC<{ children: ReactNode }> = ({ children }) => {
|
|
54
55
|
const pbcRoutes = getApp().routes.map((route) => ({
|
|
55
|
-
title: route.
|
|
56
|
+
title: changeCase.capitalCase(route.path),
|
|
56
57
|
path: `/${route.path}`,
|
|
57
58
|
element: <PBCContainer />,
|
|
58
59
|
data: {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"fontFamily": {
|
|
14
14
|
"bodyFont": {
|
|
15
|
-
"$value": "Roboto, \"Segoe UI\", Arial, Helvetica, sans-serif",
|
|
15
|
+
"$value": "{{#if fontFamily}}{{fontFamily}}, {{/if}}Roboto, \"Segoe UI\", Arial, Helvetica, sans-serif",
|
|
16
16
|
"$type": "fontFamily"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
@@ -37,6 +37,10 @@
|
|
|
37
37
|
"$value": 0,
|
|
38
38
|
"$type": "number"
|
|
39
39
|
},
|
|
40
|
+
"baseHeightMultiplier": {
|
|
41
|
+
"$value": 10,
|
|
42
|
+
"$type": "number"
|
|
43
|
+
},
|
|
40
44
|
"borderRadius": {
|
|
41
45
|
"$value": 4,
|
|
42
46
|
"$type": "number"
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
+
{{#if fontData}}
|
|
2
|
+
{{#each fontData}}
|
|
3
|
+
@font-face {
|
|
4
|
+
font-family: "{{../fontFamily}}";
|
|
5
|
+
src: url("../public/fonts/{{filename}}") format("{{format}}");
|
|
6
|
+
font-weight: {{weight}};
|
|
7
|
+
font-style: normal;
|
|
8
|
+
font-display: swap;
|
|
9
|
+
}
|
|
10
|
+
{{/each}}
|
|
11
|
+
{{/if}}
|
|
12
|
+
|
|
13
|
+
{{#unless fontFamily}}
|
|
1
14
|
@font-face {
|
|
2
15
|
font-family: Segoe UI;
|
|
3
16
|
font-weight: 300;
|
|
4
17
|
src: local("Segoe UI Semilight"), local("Segoe UI");
|
|
5
18
|
}
|
|
19
|
+
{{/unless}}
|
|
6
20
|
|
|
7
21
|
* {
|
|
8
|
-
font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
|
|
22
|
+
font-family: {{#if fontFamily}}"{{fontFamily}}", {{/if}}"Segoe UI", "Helvetica Neue", Arial, sans-serif;
|
|
9
23
|
font-style: normal;
|
|
10
24
|
font-weight: normal;
|
|
11
25
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const ERROR_PREFIX = 'Golden layout helper - ';
|
|
2
|
+
|
|
3
|
+
export const setComponentItemsMap = (
|
|
4
|
+
layoutNativeElement: any,
|
|
5
|
+
componentMapInstance: Map<string, any>,
|
|
6
|
+
): (() => void) => {
|
|
7
|
+
if (!layoutNativeElement || !layoutNativeElement.layout) {
|
|
8
|
+
throw new Error(`${ERROR_PREFIX} - layout is not defined`);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const componentSetter = ({ _target: componentItem }: any) => {
|
|
12
|
+
componentMapInstance.set(componentItem.componentName, componentItem);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
layoutNativeElement.layout.on('componentCreated', componentSetter);
|
|
16
|
+
|
|
17
|
+
return () => layoutNativeElement.layout.off('componentCreated', componentSetter);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const getElementRoot = (componentInstance: any): any => {
|
|
21
|
+
if (componentInstance) {
|
|
22
|
+
const { _element } = componentInstance;
|
|
23
|
+
return _element;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
throw new Error(`${ERROR_PREFIX} - component instance is not defined`);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const getElementsBySelectorFromComponent = (
|
|
30
|
+
componentInstance: any,
|
|
31
|
+
selectorValue: string,
|
|
32
|
+
): any => {
|
|
33
|
+
const element = getElementRoot(componentInstance);
|
|
34
|
+
return element.querySelectorAll(`[data-selector=${selectorValue}]`);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const getElementBySelectorFromComponent = (
|
|
38
|
+
componentInstance: any,
|
|
39
|
+
selector: string,
|
|
40
|
+
): any => {
|
|
41
|
+
return getElementsBySelectorFromComponent(componentInstance, selector)[0];
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const getElementsByTagFromComponent = (
|
|
45
|
+
componentInstance: any,
|
|
46
|
+
tag: string,
|
|
47
|
+
): any => {
|
|
48
|
+
const element = getElementRoot(componentInstance);
|
|
49
|
+
return element.getElementsByTagName(tag);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const getElementByTagFromComponent = (
|
|
53
|
+
componentInstance: any,
|
|
54
|
+
tag: string,
|
|
55
|
+
): any => {
|
|
56
|
+
return getElementsByTagFromComponent(componentInstance, tag)[0];
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useLocation } from 'react-router-dom';
|
|
3
|
+
import { useRoutesContext } from '../store/RoutesContext';
|
|
4
|
+
|
|
5
|
+
type ExtendedRouteObject = {
|
|
6
|
+
path?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
data?: {
|
|
9
|
+
navItems?: Array<{ title?: string }>;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Hook to update document title based on current route
|
|
15
|
+
*/
|
|
16
|
+
export const useDocumentTitle = () => {
|
|
17
|
+
const location = useLocation();
|
|
18
|
+
const routes = useRoutesContext() as unknown as ExtendedRouteObject[];
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
const currentRoute = routes.find((route) => {
|
|
22
|
+
const routePath = route.path;
|
|
23
|
+
|
|
24
|
+
if (!routePath) return false;
|
|
25
|
+
|
|
26
|
+
return location.pathname === routePath || location.pathname.startsWith(routePath + '/');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
let pageTitle = 'React App';
|
|
30
|
+
|
|
31
|
+
if (currentRoute) {
|
|
32
|
+
if (currentRoute.title) {
|
|
33
|
+
pageTitle = currentRoute.title;
|
|
34
|
+
}
|
|
35
|
+
else if (currentRoute.data?.navItems && currentRoute.data.navItems.length > 0) {
|
|
36
|
+
pageTitle = currentRoute.data.navItems[0].title || 'React App';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
document.title = pageTitle;
|
|
41
|
+
|
|
42
|
+
return () => {
|
|
43
|
+
document.title = 'React App';
|
|
44
|
+
};
|
|
45
|
+
}, [location.pathname, routes]);
|
|
46
|
+
};
|
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
"dependencies": {
|
|
92
92
|
"@genesislcap/foundation-auth": "{{versions.UI}}",
|
|
93
93
|
"@genesislcap/foundation-comms": "{{versions.UI}}",
|
|
94
|
+
"@genesislcap/foundation-criteria": "{{versions.UI}}",
|
|
94
95
|
"@genesislcap/foundation-entity-management": "{{versions.UI}}",
|
|
95
96
|
"@genesislcap/foundation-events": "{{versions.UI}}",
|
|
96
97
|
{{#if FDC3.includeDependencies}}
|
|
@@ -103,6 +104,7 @@
|
|
|
103
104
|
"@genesislcap/foundation-notifications": "{{versions.UI}}",
|
|
104
105
|
"@genesislcap/foundation-shell": "{{versions.UI}}",
|
|
105
106
|
"@genesislcap/foundation-store": "{{versions.UI}}",
|
|
107
|
+
"@genesislcap/foundation-redux": "{{versions.UI}}",
|
|
106
108
|
"@genesislcap/foundation-ui": "{{versions.UI}}",
|
|
107
109
|
"@genesislcap/foundation-utils": "{{versions.UI}}",
|
|
108
110
|
"@genesislcap/foundation-user": "{{versions.UI}}",
|
|
@@ -122,6 +124,7 @@
|
|
|
122
124
|
"@analytics/core": "0.12.17",
|
|
123
125
|
"@genesislcap/foundation-auth": "{{versions.UI}}",
|
|
124
126
|
"@genesislcap/foundation-comms": "{{versions.UI}}",
|
|
127
|
+
"@genesislcap/foundation-criteria": "{{versions.UI}}",
|
|
125
128
|
"@genesislcap/foundation-entity-management": "{{versions.UI}}",
|
|
126
129
|
"@genesislcap/foundation-events": "{{versions.UI}}",
|
|
127
130
|
{{#if FDC3.includeDependencies}}
|
|
@@ -134,6 +137,7 @@
|
|
|
134
137
|
"@genesislcap/foundation-notifications": "{{versions.UI}}",
|
|
135
138
|
"@genesislcap/foundation-shell": "{{versions.UI}}",
|
|
136
139
|
"@genesislcap/foundation-store": "{{versions.UI}}",
|
|
140
|
+
"@genesislcap/foundation-redux": "{{versions.UI}}",
|
|
137
141
|
"@genesislcap/foundation-ui": "{{versions.UI}}",
|
|
138
142
|
"@genesislcap/foundation-utils": "{{versions.UI}}",
|
|
139
143
|
"@genesislcap/foundation-user": "{{versions.UI}}",
|
|
@@ -6,7 +6,8 @@ import { FoundationRouter } from '@genesislcap/foundation-ui';
|
|
|
6
6
|
import * as zeroDesignSystem from '@genesislcap/foundation-zero';
|
|
7
7
|
import { g2plotChartsComponents } from '@genesislcap/g2plot-chart';
|
|
8
8
|
import * as rapidDesignSystem from '@genesislcap/rapid-design-system';
|
|
9
|
-
import { rapidGridComponents } from '@genesislcap/rapid-grid-pro';
|
|
9
|
+
import { rapidGridComponents, rapidGridPro, rapidGridProStyles } from '@genesislcap/rapid-grid-pro';
|
|
10
|
+
import { css } from '@genesislcap/web-core';
|
|
10
11
|
import { NotPermittedComponent } from './not-permitted-component';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -31,14 +32,22 @@ export async function registerComponents() {
|
|
|
31
32
|
designSystem: rapidDesignSystem,
|
|
32
33
|
});
|
|
33
34
|
|
|
34
|
-
rapidDesignSystem
|
|
35
|
-
.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
rapidDesignSystem.provideDesignSystem().register(
|
|
36
|
+
rapidDesignSystem.baseComponents,
|
|
37
|
+
rapidGridPro({
|
|
38
|
+
styles: css`
|
|
39
|
+
${rapidGridProStyles}
|
|
40
|
+
.ag-theme-genesis-rapid,
|
|
41
|
+
.ag-theme-genesis-rapid-dark,
|
|
42
|
+
.ag-theme-genesis-rapid-light {
|
|
43
|
+
--ag-selected-row-background-color: var(--accent-fill-rest);
|
|
44
|
+
}
|
|
45
|
+
`,
|
|
46
|
+
}),
|
|
47
|
+
rapidGridComponents,
|
|
48
|
+
g2plotChartsComponents,
|
|
49
|
+
foundationLayoutComponents,
|
|
50
|
+
);
|
|
42
51
|
|
|
43
52
|
configureHeader({
|
|
44
53
|
templateOptions: {
|