@djb25/digit-ui-module-vendor 1.0.68 → 1.0.70

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: {
@@ -2388,16 +2388,47 @@ const VendorInbox = props => {
2388
2388
  const getCSVExportData = React__default.useCallback(function () {
2389
2389
  try {
2390
2390
  let _exit = false;
2391
- function _temp8(_result) {
2391
+ function _temp10(_result) {
2392
2392
  let _exit2 = false;
2393
2393
  if (_exit) return _result;
2394
- const _temp6 = function () {
2394
+ function _temp0(_result2) {
2395
+ let _exit3 = false;
2396
+ if (_exit2) return _result2;
2397
+ const _temp8 = function () {
2398
+ if (props.selectedTab === "VENDOR") {
2399
+ return _catch(function () {
2400
+ var _props$searchParams, _props$searchParams2;
2401
+ return Promise.resolve(Digit.FSMService.vendorSearch(tenantId, {
2402
+ status: "ACTIVE,DISABLED",
2403
+ name: (_props$searchParams = props.searchParams) === null || _props$searchParams === void 0 ? void 0 : _props$searchParams.name,
2404
+ mobileNumber: ((_props$searchParams2 = props.searchParams) === null || _props$searchParams2 === void 0 ? void 0 : _props$searchParams2.mobileNumber) || undefined,
2405
+ limit: 100000,
2406
+ offset: 0
2407
+ })).then(function (response) {
2408
+ const _temp6 = (response === null || response === void 0 ? void 0 : response.vendors) || (response === null || response === void 0 ? void 0 : response.vendor) || [];
2409
+ _exit3 = true;
2410
+ return _temp6;
2411
+ });
2412
+ }, function (e) {
2413
+ console.error(e);
2414
+ const _temp7 = [];
2415
+ _exit3 = true;
2416
+ return _temp7;
2417
+ });
2418
+ }
2419
+ }();
2420
+ return _temp8 && _temp8.then ? _temp8.then(function (_result3) {
2421
+ return _exit3 ? _result3 : tableData;
2422
+ }) : _exit3 ? _temp8 : tableData;
2423
+ }
2424
+ const _temp9 = function () {
2395
2425
  if (props.selectedTab === "SURVEYOR") {
2396
2426
  return _catch(function () {
2397
- var _props$searchParams;
2427
+ var _props$searchParams3, _props$searchParams4;
2398
2428
  return Promise.resolve(Digit.FSMService.surveyorSearch(tenantId, {
2399
2429
  status: "ACTIVE,DISABLED",
2400
- name: (_props$searchParams = props.searchParams) === null || _props$searchParams === void 0 ? void 0 : _props$searchParams.name,
2430
+ name: (_props$searchParams3 = props.searchParams) === null || _props$searchParams3 === void 0 ? void 0 : _props$searchParams3.name,
2431
+ mobileNumber: ((_props$searchParams4 = props.searchParams) === null || _props$searchParams4 === void 0 ? void 0 : _props$searchParams4.mobileNumber) || undefined,
2401
2432
  limit: 100000,
2402
2433
  offset: 0
2403
2434
  })).then(function (response) {
@@ -2413,17 +2444,16 @@ const VendorInbox = props => {
2413
2444
  });
2414
2445
  }
2415
2446
  }();
2416
- return _temp6 && _temp6.then ? _temp6.then(function (_result2) {
2417
- return _exit2 ? _result2 : tableData;
2418
- }) : _exit2 ? _temp6 : tableData;
2447
+ return _temp9 && _temp9.then ? _temp9.then(_temp0) : _temp0(_temp9);
2419
2448
  }
2420
- const _temp7 = function () {
2449
+ const _temp1 = function () {
2421
2450
  if (props.selectedTab === "SUPERVISOR") {
2422
2451
  return _catch(function () {
2423
- var _props$searchParams2;
2452
+ var _props$searchParams5, _props$searchParams6;
2424
2453
  return Promise.resolve(Digit.FSMService.supervisorSearch(tenantId, {
2425
2454
  status: "ACTIVE,DISABLED",
2426
- name: (_props$searchParams2 = props.searchParams) === null || _props$searchParams2 === void 0 ? void 0 : _props$searchParams2.name,
2455
+ name: (_props$searchParams5 = props.searchParams) === null || _props$searchParams5 === void 0 ? void 0 : _props$searchParams5.name,
2456
+ mobileNumber: ((_props$searchParams6 = props.searchParams) === null || _props$searchParams6 === void 0 ? void 0 : _props$searchParams6.mobileNumber) || undefined,
2427
2457
  limit: 100000,
2428
2458
  offset: 0
2429
2459
  })).then(function (response) {
@@ -2439,7 +2469,7 @@ const VendorInbox = props => {
2439
2469
  });
2440
2470
  }
2441
2471
  }();
2442
- return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7));
2472
+ return Promise.resolve(_temp1 && _temp1.then ? _temp1.then(_temp10) : _temp10(_temp1));
2443
2473
  } catch (e) {
2444
2474
  return Promise.reject(e);
2445
2475
  }
@@ -2699,12 +2729,14 @@ const SearchVendor = () => {
2699
2729
  }
2700
2730
  }) : tab === "SUPERVISOR" ? Digit.Hooks.fsm.useSupervisorSearch(tenantId, _extends({}, paginationParms, {
2701
2731
  status: "ACTIVE,DISABLED",
2702
- name: searchParams === null || searchParams === void 0 ? void 0 : searchParams.name
2732
+ name: searchParams === null || searchParams === void 0 ? void 0 : searchParams.name,
2733
+ mobileNumber: (searchParams === null || searchParams === void 0 ? void 0 : searchParams.mobileNumber) || undefined
2703
2734
  }), {
2704
2735
  enabled: false
2705
2736
  }) : tab === "SURVEYOR" ? Digit.Hooks.fsm.useSurveyorSearch(tenantId, _extends({}, paginationParms, {
2706
2737
  status: "ACTIVE,DISABLED",
2707
- name: searchParams === null || searchParams === void 0 ? void 0 : searchParams.name
2738
+ name: searchParams === null || searchParams === void 0 ? void 0 : searchParams.name,
2739
+ mobileNumber: (searchParams === null || searchParams === void 0 ? void 0 : searchParams.mobileNumber) || undefined
2708
2740
  }), {
2709
2741
  enabled: false
2710
2742
  }) : Digit.Hooks.fsm.useVendorSearch({
@@ -2904,19 +2936,15 @@ const SearchVendor = () => {
2904
2936
  label: t("ES_DRIVER_SEARCH_DRIVER_NAME"),
2905
2937
  name: "name"
2906
2938
  }] : 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
2939
  label: tab === "SUPERVISOR" ? t("ES_SUPERVISOR_SEARCH_NAME") : t("ES_SURVEYOR_SEARCH_NAME"),
2919
2940
  name: "name"
2941
+ }, {
2942
+ label: t("WT_MOBILE_NUMBER"),
2943
+ name: "mobileNumber",
2944
+ type: "text",
2945
+ pattern: "[0-9]{10}",
2946
+ maxLength: 10,
2947
+ title: t("ES_FSM_MOBILE_NUMBER_FORMAT_TIP") || "Enter 10-digit mobile number"
2920
2948
  }] : [{
2921
2949
  label: t("ES_VENDOR_SEARCH_VENDOR_NAME"),
2922
2950
  name: "name"
@@ -4396,7 +4424,7 @@ const VendorDetails = () => {
4396
4424
  }, safeVal));
4397
4425
  })), /*#__PURE__*/React__default.createElement("div", {
4398
4426
  className: "add-details-link hover-button",
4399
- onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/additionaldetails/info?vendorId=" + (dsoId || vendorId))
4427
+ onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/additionaldetails/modify-details?vendorId=" + (dsoId || vendorId))
4400
4428
  }, t("Edit Details"))) : userType !== "CITIZEN" && !isEkyc && /*#__PURE__*/React__default.createElement("div", {
4401
4429
  onClick: () => history.push("/digit-ui/" + userType + "/vendor/registry/additionaldetails/modify-details?vendorId=" + (dsoId || vendorId)),
4402
4430
  className: "add-details-link hover-button"
@@ -9619,13 +9647,47 @@ const SelectEkycZones = _ref => {
9619
9647
  var _zroData$commonMaste, _zroData$MdmsRes, _zroData$MdmsRes$comm;
9620
9648
  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
9649
  if (Array.isArray(zroOfficeList)) {
9622
- const activeZros = zroOfficeList.filter(zro => zro && zro.active).map(zro => ({
9650
+ let activeZros = zroOfficeList.filter(zro => zro && zro.active).map(zro => ({
9623
9651
  code: zro.code,
9624
- name: zro.code
9652
+ name: t(zro.code)
9625
9653
  }));
9654
+ if (isEkycVendor && !isVendorPage) {
9655
+ if (!matchedVendor) {
9656
+ activeZros = [];
9657
+ } else {
9658
+ let vendorZoneCodes = [];
9659
+ if (Array.isArray(matchedVendor === null || matchedVendor === void 0 ? void 0 : matchedVendor.zoneIds) && matchedVendor.zoneIds.length > 0) {
9660
+ vendorZoneCodes = matchedVendor.zoneIds.map(z => z.trim().toUpperCase()).filter(Boolean);
9661
+ } else if (matchedVendor !== null && matchedVendor !== void 0 && matchedVendor.assignedZoneId) {
9662
+ vendorZoneCodes = matchedVendor.assignedZoneId.split(",").map(z => z.trim().toUpperCase()).filter(Boolean);
9663
+ }
9664
+ if (vendorZoneCodes.length > 0) {
9665
+ activeZros = activeZros.filter(zro => vendorZoneCodes.includes(zro.code.trim().toUpperCase()));
9666
+ } else {
9667
+ activeZros = [];
9668
+ }
9669
+ }
9670
+ }
9671
+ if (isEkycSupervisor) {
9672
+ if (!matchedSupervisor) {
9673
+ activeZros = [];
9674
+ } else {
9675
+ let supervisorZoneCodes = [];
9676
+ if (Array.isArray(matchedSupervisor === null || matchedSupervisor === void 0 ? void 0 : matchedSupervisor.zoneIds) && matchedSupervisor.zoneIds.length > 0) {
9677
+ supervisorZoneCodes = matchedSupervisor.zoneIds.map(z => z.trim().toUpperCase()).filter(Boolean);
9678
+ } else if (matchedSupervisor !== null && matchedSupervisor !== void 0 && matchedSupervisor.assignedZoneId) {
9679
+ supervisorZoneCodes = matchedSupervisor.assignedZoneId.split(",").map(z => z.trim().toUpperCase()).filter(Boolean);
9680
+ }
9681
+ if (supervisorZoneCodes.length > 0) {
9682
+ activeZros = activeZros.filter(zro => supervisorZoneCodes.includes(zro.code.trim().toUpperCase()));
9683
+ } else {
9684
+ activeZros = [];
9685
+ }
9686
+ }
9687
+ }
9626
9688
  setZones(activeZros);
9627
9689
  }
9628
- }, [zroData]);
9690
+ }, [zroData, matchedVendor, matchedSupervisor, isEkycVendor, isEkycSupervisor, isVendorPage, t]);
9629
9691
  React.useEffect(() => {
9630
9692
  if (!zones.length || !(formData !== null && formData !== void 0 && formData.zoneIds)) return;
9631
9693
  if (isMultiSelect) {