@mseva/digit-ui-module-ndc 1.0.18 → 1.0.19

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
@@ -8979,13 +8979,14 @@ const getTimelineCaptions$1 = (checkpoint, index, arr, t) => {
8979
8979
  }, caption.date && /*#__PURE__*/React__default.createElement("p", null, caption.date), caption.name && /*#__PURE__*/React__default.createElement("p", null, caption.name), caption.mobileNumber , caption.source && /*#__PURE__*/React__default.createElement("p", null, t("ES_COMMON_FILED_VIA_" + caption.source.toUpperCase()))));
8980
8980
  };
8981
8981
  const CitizenApplicationOverview = () => {
8982
- var _user, _user$info, _user$info$roles, _applicationDetails$A3, _applicationDetails$A4, _Object$entries, _displayData$NdcDetai, _displayData$Document, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5;
8982
+ var _user, _user$info, _user$info$roles, _applicationDetails$A3, _applicationDetails$A4, _applicationDetails$A5, _applicationDetails$A6, _Object$entries, _displayData$NdcDetai, _displayData$Document, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5;
8983
8983
  const {
8984
8984
  id
8985
8985
  } = reactRouterDom.useParams();
8986
8986
  const {
8987
8987
  t
8988
8988
  } = reactI18next.useTranslation();
8989
+ const history = reactRouterDom.useHistory();
8989
8990
  const tenantId = window.localStorage.getItem("CITIZEN.CITY");
8990
8991
  const state = tenantId === null || tenantId === void 0 ? void 0 : tenantId.split(".")[0];
8991
8992
  const [appDetails, setAppDetails] = React.useState({});
@@ -9065,7 +9066,6 @@ const CitizenApplicationOverview = () => {
9065
9066
  }
9066
9067
  }, [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications]);
