@mseva/digit-ui-module-ndc 1.0.17 → 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.
@@ -1,4 +1,4 @@
1
- import { Card, Banner, ActionBar, SubmitBar as SubmitBar$1, PrivateRoute, BreadCrumb, BackButton, AppContainer, Loader, Dropdown, UploadFile, Modal, FormComposer, Toast, Header, CardSubHeader, StatusTable, Row, CheckPoint, ConnectingCheckPoints, DisplayPhotos, Menu, LinkButton, EmployeeModuleCard, SearchField, TextInput, FilterFormField, RadioButtons, CheckBox, ComplaintIcon, InboxComposer, MobileNumber, CardLabelError, SearchAction, PopUp, DetailsCard, SearchForm, CloseSvg, Table, CardHeader, LabelFieldPair, CardLabel, DeleteIcon, KeyNote } from '@mseva/digit-ui-react-components';
1
+ import { Card, Banner, ActionBar, SubmitBar as SubmitBar$1, PrivateRoute, BreadCrumb, BackButton, AppContainer, Loader, Dropdown, UploadFile, Modal, FormComposer, Toast, CardSubHeader, StatusTable, Row, CheckPoint, ConnectingCheckPoints, DisplayPhotos, Menu, LinkButton, EmployeeModuleCard, SearchField, TextInput, FilterFormField, RadioButtons, CheckBox, ComplaintIcon, Header, InboxComposer, MobileNumber, CardLabelError, SearchAction, PopUp, DetailsCard, SearchForm, CloseSvg, Table, CardHeader, LabelFieldPair, CardLabel, DeleteIcon, KeyNote } from '@mseva/digit-ui-react-components';
2
2
  import React, { Fragment as Fragment$1, useState, useEffect, useRef, useMemo, useReducer, useCallback, forwardRef } from 'react';
3
3
  import { useHistory, useLocation, Switch, Route, useRouteMatch, useParams, Link } from 'react-router-dom';
4
4
  import { useTranslation } from 'react-i18next';
@@ -1027,6 +1027,7 @@ const NDCModal = ({
1027
1027
  Licenses: [applicationData]
1028
1028
  });
1029
1029
  }
1030
+ console.log("config.label.submit", config);
1030
1031
  useEffect(() => {
1031
1032
  if (action) {
1032
1033
  setConfig(ModalConfig({
@@ -1332,11 +1333,7 @@ const ApplicationOverview = () => {
1332
1333
  }
1333
1334
  return /*#__PURE__*/React.createElement("div", {
1334
1335
  className: "employee-main-application-details"
1335
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Header, {
1336
- styles: {
1337
- fontSize: "32px"
1338
- }
1339
- }, t("NDC_APP_OVER_VIEW_HEADER"))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, 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, {
1336
+ }, /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, 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, {
1340
1337
  key: key,
1341
1338
  label: t(`${key === null || key === void 0 ? void 0 : key.toUpperCase()}`),
1342
1339
  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")
@@ -1381,7 +1378,7 @@ const ApplicationOverview = () => {
1381
1378
  label: t(checkpoint.status),
1382
1379
  customChild: getTimelineCaptions(checkpoint, index, arr, t)
1383
1380
  })))), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A3 = applicationDetails.Applications) === null || _applicationDetails$A3 === void 0 ? void 0 : (_applicationDetails$A4 = _applicationDetails$A3[0]) === null || _applicationDetails$A4 === void 0 ? void 0 : _applicationDetails$A4.applicationStatus) !== "INITIATED" && actions && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu && (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data12 = workflowDetails.data) !== null && _workflowDetails$data12 !== void 0 && (_workflowDetails$data13 = _workflowDetails$data12.actionState) !== null && _workflowDetails$data13 !== void 0 && _workflowDetails$data13.nextActions || workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data14 = workflowDetails.data) !== null && _workflowDetails$data14 !== void 0 && _workflowDetails$data14.nextActions) ? /*#__PURE__*/React.createElement(Menu, {
1384
- localeKeyPrefix: `WF_EMPLOYEE_${"NDC"}`,
1381
+ localeKeyPrefix: `WF_EDITRENEWAL`,
1385
1382
  options: actions,
1386
1383
  optionKey: "action",
1387
1384
  t: t,
@@ -8844,13 +8841,14 @@ const getTimelineCaptions$1 = (checkpoint, index, arr, t) => {
8844
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()))));
8845
8842
  };
