@djb25/digit-ui-module-common 1.0.6 → 1.0.8

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/index.js CHANGED
@@ -2871,6 +2871,8 @@ const CitizenPayment = _ref => {
2871
2871
  moduleCode = _ref.moduleCode;
2872
2872
  const _useRouteMatch = reactRouterDom.useRouteMatch(),
2873
2873
  currentPath = _useRouteMatch.path;
2874
+ const _useLocation = reactRouterDom.useLocation(),
2875
+ routerState = _useLocation.state;
2874
2876
  const commonProps = {
2875
2877
  stateCode,
2876
2878
  cityCode,
@@ -2890,15 +2892,15 @@ const CitizenPayment = _ref => {
2890
2892
  }, {
2891
2893
  path: "/digit-ui/citizen/payment/my-bills",
2892
2894
  label: t("CS_PAYMENT_BILL_DETAILS"),
2893
- show: pathname.includes("/my-bills")
2895
+ show: pathname.includes("/my-bills") || pathname.includes("/billDetails") || pathname.includes("/collect") || pathname.includes("/success") || pathname.includes("/failure")
2894
2896
  }, {
2895
2897
  path: pathname,
2896
2898
  label: t("PAYERS_DETAILS_HEADER"),
2897
- show: pathname.includes("/billDetails")
2899
+ show: pathname.includes("/billDetails") || pathname.includes("/collect") || pathname.includes("/success") || pathname.includes("/failure")
2898
2900
  }, {
2899
2901
  path: pathname,
2900
2902
  label: t("PAYMENT_CS_HEADER"),
2901
- show: pathname.includes("/collect")
2903
+ show: pathname.includes("/collect") || pathname.includes("/success") || pathname.includes("/failure")
2902
2904
  }, {
2903
2905
  path: pathname,
2904
2906
  label: t("CS_TITLE_PAYMENT_SUCCESS"),
@@ -2909,7 +2911,38 @@ const CitizenPayment = _ref => {
2909
2911
  show: pathname.includes("/failure")
2910
2912
  }];
2911
2913
  const getDynamicBreadcrumbs = () => {
2912
- return crumbs.filter(crumb => crumb.show);
2914
+ let activeCrumbs = crumbs.filter(crumb => crumb.show);
2915
+ const isWNS = pathname.includes("/WS") || pathname.includes("/SW") || window.location.search.includes("workflow=WNS");
2916
+ if (isWNS) {
2917
+ activeCrumbs.splice(1, 0, {
2918
+ path: "/digit-ui/citizen/ws-home",
2919
+ label: t("ES_TITLE_WATER_AND_SEWERAGE"),
2920
+ show: true
2921
+ });
2922
+ activeCrumbs.splice(2, 0, {
2923
+ path: "/digit-ui/citizen/ws/my-applications",
2924
+ label: t("CS_HOME_MY_APPLICATIONS"),
2925
+ show: true
2926
+ });
2927
+ if (routerState !== null && routerState !== void 0 && routerState.fromApplicationDetails) {
2928
+ activeCrumbs.splice(3, 0, {
2929
+ label: t("WS_APPLICATION_DETAILS_HEADER"),
2930
+ show: true,
2931
+ onClick: () => window.history.back()
2932
+ });
2933
+ }
2934
+ }
2935
+ activeCrumbs.forEach((crumb, index) => {
2936
+ if (index < activeCrumbs.length - 1 && crumb.path === pathname) {
2937
+ crumb.path = "";
2938
+ crumb.onClick = () => window.history.go(index - (activeCrumbs.length - 1));
2939
+ }
2940
+ });
2941
+ if (activeCrumbs.length > 0) {
2942
+ activeCrumbs[activeCrumbs.length - 1].path = "";
2943
+ delete activeCrumbs[activeCrumbs.length - 1].onClick;
2944
+ }
2945
+ return activeCrumbs;
2913
2946
  };
2914
2947
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(reactRouterDom.Switch, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.AppContainer, null, /*#__PURE__*/React__default.createElement("div", {
2915
2948
  className: "ground-container employee-app-container form-container"