@mseva/digit-ui-module-ndc 1.0.36 → 1.0.38

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
@@ -1000,7 +1000,7 @@ const CloseBtn = props => {
1000
1000
  }, /*#__PURE__*/React__default.createElement(Close, null));
1001
1001
  };
1002
1002
  const NDCModal = _ref => {
1003
- var _action$assigneeRoles, _action$assigneeRoles2;
1003
+ var _action$state;
1004
1004
  let {
1005
1005
  t,
1006
1006
  action,
@@ -1031,12 +1031,14 @@ const NDCModal = _ref => {
1031
1031
  const [error, setError] = React.useState(null);
1032
1032
  const [financialYears, setFinancialYears] = React.useState([]);
1033
1033
  const [selectedFinancialYear, setSelectedFinancialYear] = React.useState(null);
1034
+ const checkRole = action === null || action === void 0 ? void 0 : (_action$state = action.state) === null || _action$state === void 0 ? void 0 : _action$state.actions;
1035
+ const allRoles = [...new Set(checkRole === null || checkRole === void 0 ? void 0 : checkRole.flatMap(a => a.roles))];
1034
1036
  const {
1035
1037
  data: approverData,
1036
1038
  isLoading: PTALoading
1037
1039
  } = Digit.Hooks.useEmployeeSearch(tenantId, {
1038
- roles: action === null || action === void 0 ? void 0 : (_action$assigneeRoles = action.assigneeRoles) === null || _action$assigneeRoles === void 0 ? void 0 : (_action$assigneeRoles2 = _action$assigneeRoles.map) === null || _action$assigneeRoles2 === void 0 ? void 0 : _action$assigneeRoles2.call(_action$assigneeRoles, e => ({
1039
- code: e
1040
+ roles: allRoles === null || allRoles === void 0 ? void 0 : allRoles.map(role => ({
1041
+ code: role
1040
1042
  })),
1041
1043
  isActive: true
1042
1044
  }, {
@@ -1272,7 +1274,7 @@ const ApplicationOverview = () => {
1272
1274
  isLoading,
1273
1275
  data: applicationDetails
1274
1276
  } = Digit.Hooks.ndc.useSearchEmployeeApplication({
1275
- uuid: id
1277
+ applicationNo: id
1276
1278
  }, tenantId);
1277
1279
  const workflowDetails = Digit.Hooks.useWorkflowDetails({
1278
1280
  tenantId: tenantId,
@@ -1280,6 +1282,7 @@ const ApplicationOverview = () => {
1280
1282
  moduleCode: "ndc-services",
1281
1283
  role: "EMPLOYEE"
1282
1284
  });
1285
+ console.log("workflowDetails", workflowDetails);
1283
1286
  if (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data = workflowDetails.data) !== null && _workflowDetails$data !== void 0 && (_workflowDetails$data2 = _workflowDetails$data.actionState) !== null && _workflowDetails$data2 !== void 0 && _workflowDetails$data2.nextActions && !workflowDetails.isLoading) workflowDetails.data.actionState.nextActions = [...(workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data3 = workflowDetails.data) === null || _workflowDetails$data3 === void 0 ? void 0 : _workflowDetails$data3.nextActions)];
1284
1287
  if (workflowDetails && workflowDetails.data && !workflowDetails.isLoading) {
1285
1288
  var _workflowDetails$data4, _workflowDetails$data5;
@@ -1330,6 +1333,7 @@ const ApplicationOverview = () => {
1330
1333
  return (_e$roles2 = e.roles) === null || _e$roles2 === void 0 ? void 0 : _e$roles2.includes(role);
1331
1334
  })) || !e.roles;
1332
1335
  }));
1336
+ console.log("actions", actions);
1333
1337
  const [displayMenu, setDisplayMenu] = React.useState(false);
1334
1338
  const [selectedAction, setSelectedAction] = React.useState(null);
1335
1339
  const [showModal, setShowModal] = React.useState(false);
@@ -1364,7 +1368,7 @@ const ApplicationOverview = () => {
1364
1368
  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,
1365
1369
  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,
1366
1370
  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,
1367
- applicationNo: ndcObject === null || ndcObject === void 0 ? void 0 : ndcObject.uuid
1371
+ applicationNo: ndcObject === null || ndcObject === void 0 ? void 0 : ndcObject.applicationNo
1368
1372
  };
1369
1373
  const Documents = removeDuplicatesByUUID((ndcObject === null || ndcObject === void 0 ? void 0 : ndcObject.Documents) || []);
1370
1374
  const NdcDetails = (_removeDuplicatesByUU = removeDuplicatesByUUID((ndcObject === null || ndcObject === void 0 ? void 0 : ndcObject.NdcDetails) || [])) === null || _removeDuplicatesByUU === void 0 ? void 0 : _removeDuplicatesByUU.map(item => {
@@ -1393,6 +1397,7 @@ const ApplicationOverview = () => {
1393
1397
  }, [applicationDetails]);
1394
1398
  function onActionSelect(action) {
1395
1399
  var _displayData$applican;
1400
+ console.log("action====???", action);
1396
1401
  const payload = {
1397
1402
  Licenses: [action]
1398
1403
  };
@@ -1466,11 +1471,8 @@ const ApplicationOverview = () => {
1466
1471
  setShowModal(false);
1467
1472
  });
1468
1473
  }, function () {
1469
- setShowToast({
1470
- key: "error",
1471
- message: "Something went wrong"
1472
- });
1473
- setError("Something went wrong");
1474
+ setErrorOne("Something went wrong");
1475
+ setShowErrorToastt(true);
1474
1476
  });
1475
1477
  return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
1476
1478
  } catch (e) {
@@ -1652,7 +1654,7 @@ const ApplicationOverview = () => {
1652
1654
  label: t("COMMON_EDIT"),
1653
1655
  onSubmit: () => {
1654
1656
  var _applicationDetails$A7, _applicationDetails$A8;
1655
- 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;
1657
+ 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.applicationNo;
1656
1658
  history.push("/digit-ui/employee/ndc/create/" + id);
1657
1659
  }
1658
1660
  })), showModal ? /*#__PURE__*/React__default.createElement(NDCModal, {
@@ -8993,19 +8995,19 @@ const capitalize = text => text.substr(0, 1).toUpperCase() + text.substr(1);
8993
8995
  const ulbCamel = ulb => ulb.toLowerCase().split(" ").map(capitalize).join(" ");
8994
8996
  const getAcknowledgementData = function (application, tenantInfo, t) {
8995
8997
  try {
8996
- var _application$Applicat, _appData$owners, _appData$NdcDetails, _appData$additionalDe, _tenantInfo$city;
8998
+ var _application$Applicat, _appData$owners, _appData$NdcDetails, _appData$NdcDetails2, _appData$NdcDetails2$, _appData$NdcDetails3, _appData$NdcDetails3$, _appData$NdcDetails3$2, _appData$additionalDe, _tenantInfo$city;
8997
8999
  const appData = (application === null || application === void 0 ? void 0 : (_application$Applicat = application.Applications) === null || _application$Applicat === void 0 ? void 0 : _application$Applicat[0]) || {};
8998
9000
  const owner = (appData === null || appData === void 0 ? void 0 : (_appData$owners = appData.owners) === null || _appData$owners === void 0 ? void 0 : _appData$owners[0]) || {};
8999
9001
  const ndc = (appData === null || appData === void 0 ? void 0 : (_appData$NdcDetails = appData.NdcDetails) === null || _appData$NdcDetails === void 0 ? void 0 : _appData$NdcDetails[0]) || {};
9000
9002
  const add = (ndc === null || ndc === void 0 ? void 0 : ndc.additionalDetails) || {};
9001
- const applicationNumber = (appData === null || appData === void 0 ? void 0 : appData.uuid) || "NA";
9002
- const propertyId = (ndc === null || ndc === void 0 ? void 0 : ndc.consumerCode) || "NA";
9003
+ const applicationNumber = (appData === null || appData === void 0 ? void 0 : appData.applicationNo) || "NA";
9004
+ const propertyId = appData === null || appData === void 0 ? void 0 : (_appData$NdcDetails2 = appData.NdcDetails) === null || _appData$NdcDetails2 === void 0 ? void 0 : (_appData$NdcDetails2$ = _appData$NdcDetails2[3]) === null || _appData$NdcDetails2$ === void 0 ? void 0 : _appData$NdcDetails2$.consumerCode;
9003
9005
  const propertyType = add !== null && add !== void 0 && add.propertyType ? t(add.propertyType) : "NA";
9004
9006
  const applicantName = (owner === null || owner === void 0 ? void 0 : owner.name) || "NA";
9005
- const address = (owner === null || owner === void 0 ? void 0 : owner.permanentAddress) || (owner === null || owner === void 0 ? void 0 : owner.correspondenceAddress) || "NA";
9007
+ const address = (appData === null || appData === void 0 ? void 0 : (_appData$NdcDetails3 = appData.NdcDetails) === null || _appData$NdcDetails3 === void 0 ? void 0 : (_appData$NdcDetails3$ = _appData$NdcDetails3[0]) === null || _appData$NdcDetails3$ === void 0 ? void 0 : (_appData$NdcDetails3$2 = _appData$NdcDetails3$.additionalDetails) === null || _appData$NdcDetails3$2 === void 0 ? void 0 : _appData$NdcDetails3$2.propertyAddress) || (owner === null || owner === void 0 ? void 0 : owner.permanentAddress) || (owner === null || owner === void 0 ? void 0 : owner.correspondenceAddress) || "NA";
9006
9008
  const ulbName = (tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.name) || (appData === null || appData === void 0 ? void 0 : appData.tenantId) || "NA";
9007
9009
  const duesAmount = (add === null || add === void 0 ? void 0 : add.duesAmount) || (appData === null || appData === void 0 ? void 0 : (_appData$additionalDe = appData.additionalDetails) === null || _appData$additionalDe === void 0 ? void 0 : _appData$additionalDe.duesAmount) || "0";
9008
- const certificateBody = t("NDC_MSG_INTRO") + "\n\n" + t("NDC_MSG_APPLICATION_LABEL") + ": " + applicationNumber + "\n\n" + t("NDC_MSG_PROPERTY_LABEL") + ": " + propertyId + " " + t("NDC_MSG_PROPERTY_TYPE_LABEL") + " " + propertyType + "\n\n" + t("NDC_MSG_APPLICANT_LABEL") + ": " + applicantName + " " + t("NDC_MSG_FOR_LAND") + " " + address + "\n\n" + t("NDC_MSG_FALLING_CLAUSE_PART1") + " " + t("NDC_MSG_FALLING_CLAUSE_PART2") + " " + ulbName + " " + t("NDC_MSG_AFTER_RECOVERY") + " " + duesAmount + " " + t("NDC_MSG_DUES_LIST") + "\n\n" + t("NDC_MSG_DECLARATION_TITLE") + "\n" + t("NDC_MSG_DECL_A") + "\n" + t("NDC_MSG_DECL_B") + "\n" + t("NDC_MSG_DECL_C") + "\n" + t("NDC_MSG_DECL_D") + "\n" + t("NDC_MSG_DECL_E") + "\n\n" + t("NDC_MSG_DISCLAIMER_TITLE") + "\n" + t("NDC_MSG_DISCLAIMER_BODY") + "\n\n" + t("NDC_MSG_NOTE") + " " + t("NDC_MSG_VERIFICATION_LINK_LABEL");
9010
+ const certificateBody = t("NDC_MSG_INTRO") + "\n\n" + t("NDC_MSG_APPLICATION_LABEL") + ": " + applicationNumber + "\n\n" + t("NDC_MSG_PROPERTY_LABEL") + ": " + propertyId + " " + t("NDC_MSG_PROPERTY_TYPE_LABEL") + " " + propertyType + "\n\n" + t("NDC_MSG_APPLICANT_LABEL") + ": " + applicantName + " " + t("NDC_MSG_FOR_LAND") + " " + address + " " + t("NDC_MSG_FALLING_CLAUSE_PART1") + " " + t("NDC_MSG_FALLING_CLAUSE_PART2") + " Municipal Council/ Corporation " + t("NDC_MSG_AFTER_RECOVERY") + " " + duesAmount + " " + t("NDC_MSG_DUES_LIST") + "\n\n" + t("NDC_MSG_DECLARATION_TITLE") + "\n" + t("NDC_MSG_DECL_A") + "\n" + t("NDC_MSG_DECL_B") + "\n" + t("NDC_MSG_DECL_C") + "\n" + t("NDC_MSG_DECL_D") + "\n" + t("NDC_MSG_DECL_E") + "\n\n" + t("NDC_MSG_DISCLAIMER_TITLE") + "\n" + t("NDC_MSG_DISCLAIMER_BODY") + "\n\n" + t("NDC_MSG_NOTE") + " " + t("NDC_MSG_VERIFICATION_LINK_LABEL");
9009
9011
  return Promise.resolve({
9010
9012
  t,
9011
9013
  tenantId: tenantInfo === null || tenantInfo === void 0 ? void 0 : tenantInfo.code,
@@ -9085,7 +9087,7 @@ const CitizenApplicationOverview = () => {
9085
9087
  isLoading,
9086
9088
  data: applicationDetails
9087
9089
  } = Digit.Hooks.ndc.useSearchEmployeeApplication({
9088
- uuid: id
9090
+ applicationNo: id
9089
9091
  }, tenantId);
9090
9092
  const workflowDetails = Digit.Hooks.useWorkflowDetails({
9091
9093
  tenantId: tenantId,
@@ -9127,7 +9129,7 @@ const CitizenApplicationOverview = () => {
9127
9129
  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,
9128
9130
  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,
9129
9131
  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,
9130
- applicationNo: ndcObject === null || ndcObject === void 0 ? void 0 : ndcObject.uuid
9132
+ applicationNo: ndcObject === null || ndcObject === void 0 ? void 0 : ndcObject.applicationNo
9131
9133
  };
9132
9134
  const Documents = removeDuplicatesByUUID((ndcObject === null || ndcObject === void 0 ? void 0 : ndcObject.Documents) || []);
9133
9135
  const NdcDetails = (_removeDuplicatesByUU = removeDuplicatesByUUID((ndcObject === null || ndcObject === void 0 ? void 0 : ndcObject.NdcDetails) || [])) === null || _removeDuplicatesByUU === void 0 ? void 0 : _removeDuplicatesByUU.map(item => {
@@ -9219,7 +9221,7 @@ const CitizenApplicationOverview = () => {
9219
9221
  label: t("COMMON_EDIT"),
9220
9222
  onSubmit: () => {
9221
9223
  var _applicationDetails$A9, _applicationDetails$A0;
9222
- const id = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A9 = applicationDetails.Applications) === null || _applicationDetails$A9 === void 0 ? void 0 : (_applicationDetails$A0 = _applicationDetails$A9[0]) === null || _applicationDetails$A0 === void 0 ? void 0 : _applicationDetails$A0.uuid;
9224
+ const id = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A9 = applicationDetails.Applications) === null || _applicationDetails$A9 === void 0 ? void 0 : (_applicationDetails$A0 = _applicationDetails$A9[0]) === null || _applicationDetails$A0 === void 0 ? void 0 : _applicationDetails$A0.applicationNo;
9223
9225
  history.push("/digit-ui/citizen/ndc/new-application/" + id);
9224
9226
  }
9225
9227
  }))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, {
@@ -9424,7 +9426,7 @@ const SearchFormFieldsComponents = _ref => {
9424
9426
  textAlign: "start"
9425
9427
  }
9426
9428
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SearchField, null, /*#__PURE__*/React__default.createElement("label", null, t("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
9427
- name: "uuid",
9429
+ name: "applicationNo",
9428
9430
  inputRef: registerRef({})
9429
9431
  })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.SearchField, null, /*#__PURE__*/React__default.createElement("label", null, t("CORE_COMMON_PHONE_NUMBER")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
9430
9432
  name: "mobileNumber",
@@ -9437,7 +9439,7 @@ const SearchFormFieldsComponents = _ref => {
9437
9439
  }, searchFieldComponents)))));
9438
9440
  }
9439
9441
  return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SearchField, null, /*#__PURE__*/React__default.createElement("label", null, t("NOC_APPLICATION_NUMBER_LABEL")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
9440
- name: "uuid",
9442
+ name: "applicationNo",
9441
9443
  inputRef: registerRef({})
9442
9444
  })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.SearchField, null, /*#__PURE__*/React__default.createElement("label", null, t("NOC_BPA_APPLICATION_NUMBER_LABEL")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
9443
9445
  name: "sourceRefId",
@@ -9539,6 +9541,7 @@ const useInboxTableConfig = _ref => {
9539
9541
  let {
9540
9542
  row
9541
9543
  } = _ref2;
9544
+ console.log("row", row);
9542
9545
  return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
9543
9546
  to: parentRoute + "/inbox/application-overview/" + ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.applicationId)
9544
9547
  }, /*#__PURE__*/React__default.createElement("span", {
@@ -9731,7 +9734,7 @@ const Inbox = _ref => {
9731
9734
  const InboxObjectInSessionStorage = Digit.SessionStorage.get("NDC.INBOX");
9732
9735
  const onSearchFormReset = setSearchFormValue => {
9733
9736
  setSearchFormValue("sourceRefId", null);
9734
- setSearchFormValue("uuid", null);
9737
+ setSearchFormValue("applicationNo", null);
9735
9738
  setSearchFormValue("mobileNumber", null);
9736
9739
  dispatch({
9737
9740
  action: "mutateSearchForm",
@@ -11842,7 +11845,7 @@ const NewNDCStepForm = () => {
11842
11845
  isLoading,
11843
11846
  data: applicationDetails
11844
11847
  } = Digit.Hooks.ndc.useSearchEmployeeApplication({
11845
- uuid: id
11848
+ applicationNo: id
11846
11849
  }, tenantId);
11847
11850
  React.useEffect(() => {
11848
11851
  console.log("applicationDetails", applicationDetails);
@@ -11884,6 +11887,51 @@ const NewNDCStepForm = () => {
11884
11887
  }));
11885
11888
  };
11886
11889
 
11890
+ const Loader = _ref => {
11891
+ let {
11892
+ page = false
11893
+ } = _ref;
11894
+ const baseStyle = {
11895
+ display: "flex",
11896
+ justifyContent: "center",
11897
+ alignItems: "center"
11898
+ };
11899
+ const pageStyle = _extends({}, baseStyle, {
11900
+ position: "fixed",
11901
+ top: 0,
11902
+ left: 0,
11903
+ width: "100vw",
11904
+ height: "100vh",
11905
+ background: "rgba(255,255,255,0.6)",
11906
+ backdropFilter: "blur(4px)",
11907
+ zIndex: 9999
11908
+ });
11909
+ const moduleStyle = _extends({}, baseStyle, {
11910
+ minHeight: "100px",
11911
+ width: "100%",
11912
+ position: "relative"
11913
+ });
11914
+ const spinnerStyle = {
11915
+ width: "64px",
11916
+ height: "64px",
11917
+ border: "8px solid #1976d2",
11918
+ borderTop: "8px solid transparent",
11919
+ borderRadius: "50%",
11920
+ animation: "spin 1.2s linear infinite"
11921
+ };
11922
+ return /*#__PURE__*/React__default.createElement("div", {
11923
+ style: page ? pageStyle : moduleStyle
11924
+ }, /*#__PURE__*/React__default.createElement("div", {
11925
+ style: spinnerStyle
11926
+ }), /*#__PURE__*/React__default.createElement("style", null, "\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "));
11927
+ };
11928
+ Loader.propTypes = {
11929
+ page: propTypes.bool
11930
+ };
11931
+ Loader.defaultProps = {
11932
+ page: false
11933
+ };
11934
+
11887
11935
  const NewNDCStepFormOne = _ref => {
11888
11936
  let {
11889
11937
  config,
@@ -11897,6 +11945,7 @@ const NewNDCStepFormOne = _ref => {
11897
11945
  const user = Digit.UserService.getUser();
11898
11946
  const id = window.location.pathname.split("/").pop();
11899
11947
  const currentStepData = reactRedux.useSelector(state => state.ndc.NDCForm.formData && state.ndc.NDCForm.formData[config.key] ? state.ndc.NDCForm.formData[config.key] : {});
11948
+ const [getLoader, setLoader] = React.useState(false);
11900
11949
  const checkFormData = reactRedux.useSelector(state => state.ndc.NDCForm.formData || {});
11901
11950
  const checkFormDatass = reactRedux.useSelector(state => state.ndc.NDCForm || {});
11902
11951
  const tenantId = window.localStorage.getItem("CITIZEN.CITY");
@@ -11914,7 +11963,7 @@ const NewNDCStepFormOne = _ref => {
11914
11963
  console.log("checkFormData", checkFormData);
11915
11964
  const isRealId = id && id.startsWith("NDC-");
11916
11965
  console.log("isRealId", isRealId);
11917
- if (checkFormData !== null && checkFormData !== void 0 && (_checkFormData$apiDat = checkFormData.apiData) !== null && _checkFormData$apiDat !== void 0 && (_checkFormData$apiDat2 = _checkFormData$apiDat.Applications) !== null && _checkFormData$apiDat2 !== void 0 && (_checkFormData$apiDat3 = _checkFormData$apiDat2[0]) !== null && _checkFormData$apiDat3 !== void 0 && _checkFormData$apiDat3.uuid || checkFormData !== null && checkFormData !== void 0 && (_checkFormData$respon = checkFormData.responseData) !== null && _checkFormData$respon !== void 0 && (_checkFormData$respon2 = _checkFormData$respon[0]) !== null && _checkFormData$respon2 !== void 0 && _checkFormData$respon2.uuid || isRealId) {
11966
+ if (checkFormData !== null && checkFormData !== void 0 && (_checkFormData$apiDat = checkFormData.apiData) !== null && _checkFormData$apiDat !== void 0 && (_checkFormData$apiDat2 = _checkFormData$apiDat.Applications) !== null && _checkFormData$apiDat2 !== void 0 && (_checkFormData$apiDat3 = _checkFormData$apiDat2[0]) !== null && _checkFormData$apiDat3 !== void 0 && _checkFormData$apiDat3.applicationNo || checkFormData !== null && checkFormData !== void 0 && (_checkFormData$respon = checkFormData.responseData) !== null && _checkFormData$respon !== void 0 && (_checkFormData$respon2 = _checkFormData$respon[0]) !== null && _checkFormData$respon2 !== void 0 && _checkFormData$respon2.applicationNo || isRealId) {
11918
11967
  updateApplication(data);
11919
11968
  console.log("here bab");
11920
11969
  } else createApplication(data);
@@ -11922,6 +11971,7 @@ const NewNDCStepFormOne = _ref => {
11922
11971
  const createApplication = function (data) {
11923
11972
  try {
11924
11973
  var _Digit$UserService$ge, _data$cpt, _data$cpt$details, _user$info, _user$info2, _data$PropertyDetails, _user$info3, _user$info4, _data$PropertyDetails2, _data$PropertyDetails4, _data$PropertyDetails6, _data$PropertyDetails7, _data$NDCReason;
11974
+ setLoader(true);
11925
11975
  const applicant = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
11926
11976
  const auditDetails = data === null || data === void 0 ? void 0 : (_data$cpt = data.cpt) === null || _data$cpt === void 0 ? void 0 : (_data$cpt$details = _data$cpt.details) === null || _data$cpt$details === void 0 ? void 0 : _data$cpt$details.auditDetails;
11927
11977
  const applicantId = applicant === null || applicant === void 0 ? void 0 : applicant.uuid;
@@ -11992,32 +12042,37 @@ const NewNDCStepFormOne = _ref => {
11992
12042
  }
11993
12043
  }]
11994
12044
  };
11995
- return Promise.resolve(Digit.NDCService.NDCcreate({
11996
- tenantId,
11997
- details: payload
11998
- })).then(function (response) {
11999
- var _response$ResponseInf;
12000
- if ((response === null || response === void 0 ? void 0 : (_response$ResponseInf = response.ResponseInfo) === null || _response$ResponseInf === void 0 ? void 0 : _response$ResponseInf.status) === "successful") {
12001
- dispatch(updateNDCForm("apiData", response));
12002
- onGoNext();
12003
- return {
12004
- isSuccess: true,
12005
- response
12006
- };
12007
- } else {
12008
- return {
12009
- isSuccess: false,
12010
- response
12011
- };
12012
- }
12013
- });
12045
+ return Promise.resolve(_catch(function () {
12046
+ return Promise.resolve(Digit.NDCService.NDCcreate({
12047
+ tenantId,
12048
+ details: payload
12049
+ })).then(function (response) {
12050
+ var _response$ResponseInf;
12051
+ setLoader(false);
12052
+ if ((response === null || response === void 0 ? void 0 : (_response$ResponseInf = response.ResponseInfo) === null || _response$ResponseInf === void 0 ? void 0 : _response$ResponseInf.status) === "successful") {
12053
+ dispatch(updateNDCForm("apiData", response));
12054
+ onGoNext();
12055
+ return {
12056
+ isSuccess: true,
12057
+ response
12058
+ };
12059
+ } else {
12060
+ return {
12061
+ isSuccess: false,
12062
+ response
12063
+ };
12064
+ }
12065
+ });
12066
+ }, function () {
12067
+ setLoader(false);
12068
+ }));
12014
12069
  } catch (e) {
12015
12070
  return Promise.reject(e);
12016
12071
  }
12017
12072
  };
12018
12073
  const updateApplication = function (data) {
12019
12074
  try {
12020
- var _Digit$UserService$ge2, _data$cpt6, _data$cpt6$details, _user$info5, _user$info6, _data$PropertyDetails1, _user$info7, _user$info8, _checkFormData$respon3, _checkFormData$respon4, _checkFormData$respon5, _data$NDCReason2, _data$cpt1, _data$cpt1$details;
12075
+ var _Digit$UserService$ge2, _data$cpt6, _data$cpt6$details, _user$info5, _user$info6, _data$PropertyDetails1, _user$info7, _user$info8, _checkFormData$respon3, _checkFormData$respon4, _checkFormData$respon5, _data$NDCReason2, _data$cpt1, _data$cpt1$details, _checkFormData$respon6, _checkFormData$respon7;
12021
12076
  const applicant = ((_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.info) || {};
12022
12077
  const auditDetails = data === null || data === void 0 ? void 0 : (_data$cpt6 = data.cpt) === null || _data$cpt6 === void 0 ? void 0 : (_data$cpt6$details = _data$cpt6.details) === null || _data$cpt6$details === void 0 ? void 0 : _data$cpt6$details.auditDetails;
12023
12078
  const applicantId = applicant === null || applicant === void 0 ? void 0 : applicant.uuid;
@@ -12091,7 +12146,8 @@ const NewNDCStepFormOne = _ref => {
12091
12146
  active: true,
12092
12147
  reason: data === null || data === void 0 ? void 0 : (_data$NDCReason2 = data.NDCReason) === null || _data$NDCReason2 === void 0 ? void 0 : _data$NDCReason2.code,
12093
12148
  auditDetails: data === null || data === void 0 ? void 0 : (_data$cpt1 = data.cpt) === null || _data$cpt1 === void 0 ? void 0 : (_data$cpt1$details = _data$cpt1.details) === null || _data$cpt1$details === void 0 ? void 0 : _data$cpt1$details.auditDetails,
12094
- uuid: id,
12149
+ applicationNo: id,
12150
+ uuid: checkFormData === null || checkFormData === void 0 ? void 0 : (_checkFormData$respon6 = checkFormData.responseData) === null || _checkFormData$respon6 === void 0 ? void 0 : (_checkFormData$respon7 = _checkFormData$respon6[0]) === null || _checkFormData$respon7 === void 0 ? void 0 : _checkFormData$respon7.uuid,
12095
12151
  workflow: {
12096
12152
  action: "DRAFT"
12097
12153
  }
@@ -12199,6 +12255,8 @@ const NewNDCStepFormOne = _ref => {
12199
12255
  label: t("" + config.texts.submitBarLabel),
12200
12256
  currentStep: config.currStepNumber,
12201
12257
  onBackClick: onGoBack
12258
+ }), getLoader && /*#__PURE__*/React__default.createElement(Loader, {
12259
+ page: true
12202
12260
  }), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
12203
12261
  isDleteBtn: true,
12204
12262
  error: true,
@@ -13044,6 +13102,7 @@ const PropertySearchNSummary = _ref => {
13044
13102
  var _apiDataCheck$, _apiDataCheck$$NdcDet, _formData$cpt, _formData$cpt2, _propertyDetails$Prop3, _apiDataCheck$2, _formData$cpt11, _formData$cpt11$dues;
13045
13103
  const fetchBill = function () {
13046
13104
  try {
13105
+ setLoader(true);
13047
13106
  const _temp = _catch(function () {
13048
13107
  var _formData$cpt13;
13049
13108
  return Promise.resolve(Digit.PaymentService.fetchBill(tenantId, {
@@ -13095,8 +13154,10 @@ const PropertySearchNSummary = _ref => {
13095
13154
  setNoDue(true);
13096
13155
  setCheckStats(false);
13097
13156
  }
13157
+ setLoader(false);
13098
13158
  });
13099
13159
  }, function () {
13160
+ setLoader(false);
13100
13161
  setShowToast({
13101
13162
  error: true,
13102
13163
  label: t("NDC_MESSAGE_FETCH_FAILED")
@@ -13131,6 +13192,7 @@ const PropertySearchNSummary = _ref => {
13131
13192
  const search = reactRouterDom.useLocation().search;
13132
13193
  const urlPropertyId = new URLSearchParams(search).get("propertyId");
13133
13194
  const isfirstRender = React.useRef(true);
13195
+ const [getLoader, setLoader] = React.useState(false);
13134
13196
  const ptFromApi = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$ = apiDataCheck[0]) === null || _apiDataCheck$ === void 0 ? void 0 : (_apiDataCheck$$NdcDet = _apiDataCheck$.NdcDetails) === null || _apiDataCheck$$NdcDet === void 0 ? void 0 : _apiDataCheck$$NdcDet.find(item => item.businessService == "PT");
13135
13197
  const [propertyId, setPropertyId] = React.useState((formData === null || formData === void 0 ? void 0 : (_formData$cpt = formData.cpt) === null || _formData$cpt === void 0 ? void 0 : _formData$cpt.id) || (urlPropertyId !== "null" ? urlPropertyId : "") || (ptFromApi === null || ptFromApi === void 0 ? void 0 : ptFromApi.consumerCode) || "");
13136
13198
  const [searchPropertyId, setSearchPropertyId] = React.useState((formData === null || formData === void 0 ? void 0 : (_formData$cpt2 = formData.cpt) === null || _formData$cpt2 === void 0 ? void 0 : _formData$cpt2.id) || (urlPropertyId !== "null" ? urlPropertyId : "") || (ptFromApi === null || ptFromApi === void 0 ? void 0 : ptFromApi.consumerCode) || "");
@@ -13324,7 +13386,7 @@ const PropertySearchNSummary = _ref => {
13324
13386
  return () => clearTimeout(timer);
13325
13387
  }
13326
13388
  }, [showToast]);
13327
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, isLoading && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null), /*#__PURE__*/React__default.createElement("div", {
13389
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
13328
13390
  style: {
13329
13391
  marginBottom: "16px"
13330
13392
  }
@@ -13404,7 +13466,9 @@ const PropertySearchNSummary = _ref => {
13404
13466
  onClose: () => {
13405
13467
  setShowToast(null);
13406
13468
  }
13407
- })));
13469
+ })), (isLoading || getLoader) && /*#__PURE__*/React__default.createElement(Loader, {
13470
+ page: true
13471
+ }));
13408
13472
  };
13409
13473
 
13410
13474
  const SelectNDCDocuments = _ref => {
@@ -13455,7 +13519,7 @@ const SelectNDCDocuments = _ref => {
13455
13519
  goNext();
13456
13520
  }, [documents]);
13457
13521
  if (isLoading) {
13458
- return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
13522
+ return /*#__PURE__*/React__default.createElement(Loader, null);
13459
13523
  }
13460
13524
  return /*#__PURE__*/React__default.createElement("div", null, ndcDocuments === null || ndcDocuments === void 0 ? void 0 : ndcDocuments.map((document, index) => {
13461
13525
  return /*#__PURE__*/React__default.createElement(SelectDocument, {
@@ -13496,6 +13560,7 @@ function SelectDocument(_ref2) {
13496
13560
  return item === null || item === void 0 ? void 0 : (_item$documentType = item.documentType) === null || _item$documentType === void 0 ? void 0 : _item$documentType.includes(doc === null || doc === void 0 ? void 0 : doc.code);
13497
13561
  })[0];
13498
13562
  const tenantId = Digit.ULBService.getCurrentTenantId();
13563
+ const [getLoader, setLoader] = React.useState(false);
13499
13564
  const [file, setFile] = React.useState(null);
13500
13565
  const [uploadedFile, setUploadedFile] = React.useState(() => (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.fileStoreId) || null);
13501
13566
  function selectfile(e) {
@@ -13530,9 +13595,11 @@ function SelectDocument(_ref2) {
13530
13595
  setError(null);
13531
13596
  const _temp3 = function () {
13532
13597
  if (file) {
13598
+ setLoader(true);
13533
13599
  const _temp2 = function () {
13534
13600
  if (file.size >= 5242880) {
13535
13601
  setError(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
13602
+ setLoader(false);
13536
13603
  if (!formState.errors[config.key]) setFormError(config.key, {
13537
13604
  type: doc === null || doc === void 0 ? void 0 : doc.code
13538
13605
  });
@@ -13541,6 +13608,7 @@ function SelectDocument(_ref2) {
13541
13608
  setUploadedFile(null);
13542
13609
  return Promise.resolve(Digit.UploadServices.Filestorage("PT", file, Digit.ULBService.getStateId())).then(function (response) {
13543
13610
  var _response$data, _response$data$files;
13611
+ setLoader(false);
13544
13612
  if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
13545
13613
  var _response$data2, _response$data2$files;
13546
13614
  setUploadedFile(response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$files = _response$data2.files[0]) === null || _response$data2$files === void 0 ? void 0 : _response$data2$files.fileStoreId);
@@ -13549,6 +13617,7 @@ function SelectDocument(_ref2) {
13549
13617
  }
13550
13618
  });
13551
13619
  }, function () {
13620
+ setLoader(false);
13552
13621
  setError(t("CS_FILE_UPLOAD_ERROR"));
13553
13622
  });
13554
13623
  if (_temp && _temp.then) return _temp.then(function () {});
@@ -13582,7 +13651,9 @@ function SelectDocument(_ref2) {
13582
13651
  width: "100%"
13583
13652
  },
13584
13653
  accept: "image/*,.pdf"
13585
- }))));
13654
+ }))), getLoader && /*#__PURE__*/React__default.createElement(Loader, {
13655
+ page: true
13656
+ }));
13586
13657
  }
13587
13658
 
13588
13659
  const NewNDCStepFormTwo = _ref => {
@@ -13610,7 +13681,7 @@ const NewNDCStepFormTwo = _ref => {
13610
13681
  data: applicationDetails,
13611
13682
  refetch
13612
13683
  } = Digit.Hooks.ndc.useSearchEmployeeApplication({
13613
- uuid: id
13684
+ applicationNo: id
13614
13685
  }, tenantId);
13615
13686
  React.useEffect(() => {
13616
13687
  if (applicationDetails !== null && applicationDetails !== void 0 && applicationDetails.Applications.length) {
@@ -13736,7 +13807,7 @@ const NewNDCStepFormTwo = _ref => {
13736
13807
  };
13737
13808
 
13738
13809
  const NDCSummary = _ref => {
13739
- var _formData$DocummentDe, _formData$DocummentDe2, _formData$apiData, _formData$apiData$App, _formData$apiData$App2, _formData$responseDat, _formData$responseDat2, _user$info, _user$info$roles, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _workflowDetails$data6, _formData$NDCDetails, _formData$NDCDetails$, _formData$NDCDetails2, _formData$NDCDetails3, _formData$NDCDetails4, _formData$NDCDetails5, _formData$NDCDetails6, _formData$NDCDetails7, _formData$NDCDetails8, _formData$NDCDetails9, _formData$NDCDetails0, _formData$NDCDetails1, _formData$NDCDetails10, _formData$NDCDetails11, _formData$NDCDetails12, _formData$NDCDetails13, _formData$NDCDetails14, _formData$NDCDetails15, _formData$NDCDetails16, _formData$NDCDetails17, _formData$NDCDetails18, _formData$NDCDetails19, _formData$NDCDetails20, _formData$NDCDetails21, _workflowDetails$data7, _workflowDetails$data8, _workflowDetails$data9;
13810
+ var _formData$DocummentDe, _formData$DocummentDe2, _formData$apiData, _formData$apiData$App, _formData$apiData$App2, _formData$responseDat, _formData$responseDat2, _user$info, _user$info$roles, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _formData$NDCDetails, _formData$NDCDetails$, _formData$NDCDetails2, _formData$NDCDetails3, _formData$NDCDetails4, _formData$NDCDetails5, _formData$NDCDetails6, _formData$NDCDetails7, _formData$NDCDetails8, _formData$NDCDetails9, _formData$NDCDetails0, _formData$NDCDetails1, _formData$NDCDetails10, _formData$NDCDetails11, _formData$NDCDetails12, _formData$NDCDetails13, _formData$NDCDetails14, _formData$NDCDetails15, _formData$NDCDetails16, _formData$NDCDetails17, _formData$NDCDetails18, _formData$NDCDetails19, _formData$NDCDetails20, _formData$NDCDetails21, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8;
13740
13811
  let {
13741
13812
  formData,
13742
13813
  goNext,
@@ -13753,9 +13824,8 @@ const NDCSummary = _ref => {
13753
13824
  const dispatch = reactRedux.useDispatch();
13754
13825
  const mutateScreen = url.includes("/property-mutate/");
13755
13826
  let user = Digit.UserService.getUser();
13756
- console.log("formData", formData);
13757
13827
  let docs = formData === null || formData === void 0 ? void 0 : (_formData$DocummentDe = formData.DocummentDetails) === null || _formData$DocummentDe === void 0 ? void 0 : (_formData$DocummentDe2 = _formData$DocummentDe.documents) === null || _formData$DocummentDe2 === void 0 ? void 0 : _formData$DocummentDe2.documents;
13758
- const appId = (formData === null || formData === void 0 ? void 0 : (_formData$apiData = formData.apiData) === null || _formData$apiData === void 0 ? void 0 : (_formData$apiData$App = _formData$apiData.Applications) === null || _formData$apiData$App === void 0 ? void 0 : (_formData$apiData$App2 = _formData$apiData$App[0]) === null || _formData$apiData$App2 === void 0 ? void 0 : _formData$apiData$App2.uuid) || (formData === null || formData === void 0 ? void 0 : (_formData$responseDat = formData.responseData) === null || _formData$responseDat === void 0 ? void 0 : (_formData$responseDat2 = _formData$responseDat[0]) === null || _formData$responseDat2 === void 0 ? void 0 : _formData$responseDat2.uuid);
13828
+ const appId = (formData === null || formData === void 0 ? void 0 : (_formData$apiData = formData.apiData) === null || _formData$apiData === void 0 ? void 0 : (_formData$apiData$App = _formData$apiData.Applications) === null || _formData$apiData$App === void 0 ? void 0 : (_formData$apiData$App2 = _formData$apiData$App[0]) === null || _formData$apiData$App2 === void 0 ? void 0 : _formData$apiData$App2.applicationNo) || (formData === null || formData === void 0 ? void 0 : (_formData$responseDat = formData.responseData) === null || _formData$responseDat === void 0 ? void 0 : (_formData$responseDat2 = _formData$responseDat[0]) === null || _formData$responseDat2 === void 0 ? void 0 : _formData$responseDat2.applicationNo);
13759
13829
  const tenantId = window.location.href.includes("citizen") ? window.localStorage.getItem("CITIZEN.CITY") : window.localStorage.getItem("Employee.tenant-id");
13760
13830
  const isCitizen = window.location.href.includes("citizen");
13761
13831
  const [getData, setData] = React.useState();
@@ -13779,9 +13849,8 @@ const NDCSummary = _ref => {
13779
13849
  },
13780
13850
  details: payload
13781
13851
  })).then(function (response) {
13782
- var _response$Calculation, _response$Calculation2, _response$Calculation3;
13783
- console.log("response", response === null || response === void 0 ? void 0 : (_response$Calculation = response.Calculation) === null || _response$Calculation === void 0 ? void 0 : (_response$Calculation2 = _response$Calculation[0]) === null || _response$Calculation2 === void 0 ? void 0 : _response$Calculation2.totalAmount);
13784
- setData(response === null || response === void 0 ? void 0 : (_response$Calculation3 = response.Calculation) === null || _response$Calculation3 === void 0 ? void 0 : _response$Calculation3[0]);
13852
+ var _response$Calculation;
13853
+ setData(response === null || response === void 0 ? void 0 : (_response$Calculation = response.Calculation) === null || _response$Calculation === void 0 ? void 0 : _response$Calculation[0]);
13785
13854
  });
13786
13855
  } catch (e) {
13787
13856
  return Promise.reject(e);
@@ -13810,8 +13879,6 @@ const NDCSummary = _ref => {
13810
13879
  function onActionSelect(action) {
13811
13880
  goNext(action);
13812
13881
  }
13813
- console.log("workflowDetails", workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data6 = workflowDetails.data) === null || _workflowDetails$data6 === void 0 ? void 0 : _workflowDetails$data6.nextActions);
13814
- console.log("actions", actions);
13815
13882
  const pageStyle = {
13816
13883
  padding: "2rem",
13817
13884
  backgroundColor: "#f9f9f9",
@@ -13883,15 +13950,23 @@ const NDCSummary = _ref => {
13883
13950
  style: sectionStyle
13884
13951
  }, (docs === null || docs === void 0 ? void 0 : docs.length) > 0 ? /*#__PURE__*/React__default.createElement("div", {
13885
13952
  style: documentsContainerStyle
13886
- }, docs === null || docs === void 0 ? void 0 : docs.map((doc, index) => /*#__PURE__*/React__default.createElement("div", {
13887
- key: index,
13888
- style: documentCardStyle
13889
- }, /*#__PURE__*/React__default.createElement(NDCDocument$1, {
13890
- value: docs,
13891
- Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
13892
- index: index,
13893
- formData: formData
13894
- })))) : /*#__PURE__*/React__default.createElement("div", null, t("TL_NO_DOCUMENTS_MSG"))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
13953
+ }, docs === null || docs === void 0 ? void 0 : docs.map((doc, index) => {
13954
+ var _doc$documentType;
13955
+ return /*#__PURE__*/React__default.createElement("div", {
13956
+ key: index,
13957
+ style: documentCardStyle
13958
+ }, /*#__PURE__*/React__default.createElement(NDCDocument$1, {
13959
+ value: docs,
13960
+ Code: doc === null || doc === void 0 ? void 0 : doc.documentType,
13961
+ index: index,
13962
+ formData: formData
13963
+ }), /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardSectionHeader, {
13964
+ style: {
13965
+ marginTop: "10px",
13966
+ fontSize: "15px"
13967
+ }
13968
+ }, t("NDC_" + (doc === null || doc === void 0 ? void 0 : (_doc$documentType = doc.documentType) === null || _doc$documentType === void 0 ? void 0 : _doc$documentType.replace(/\./g, "_")) + "_LABEL")));
13969
+ })) : /*#__PURE__*/React__default.createElement("div", null, t("TL_NO_DOCUMENTS_MSG"))), /*#__PURE__*/React__default.createElement(digitUiReactComponents.ActionBar, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
13895
13970
  style: {
13896
13971
  background: " white",
13897
13972
  color: "black",
@@ -13900,7 +13975,7 @@ const NDCSummary = _ref => {
13900
13975
  },
13901
13976
  label: "Back",
13902
13977
  onSubmit: onGoBack
13903
- }), displayMenu && (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data7 = workflowDetails.data) !== null && _workflowDetails$data7 !== void 0 && (_workflowDetails$data8 = _workflowDetails$data7.actionState) !== null && _workflowDetails$data8 !== void 0 && _workflowDetails$data8.nextActions || workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data9 = workflowDetails.data) !== null && _workflowDetails$data9 !== void 0 && _workflowDetails$data9.nextActions) ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Menu, {
13978
+ }), displayMenu && (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data6 = workflowDetails.data) !== null && _workflowDetails$data6 !== void 0 && (_workflowDetails$data7 = _workflowDetails$data6.actionState) !== null && _workflowDetails$data7 !== void 0 && _workflowDetails$data7.nextActions || workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data8 = workflowDetails.data) !== null && _workflowDetails$data8 !== void 0 && _workflowDetails$data8.nextActions) ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.Menu, {
13904
13979
  localeKeyPrefix: "WF_EMPLOYEE_" + "NDC",
13905
13980
  options: actions,
13906
13981
  optionKey: "action",
@@ -13925,14 +14000,16 @@ const NDCNewFormSummaryStepThreeCitizen = _ref => {
13925
14000
  const tenantId = window.localStorage.getItem("CITIZEN.CITY");
13926
14001
  const user = Digit.UserService.getUser();
13927
14002
  const formData = reactRedux.useSelector(state => state.ndc.NDCForm.formData || {});
14003
+ console.log("formData 4th step", formData);
13928
14004
  const goNext = function (action) {
13929
14005
  try {
13930
14006
  const actionStatus = action === null || action === void 0 ? void 0 : action.action;
14007
+ console.log("actionStatus", actionStatus);
13931
14008
  const _temp = _catch(function () {
13932
14009
  return Promise.resolve(onSubmit(formData, actionStatus)).then(function (res) {
13933
14010
  if (res !== null && res !== void 0 && res.isSuccess) {
13934
14011
  var _res$response, _res$response$Applica, _res$response$Applica2;
13935
- history.push("/digit-ui/citizen/ndc/response/" + (res === null || res === void 0 ? void 0 : (_res$response = res.response) === null || _res$response === void 0 ? void 0 : (_res$response$Applica = _res$response.Applications) === null || _res$response$Applica === void 0 ? void 0 : (_res$response$Applica2 = _res$response$Applica[0]) === null || _res$response$Applica2 === void 0 ? void 0 : _res$response$Applica2.uuid));
14012
+ history.push("/digit-ui/citizen/ndc/response/" + (res === null || res === void 0 ? void 0 : (_res$response = res.response) === null || _res$response === void 0 ? void 0 : (_res$response$Applica = _res$response.Applications) === null || _res$response$Applica === void 0 ? void 0 : (_res$response$Applica2 = _res$response$Applica[0]) === null || _res$response$Applica2 === void 0 ? void 0 : _res$response$Applica2.applicationNo));
13936
14013
  } else {
13937
14014
  console.error("Submission failed, not moving to next step.", res === null || res === void 0 ? void 0 : res.response);
13938
14015
  }
@@ -13948,7 +14025,7 @@ const NDCNewFormSummaryStepThreeCitizen = _ref => {
13948
14025
  function mapToNDCPayload(inputData, actionStatus) {
13949
14026
  var _Digit$UserService$ge, _user$info, _user$info2, _formData$NDCDetails, _formData$NDCDetails$, _user$info3, _user$info4, _formData$responseDat, _formData$apiData, _formData$apiData$App, _inputData$DocummentD, _inputData$DocummentD2;
13950
14027
  const applicant = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
13951
- console.log("formData mobile number", formData);
14028
+ console.log("inputData", inputData);
13952
14029
  const owners = [{
13953
14030
  name: user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.name,
13954
14031
  mobileNumber: user === null || user === void 0 ? void 0 : (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : _user$info2.mobileNumber,
@@ -13957,6 +14034,7 @@ const NDCNewFormSummaryStepThreeCitizen = _ref => {
13957
14034
  type: user === null || user === void 0 ? void 0 : (_user$info4 = user.info) === null || _user$info4 === void 0 ? void 0 : _user$info4.type
13958
14035
  }];
13959
14036
  const baseApplication = (formData === null || formData === void 0 ? void 0 : (_formData$responseDat = formData.responseData) === null || _formData$responseDat === void 0 ? void 0 : _formData$responseDat[0]) || (formData === null || formData === void 0 ? void 0 : (_formData$apiData = formData.apiData) === null || _formData$apiData === void 0 ? void 0 : (_formData$apiData$App = _formData$apiData.Applications) === null || _formData$apiData$App === void 0 ? void 0 : _formData$apiData$App[0]) || {};
14037
+ console.log("baseApplication", baseApplication);
13960
14038
  const updatedApplication = _extends({}, baseApplication, {
13961
14039
  workflow: _extends({}, baseApplication === null || baseApplication === void 0 ? void 0 : baseApplication.workflow, {
13962
14040
  action: actionStatus
@@ -13969,17 +14047,19 @@ const NDCNewFormSummaryStepThreeCitizen = _ref => {
13969
14047
  updatedApplication.Documents.push({
13970
14048
  uuid: doc === null || doc === void 0 ? void 0 : doc.documentUid,
13971
14049
  documentType: doc === null || doc === void 0 ? void 0 : doc.documentType,
13972
- documentAttachment: doc === null || doc === void 0 ? void 0 : doc.fileStoreId
14050
+ documentAttachment: doc === null || doc === void 0 ? void 0 : doc.filestoreId
13973
14051
  });
13974
14052
  });
13975
14053
  const payload = {
13976
14054
  Applications: [updatedApplication]
13977
14055
  };
14056
+ console.log("updatedApplication", updatedApplication);
13978
14057
  return payload;
13979
14058
  }
13980
14059
  const onSubmit = function (data, actionStatus) {
13981
14060
  try {
13982
14061
  const finalPayload = mapToNDCPayload(data, actionStatus);
14062
+ console.log("finalPayload", finalPayload);
13983
14063
  return Promise.resolve(Digit.NDCService.NDCUpdate({
13984
14064
  tenantId,
13985
14065
  details: finalPayload
@@ -14306,7 +14386,7 @@ const NewNDCStepForm$1 = () => {
14306
14386
  isLoading,
14307
14387
  data: applicationDetails
14308
14388
  } = Digit.Hooks.ndc.useSearchEmployeeApplication({
14309
- uuid: id
14389
+ applicationNo: id
14310
14390
  }, tenantId);
14311
14391
  React.useEffect(() => {
14312
14392
  if (applicationDetails !== null && applicationDetails !== void 0 && applicationDetails.Applications.length) {
@@ -14372,7 +14452,7 @@ const NewNDCStepFormOne$1 = _ref => {
14372
14452
  }, 3000);
14373
14453
  return;
14374
14454
  }
14375
- if (checkFormData !== null && checkFormData !== void 0 && (_checkFormData$apiDat = checkFormData.apiData) !== null && _checkFormData$apiDat !== void 0 && (_checkFormData$apiDat2 = _checkFormData$apiDat.Applications) !== null && _checkFormData$apiDat2 !== void 0 && (_checkFormData$apiDat3 = _checkFormData$apiDat2[0]) !== null && _checkFormData$apiDat3 !== void 0 && _checkFormData$apiDat3.uuid || checkFormData !== null && checkFormData !== void 0 && (_checkFormData$respon = checkFormData.responseData) !== null && _checkFormData$respon !== void 0 && (_checkFormData$respon2 = _checkFormData$respon[0]) !== null && _checkFormData$respon2 !== void 0 && _checkFormData$respon2.uuid) {
14455
+ if (checkFormData !== null && checkFormData !== void 0 && (_checkFormData$apiDat = checkFormData.apiData) !== null && _checkFormData$apiDat !== void 0 && (_checkFormData$apiDat2 = _checkFormData$apiDat.Applications) !== null && _checkFormData$apiDat2 !== void 0 && (_checkFormData$apiDat3 = _checkFormData$apiDat2[0]) !== null && _checkFormData$apiDat3 !== void 0 && _checkFormData$apiDat3.applicationNo || checkFormData !== null && checkFormData !== void 0 && (_checkFormData$respon = checkFormData.responseData) !== null && _checkFormData$respon !== void 0 && (_checkFormData$respon2 = _checkFormData$respon[0]) !== null && _checkFormData$respon2 !== void 0 && _checkFormData$respon2.applicationNo) {
14376
14456
  onGoNext();
14377
14457
  } else createApplication(data);
14378
14458
  onGoNext();
@@ -14657,7 +14737,7 @@ const NDCNewFormSummaryStepThreeEmployee = _ref => {
14657
14737
  return Promise.resolve(onSubmit(formData, actionStatus)).then(function (res) {
14658
14738
  if (res !== null && res !== void 0 && res.isSuccess) {
14659
14739
  var _res$response, _res$response$Applica, _res$response$Applica2;
14660
- history.push("/digit-ui/employee/ndc/response/" + (res === null || res === void 0 ? void 0 : (_res$response = res.response) === null || _res$response === void 0 ? void 0 : (_res$response$Applica = _res$response.Applications) === null || _res$response$Applica === void 0 ? void 0 : (_res$response$Applica2 = _res$response$Applica[0]) === null || _res$response$Applica2 === void 0 ? void 0 : _res$response$Applica2.uuid));
14740
+ history.push("/digit-ui/employee/ndc/response/" + (res === null || res === void 0 ? void 0 : (_res$response = res.response) === null || _res$response === void 0 ? void 0 : (_res$response$Applica = _res$response.Applications) === null || _res$response$Applica === void 0 ? void 0 : (_res$response$Applica2 = _res$response$Applica[0]) === null || _res$response$Applica2 === void 0 ? void 0 : _res$response$Applica2.applicationNo));
14661
14741
  } else {
14662
14742
  console.error("Submission failed, not moving to next step.", res === null || res === void 0 ? void 0 : res.response);
14663
14743
  }
@@ -14740,46 +14820,45 @@ const NDCNewFormSummaryStepThreeEmployee = _ref => {
14740
14820
  };
14741
14821
 
14742
14822
  const MyApplications = _ref => {
14743
- var _Digit$UserService$ge, _data$data;
14823
+ var _Digit$UserService$ge;
14744
14824
  const {
14745
14825
  t
14746
14826
  } = reactI18next.useTranslation();
14747
- const history = reactRouterDom.useHistory();
14748
14827
  const userInfo = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
14749
14828
  const tenantId = window.localStorage.getItem("CITIZEN.CITY");
14750
- console.log("userInfo========", userInfo);
14829
+ const itemsPerPage = 5;
14751
14830
  const {
14752
14831
  isLoading,
14753
- data,
14754
- isError,
14755
- error
14832
+ data
14756
14833
  } = Digit.Hooks.ndc.useSearchApplication({
14757
14834
  mobileNumber: userInfo.mobileNumber
14758
14835
  }, tenantId);
14759
- console.log("data", data);
14836
+ const [currentPage, setCurrentPage] = React.useState(1);
14760
14837
  if (isLoading) {
14761
14838
  return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
14762
14839
  }
14763
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Header, null, "" + t("TL_MY_APPLICATIONS_HEADER")), data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.map((application, index) => {
14840
+ const applicationsList = (data === null || data === void 0 ? void 0 : data.data) || [];
14841
+ const totalPages = Math.ceil(applicationsList.length / itemsPerPage);
14842
+ const indexOfLastItem = currentPage * itemsPerPage;
14843
+ const indexOfFirstItem = indexOfLastItem - itemsPerPage;
14844
+ const currentApplications = applicationsList.slice(indexOfFirstItem, indexOfLastItem);
14845
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Header, null, t("TL_MY_APPLICATIONS_HEADER")), currentApplications.map((application, index) => {
14764
14846
  var _application$Applicat, _application$Applicat2, _application$Applicat3, _application$Applicat4;
14765
14847
  const filteredApplication = Object.fromEntries(Object.entries(application).filter(_ref2 => {
14766
14848
  let [key] = _ref2;
14767
14849
  return key !== "Applications";
14768
14850
  }));
14769
- console.log("application?.Applications?.applicationStatus", filteredApplication);
14770
14851
  return /*#__PURE__*/React__default.createElement("div", {
14771
14852
  key: "card-" + index
14772
14853
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.Card, null, Object.keys(filteredApplication).filter(key => filteredApplication[key] !== null).map(item => /*#__PURE__*/React__default.createElement(digitUiReactComponents.KeyNote, {
14773
14854
  keyValue: t(item),
14774
14855
  note: t(filteredApplication[item])
14775
- })), (application === null || application === void 0 ? void 0 : (_application$Applicat = application.Applications) === null || _application$Applicat === void 0 ? void 0 : _application$Applicat.applicationStatus) != "PENDINGPAYMENT" && /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
14776
- to: "/digit-ui/citizen/ndc/search/application-overview/" + (application === null || application === void 0 ? void 0 : (_application$Applicat2 = application.Applications) === null || _application$Applicat2 === void 0 ? void 0 : _application$Applicat2.uuid)
14856
+ })), (application === null || application === void 0 ? void 0 : (_application$Applicat = application.Applications) === null || _application$Applicat === void 0 ? void 0 : _application$Applicat.applicationStatus) !== "PENDINGPAYMENT" && /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
14857
+ to: "/digit-ui/citizen/ndc/search/application-overview/" + (application === null || application === void 0 ? void 0 : (_application$Applicat2 = application.Applications) === null || _application$Applicat2 === void 0 ? void 0 : _application$Applicat2.applicationNo)
14777
14858
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
14778
14859
  label: t("CS_VIEW_DETAILS")
14779
14860
  })), (application === null || application === void 0 ? void 0 : (_application$Applicat3 = application.Applications) === null || _application$Applicat3 === void 0 ? void 0 : _application$Applicat3.applicationStatus) === "PENDINGPAYMENT" && /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
14780
- to: {
14781
- pathname: "/digit-ui/citizen/payment/collect/NDC/" + (application === null || application === void 0 ? void 0 : (_application$Applicat4 = application.Applications) === null || _application$Applicat4 === void 0 ? void 0 : _application$Applicat4.uuid) + "/" + tenantId + "?tenantId=" + tenantId
14782
- }
14861
+ to: "/digit-ui/citizen/payment/collect/NDC/" + (application === null || application === void 0 ? void 0 : (_application$Applicat4 = application.Applications) === null || _application$Applicat4 === void 0 ? void 0 : _application$Applicat4.applicationNo) + "/" + tenantId + "?tenantId=" + tenantId
14783
14862
  }, /*#__PURE__*/React__default.createElement("div", {
14784
14863
  style: {
14785
14864
  marginTop: "10px"
@@ -14787,7 +14866,44 @@ const MyApplications = _ref => {
14787
14866
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.SubmitBar, {
14788
14867
  label: t("CS_APPLICATION_DETAILS_MAKE_PAYMENT")
14789
14868
  })))));
14790
- }));
14869
+ }), !applicationsList.length && /*#__PURE__*/React__default.createElement("p", {
14870
+ style: {
14871
+ marginLeft: "16px",
14872
+ marginTop: "16px"
14873
+ }
14874
+ }, t("PTR_NO_APPLICATION_FOUND_MSG")), applicationsList.length > itemsPerPage && /*#__PURE__*/React__default.createElement("div", {
14875
+ style: {
14876
+ display: "flex",
14877
+ alignItems: "center",
14878
+ justifyContent: "center",
14879
+ gap: "16px",
14880
+ marginTop: "20px"
14881
+ }
14882
+ }, /*#__PURE__*/React__default.createElement("button", {
14883
+ disabled: currentPage === 1,
14884
+ onClick: () => setCurrentPage(prev => prev - 1),
14885
+ style: {
14886
+ cursor: currentPage === 1 ? "not-allowed" : "pointer"
14887
+ }
14888
+ }, "\u2190 Prev"), /*#__PURE__*/React__default.createElement("span", null, "Page ", currentPage, " of ", totalPages), /*#__PURE__*/React__default.createElement("button", {
14889
+ disabled: currentPage === totalPages,
14890
+ onClick: () => setCurrentPage(prev => prev + 1),
14891
+ style: {
14892
+ cursor: currentPage === totalPages ? "not-allowed" : "pointer"
14893
+ }
14894
+ }, "Next \u2192")), /*#__PURE__*/React__default.createElement("p", {
14895
+ style: {
14896
+ marginLeft: "16px",
14897
+ marginTop: "16px"
14898
+ }
14899
+ }, t("PTR_TEXT_NOT_ABLE_TO_FIND_THE_APPLICATION"), " ", /*#__PURE__*/React__default.createElement("span", {
14900
+ className: "link",
14901
+ style: {
14902
+ display: "block"
14903
+ }
14904
+ }, /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
14905
+ to: "/digit-ui/citizen/ndc/new-application"
14906
+ }, t("NDC_COMMON_CLICK_HERE_TO_REGISTER_NEW_APPLICATION")))));
14791
14907
  };
14792
14908
 
14793
14909
  const NDCResponseCitizen = props => {