@genesislcap/blank-app-seed 4.0.0-prerelease.35 → 4.0.0-prerelease.37
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/package.json +1 -1
- package/.genx/versions.json +2 -2
- package/CHANGELOG.md +15 -0
- package/client-tmp/angular/angular.json +0 -3
- package/client-tmp/angular/webpack.shared.config.js +22 -0
- package/client-tmp/react/src/App.tsx +4 -1
- package/client-tmp/react/src/guards/ProtectedGuard.tsx +11 -19
- package/client-tmp/react/src/layouts/default/DefaultLayout.tsx +0 -7
- package/client-tmp/react/webpack.config.js +5 -2
- package/package.json +1 -1
- package/client-tmp/angular/src/proxy.conf.json +0 -13
package/.genx/package.json
CHANGED
package/.genx/versions.json
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [4.0.0-prerelease.37](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v4.0.0-prerelease.36...v4.0.0-prerelease.37) (2025-05-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* update to 8.11.0 GSF PDS-0 998a093
|
|
9
|
+
* update to 8.11.0 GSF PDS-0 (#456) e3075f7
|
|
10
|
+
|
|
11
|
+
## [4.0.0-prerelease.36](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v4.0.0-prerelease.35...v4.0.0-prerelease.36) (2025-05-09)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* proxy fixes for angular and react to support base path 75f6bb8
|
|
17
|
+
|
|
3
18
|
## [4.0.0-prerelease.35](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v4.0.0-prerelease.34...v4.0.0-prerelease.35) (2025-05-07)
|
|
4
19
|
|
|
5
20
|
|
|
@@ -8,6 +8,10 @@ require('ts-node').register({
|
|
|
8
8
|
}
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
+
const apiPrefix = process.env.SOCKET_EXT || 'gwf';
|
|
12
|
+
const publicPath = process.env.PUBLIC_PATH || '/';
|
|
13
|
+
const apiBasePath = `${publicPath}${apiPrefix}`;
|
|
14
|
+
|
|
11
15
|
module.exports = {
|
|
12
16
|
module: {
|
|
13
17
|
rules: [
|
|
@@ -51,5 +55,23 @@ module.exports = {
|
|
|
51
55
|
externals: {
|
|
52
56
|
'foundationZero/ZeroDesignSystem': 'foundationZero/ZeroDesignSystem',
|
|
53
57
|
},
|
|
58
|
+
devServer: {
|
|
59
|
+
proxy: [
|
|
60
|
+
{
|
|
61
|
+
context: apiBasePath,
|
|
62
|
+
target: "{{apiHost}}",
|
|
63
|
+
pathRewrite: { [`^${apiBasePath}`]: '' },
|
|
64
|
+
secure: false,
|
|
65
|
+
changeOrigin: true,
|
|
66
|
+
cookieDomainRewrite: 'localhost',
|
|
67
|
+
ws: true,
|
|
68
|
+
headers: {
|
|
69
|
+
origin: "{{apiHost}}",
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
compress: true,
|
|
74
|
+
historyApiFallback: true,
|
|
75
|
+
},
|
|
54
76
|
};
|
|
55
77
|
|
|
@@ -99,10 +99,13 @@ const App: React.FC<AppProps> = ({ rootElement }) => {
|
|
|
99
99
|
};
|
|
100
100
|
}, [isStoreConnected]);
|
|
101
101
|
|
|
102
|
+
const baseElement = document.querySelector('base');
|
|
103
|
+
const basePath = baseElement?.getAttribute('href') || '';
|
|
104
|
+
|
|
102
105
|
return (
|
|
103
106
|
<AuthProvider>
|
|
104
107
|
<RoutesProvider>
|
|
105
|
-
<BrowserRouter>
|
|
108
|
+
<BrowserRouter basename={basePath}>
|
|
106
109
|
<Routes>
|
|
107
110
|
<Route path="*" element={<DynamicLayout />} />
|
|
108
111
|
</Routes>
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, ReactNode } from 'react';
|
|
2
2
|
import {RouteObject, useNavigate} from 'react-router';
|
|
3
|
-
import isConnectedHelper from '@/helpers/isConnectedHelper';
|
|
4
|
-
import isAuthenticatedHelper from '@/helpers/isAuthenticatedHelper';
|
|
5
3
|
import hasPermissionHelper from '@/helpers/hasPermissionHelper';
|
|
6
4
|
import { useRoutesContext } from '@/store/RoutesContext';
|
|
7
5
|
import { NOT_PERMITTED_PATH, AUTH_PATH } from '@/config';
|
|
6
|
+
import { getUser } from '@genesislcap/foundation-user';
|
|
8
7
|
|
|
9
8
|
enum PermissionState {
|
|
10
9
|
ALLOWED = 'allowed',
|
|
@@ -33,35 +32,28 @@ const ProtectedGuard: React.FC<{ children: ReactNode }> = ({ children }: { child
|
|
|
33
32
|
const navigate = useNavigate();
|
|
34
33
|
|
|
35
34
|
useEffect(() => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
if (!getUser().isAuthenticated){
|
|
36
|
+
getUser().trackPath();
|
|
37
|
+
navigate('/login')
|
|
38
|
+
}
|
|
39
39
|
}, []);
|
|
40
40
|
|
|
41
41
|
useEffect((): void => {
|
|
42
|
-
if (isConnected === null) {
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const isAuthenticated = isAuthenticatedHelper();
|
|
47
|
-
|
|
48
42
|
|
|
43
|
+
const isAuthenticated = getUser().isAuthenticated;
|
|
49
44
|
let permissionState;
|
|
50
45
|
|
|
51
|
-
if (!
|
|
46
|
+
if (!isAuthenticated) {
|
|
52
47
|
permissionState = PermissionState.UNKNOWN;
|
|
53
48
|
} else if (hasPermission === false) {
|
|
54
49
|
permissionState = PermissionState.DENIED;
|
|
55
50
|
}
|
|
56
51
|
|
|
57
52
|
if (permissionState) {
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const redirect = `${basePath}${redirectUrlByPermissionState[permissionState]}`;
|
|
62
|
-
navigate(`/${redirect}`);
|
|
53
|
+
const redirect = `${redirectUrlByPermissionState[permissionState]}`;
|
|
54
|
+
navigate(`${redirect}`);
|
|
63
55
|
}
|
|
64
|
-
}, [routes,
|
|
56
|
+
}, [routes, isAuthenticated, hasPermission]);
|
|
65
57
|
|
|
66
58
|
return children;
|
|
67
59
|
};
|
|
@@ -9,8 +9,6 @@ import styles from './DefaultLayout.module.css';
|
|
|
9
9
|
import PBCElementsRenderer from '@/pbc/elementsRenderer';
|
|
10
10
|
import * as designTokens from '@/styles/design-tokens.json';
|
|
11
11
|
import { useRoutesContext } from '@/store/RoutesContext';
|
|
12
|
-
import { connectService } from '@/services/connect.service.ts';
|
|
13
|
-
import { getUser } from '@genesislcap/foundation-user';
|
|
14
12
|
import { AUTH_PATH } from '@/config';
|
|
15
13
|
|
|
16
14
|
interface DefaultLayoutProps {
|
|
@@ -45,11 +43,6 @@ const DefaultLayout: React.FC<DefaultLayoutProps> = ({ children }) => {
|
|
|
45
43
|
}
|
|
46
44
|
};
|
|
47
45
|
|
|
48
|
-
if (!connectService.isConnected()) {
|
|
49
|
-
getUser().trackPath();
|
|
50
|
-
navigate(`/${AUTH_PATH}`)
|
|
51
|
-
}
|
|
52
|
-
|
|
53
46
|
useEffect(() => {
|
|
54
47
|
if (designSystemProviderRef.current) {
|
|
55
48
|
configureDesignSystem(designSystemProviderRef.current, designTokens);
|
|
@@ -10,6 +10,9 @@ module.exports = (env, argv) => {
|
|
|
10
10
|
? 'environment.prod.ts'
|
|
11
11
|
: 'environment.ts';
|
|
12
12
|
const environmentPath = resolve(__dirname, 'src/environments', environmentFile);
|
|
13
|
+
const apiPrefix = process.env.SOCKET_EXT || 'gwf';
|
|
14
|
+
const publicPath = process.env.PUBLIC_PATH || '/';
|
|
15
|
+
const apiBasePath = `${publicPath}${apiPrefix}`;
|
|
13
16
|
|
|
14
17
|
return {
|
|
15
18
|
mode,
|
|
@@ -78,9 +81,9 @@ module.exports = (env, argv) => {
|
|
|
78
81
|
server: https ? 'https' : 'http',
|
|
79
82
|
proxy: [
|
|
80
83
|
{
|
|
81
|
-
context:
|
|
84
|
+
context: apiBasePath,
|
|
82
85
|
target: "{{apiHost}}",
|
|
83
|
-
pathRewrite: {
|
|
86
|
+
pathRewrite: { [`^${apiBasePath}`]: '' },
|
|
84
87
|
secure: false,
|
|
85
88
|
changeOrigin: true,
|
|
86
89
|
cookieDomainRewrite: 'localhost',
|
package/package.json
CHANGED