8846
8843
  const CitizenApplicationOverview = () => {
8847
- 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;
8848
8845
  const {
8849
8846
  id
8850
8847
  } = useParams();
8851
8848
  const {
8852
8849
  t
8853
8850
  } = useTranslation();
8851
+ const history = useHistory();
8854
8852
  const tenantId = window.localStorage.getItem("CITIZEN.CITY");
8855
8853
  const state = tenantId === null || tenantId === void 0 ? void 0 : tenantId.split(".")[0];
8856
8854
  const [appDetails, setAppDetails] = useState({});
@@ -8903,12 +8901,12 @@ const CitizenApplicationOverview = () => {
8903
8901
  var _applicationDetails$A;
8904
8902
  const ndcObject = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A = applicationDetails.Applications) === null || _applicationDetails$A === void 0 ? void 0 : _applicationDetails$A[0];
8905
8903
  if (ndcObject) {
8906
- var _ndcObject$NdcDetails, _ndcObject$NdcDetails2, _ndcObject$NdcDetails3, _ndcObject$owners, _ndcObject$owners$, _ndcObject$owners2, _ndcObject$owners2$, _ndcObject$owners3, _ndcObject$owners3$, _removeDuplicatesByUU;
8904
+ var _ndcObject$owners, _ndcObject$owners$, _ndcObject$owners2, _ndcObject$owners2$, _ndcObject$owners3, _ndcObject$owners3$, _ndcObject$NdcDetails, _ndcObject$NdcDetails2, _ndcObject$NdcDetails3, _removeDuplicatesByUU;
8907
8905
  const applicantData = {
8908
- address: ndcObject === null || ndcObject === void 0 ? void 0 : (_ndcObject$NdcDetails = ndcObject.NdcDetails) === null || _ndcObject$NdcDetails === void 0 ? void 0 : (_ndcObject$NdcDetails2 = _ndcObject$NdcDetails[0]) === null || _ndcObject$NdcDetails2 === void 0 ? void 0 : (_ndcObject$NdcDetails3 = _ndcObject$NdcDetails2.additionalDetails) === null || _ndcObject$NdcDetails3 === void 0 ? void 0 : _ndcObject$NdcDetails3.propertyAddress,
8909
- email: ndcObject === null || ndcObject === void 0 ? void 0 : (_ndcObject$owners = ndcObject.owners) === null || _ndcObject$owners === void 0 ? void 0 : (_ndcObject$owners$ = _ndcObject$owners[0]) === null || _ndcObject$owners$ === void 0 ? void 0 : _ndcObject$owners$.emailId,
8906
+ name: ndcObject === null || ndcObject === void 0 ? void 0 : (_ndcObject$owners = ndcObject.owners) === null || _ndcObject$owners === void 0 ? void 0 : (_ndcObject$owners$ = _ndcObject$owners[0]) === null || _ndcObject$owners$ === void 0 ? void 0 : _ndcObject$owners$.name,
8910
8907
  mobile: ndcObject === null || ndcObject === void 0 ? void 0 : (_ndcObject$owners2 = ndcObject.owners) === null || _ndcObject$owners2 === void 0 ? void 0 : (_ndcObject$owners2$ = _ndcObject$owners2[0]) === null || _ndcObject$owners2$ === void 0 ? void 0 : _ndcObject$owners2$.mobileNumber,
8911
- name: ndcObject === null || ndcObject === void 0 ? void 0 : (_ndcObject$owners3 = ndcObject.owners) === null || _ndcObject$owners3 === void 0 ? void 0 : (_ndcObject$owners3$ = _ndcObject$owners3[0]) === null || _ndcObject$owners3$ === void 0 ? void 0 : _ndcObject$owners3$.name,
8908
+ email: ndcObject === null || ndcObject === void 0 ? void 0 : (_ndcObject$owners3 = ndcObject.owners) === null || _ndcObject$owners3 === void 0 ? void 0 : (_ndcObject$owners3$ = _ndcObject$owners3[0]) === null || _ndcObject$owners3$ === void 0 ? void 0 : _ndcObject$owners3$.emailId,
8909
+ address: ndcObject === null || ndcObject === void 0 ? void 0 : (_ndcObject$NdcDetails = ndcObject.NdcDetails) === null || _ndcObject$NdcDetails === void 0 ? void 0 : (_ndcObject$NdcDetails2 = _ndcObject$NdcDetails[0]) === null || _ndcObject$NdcDetails2 === void 0 ? void 0 : (_ndcObject$NdcDetails3 = _ndcObject$NdcDetails2.additionalDetails) === null || _ndcObject$NdcDetails3 === void 0 ? void 0 : _ndcObject$NdcDetails3.propertyAddress,
8912
8910
  applicationNo: ndcObject === null || ndcObject === void 0 ? void 0 : ndcObject.uuid
8913
8911
  };
8914
8912
  const Documents = removeDuplicatesByUUID((ndcObject === null || ndcObject === void 0 ? void 0 : ndcObject.Documents) || []);
@@ -8930,7 +8928,6 @@ const CitizenApplicationOverview = () => {
8930
8928
  }
8931
8929
  }, [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications]);
