@djb25/digit-ui-module-vendor 1.0.46 → 1.0.48

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.
@@ -6103,6 +6103,7 @@ const EditVendorDetails = props => {
6103
6103
  }
6104
6104
  const userInfo = Digit.SessionStorage.get("User");
6105
6105
  const userType = (_userInfo$info$type = userInfo.info.type) === null || _userInfo$info$type === void 0 ? void 0 : _userInfo$info$type.toLowerCase();
6106
+ console.log(supervisorData, surveyorData);
6106
6107
  useEffect(() => {
6107
6108
  switch (selectedAction) {
6108
6109
  case "DELETE":
@@ -6302,6 +6303,50 @@ const EditVendorDetails = props => {
6302
6303
  }
6303
6304
  };
6304
6305
  const isMobile = window.Digit.Utils.browser.isMobile();
6306
+ const supervisorColumns = React.useMemo(() => [{
6307
+ Header: "Supervisor Name",
6308
+ accessor: "name"
6309
+ }, {
6310
+ Header: "Mobile Number",
6311
+ accessor: "mobileNo"
6312
+ }, {
6313
+ Header: "Zone",
6314
+ accessor: "assignedZoneId"
6315
+ }, {
6316
+ Header: "Description",
6317
+ accessor: "description"
6318
+ }, {
6319
+ Header: "Status",
6320
+ accessor: "status"
6321
+ }, {
6322
+ Header: "Email",
6323
+ accessor: "owner.emailId"
6324
+ }, {
6325
+ Header: "Gender",
6326
+ accessor: "owner.gender"
6327
+ }], [supervisorData]);
6328
+ const surveyorColumns = React.useMemo(() => [{
6329
+ Header: "Surveyor Name",
6330
+ accessor: "name"
6331
+ }, {
6332
+ Header: "Mobile Number",
6333
+ accessor: "mobileNo"
6334
+ }, {
6335
+ Header: "Email",
6336
+ accessor: "owner.emailId"
6337
+ }, {
6338
+ Header: "Gender",
6339
+ accessor: "owner.gender"
6340
+ }, {
6341
+ Header: "Service Type",
6342
+ accessor: "additionalDetails.serviceType"
6343
+ }, {
6344
+ Header: "Description",
6345
+ accessor: "description"
6346
+ }, {
6347
+ Header: "Status",
6348
+ accessor: "status"
6349
+ }], [surveyorData]);
6305
6350
  if (isLoading) {
6306
6351
  return /*#__PURE__*/React.createElement(Loader, null);
6307
6352
  }
@@ -6421,47 +6466,14 @@ const EditVendorDetails = props => {
6421
6466
  marginBottom: "16px",
6422
6467
  marginTop: "32px"
6423
6468
  }
6424
- }, t("ES_VENDOR_SUPERVISOR_DETAILS")), /*#__PURE__*/React.createElement("div", null, supervisorData === null || supervisorData === void 0 ? void 0 : (_supervisorData$super = supervisorData.supervisor) === null || _supervisorData$super === void 0 ? void 0 : _supervisorData$super.map((supervisor, index) => {
6425
- var _supervisor$owner, _supervisor$owner2;
6426
- return /*#__PURE__*/React.createElement(Card, {
6427
- className: "card-with-background",
6428
- key: supervisor.id || index
6429
- }, /*#__PURE__*/React.createElement("div", {
6430
- className: "card-head"
6431
- }, /*#__PURE__*/React.createElement("h2", null, t("ES_VENDOR_SUPERVISOR_DETAILS"), " ", index + 1), /*#__PURE__*/React.createElement("div", {
6432
- style: {
6433
- display: "flex"
6434
- }
6435
- }, /*#__PURE__*/React.createElement("span", {
6436
- onClick: () => history.push(`/digit-ui/${userType}/vendor/registry/supervisor-details/${supervisor.id}`)
6437
- }, /*#__PURE__*/React.createElement(EditIcon, {
6438
- style: {
6439
- cursor: "pointer",
6440
- marginRight: "20px"
6441
- },
6442
- className: "edit",
6443
- fill: "#a82227"
6444
- })))), /*#__PURE__*/React.createElement("div", {
6445
- className: "additional-grid",
6446
- style: {
6447
- padding: "8px 16px"
6448
- }
6449
- }, /*#__PURE__*/React.createElement("div", {
6450
- className: "additional-label"
6451
- }, t("ES_FSM_REGISTRY_NEW_OWNER_NAME")), /*#__PURE__*/React.createElement("div", {
6452
- className: "additional-value"
6453
- }, (_supervisor$owner = supervisor.owner) === null || _supervisor$owner === void 0 ? void 0 : _supervisor$owner.name), /*#__PURE__*/React.createElement("div", {
6454
- className: "additional-label"
6455
- }, t("ES_FSM_REGISTRY_VENDOR_PHONE")), /*#__PURE__*/React.createElement("div", {
6456
- className: "additional-value"
6457
- }, (_supervisor$owner2 = supervisor.owner) === null || _supervisor$owner2 === void 0 ? void 0 : _supervisor$owner2.mobileNumber), /*#__PURE__*/React.createElement("div", {
6458
- className: "additional-label"
6459
- }, t("ES_VENDOR_STATUS")), /*#__PURE__*/React.createElement("div", {
6460
- className: "additional-value",
6461
- style: supervisor.status === "ACTIVE" ? {
6462
- color: "green"
6463
- } : {}
6464
- }, supervisor.status)));
6469
+ }, t("ES_VENDOR_SUPERVISOR_DETAILS")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Table, {
6470
+ data: (supervisorData === null || supervisorData === void 0 ? void 0 : supervisorData.supervisors) || [],
6471
+ columns: supervisorColumns,
6472
+ tableTitle: "Supervisors",
6473
+ totalRecords: (supervisorData === null || supervisorData === void 0 ? void 0 : (_supervisorData$super = supervisorData.supervisors) === null || _supervisorData$super === void 0 ? void 0 : _supervisorData$super.length) || 0,
6474
+ manualPagination: false,
6475
+ pageSizeLimit: 10,
6476
+ t: t
6465
6477
  }), /*#__PURE__*/React.createElement("div", {
6466
6478
  className: "add-details-link hover-button",
6467
6479
  onClick: () => history.push(`/digit-ui/${userType}/vendor/registry/new-supervisor?vendorId=${dsoId}`)
@@ -6470,47 +6482,14 @@ const EditVendorDetails = props => {
6470
6482
  marginBottom: "16px",
6471
6483
  marginTop: "32px"
6472
6484
  }
6473
- }, t("ES_VENDOR_SURVEYOR_DETAILS")), /*#__PURE__*/React.createElement("div", null, surveyorData === null || surveyorData === void 0 ? void 0 : (_surveyorData$surveyo = surveyorData.surveyor) === null || _surveyorData$surveyo === void 0 ? void 0 : _surveyorData$surveyo.map((surveyor, index) => {
6474
- var _surveyor$owner, _surveyor$owner2;
6475
- return /*#__PURE__*/React.createElement(Card, {
6476
- className: "card-with-background",
6477
- key: surveyor.id || index
6478
- }, /*#__PURE__*/React.createElement("div", {
6479
- className: "card-head"
6480
- }, /*#__PURE__*/React.createElement("h2", null, t("ES_VENDOR_SURVEYOR_DETAILS"), " ", index + 1), /*#__PURE__*/React.createElement("div", {
6481
- style: {
6482
- display: "flex"
6483
- }
6484
- }, /*#__PURE__*/React.createElement("span", {
6485
- onClick: () => history.push(`/digit-ui/${userType}/vendor/registry/surveyor-details/${surveyor.id}`)
6486
- }, /*#__PURE__*/React.createElement(EditIcon, {
6487
- style: {
6488
- cursor: "pointer",
6489
- marginRight: "20px"
6490
- },
6491
- className: "edit",
6492
- fill: "#a82227"
6493
- })))), /*#__PURE__*/React.createElement("div", {
6494
- className: "additional-grid",
6495
- style: {
6496
- padding: "8px 16px"
6497
- }
6498
- }, /*#__PURE__*/React.createElement("div", {
6499
- className: "additional-label"
6500
- }, t("ES_FSM_REGISTRY_NEW_OWNER_NAME")), /*#__PURE__*/React.createElement("div", {
6501
- className: "additional-value"
6502
- }, (_surveyor$owner = surveyor.owner) === null || _surveyor$owner === void 0 ? void 0 : _surveyor$owner.name), /*#__PURE__*/React.createElement("div", {
6503
- className: "additional-label"
6504
- }, t("ES_FSM_REGISTRY_VENDOR_PHONE")), /*#__PURE__*/React.createElement("div", {
6505
- className: "additional-value"
6506
- }, (_surveyor$owner2 = surveyor.owner) === null || _surveyor$owner2 === void 0 ? void 0 : _surveyor$owner2.mobileNumber), /*#__PURE__*/React.createElement("div", {
6507
- className: "additional-label"
6508
- }, t("ES_VENDOR_STATUS")), /*#__PURE__*/React.createElement("div", {
6509
- className: "additional-value",
6510
- style: surveyor.status === "ACTIVE" ? {
6511
- color: "green"
6512
- } : {}
6513
- }, surveyor.status)));
6485
+ }, t("ES_VENDOR_SURVEYOR_DETAILS")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Table, {
6486
+ data: (surveyorData === null || surveyorData === void 0 ? void 0 : surveyorData.surveyors) || [],
6487
+ columns: surveyorColumns,
6488
+ tableTitle: "Surveyors",
6489
+ totalRecords: (surveyorData === null || surveyorData === void 0 ? void 0 : (_surveyorData$surveyo = surveyorData.surveyors) === null || _surveyorData$surveyo === void 0 ? void 0 : _surveyorData$surveyo.length) || 0,
6490
+ manualPagination: false,
6491
+ pageSizeLimit: 10,
6492
+ t: t
6514
6493
  }), /*#__PURE__*/React.createElement("div", {
6515
6494
  className: "add-details-link hover-button",
6516
6495
  onClick: () => history.push(`/digit-ui/${userType}/vendor/registry/new-surveyor?vendorId=${dsoId}`)
@@ -9834,16 +9813,15 @@ const VENDORModule = ({
9834
9813
  path,
9835
9814
  url
9836
9815
  } = useRouteMatch();
9837
- const moduleCode = "VENDOR";
9838
9816
  const language = Digit.StoreData.getCurrentLanguage();
9839
9817
  const tenantId = Digit.ULBService.getCurrentTenantId();
9840
9818
  useEffect(() => {
9841
9819
  Digit.LocalizationService.getLocale({
9842
- modules: [`rainmaker-${moduleCode.toLowerCase()}`],
9820
+ modules: ["rainmaker-vendor"],
9843
9821
  locale: language,
9844
- tenantId: tenantId
9822
+ tenantId: "dl"
9845
9823
  });
9846
- }, [stateCode, language]);
9824
+ }, [language, tenantId]);
9847
9825
  addComponentsToRegistry();
9848
9826
  Digit.SessionStorage.set("VENDOR_TENANTS", tenants);
9849
9827
  useEffect(() => {