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