8932
8930
  useEffect(() => {
8933
- console.log("applicationDetails", applicationDetails);
8934
8931
  if (applicationDetails) {
8935
8932
  setIsDetailsLoading(true);
8936
8933
  setAppDetails({
@@ -8944,11 +8941,8 @@ const CitizenApplicationOverview = () => {
8944
8941
  }, [applicationDetails]);
8945
8942
  const handleDownloadPdf = async () => {
8946
8943
  const Property = applicationDetails;
8947
- console.log("applicationDetails in StakeholderAck", applicationDetails);
8948
- console.log("tenants", tenants);
8949
- const tenantInfo = tenants.find(tenant => tenant.code === Property.tenantId);
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));
8950
8945
  const acknowledgementData = await getAcknowledgementData(Property, tenantInfo, t);
8951
- console.log("acknowledgementData", acknowledgementData);
8952
8946
  Digit.Utils.pdf.generate(acknowledgementData);
8953
8947
  };
8954
8948
  if (isLoading || isDetailsLoading) {
@@ -8959,25 +8953,34 @@ const CitizenApplicationOverview = () => {
8959
8953
  }, /*#__PURE__*/React.createElement("div", {
8960
8954
  style: {
8961
8955
  display: "flex",
8962
- justifyContent: "space-between",
8956
+ justifyContent: "end",
8963
8957
  alignItems: "center",
8964
8958
  padding: "16px"
8965
8959
  }
8966
- }, /*#__PURE__*/React.createElement(Header, {
8967
- styles: {
8968
- fontSize: "32px"
8969
- }
8970
- }, t("NDC_APP_OVER_VIEW_HEADER")), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A3 = applicationDetails.Applications) === null || _applicationDetails$A3 === void 0 ? void 0 : (_applicationDetails$A4 = _applicationDetails$A3[0]) === null || _applicationDetails$A4 === void 0 ? void 0 : _applicationDetails$A4.applicationStatus) === "APPROVED" && /*#__PURE__*/React.createElement(LinkButton, {
8960
+ }, (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A3 = applicationDetails.Applications) === null || _applicationDetails$A3 === void 0 ? void 0 : (_applicationDetails$A4 = _applicationDetails$A3[0]) === null || _applicationDetails$A4 === void 0 ? void 0 : _applicationDetails$A4.applicationStatus) === "APPROVED" && /*#__PURE__*/React.createElement(LinkButton, {
8961
+ className: "downLoadButton",
8971
8962
  label: t("DOWNLOAD_CERTIFICATE"),
8972
- style: {
8973
- color: "#A52A2A"
8974
- },
8975
8963
  onClick: handleDownloadPdf
8976
- })), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, 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, {
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, {
8972
+ className: "ndc_card_main"
8973
+ }, /*#__PURE__*/React.createElement(CardSubHeader, {
8974
+ className: "ndc_label"
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, {
8977
8976
  key: key,
8978
8977
  label: t(`${key === null || key === void 0 ? void 0 : key.toUpperCase()}`),
8979
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")
8980
- }))))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("NDC_APPLICATION_NDC_DETAILS_OVERVIEW")), displayData === null || displayData === void 0 ? void 0 : (_displayData$NdcDetai = displayData.NdcDetails) === null || _displayData$NdcDetai === void 0 ? void 0 : _displayData$NdcDetai.map((detail, index) => {
8979
+ }))))), /*#__PURE__*/React.createElement(Card, {
8980
+ className: "ndc_card_main"
8981
+ }, /*#__PURE__*/React.createElement(CardSubHeader, {
8982
+ className: "ndc_label"
8983
+ }, t("NDC_APPLICATION_NDC_DETAILS_OVERVIEW")), displayData === null || displayData === void 0 ? void 0 : (_displayData$NdcDetai = displayData.NdcDetails) === null || _displayData$NdcDetai === void 0 ? void 0 : _displayData$NdcDetai.map((detail, index) => {
8981
8984
  var _detail$dueAmount;
8982
8985
  return /*#__PURE__*/React.createElement("div", {
8983
8986
  key: index,
@@ -9000,7 +9003,11 @@ const CitizenApplicationOverview = () => {
9000
9003
  label: t("NDC_PROPERTY_TYPE"),
9001
9004
  text: t(detail.propertyType) || detail.propertyType
9002
9005
  })));
9003
- })), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("NDC_APPLICATION_DOCUMENTS_OVERVIEW")), /*#__PURE__*/React.createElement("div", {
9006
+ })), /*#__PURE__*/React.createElement(Card, {
9007
+ className: "ndc_card_main"
9008
+ }, /*#__PURE__*/React.createElement(CardSubHeader, {
9009
+ className: "ndc_label"
9010
+ }, t("NDC_APPLICATION_DOCUMENTS_OVERVIEW")), /*#__PURE__*/React.createElement("div", {
9004
9011
  style: {
9005
9012
  display: "flex",
9006
9013
  gap: "16px"
@@ -9009,13 +9016,17 @@ const CitizenApplicationOverview = () => {
9009
9016
  value: {
9010
9017
  workflowDocs: displayData === null || displayData === void 0 ? void 0 : displayData.Documents
9011
9018
  }
9012
- }) : /*#__PURE__*/React.createElement("div", null, t("TL_NO_DOCUMENTS_MSG")))), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : _workflowDetails$data.timeline) && /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data2 = workflowDetails.data) === null || _workflowDetails$data2 === void 0 ? void 0 : _workflowDetails$data2.timeline.length) === 1 ? /*#__PURE__*/React.createElement(CheckPoint, {
9019
+ }) : /*#__PURE__*/React.createElement("div", null, t("TL_NO_DOCUMENTS_MSG")))), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data = workflowDetails.data) === null || _workflowDetails$data === void 0 ? void 0 : _workflowDetails$data.timeline) && /*#__PURE__*/React.createElement(Card, {
9020
+ className: "ndc_card_main"
9021
+ }, /*#__PURE__*/React.createElement(CardSubHeader, {
9022
+ className: "ndc_label"
9023
+ }, t("CS_APPLICATION_DETAILS_APPLICATION_TIMELINE")), (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data2 = workflowDetails.data) === null || _workflowDetails$data2 === void 0 ? void 0 : _workflowDetails$data2.timeline.length) === 1 ? /*#__PURE__*/React.createElement(CheckPoint, {
9013
9024
  isCompleted: true,
9014
- label: t("NDC_STATUS_" + (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data3 = workflowDetails.data) === null || _workflowDetails$data3 === void 0 ? void 0 : (_workflowDetails$data4 = _workflowDetails$data3.timeline[0]) === null || _workflowDetails$data4 === void 0 ? void 0 : _workflowDetails$data4.status))
9025
+ label: t(workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data3 = workflowDetails.data) === null || _workflowDetails$data3 === void 0 ? void 0 : (_workflowDetails$data4 = _workflowDetails$data3.timeline[0]) === null || _workflowDetails$data4 === void 0 ? void 0 : _workflowDetails$data4.status)
9015
9026
  }) : /*#__PURE__*/React.createElement(ConnectingCheckPoints, null, workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data5 = workflowDetails.data) === null || _workflowDetails$data5 === void 0 ? void 0 : _workflowDetails$data5.timeline.map((checkpoint, index, arr) => /*#__PURE__*/React.createElement(CheckPoint, {
9016
9027
  keyValue: index,
9017
9028
  isCompleted: index === 0,
9018
- label: t("NDC_STATUS_" + checkpoint.status),
9029
+ label: t(checkpoint.status),
9019
9030
  customChild: getTimelineCaptions$1(checkpoint, index, arr, t)
9020
9031
  })))));
