@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.
@@ -8841,13 +8841,14 @@ const getTimelineCaptions$1 = (checkpoint, index, arr, t) => {
8841
8841
  }, caption.date && /*#__PURE__*/React.createElement("p", null, caption.date), caption.name && /*#__PURE__*/React.createElement("p", null, caption.name), caption.mobileNumber , caption.source && /*#__PURE__*/React.createElement("p", null, t("ES_COMMON_FILED_VIA_" + caption.source.toUpperCase()))));
8842
8842
  };
8843
8843
  const CitizenApplicationOverview = () => {
8844
- 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;
8844
+ 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;
8845
8845
  const {
8846
8846
  id
8847
8847
  } = useParams();
8848
8848
  const {
8849
8849
  t
8850
8850
  } = useTranslation();
8851
+ const history = useHistory();
8851
8852
  const tenantId = window.localStorage.getItem("CITIZEN.CITY");
8852
8853
  const state = tenantId === null || tenantId === void 0 ? void 0 : tenantId.split(".")[0];
8853
8854
  const [appDetails, setAppDetails] = useState({});
@@ -8927,7 +8928,6 @@ const CitizenApplicationOverview = () => {
8927
8928
  }
8928
8929
  }, [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications]);
8929
8930
  useEffect(() => {
8930
- console.log("applicationDetails", applicationDetails);
8931
8931
  if (applicationDetails) {
8932
8932
  setIsDetailsLoading(true);
8933
8933
  setAppDetails({
@@ -8941,11 +8941,8 @@ const CitizenApplicationOverview = () => {
8941
8941
  }, [applicationDetails]);
8942
8942
  const handleDownloadPdf = async () => {
8943
8943
  const Property = applicationDetails;
8944
- console.log("applicationDetails in StakeholderAck", applicationDetails);
8945
- console.log("tenants", tenants);
8946
8944
  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));
8947
8945
  const acknowledgementData = await getAcknowledgementData(Property, tenantInfo, t);
8948
- console.log("acknowledgementData", acknowledgementData);
8949
8946
  Digit.Utils.pdf.generate(acknowledgementData);
8950
8947
  };
8951
8948
  if (isLoading || isDetailsLoading) {
@@ -8964,11 +8961,18 @@ const CitizenApplicationOverview = () => {
8964
8961
  className: "downLoadButton",
8965
8962
  label: t("DOWNLOAD_CERTIFICATE"),
8966
8963
  onClick: handleDownloadPdf
8967
- })), /*#__PURE__*/React.createElement(Card, {
8964
+ }), (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.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar$1, {
8965
+ label: t("COMMON_EDIT"),
8966
+ onSubmit: () => {
8967
+ var _applicationDetails$A7, _applicationDetails$A8;
8968
+ 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;
8969
+ history.push(`/digit-ui/citizen/ndc/new-application/${id}`);
8970
+ }
8971
+ }))), /*#__PURE__*/React.createElement(Card, {
8968
8972
  className: "ndc_card_main"
8969
8973
  }, /*#__PURE__*/React.createElement(CardSubHeader, {
8970
8974
  className: "ndc_label"
8971
- }, t("NDC_APPLICATION_DETAILS_OVERVIEW")), /*#__PURE__*/React.createElement(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(([key, value]) => /*#__PURE__*/React.createElement(Row, {
8975
+ }, t("NDC_APPLICATION_DETAILS_OVERVIEW")), /*#__PURE__*/React.createElement(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(([key, value]) => /*#__PURE__*/React.createElement(Row, {
8972
8976
  key: key,
8973
8977
  label: t(`${key === null || key === void 0 ? void 0 : key.toUpperCase()}`),
8974
8978
  text: Array.isArray(value) ? value.map(item => typeof item === "object" ? t((item === null || item === void 0 ? void 0 : item.code) || "N/A") : t(item || "N/A")).join(", ") : typeof value === "object" ? t((value === null || value === void 0 ? void 0 : value.code) || "N/A") : t(value || "N/A")
@@ -11540,10 +11544,29 @@ const NewNDCStepForm = () => {
11540
11544
  const formState = useSelector(state => state.ndc.NDCForm);
11541
11545
  const step = formState.step;
11542
11546
  const tenantId = Digit.ULBService.getCurrentTenantId();
11547
+ const id = window.location.pathname.split("/").pop();
11548
+ const {
11549
+ isLoading,
11550
+ data: applicationDetails
11551
+ } = Digit.Hooks.ndc.useSearchEmployeeApplication({
11552
+ uuid: id
11553
+ }, tenantId);
11554
+ useEffect(() => {
11555
+ if (applicationDetails !== null && applicationDetails !== void 0 && applicationDetails.Applications.length) {
11556
+ dispatch(updateNDCForm("responseData", applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications));
11557
+ }
11558
+ }, [applicationDetails]);
11543
11559
  const setStep = updatedStepNumber => {
11544
11560
  dispatch(setNDCStep(updatedStepNumber));
11545
11561
  };
11546
11562
  const handleSubmit = () => {};
11563
+ useEffect(() => {
11564
+ const unlisten = history.listen(() => {
11565
+ console.log("route changes guys");
11566
+ dispatch(resetNDCForm());
11567
+ });
11568
+ return () => unlisten();
11569
+ }, [history, dispatch]);
11547
11570
  return /*#__PURE__*/React.createElement("div", {
11548
11571
  className: "pageCard"
11549
11572
  }, /*#__PURE__*/React.createElement(CardHeader, {
@@ -11730,7 +11753,7 @@ const NewNDCStepFormOne = ({
11730
11753
  if (!(propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.email)) missingFields.push(t("NDC_MESSAGE_EMAIL"));
11731
11754
  if (!(NDCReason !== null && NDCReason !== void 0 && NDCReason.code)) missingFields.push(t("NDC_MESSAGE_NDC_REASON"));
11732
11755
  const nameRegex = /^[A-Za-z\s]+$/;
11733
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
11756
+ const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$/;
11734
11757
  const mobileRegex = /^[6-9]\d{9}$/;
11735
11758
  if (propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.firstName && !nameRegex.test(propertyDetails.firstName)) {
11736
11759
  invalidFields.push(t("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED"));
@@ -12300,6 +12323,7 @@ const PropertyDetailsForm$1 = ({
12300
12323
  }));
12301
12324
  }
12302
12325
  }, [apiDataCheck]);
12326
+ console.log("propertyDetails====", propertyDetails, formData);
12303
12327
  return /*#__PURE__*/React.createElement("div", {
12304
12328
  style: {
12305
12329
  marginBottom: "16px"
@@ -12593,22 +12617,22 @@ const PropertyDetailsForm$1 = ({
12593
12617
  }, /*#__PURE__*/React.createElement(Controller, {
12594
12618
  control: control,
12595
12619
  name: "email",
12596
- defaultValue: "",
12620
+ defaultValue: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.email) || "",
12597
12621
  render: props => {
12598
- var _formData$cpt7, _formData$cpt7$detail, _formData$cpt7$detail2, _formData$cpt7$detail3, _formData$cpt7$detail4;
12622
+ var _formData$cpt7, _formData$cpt7$detail, _formData$cpt7$detail2, _formData$cpt7$detail3;
12599
12623
  return /*#__PURE__*/React.createElement(TextInput, {
12600
12624
  value: props === null || props === void 0 ? void 0 : props.value,
12601
12625
  onChange: e => {
12602
- props.onChange(e.target.value);
12603
12626
  setPropertyDetails(prev => ({
12604
12627
  ...prev,
12605
12628
  email: e.target.value
12606
12629
  }));
12630
+ props.onChange(e.target.value);
12607
12631
  },
12608
12632
  onBlur: e => {
12609
12633
  props.onBlur(e);
12610
12634
  },
12611
- 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
12635
+ 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
12612
12636
  });
12613
12637
  }
12614
12638
  }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
@@ -13993,7 +14017,7 @@ const NewNDCStepFormOne$1 = ({
13993
14017
  if (!(propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.email)) missingFields.push(t("NDC_MESSAGE_EMAIL"));
13994
14018
  if (!(NDCReason !== null && NDCReason !== void 0 && NDCReason.code)) missingFields.push(t("NDC_MESSAGE_NDC_REASON"));
13995
14019
  const nameRegex = /^[A-Za-z\s]+$/;
13996
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
14020
+ const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$/;
13997
14021
  const mobileRegex = /^[6-9]\d{9}$/;
13998
14022
  if (propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.firstName && !nameRegex.test(propertyDetails.firstName)) {
13999
14023
  invalidFields.push(t("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED"));