@elliemae/pui-app-sdk 5.24.2 → 5.25.1
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/dist/cjs/utils/micro-frontend/guest.js +7 -1
- package/dist/cjs/view/guest-microapp.js +4 -1
- package/dist/esm/utils/micro-frontend/guest.js +7 -1
- package/dist/esm/view/guest-microapp.js +4 -1
- package/dist/types/lib/utils/app-config/config.d.ts +7 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
|
@@ -253,7 +253,6 @@ class CMicroAppGuest {
|
|
|
253
253
|
}
|
|
254
254
|
async init(options) {
|
|
255
255
|
this.props = import_lodash.default.merge(this.props, options);
|
|
256
|
-
this.props.history = options?.history || this.props.history;
|
|
257
256
|
if (!this.props.host) {
|
|
258
257
|
const host = await this.findHost();
|
|
259
258
|
if (host) {
|
|
@@ -266,6 +265,13 @@ class CMicroAppGuest {
|
|
|
266
265
|
const userId = this.getSessionStorageItem("userId") || "";
|
|
267
266
|
(0, import_web_analytics.updateBAEventParameters)({ appId: this.appId, instanceId, userId });
|
|
268
267
|
(0, import_appdynamics.setAppDynamicsUserData)({ appId: this.appId, instanceId, userId });
|
|
268
|
+
const useParentHistory = (0, import_config.getAppConfigValue)("useParentHistory", true);
|
|
269
|
+
if (useParentHistory && options?.history) {
|
|
270
|
+
this.props.history = options.history;
|
|
271
|
+
}
|
|
272
|
+
if (!useParentHistory && options?.initialRoute) {
|
|
273
|
+
this.props.history.push(options.initialRoute);
|
|
274
|
+
}
|
|
269
275
|
return (0, import_app_bridge.getAppBridge)().then((appBridge) => {
|
|
270
276
|
this.#appBridge = appBridge;
|
|
271
277
|
if (this.onInit) this.onInit(this.props);
|
|
@@ -50,6 +50,7 @@ const useAppRenderer = (props) => {
|
|
|
50
50
|
id,
|
|
51
51
|
history,
|
|
52
52
|
homeRoute,
|
|
53
|
+
initialRoute,
|
|
53
54
|
onLoadComplete,
|
|
54
55
|
onUnloadComplete,
|
|
55
56
|
containerId
|
|
@@ -72,7 +73,8 @@ const useAppRenderer = (props) => {
|
|
|
72
73
|
id,
|
|
73
74
|
frameOptions: { containerId },
|
|
74
75
|
history,
|
|
75
|
-
homeRoute
|
|
76
|
+
homeRoute,
|
|
77
|
+
initialRoute
|
|
76
78
|
});
|
|
77
79
|
setTimeout(() => {
|
|
78
80
|
try {
|
|
@@ -115,6 +117,7 @@ const useAppRenderer = (props) => {
|
|
|
115
117
|
dispatch,
|
|
116
118
|
history,
|
|
117
119
|
homeRoute,
|
|
120
|
+
initialRoute,
|
|
118
121
|
id,
|
|
119
122
|
onLoadComplete,
|
|
120
123
|
onUnloadComplete
|
|
@@ -220,7 +220,6 @@ class CMicroAppGuest {
|
|
|
220
220
|
}
|
|
221
221
|
async init(options) {
|
|
222
222
|
this.props = _.merge(this.props, options);
|
|
223
|
-
this.props.history = options?.history || this.props.history;
|
|
224
223
|
if (!this.props.host) {
|
|
225
224
|
const host = await this.findHost();
|
|
226
225
|
if (host) {
|
|
@@ -233,6 +232,13 @@ class CMicroAppGuest {
|
|
|
233
232
|
const userId = this.getSessionStorageItem("userId") || "";
|
|
234
233
|
updateBAEventParameters({ appId: this.appId, instanceId, userId });
|
|
235
234
|
setAppDynamicsUserData({ appId: this.appId, instanceId, userId });
|
|
235
|
+
const useParentHistory = getAppConfigValue("useParentHistory", true);
|
|
236
|
+
if (useParentHistory && options?.history) {
|
|
237
|
+
this.props.history = options.history;
|
|
238
|
+
}
|
|
239
|
+
if (!useParentHistory && options?.initialRoute) {
|
|
240
|
+
this.props.history.push(options.initialRoute);
|
|
241
|
+
}
|
|
236
242
|
return getAppBridge().then((appBridge) => {
|
|
237
243
|
this.#appBridge = appBridge;
|
|
238
244
|
if (this.onInit) this.onInit(this.props);
|
|
@@ -17,6 +17,7 @@ const useAppRenderer = (props) => {
|
|
|
17
17
|
id,
|
|
18
18
|
history,
|
|
19
19
|
homeRoute,
|
|
20
|
+
initialRoute,
|
|
20
21
|
onLoadComplete,
|
|
21
22
|
onUnloadComplete,
|
|
22
23
|
containerId
|
|
@@ -39,7 +40,8 @@ const useAppRenderer = (props) => {
|
|
|
39
40
|
id,
|
|
40
41
|
frameOptions: { containerId },
|
|
41
42
|
history,
|
|
42
|
-
homeRoute
|
|
43
|
+
homeRoute,
|
|
44
|
+
initialRoute
|
|
43
45
|
});
|
|
44
46
|
setTimeout(() => {
|
|
45
47
|
try {
|
|
@@ -82,6 +84,7 @@ const useAppRenderer = (props) => {
|
|
|
82
84
|
dispatch,
|
|
83
85
|
history,
|
|
84
86
|
homeRoute,
|
|
87
|
+
initialRoute,
|
|
85
88
|
id,
|
|
86
89
|
onLoadComplete,
|
|
87
90
|
onUnloadComplete
|
|
@@ -14,6 +14,13 @@ export interface AppConfig {
|
|
|
14
14
|
sessionTimeoutWarnInterval?: string;
|
|
15
15
|
sessionTimeoutInterval?: string;
|
|
16
16
|
serviceEndpoints: ServiceEndpoints;
|
|
17
|
+
/**
|
|
18
|
+
* Whether to use the parent history for navigation.
|
|
19
|
+
* If true, the app will use the history from the parent window.
|
|
20
|
+
* If false, it will use its own history.
|
|
21
|
+
* Defaults to true.
|
|
22
|
+
*/
|
|
23
|
+
useParentHistory?: boolean;
|
|
17
24
|
env: {
|
|
18
25
|
[key: string]: Env;
|
|
19
26
|
};
|