@djb25/digit-ui-module-ekyc 1.0.60 → 1.0.61

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.
@@ -5622,12 +5622,12 @@ const SupervisorDetailsCard = () => {
5622
5622
  });
5623
5623
  }
5624
5624
  if (matchedSup) {
5625
- var _progressReport, _progressReport2, _progressReport3, _matchedSup$owner2, _matchedSup$owner3, _matchedSup$owner4;
5625
+ var _progressReport, _progressReport2, _progressReport3, _matchedSup$owner2, _matchedSup$owner3, _matchedSup$owner4, _matchedSup$owner5, _matchedSup$owner6, _matchedSup$owner7;
5626
5626
  const matchedSurveyors = surveyorSearchResponse !== null && surveyorSearchResponse !== void 0 && surveyorSearchResponse.surveyors ? surveyorSearchResponse.surveyors.filter(surv => {
5627
5627
  var _matchedSup$owner;
5628
5628
  return surv.supervisorId === (matchedSup.id || ((_matchedSup$owner = matchedSup.owner) === null || _matchedSup$owner === void 0 ? void 0 : _matchedSup$owner.uuid));
5629
5629
  }).map(surv => {
5630
- var _surv$owner3, _surv$owner4, _surv$owner5, _realStats, _realStats2, _realStats3, _realStats4;
5630
+ var _surv$owner3, _surv$owner4, _surv$owner5, _surv$owner6, _surv$owner7, _realStats, _realStats2, _realStats3, _realStats4;
5631
5631
  let realStats = null;
5632
5632
  if (progressData !== null && progressData !== void 0 && progressData.supervisorReport) {
5633
5633
  for (const report of progressData.supervisorReport) {
@@ -5647,6 +5647,8 @@ const SupervisorDetailsCard = () => {
5647
5647
  surveyorId: surv.id || ((_surv$owner3 = surv.owner) === null || _surv$owner3 === void 0 ? void 0 : _surv$owner3.uuid),
5648
5648
  surveyorName: surv.name || ((_surv$owner4 = surv.owner) === null || _surv$owner4 === void 0 ? void 0 : _surv$owner4.name) || "N/A",
5649
5649
  mobileNo: ((_surv$owner5 = surv.owner) === null || _surv$owner5 === void 0 ? void 0 : _surv$owner5.mobileNumber) || surv.mobileNo || "N/A",
5650
+ email: ((_surv$owner6 = surv.owner) === null || _surv$owner6 === void 0 ? void 0 : _surv$owner6.emailId) || "N/A",
5651
+ gender: ((_surv$owner7 = surv.owner) === null || _surv$owner7 === void 0 ? void 0 : _surv$owner7.gender) || "N/A",
5650
5652
  status: surv.status || "ACTIVE",
5651
5653
  totalKnos: ((_realStats = realStats) === null || _realStats === void 0 ? void 0 : _realStats.totalKnos) || 0,
5652
5654
  submittedKnos: ((_realStats2 = realStats) === null || _realStats2 === void 0 ? void 0 : _realStats2.submittedKnos) || 0,
@@ -5662,6 +5664,8 @@ const SupervisorDetailsCard = () => {
5662
5664
  supervisorId: matchedSup.id || ((_matchedSup$owner2 = matchedSup.owner) === null || _matchedSup$owner2 === void 0 ? void 0 : _matchedSup$owner2.uuid),
5663
5665
  supervisorName: matchedSup.name || ((_matchedSup$owner3 = matchedSup.owner) === null || _matchedSup$owner3 === void 0 ? void 0 : _matchedSup$owner3.name) || "N/A",
5664
5666
  mobileNo: ((_matchedSup$owner4 = matchedSup.owner) === null || _matchedSup$owner4 === void 0 ? void 0 : _matchedSup$owner4.mobileNumber) || matchedSup.mobileNo || "N/A",
5667
+ email: ((_matchedSup$owner5 = matchedSup.owner) === null || _matchedSup$owner5 === void 0 ? void 0 : _matchedSup$owner5.emailId) || ((_matchedSup$owner6 = matchedSup.owner) === null || _matchedSup$owner6 === void 0 ? void 0 : _matchedSup$owner6.email) || matchedSup.email || matchedSup.emailId || "N/A",
5668
+ gender: ((_matchedSup$owner7 = matchedSup.owner) === null || _matchedSup$owner7 === void 0 ? void 0 : _matchedSup$owner7.gender) || matchedSup.gender || "N/A",
5665
5669
  status: matchedSup.status || "ACTIVE",
5666
5670
  assignedZoneId: matchedSup.assignedZoneId || "N/A",
5667
5671
  vendorId: matchedSup.vendorId,
@@ -5673,20 +5677,28 @@ const SupervisorDetailsCard = () => {
5673
5677
  };
5674
5678
  }
5675
5679
  if (progressReport) {
5676
- var _loggedInUser$uuid;
5680
+ var _loggedInUser$uuid, _supervisorSearchResp, _matchedSupForFallbac, _matchedSupForFallbac2, _matchedSupForFallbac3;
5677
5681
  const isSelf = (targetId === null || targetId === void 0 ? void 0 : targetId.toLowerCase()) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$uuid = loggedInUser.uuid) === null || _loggedInUser$uuid === void 0 ? void 0 : _loggedInUser$uuid.toLowerCase());
5678
5682
  const supervisorName = isSelf ? (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.name) || progressReport.supervisorName || "N/A" : progressReport.supervisorName || "N/A";
5679
5683
  const mobileNo = isSelf ? (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber) || progressReport.mobileNo || "N/A" : progressReport.mobileNo || "N/A";
5684
+ const matchedSupForFallback = supervisorSearchResponse === null || supervisorSearchResponse === void 0 ? void 0 : (_supervisorSearchResp = supervisorSearchResponse.supervisors) === null || _supervisorSearchResp === void 0 ? void 0 : _supervisorSearchResp.find(s => {
5685
+ var _s$id7, _ref, _s$owner4, _s$owner4$uuid, _ref2;
5686
+ return ((_s$id7 = s.id) === null || _s$id7 === void 0 ? void 0 : _s$id7.toLowerCase()) === ((_ref = progressReport.supervisorId || progressReport.id) === null || _ref === void 0 ? void 0 : _ref.toLowerCase()) || ((_s$owner4 = s.owner) === null || _s$owner4 === void 0 ? void 0 : (_s$owner4$uuid = _s$owner4.uuid) === null || _s$owner4$uuid === void 0 ? void 0 : _s$owner4$uuid.toLowerCase()) === ((_ref2 = progressReport.supervisorId || progressReport.id) === null || _ref2 === void 0 ? void 0 : _ref2.toLowerCase());
5687
+ });
5688
+ const email = (matchedSupForFallback === null || matchedSupForFallback === void 0 ? void 0 : (_matchedSupForFallbac = matchedSupForFallback.owner) === null || _matchedSupForFallbac === void 0 ? void 0 : _matchedSupForFallbac.emailId) || (matchedSupForFallback === null || matchedSupForFallback === void 0 ? void 0 : (_matchedSupForFallbac2 = matchedSupForFallback.owner) === null || _matchedSupForFallbac2 === void 0 ? void 0 : _matchedSupForFallbac2.email) || (matchedSupForFallback === null || matchedSupForFallback === void 0 ? void 0 : matchedSupForFallback.email) || (isSelf ? loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.emailId : null) || progressReport.email || "N/A";
5689
+ const gender = (matchedSupForFallback === null || matchedSupForFallback === void 0 ? void 0 : (_matchedSupForFallbac3 = matchedSupForFallback.owner) === null || _matchedSupForFallbac3 === void 0 ? void 0 : _matchedSupForFallbac3.gender) || (matchedSupForFallback === null || matchedSupForFallback === void 0 ? void 0 : matchedSupForFallback.gender) || (isSelf ? loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.gender : null) || progressReport.gender || "N/A";
5680
5690
  const surveyorsMapped = progressReport.surveyors ? progressReport.surveyors.map(surv => {
5681
- var _surveyorSearchRespon, _matchedSurv$owner, _matchedSurv$owner2;
5691
+ var _surveyorSearchRespon, _matchedSurv$owner, _matchedSurv$owner2, _matchedSurv$owner3, _matchedSurv$owner4, _matchedSurv$owner5;
5682
5692
  const matchedSurv = surveyorSearchResponse === null || surveyorSearchResponse === void 0 ? void 0 : (_surveyorSearchRespon = surveyorSearchResponse.surveyors) === null || _surveyorSearchRespon === void 0 ? void 0 : _surveyorSearchRespon.find(s => {
5683
- var _s$id7, _surv$surveyorId, _s$owner4, _s$owner4$uuid, _surv$surveyorId2;
5684
- return ((_s$id7 = s.id) === null || _s$id7 === void 0 ? void 0 : _s$id7.toLowerCase()) === ((_surv$surveyorId = surv.surveyorId) === null || _surv$surveyorId === void 0 ? void 0 : _surv$surveyorId.toLowerCase()) || ((_s$owner4 = s.owner) === null || _s$owner4 === void 0 ? void 0 : (_s$owner4$uuid = _s$owner4.uuid) === null || _s$owner4$uuid === void 0 ? void 0 : _s$owner4$uuid.toLowerCase()) === ((_surv$surveyorId2 = surv.surveyorId) === null || _surv$surveyorId2 === void 0 ? void 0 : _surv$surveyorId2.toLowerCase());
5693
+ var _s$id8, _surv$surveyorId, _s$owner5, _s$owner5$uuid, _surv$surveyorId2;
5694
+ return ((_s$id8 = s.id) === null || _s$id8 === void 0 ? void 0 : _s$id8.toLowerCase()) === ((_surv$surveyorId = surv.surveyorId) === null || _surv$surveyorId === void 0 ? void 0 : _surv$surveyorId.toLowerCase()) || ((_s$owner5 = s.owner) === null || _s$owner5 === void 0 ? void 0 : (_s$owner5$uuid = _s$owner5.uuid) === null || _s$owner5$uuid === void 0 ? void 0 : _s$owner5$uuid.toLowerCase()) === ((_surv$surveyorId2 = surv.surveyorId) === null || _surv$surveyorId2 === void 0 ? void 0 : _surv$surveyorId2.toLowerCase());
5685
5695
  });
5686
5696
  return {
5687
5697
  surveyorId: surv.surveyorId || surv.id,
5688
5698
  surveyorName: (matchedSurv === null || matchedSurv === void 0 ? void 0 : matchedSurv.name) || (matchedSurv === null || matchedSurv === void 0 ? void 0 : (_matchedSurv$owner = matchedSurv.owner) === null || _matchedSurv$owner === void 0 ? void 0 : _matchedSurv$owner.name) || surv.surveyorName || "N/A",
5689
5699
  mobileNo: (matchedSurv === null || matchedSurv === void 0 ? void 0 : (_matchedSurv$owner2 = matchedSurv.owner) === null || _matchedSurv$owner2 === void 0 ? void 0 : _matchedSurv$owner2.mobileNumber) || (matchedSurv === null || matchedSurv === void 0 ? void 0 : matchedSurv.mobileNo) || surv.mobileNo || "N/A",
5700
+ email: (matchedSurv === null || matchedSurv === void 0 ? void 0 : (_matchedSurv$owner3 = matchedSurv.owner) === null || _matchedSurv$owner3 === void 0 ? void 0 : _matchedSurv$owner3.emailId) || (matchedSurv === null || matchedSurv === void 0 ? void 0 : (_matchedSurv$owner4 = matchedSurv.owner) === null || _matchedSurv$owner4 === void 0 ? void 0 : _matchedSurv$owner4.email) || (matchedSurv === null || matchedSurv === void 0 ? void 0 : matchedSurv.email) || surv.email || "N/A",
5701
+ gender: (matchedSurv === null || matchedSurv === void 0 ? void 0 : (_matchedSurv$owner5 = matchedSurv.owner) === null || _matchedSurv$owner5 === void 0 ? void 0 : _matchedSurv$owner5.gender) || (matchedSurv === null || matchedSurv === void 0 ? void 0 : matchedSurv.gender) || surv.gender || "N/A",
5690
5702
  status: (matchedSurv === null || matchedSurv === void 0 ? void 0 : matchedSurv.status) || surv.status || "ACTIVE",
5691
5703
  totalKnos: surv.totalKnos || 0,
5692
5704
  submittedKnos: surv.submittedKnos || 0,
@@ -5698,6 +5710,8 @@ const SupervisorDetailsCard = () => {
5698
5710
  supervisorId: progressReport.supervisorId || progressReport.id,
5699
5711
  supervisorName,
5700
5712
  mobileNo,
5713
+ email,
5714
+ gender,
5701
5715
  status: progressReport.status || "ACTIVE",
5702
5716
  assignedZoneId: progressReport.assignedZoneId || "N/A",
5703
5717
  vendorId: progressReport.vendorId,
@@ -5712,8 +5726,8 @@ const SupervisorDetailsCard = () => {
5712
5726
  }, [progressData, supervisorSearchResponse, surveyorSearchResponse, supervisorId, loggedInUser]);
5713
5727
  const fullName = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.supervisorName) || "N/A";
5714
5728
  const mobileNumber = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.mobileNo) || "N/A";
5715
- const email = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.emailId) || "N/A";
5716
- const gender = (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.gender) || "N/A";
5729
+ const email = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.email) || ((supervisor === null || supervisor === void 0 ? void 0 : supervisor.supervisorId) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid) ? loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.emailId : null) || "N/A";
5730
+ const gender = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.gender) || ((supervisor === null || supervisor === void 0 ? void 0 : supervisor.supervisorId) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.uuid) ? loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.gender : null) || "N/A";
5717
5731
  const status = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.status) || "N/A";
