@elliemae/pui-app-sdk 5.24.1 → 5.25.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.
@@ -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,10 @@ 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
+ }
269
272
  return (0, import_app_bridge.getAppBridge)().then((appBridge) => {
270
273
  this.#appBridge = appBridge;
271
274
  if (this.onInit) this.onInit(this.props);
@@ -94,10 +94,10 @@ class CMicroAppHost {
94
94
  (0, import_app_config.loadAppConfig)().then(() => {
95
95
  (0, import_app_bridge.getAppBridge)().then((appBridge) => {
96
96
  this.#appBridge = appBridge;
97
+ if (this.onInit) this.onInit(this.props);
97
98
  }).catch((ex) => {
98
99
  throw ex;
99
100
  });
100
- if (this.onInit) this.onInit(this.props);
101
101
  }).catch(() => {
102
102
  });
103
103
  (0, import_web_analytics.updateBAEventParameters)({ appId: this.appId });
@@ -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,10 @@ 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
+ }
236
239
  return getAppBridge().then((appBridge) => {
237
240
  this.#appBridge = appBridge;
238
241
  if (this.onInit) this.onInit(this.props);
@@ -79,10 +79,10 @@ class CMicroAppHost {
79
79
  loadAppConfig().then(() => {
80
80
  getAppBridge().then((appBridge) => {
81
81
  this.#appBridge = appBridge;
82
+ if (this.onInit) this.onInit(this.props);
82
83
  }).catch((ex) => {
83
84
  throw ex;
84
85
  });
85
- if (this.onInit) this.onInit(this.props);
86
86
  }).catch(() => {
87
87
  });
88
88
  updateBAEventParameters({ appId: this.appId });
@@ -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
  };