impaktapps-ui-builder 0.0.101-alpha.335 → 0.0.101-alpha.337

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.
@@ -10299,19 +10299,20 @@ var service = (funcParams) => {
10299
10299
  }));
10300
10300
  }
10301
10301
  const config2 = pageData == null ? void 0 : pageData.config;
10302
- const uiSchema = pageData == null ? void 0 : pageData.uiSchema;
10303
- if (config2 == null ? void 0 : config2.programIdRequired) {
10304
- const programId = ((_a = JSON.parse(window.sessionStorage.getItem("ProgramID") || "{}")) == null ? void 0 : _a.value) || "programID";
10305
- const queryParams = new URLSearchParams(location.search);
10306
- console.log("queryParams ", queryParams);
10307
- if ((queryParams == null ? void 0 : queryParams.get("ProgramID")) !== programId + "") {
10308
- funcParams.store.setSearchParams({ ...queryParams, ProgramID: programId });
10309
- funcParams.store.navigate(0);
10310
- }
10311
- if (programId !== "programID") {
10312
- funcParams.store.setFormdata((pre) => ({ ...pre, programId }));
10302
+ const pathParts = funcParams.store.location.pathname.split("/");
10303
+ const programId = ((_a = JSON.parse(window.sessionStorage.getItem("ProgramID") || "{}")) == null ? void 0 : _a.value) || "programID";
10304
+ if ((config2 == null ? void 0 : config2.programIdRequired) && programId) {
10305
+ if (pathParts.length < 2) {
10306
+ funcParams.store.navigate(
10307
+ `${programId}/${funcParams.store.location.pathname}`
10308
+ );
10309
+ } else if (pathParts[1] !== programId + "") {
10310
+ pathParts[1] = programId;
10311
+ const newPath = pathParts.slice(0, 3).join("/");
10312
+ funcParams.store.navigate(newPath);
10313
10313
  }
10314
10314
  }
10315
+ const uiSchema = pageData == null ? void 0 : pageData.uiSchema;
10315
10316
  const event2 = new CustomEvent("pageNameChanged", {
10316
10317
  detail: { pageName: config2.label }
10317
10318
  });