5718
5732
  const assignedZone = (supervisor === null || supervisor === void 0 ? void 0 : supervisor.assignedZoneId) || "N/A";
5719
5733
  const vendorName = useMemo(() => {
@@ -5769,9 +5783,9 @@ const SupervisorDetailsCard = () => {
5769
5783
  const surveyorColumns = useMemo(() => [{
5770
5784
  Header: t("SURVEYOR_NAME") || "Surveyor Name",
5771
5785
  accessor: row => (row === null || row === void 0 ? void 0 : row.surveyorName) || "N/A",
5772
- Cell: _ref => {
5786
+ Cell: _ref3 => {
5773
5787
  var _Digit$SessionStorage2, _Digit$SessionStorage3, _Digit$SessionStorage4, _row$original;
5774
- let row = _ref.row;
5788
+ let row = _ref3.row;
5775
5789
  const userType = ((_Digit$SessionStorage2 = Digit.SessionStorage.get("User")) === null || _Digit$SessionStorage2 === void 0 ? void 0 : (_Digit$SessionStorage3 = _Digit$SessionStorage2.info) === null || _Digit$SessionStorage3 === void 0 ? void 0 : (_Digit$SessionStorage4 = _Digit$SessionStorage3.type) === null || _Digit$SessionStorage4 === void 0 ? void 0 : _Digit$SessionStorage4.toLowerCase()) || "citizen";
5776
5790
  const targetPath = "/digit-ui/" + userType + "/ekyc/surveyor-dashboard/" + row.original.surveyorId;
5777
5791
  return /*#__PURE__*/React.createElement("a", {
@@ -5795,8 +5809,8 @@ const SupervisorDetailsCard = () => {
5795
5809
  Header: t("STATUS") || "Status",
5796
5810
  accessor: () => "ACTIVE",
5797
5811
  id: "status",
5798
- Cell: _ref2 => {
5799
- let value = _ref2.value;
5812
+ Cell: _ref4 => {
5813
+ let value = _ref4.value;
5800
5814
  return /*#__PURE__*/React.createElement("span", {
5801
5815
  className: "status-badge verified"
5802
5816
  }, t(value) || value);
@@ -6124,12 +6138,12 @@ const SupervisorDetailsCard = () => {
6124
6138
  }
6125
6139
  return null;
6126
6140
  };
6127
- const StatCard = _ref3 => {
6128
- let title = _ref3.title,
6129
- value = _ref3.value,
6130
- type = _ref3.type,
6131
- isLoading = _ref3.isLoading,
6132
- icon = _ref3.icon;
6141
+ const StatCard = _ref5 => {
6142
+ let title = _ref5.title,
6143
+ value = _ref5.value,
6144
+ type = _ref5.type,
6145
+ isLoading = _ref5.isLoading,
6146
+ icon = _ref5.icon;
6133
6147
  return /*#__PURE__*/React.createElement("div", {
6134
6148
  className: "stat-card " + type
6135
6149
  }, isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
@@ -6243,9 +6257,9 @@ const SupervisorDetailsCard = () => {
6243
6257
  }, {
6244
6258
  label: t("THIS_MONTH") || "This Month",
6245
6259
  key: "month"
6246
- }].map(_ref4 => {
6247
- let label = _ref4.label,
6248
- key = _ref4.key;
6260
+ }].map(_ref6 => {
6261
+ let label = _ref6.label,
6262
+ key = _ref6.key;
6249
6263
  return /*#__PURE__*/React.createElement("div", {
6250
6264
  key: key,
6251
6265
  className: "menu-item",
@@ -6296,7 +6310,7 @@ const SupervisorDetailsCard = () => {
6296
6310
  className: "label"
6297
6311
  }, t("GENDER")), /*#__PURE__*/React.createElement("span", {
6298
6312
  className: "value"
6299
- }, gender)), /*#__PURE__*/React.createElement("div", {
6313
+ }, t(gender) || gender)), /*#__PURE__*/React.createElement("div", {
6300
6314
  className: "detail-item"
6301
6315
  }, /*#__PURE__*/React.createElement("span", {
6302
6316
  className: "label"
@@ -6661,12 +6675,6 @@ const AssignEkycModal = _ref => {
6661
6675
  const start = currentPage * pageSize;
6662
6676
  return allData.slice(start, start + pageSize);
6663
6677
  }, [allData, currentPage, pageSize]);
6664
- useEffect(() => {
6665
- if (filters.mrkey && (allData === null || allData === void 0 ? void 0 : allData.length) > 0) {
6666
- const mrKnos = allData.map(item => item.kno).filter(Boolean);
6667
- setSelectedKnos(mrKnos);
6668
- }
6669
- }, [filters.mrkey, allData]);
6670
6678
  const handleAssign = () => {
6671
6679
  const payload = {
6672
6680
  tenantId: tenantId,
@@ -6682,22 +6690,36 @@ const AssignEkycModal = _ref => {
6682
6690
  }
6683
6691
  activeMutation.mutate(payload);
6684
6692
  };
6685
- const handleSelectAll = () => {
6686
- const currentKnos = paginatedData.map(item => item.kno);
6687
- const allSelected = currentKnos.length > 0 && currentKnos.every(kno => selectedKnos.includes(kno));
6688
- setSelectedKnos(prev => allSelected ? prev.filter(kno => !currentKnos.includes(kno)) : [...new Set([...prev, ...currentKnos])]);
6693
+ const handleSelect = kno => {
6694
+ setSelectedKnos(prev => prev.includes(kno) ? prev.filter(item => item !== kno) : [...prev, kno]);
6695
+ };
6696
+ const handleSelectAll = e => {
6697
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
6698
+ const allMatchingKnos = allData.map(item => item.kno).filter(Boolean);
6699
+ if (allMatchingKnos.length === 0) return;
6700
+ const isAllSelected = allMatchingKnos.length > 0 && allMatchingKnos.every(kno => selectedKnos.includes(kno));
6701
+ setSelectedKnos(isAllSelected ? [] : allMatchingKnos);
6689
6702
  };
6690
6703
  const handleFilterChange = (key, value) => {
6691
6704
  setFilters(prev => _extends({}, prev, {
6692
6705
  [key]: value
6693
6706
  }));
6707
+ setCurrentPage(0);
6694
6708
  };
6695
6709
  const columns = useMemo(() => [{
6696
- Header: () => /*#__PURE__*/React.createElement("input", {
6697
- type: "checkbox",
6698
- checked: paginatedData.length > 0 && paginatedData.every(item => selectedKnos.includes(item.kno)),
6699
- onChange: handleSelectAll
6700
- }),
6710
+ Header: () => {
6711
+ const allMatchingKnos = allData.map(item => item.kno).filter(Boolean);
6712
+ const isAllChecked = allMatchingKnos.length > 0 && allMatchingKnos.every(kno => selectedKnos.includes(kno));
6713
+ return /*#__PURE__*/React.createElement("input", {
6714
+ type: "checkbox",
6715
+ checked: isAllChecked,
6716
+ onChange: e => {
6717
+ e.stopPropagation();
6718
+ handleSelectAll(e);
6719
+ },
6720
+ onClick: e => e.stopPropagation()
6721
+ });
6722
+ },
6701
6723
  id: "selection",
6702
6724
  Cell: _ref2 => {
6703
6725
  let row = _ref2.row;
@@ -6705,7 +6727,11 @@ const AssignEkycModal = _ref => {
6705
6727
  return /*#__PURE__*/React.createElement("input", {
6706
6728
  type: "checkbox",
6707
6729
  checked: selectedKnos.includes(kno),
6708
- onChange: () => handleSelect(kno)
6730
+ onChange: e => {
6731
+ e.stopPropagation();
6732
+ handleSelect(kno);
6733
+ },
6734
+ onClick: e => e.stopPropagation()
6709
6735
  });
6710
6736
  }
6711
6737
  }, {
@@ -6740,10 +6766,7 @@ const AssignEkycModal = _ref => {
6740
6766
  className: "ekyc-status-tag " + status
6741
6767
  }, t(status)) : "-";
6742
6768
  }
6743
- }], [selectedKnos, paginatedData]);
6744
- const handleSelect = kno => {
6745
- setSelectedKnos(prev => prev.includes(kno) ? prev.filter(item => item !== kno) : [...prev, kno]);
6746
- };
6769
+ }], [selectedKnos, paginatedData, allData]);
6747
6770
  return /*#__PURE__*/React.createElement(Modal, {
6748
6771
  headerBarMain: isReassign ? "Reassign KNOs to " + (surveyor === null || surveyor === void 0 ? void 0 : surveyor.name) : "Assign KNOs to " + (surveyor === null || surveyor === void 0 ? void 0 : surveyor.name),
6749
6772
  headerBarEnd: /*#__PURE__*/React.createElement(Close, {