9021
9032
  };
@@ -11533,10 +11544,29 @@ const NewNDCStepForm = () => {
11533
11544
  const formState = useSelector(state => state.ndc.NDCForm);
11534
11545
  const step = formState.step;
11535
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]);
11536
11559
  const setStep = updatedStepNumber => {
11537
11560
  dispatch(setNDCStep(updatedStepNumber));
11538
11561
  };
11539
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]);
11540
11570
  return /*#__PURE__*/React.createElement("div", {
11541
11571
  className: "pageCard"
11542
11572
  }, /*#__PURE__*/React.createElement(CardHeader, {
@@ -11723,7 +11753,7 @@ const NewNDCStepFormOne = ({
11723
11753
  if (!(propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.email)) missingFields.push(t("NDC_MESSAGE_EMAIL"));
11724
11754
  if (!(NDCReason !== null && NDCReason !== void 0 && NDCReason.code)) missingFields.push(t("NDC_MESSAGE_NDC_REASON"));
11725
11755
  const nameRegex = /^[A-Za-z\s]+$/;
11726
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
11756
+ const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$/;
11727
11757
  const mobileRegex = /^[6-9]\d{9}$/;
11728
11758
  if (propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.firstName && !nameRegex.test(propertyDetails.firstName)) {
11729
11759
  invalidFields.push(t("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED"));
@@ -12293,6 +12323,7 @@ const PropertyDetailsForm$1 = ({
12293
12323
  }));
12294
12324
  }
12295
12325
  }, [apiDataCheck]);
12326
+ console.log("propertyDetails====", propertyDetails, formData);
12296
12327
  return /*#__PURE__*/React.createElement("div", {
12297
12328
  style: {
12298
12329
  marginBottom: "16px"
@@ -12586,22 +12617,22 @@ const PropertyDetailsForm$1 = ({
12586
12617
  }, /*#__PURE__*/React.createElement(Controller, {
12587
12618
  control: control,
12588
12619
  name: "email",
12589
- defaultValue: "",
12620
+ defaultValue: (propertyDetails === null || propertyDetails === void 0 ? void 0 : propertyDetails.email) || "",
12590
12621
  render: props => {
12591
- 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;
12592
12623
  return /*#__PURE__*/React.createElement(TextInput, {
12593
12624
  value: props === null || props === void 0 ? void 0 : props.value,
12594
12625
  onChange: e => {
12595
- props.onChange(e.target.value);
12596
12626
  setPropertyDetails(prev => ({
12597
12627
  ...prev,
12598
12628
  email: e.target.value
12599
12629
  }));
12630
+ props.onChange(e.target.value);
12600
12631
  },
12601
12632
  onBlur: e => {
12602
12633
  props.onBlur(e);
12603
12634
  },
12604
- 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
12605
12636
  });
12606
12637
  }
12607
12638
  }))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
@@ -13986,7 +14017,7 @@ const NewNDCStepFormOne$1 = ({
13986
14017
  if (!(propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.email)) missingFields.push(t("NDC_MESSAGE_EMAIL"));
13987
14018
  if (!(NDCReason !== null && NDCReason !== void 0 && NDCReason.code)) missingFields.push(t("NDC_MESSAGE_NDC_REASON"));
13988
14019
  const nameRegex = /^[A-Za-z\s]+$/;
13989
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
14020
+ const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,}$/;
13990
14021
  const mobileRegex = /^[6-9]\d{9}$/;
13991
14022
  if (propertyDetails !== null && propertyDetails !== void 0 && propertyDetails.firstName && !nameRegex.test(propertyDetails.firstName)) {
13992
14023
  invalidFields.push(t("NDC_MESSAGE_FIRST_NAME_ONLY_ALPHABETS_ALLOWED"));