9067
9068
  React.useEffect(() => {
9068
- console.log("applicationDetails", applicationDetails);
9069
9069
  if (applicationDetails) {
9070
9070
  setIsDetailsLoading(true);
9071
9071
  setAppDetails(_extends({}, applicationDetails, {
@@ -9079,11 +9079,8 @@ const CitizenApplicationOverview = () => {
9079
9079
  const handleDownloadPdf = function () {
9080
9080
  try {
9081
9081
  const Property = applicationDetails;
9082
- console.log("applicationDetails in StakeholderAck", applicationDetails);
9083
- console.log("tenants", tenants);
9084
9082
  const tenantInfo = tenants === null || tenants === void 0 ? void 0 : tenants.find(tenant => (tenant === null || tenant === void 0 ? void 0 : tenant.code) === (Property === null || Property === void 0 ? void 0 : Property.tenantId));
9085
9083
  return Promise.resolve(getAcknowledgementData(Property, tenantInfo, t)).then(function (acknowledgementData) {
9086
- console.log("acknowledgementData", acknowledgementData);
9087
9084
  Digit.Utils.pdf.generate(acknowledgementData);
9088
9085
  });
9089
9086
  } catch (e) {
@@ -9106,11 +9103,18 @@ const CitizenApplicationOverview = () => {
9106
9103
  className: "downLoadButton",
9107
9104
  label: t("DOWNLOAD_CERTIFICATE"),
9108
9105
  onClick: handleDownloadPdf
9109
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
9106
+ }), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A5 = applicationDetails.Applications) === null || _applicationDetails$A5 === void 0 ? void 0 : (_applicationDetails$A6 = _applicationDetails$A5[0]) === null || _applicationDetails$A6 === void 0 ? void 0 : _applicationDetails$A6.applicationStatus) == "INITIATED" && /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
9107
+ label: t("COMMON_EDIT"),
9108
+ onSubmit: () => {
9109
+ var _applicationDetails$A7, _applicationDetails$A8;
9110
+ const id = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A7 = applicationDetails.Applications) === null || _applicationDetails$A7 === void 0 ? void 0 : (_applicationDetails$A8 = _applicationDetails$A7[0]) === null || _applicationDetails$A8 === void 0 ? void 0 : _applicationDetails$A8.uuid;
9111
+ history.push("/digit-ui/citizen/ndc/new-application/" + id);
9112
+ }
9113
+ }))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
9110
9114
  className: "ndc_card_main"
9111
9115
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSubHeader, {
9112
9116
  className: "ndc_label"
9113
- }, t("NDC_APPLICATION_DETAILS_OVERVIEW")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.StatusTable, null, console.log("displayData?.applicantData", displayData === null || displayData === void 0 ? void 0 : displayData.applicantData), (displayData === null || displayData === void 0 ? void 0 : displayData.applicantData) && ((_Object$entries = Object.entries(displayData === null || displayData === void 0 ? void 0 : displayData.applicantData)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.map(_ref => {
9117
+ }, t("NDC_APPLICATION_DETAILS_OVERVIEW")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.StatusTable, null, (displayData === null || displayData === void 0 ? void 0 : displayData.applicantData) && ((_Object$entries = Object.entries(displayData === null || displayData === void 0 ? void 0 : displayData.applicantData)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.map(_ref => {
9114
9118
  let [key, value] = _ref;
9115
9119
  return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Row, {
9116
9120
  key: key,
@@ -11687,10 +11691,29 @@ const NewNDCStepForm = () => {
11687
11691
  const formState = reactRedux.useSelector(state => state.ndc.NDCForm);
11688
11692
  const step = formState.step;
11689
11693
  const tenantId = Digit.ULBService.getCurrentTenantId();
11694
+ const id = window.location.pathname.split("/").pop();
11695
+ const {
11696
+ isLoading,
11697
+ data: applicationDetails
11698
+ } = Digit.Hooks.ndc.useSearchEmployeeApplication({
11699
+ uuid: id
11700
+ }, tenantId);
11701
+ React.useEffect(() => {
11702
+ if (applicationDetails !== null && applicationDetails !== void 0 && applicationDetails.Applications.length) {
11703
+ dispatch(updateNDCForm("responseData", applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications));
11704
+ }
11705
+ }, [applicationDetails]);
11690
11706
  const setStep = updatedStepNumber => {
11691
11707
  dispatch(setNDCStep(updatedStepNumber));
11692
11708
  };
11693
11709
  const handleSubmit = () => {};
11710
+ React.useEffect(() => {
11711
+ const unlisten = history.listen(() => {
11712
+ console.log("route changes guys");
11713
+ dispatch(resetNDCForm());
11714
+ });
11715
+ return () => unlisten();
11716
+ }, [history, dispatch]);
11694
11717
  return /*#__PURE__*/React__default.createElement("div", {
11695
11718
  className: "pageCard"
11696
11719
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardHeader, {
@@ -11885,7 +11908,7 @@ const NewNDCStepFormOne = _ref => {
11885
11908
  if (!(propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.email)) missingFields.push(t("NDC_MESSAGE_EMAIL"));
11886
11909
  if (!(NDCReason !== null && NDCReason !== void 0 && NDCReason.code)) missingFields.push(t("NDC_MESSAGE_NDC_REASON"));
11887
11910
  const nameRegex = /^[A-Za-z\s]+$/;
11888
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
11911
+ const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$/;
11889
11912
  const mobileRegex = /^[6-9]\d{9}$/;
11890
11913
  if (propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.firstName && !nameRegex.test(propertyDetails.firstName)) {
11891
11914
  invalidFields.push(t("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED"));
@@ -12430,6 +12453,7 @@ const PropertyDetailsForm$1 = _ref => {
12430
12453
  }));
12431
12454
  }
12432
12455
  }, [apiDataCheck]);
12456
+ console.log("propertyDetails====", propertyDetails, formData);
12433
12457
  return /*#__PURE__*/React__default.createElement("div", {
12434
12458
  style: {
12435
12459
  marginBottom: "16px"
@@ -12717,21 +12741,21 @@ const PropertyDetailsForm$1 = _ref => {
12717
12741
  }, /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
12718
12742
  control: control,
12719
12743
  name: "email",
12720
- defaultValue: "",
12744
+ defaultValue: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.email) || "",
12721
12745
  render: props => {
12722
- var _formData$cpt7, _formData$cpt7$detail, _formData$cpt7$detail2, _formData$cpt7$detail3, _formData$cpt7$detail4;
12746
+ var _formData$cpt7, _formData$cpt7$detail, _formData$cpt7$detail2, _formData$cpt7$detail3;
12723
12747
  return /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
12724
12748
  value: props === null || props === void 0 ? void 0 : props.value,
12725
12749
  onChange: e => {
12726
- props.onChange(e.target.value);
12727
12750
  setPropertyDetails(prev => _extends({}, prev, {
12728
12751
  email: e.target.value
12729
12752
  }));
12753
+ props.onChange(e.target.value);
12730
12754
  },
12731
12755
  onBlur: e => {
12732
12756
  props.onBlur(e);
12733
12757
  },
12734
- disabled: (formData === null || formData === void 0 ? void 0 : (_formData$cpt7 = formData.cpt) === null || _formData$cpt7 === void 0 ? void 0 : (_formData$cpt7$detail = _formData$cpt7.details) === null || _formData$cpt7$detail === void 0 ? void 0 : (_formData$cpt7$detail2 = _formData$cpt7$detail.owners) === null || _formData$cpt7$detail2 === void 0 ? void 0 : (_formData$cpt7$detail3 = _formData$cpt7$detail2[0]) === null || _formData$cpt7$detail3 === void 0 ? void 0 : (_formData$cpt7$detail4 = _formData$cpt7$detail3.email) === null || _formData$cpt7$detail4 === void 0 ? void 0 : _formData$cpt7$detail4.length) > 0
12758
+ disabled: formData === null || formData === void 0 ? void 0 : (_formData$cpt7 = formData.cpt) === null || _formData$cpt7 === void 0 ? void 0 : (_formData$cpt7$detail = _formData$cpt7.details) === null || _formData$cpt7$detail === void 0 ? void 0 : (_formData$cpt7$detail2 = _formData$cpt7$detail.owners) === null || _formData$cpt7$detail2 === void 0 ? void 0 : (_formData$cpt7$detail3 = _formData$cpt7$detail2[0]) === null || _formData$cpt7$detail3 === void 0 ? void 0 : _formData$cpt7$detail3.emailId
12735
12759
  });
12736
12760
  }
12737
12761
  }))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
@@ -14150,7 +14174,7 @@ const NewNDCStepFormOne$1 = _ref => {
14150
14174
  if (!(propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.email)) missingFields.push(t("NDC_MESSAGE_EMAIL"));
14151
14175
  if (!(NDCReason !== null && NDCReason !== void 0 && NDCReason.code)) missingFields.push(t("NDC_MESSAGE_NDC_REASON"));
14152
14176
  const nameRegex = /^[A-Za-z\s]+$/;
14153
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
14177
+ const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$/;
14154
14178
  const mobileRegex = /^[6-9]\d{9}$/;
14155
14179
  if (propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.firstName && !nameRegex.test(propertyDetails.firstName)) {
14156
14180
  invalidFields.push(t("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED"));