@djb25/digit-ui-module-vendor 1.0.67 → 1.0.69

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
@@ -1866,7 +1866,7 @@ const VendorInbox = props => {
1866
1866
  }
1867
1867
  const hasDetails = ((_row$original8 = row.original) === null || _row$original8 === void 0 ? void 0 : _row$original8.vendorAdditionalDetails) !== null;
1868
1868
  return /*#__PURE__*/React__default.createElement(reactRouterDom.Link, {
1869
- to: !hasDetails ? "/digit-ui/" + userType + "/vendor/registry/additionaldetails/info?vendorId=" + vendorId : "/digit-ui/" + userType + "/vendor/registry/vendor-details/" + vendorId
1869
+ to: !hasDetails ? "/digit-ui/" + userType + "/vendor/registry/additionaldetails/modify-details?vendorId=" + vendorId : "/digit-ui/" + userType + "/vendor/registry/vendor-details/" + vendorId
1870
1870
  }, /*#__PURE__*/React__default.createElement("button", {
1871
1871
  className: "submit-bar",
1872
1872
  style: {
@@ -2394,10 +2394,11 @@ const VendorInbox = props => {
2394
2394
  const _temp6 = function () {
2395
2395
  if (props.selectedTab === "SURVEYOR") {
2396
2396
  return _catch(function () {
2397
- var _props$searchParams;
2397
+ var _props$searchParams, _props$searchParams2;
2398
2398
  return Promise.resolve(Digit.FSMService.surveyorSearch(tenantId, {
2399
2399
  status: "ACTIVE,DISABLED",
2400
2400
  name: (_props$searchParams = props.searchParams) === null || _props$searchParams === void 0 ? void 0 : _props$searchParams.name,
2401
+ mobileNumber: ((_props$searchParams2 = props.searchParams) === null || _props$searchParams2 === void 0 ? void 0 : _props$searchParams2.mobileNumber) || undefined,
2401
2402
  limit: 100000,
2402
2403
  offset: 0
2403
2404
  })).then(function (response) {
@@ -2420,10 +2421,11 @@ const VendorInbox = props => {
2420
2421
  const _temp7 = function () {
2421
2422
  if (props.selectedTab === "SUPERVISOR") {
2422
2423
  return _catch(function () {
2423
- var _props$searchParams2;
2424
+ var _props$searchParams3, _props$searchParams4;
2424
2425
  return Promise.resolve(Digit.FSMService.supervisorSearch(tenantId, {
2425
2426
  status: "ACTIVE,DISABLED",
2426
- name: (_props$searchParams2 = props.searchParams) === null || _props$searchParams2 === void 0 ? void 0 : _props$searchParams2.name,
2427
+ name: (_props$searchParams3 = props.searchParams) === null || _props$searchParams3 === void 0 ? void 0 : _props$searchParams3.name,
2428
+ mobileNumber: ((_props$searchParams4 = props.searchParams) === null || _props$searchParams4 === void 0 ? void 0 : _props$searchParams4.mobileNumber) || undefined,
2427
2429
  limit: 100000,
2428
2430
  offset: 0
2429
2431
  })).then(function (response) {
@@ -2699,12 +2701,14 @@ const SearchVendor = () => {
2699
2701
  }
2700
2702
  }) : tab === "SUPERVISOR" ? Digit.Hooks.fsm.useSupervisorSearch(tenantId, _extends({}, paginationParms, {
2701
2703
  status: "ACTIVE,DISABLED",
2702
- name: searchParams === null || searchParams === void 0 ? void 0 : searchParams.name
2704
+ name: searchParams === null || searchParams === void 0 ? void 0 : searchParams.name,
2705
+ mobileNumber: (searchParams === null || searchParams === void 0 ? void 0 : searchParams.mobileNumber) || undefined
2703
2706
  }), {
2704
2707
  enabled: false
2705
2708
  }) : tab === "SURVEYOR" ? Digit.Hooks.fsm.useSurveyorSearch(tenantId, _extends({}, paginationParms, {
2706
2709
  status: "ACTIVE,DISABLED",
2707
- name: searchParams === null || searchParams === void 0 ? void 0 : searchParams.name
2710
+ name: searchParams === null || searchParams === void 0 ? void 0 : searchParams.name,
2711
+ mobileNumber: (searchParams === null || searchParams === void 0 ? void 0 : searchParams.mobileNumber) || undefined
2708
2712
  }), {
2709
2713
  enabled: false
2710
2714
  }) : Digit.Hooks.fsm.useVendorSearch({
@@ -2904,19 +2908,15 @@ const SearchVendor = () => {
2904
2908
  label: t("ES_DRIVER_SEARCH_DRIVER_NAME"),
2905
2909
  name: "name"
2906
2910
  }] : tab === "SUPERVISOR" || tab === "SURVEYOR" ? [{
2907
- label: t("ES_VENDOR_SEARCH_VENDOR_NAME"),
2908
- name: "vendor",
2909
- type: "dropdown",
2910
- options: allVendors === null || allVendors === void 0 ? void 0 : allVendors.map(data => {
2911
- var _data$dsoDetails$owne3;
2912
- return _extends({}, data.dsoDetails, {
2913
- displayName: data.dsoDetails.name + " (" + (data.dsoDetails.mobileNumber || ((_data$dsoDetails$owne3 = data.dsoDetails.owner) === null || _data$dsoDetails$owne3 === void 0 ? void 0 : _data$dsoDetails$owne3.mobileNumber) || "N/A") + ")"
2914
- });
2915
- }),
2916
- optionsKey: "displayName"
2917
- }, {
2918
2911
  label: tab === "SUPERVISOR" ? t("ES_SUPERVISOR_SEARCH_NAME") : t("ES_SURVEYOR_SEARCH_NAME"),
2919
2912
  name: "name"
2913
+ }, {
2914
+ label: t("WT_MOBILE_NUMBER"),
2915
+ name: "mobileNumber",
2916
+ type: "text",
2917
+ pattern: "[0-9]{10}",
2918
+ maxLength: 10,
2919
+ title: t("ES_FSM_MOBILE_NUMBER_FORMAT_TIP") || "Enter 10-digit mobile number"
2920
2920
  }] : [{
2921
2921
  label: t("ES_VENDOR_SEARCH_VENDOR_NAME"),
2922
2922
  name: "name"
@@ -4396,7 +4396,7 @@ const VendorDetails = () => {
4396
4396
  }, safeVal));
4397
4397
  })), /*#__PURE__*/React__default.createElement("div", {
4398
4398
  className: "add-details-link hover-button",
4399
- onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/additionaldetails/info?vendorId=" + (dsoId || vendorId))
4399
+ onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/additionaldetails/modify-details?vendorId=" + (dsoId || vendorId))
4400
4400
  }, t("Edit Details"))) : userType !== "CITIZEN" && !isEkyc && /*#__PURE__*/React__default.createElement("div", {
4401
4401
  onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/additionaldetails/modify-details?vendorId=" + (dsoId || vendorId)),
4402
4402
  className: "add-details-link hover-button"
@@ -9612,31 +9612,54 @@ const SelectEkycZones = _ref => {
9612
9612
  return ((_s$id = s.id) === null || _s$id === void 0 ? void 0 : _s$id.toLowerCase()) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$uuid = loggedInUser.uuid) === null || _loggedInUser$uuid === void 0 ? void 0 : _loggedInUser$uuid.toLowerCase()) || ((_s$owner = s.owner) === null || _s$owner === void 0 ? void 0 : (_s$owner$uuid = _s$owner.uuid) === null || _s$owner$uuid === void 0 ? void 0 : _s$owner$uuid.toLowerCase()) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : (_loggedInUser$uuid2 = loggedInUser.uuid) === null || _loggedInUser$uuid2 === void 0 ? void 0 : _loggedInUser$uuid2.toLowerCase()) || ((_s$owner2 = s.owner) === null || _s$owner2 === void 0 ? void 0 : _s$owner2.mobileNumber) === (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber) || s.mobileNo === (loggedInUser === null || loggedInUser === void 0 ? void 0 : loggedInUser.mobileNumber);
9613
9613
  });
9614
9614
  }, [supervisorSearchResponse, loggedInUser]);
9615
- const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS("dl", "egov-location", ["TenantBoundary"]),
9616
- boundaryData = _Digit$Hooks$useCommo.data,
9615
+ const _Digit$Hooks$useCommo = Digit.Hooks.useCommonMDMS("dl", "common-masters", ["ZroOfficeList"]),
9616
+ zroData = _Digit$Hooks$useCommo.data,
9617
9617
  isLoading = _Digit$Hooks$useCommo.isLoading;
9618
9618
  React.useEffect(() => {
9619
- var _boundaryData$egovLo, _boundaryData$MdmsRes, _boundaryData$MdmsRes2;
9620
- const tenantBoundaryList = (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$egovLo = boundaryData["egov-location"]) === null || _boundaryData$egovLo === void 0 ? void 0 : _boundaryData$egovLo.TenantBoundary) || (boundaryData === null || boundaryData === void 0 ? void 0 : (_boundaryData$MdmsRes = boundaryData.MdmsRes) === null || _boundaryData$MdmsRes === void 0 ? void 0 : (_boundaryData$MdmsRes2 = _boundaryData$MdmsRes["egov-location"]) === null || _boundaryData$MdmsRes2 === void 0 ? void 0 : _boundaryData$MdmsRes2.TenantBoundary) || [];
9621
- const zoneMap = {};
9622
- tenantBoundaryList.forEach(tb => {
9623
- const walkBoundary = node => {
9624
- if (!node) return;
9625
- if (node.label === "Zone" && node.code && node.code !== "UNKNOWN") {
9626
- if (!zoneMap[node.code]) {
9627
- zoneMap[node.code] = {
9628
- code: node.code,
9629
- name: node.name || node.code
9630
- };
9619
+ var _zroData$commonMaste, _zroData$MdmsRes, _zroData$MdmsRes$comm;
9620
+ const zroOfficeList = (zroData === null || zroData === void 0 ? void 0 : (_zroData$commonMaste = zroData["common-masters"]) === null || _zroData$commonMaste === void 0 ? void 0 : _zroData$commonMaste.ZroOfficeList) || (zroData === null || zroData === void 0 ? void 0 : (_zroData$MdmsRes = zroData.MdmsRes) === null || _zroData$MdmsRes === void 0 ? void 0 : (_zroData$MdmsRes$comm = _zroData$MdmsRes["common-masters"]) === null || _zroData$MdmsRes$comm === void 0 ? void 0 : _zroData$MdmsRes$comm.ZroOfficeList) || [];
9621
+ if (Array.isArray(zroOfficeList)) {
9622
+ let activeZros = zroOfficeList.filter(zro => zro && zro.active).map(zro => ({
9623
+ code: zro.code,
9624
+ name: t(zro.code)
9625
+ }));
9626
+ if (isEkycVendor && !isVendorPage) {
9627
+ if (!matchedVendor) {
9628
+ activeZros = [];
9629
+ } else {
9630
+ let vendorZoneCodes = [];
9631
+ if (Array.isArray(matchedVendor === null || matchedVendor === void 0 ? void 0 : matchedVendor.zoneIds) && matchedVendor.zoneIds.length > 0) {
9632
+ vendorZoneCodes = matchedVendor.zoneIds.map(z => z.trim().toUpperCase()).filter(Boolean);
9633
+ } else if (matchedVendor !== null && matchedVendor !== void 0 && matchedVendor.assignedZoneId) {
9634
+ vendorZoneCodes = matchedVendor.assignedZoneId.split(",").map(z => z.trim().toUpperCase()).filter(Boolean);
9635
+ }
9636
+ if (vendorZoneCodes.length > 0) {
9637
+ activeZros = activeZros.filter(zro => vendorZoneCodes.includes(zro.code.trim().toUpperCase()));
9638
+ } else {
9639
+ activeZros = [];
9631
9640
  }
9632
9641
  }
9633
- (node.children || []).forEach(walkBoundary);
9634
- };
9635
- walkBoundary(tb.boundary);
9636
- });
9637
- const uniqueZones = Object.values(zoneMap).sort((a, b) => a.name.localeCompare(b.name));
9638
- setZones(uniqueZones);
9639
- }, [boundaryData]);
9642
+ }
9643
+ if (isEkycSupervisor) {
9644
+ if (!matchedSupervisor) {
9645
+ activeZros = [];
9646
+ } else {
9647
+ let supervisorZoneCodes = [];
9648
+ if (Array.isArray(matchedSupervisor === null || matchedSupervisor === void 0 ? void 0 : matchedSupervisor.zoneIds) && matchedSupervisor.zoneIds.length > 0) {
9649
+ supervisorZoneCodes = matchedSupervisor.zoneIds.map(z => z.trim().toUpperCase()).filter(Boolean);
9650
+ } else if (matchedSupervisor !== null && matchedSupervisor !== void 0 && matchedSupervisor.assignedZoneId) {
9651
+ supervisorZoneCodes = matchedSupervisor.assignedZoneId.split(",").map(z => z.trim().toUpperCase()).filter(Boolean);
9652
+ }
9653
+ if (supervisorZoneCodes.length > 0) {
9654
+ activeZros = activeZros.filter(zro => supervisorZoneCodes.includes(zro.code.trim().toUpperCase()));
9655
+ } else {
9656
+ activeZros = [];
9657
+ }
9658
+ }
9659
+ }
9660
+ setZones(activeZros);
9661
+ }
9662
+ }, [zroData, matchedVendor, matchedSupervisor, isEkycVendor, isEkycSupervisor, isVendorPage, t]);
9640
9663
  React.useEffect(() => {
9641
9664
  if (!zones.length || !(formData !== null && formData !== void 0 && formData.zoneIds)) return;
9642
9665
  if (isMultiSelect) {
@@ -9645,10 +9668,7 @@ const SelectEkycZones = _ref => {
9645
9668
  setSelectedZones(formData.zoneIds.filter(Boolean));
9646
9669
  return;
9647
9670
  }
9648
- const selected = zones.filter(zone => zone && formData.zoneIds.some(id => {
9649
- var _zone$code, _zone$name;
9650
- return id && (id.toString().toUpperCase() === ((_zone$code = zone.code) === null || _zone$code === void 0 ? void 0 : _zone$code.toUpperCase()) || id.toString().toUpperCase() === ((_zone$name = zone.name) === null || _zone$name === void 0 ? void 0 : _zone$name.toUpperCase()));
9651
- }));
9671
+ const selected = zones.filter(zone => zone && (formData.zoneIds.includes(zone.name) || formData.zoneIds.includes(zone.code)));
9652
9672
  setSelectedZones(selected);
9653
9673
  if (!initialized.current) {
9654
9674
  initialized.current = true;
@@ -9663,10 +9683,7 @@ const SelectEkycZones = _ref => {
9663
9683
  if (selectedVal && typeof selectedVal === "object") {
9664
9684
  selectedVal = selectedVal.name || selectedVal.code || "";
9665
9685
  }
9666
- const selected = zones.find(zone => {
9667
- var _zone$name2, _selectedVal, _zone$code2, _selectedVal2;
9668
- return zone && (((_zone$name2 = zone.name) === null || _zone$name2 === void 0 ? void 0 : _zone$name2.toUpperCase()) === ((_selectedVal = selectedVal) === null || _selectedVal === void 0 ? void 0 : _selectedVal.toString().toUpperCase()) || ((_zone$code2 = zone.code) === null || _zone$code2 === void 0 ? void 0 : _zone$code2.toUpperCase()) === ((_selectedVal2 = selectedVal) === null || _selectedVal2 === void 0 ? void 0 : _selectedVal2.toString().toUpperCase()));
9669
- });
9686
+ const selected = zones.find(zone => zone && (zone.name === selectedVal || zone.code === selectedVal));
9670
9687
  setSelectedZones(selected ? [selected] : []);
9671
9688
  if (!initialized.current && selected) {
9672
9689
  initialized.current = true;
@@ -9685,7 +9702,7 @@ const SelectEkycZones = _ref => {
9685
9702
  if (isMultiSelect) {
9686
9703
  const selected = Array.isArray(value) ? value.map(v => Array.isArray(v) ? v[1] : v).filter(Boolean) : [];
9687
9704
  setSelectedZones(selected);
9688
- onSelect(config.key, selected.map(z => z.name));
9705
+ onSelect(config.key, selected);
9689
9706
  } else {
9690
9707
  const selectedZone = Array.isArray(value) ? Array.isArray(value[0]) ? value[0][1] : value[0] : value;
9691
9708
  setSelectedZones(selectedZone ? [selectedZone] : []);
@@ -9717,10 +9734,10 @@ const SelectEkycZones = _ref => {
9717
9734
  disable: disable || isEkycSupervisor || ((_config$props = config.props) === null || _config$props === void 0 ? void 0 : _config$props.disable) || config.disable
9718
9735
  })), isMultiSelect && selectedZones.length > 0 && /*#__PURE__*/React__default.createElement("div", {
9719
9736
  className: "selected-zones"
9720
- }, selectedZones.filter(zone => zone && zone.name).map(zone => /*#__PURE__*/React__default.createElement("span", {
9737
+ }, selectedZones.filter(zone => zone && zone.code).map(zone => /*#__PURE__*/React__default.createElement("span", {
9721
9738
  key: zone.code,
9722
9739
  className: "selected-zone-chip"
9723
- }, zone.name))));
9740
+ }, t(zone.code)))));
9724
9741
  };
9725
9742
 
9726
9743
  const SelectEkycClusters = _ref => {