@djb25/digit-ui-module-vendor 1.0.24 → 1.0.26

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.
@@ -454,16 +454,19 @@ const VENDORCard = () => {
454
454
  const {
455
455
  t
456
456
  } = useTranslation();
457
+ const history = useHistory();
457
458
  const [total, setTotal] = useState("-");
458
- if (!Digit.Utils.vendorAccess()) {
459
+ const isCitizen = window.location.pathname.toLowerCase().includes("citizen");
460
+ const hasAccess = Digit.Utils.vendorAccess() || Digit.UserService.hasAccess(["WT_VENDOR", "MT_VENDOR"]);
461
+ if (!hasAccess) {
459
462
  return null;
460
463
  }
461
464
  const links = [{
462
465
  label: t("VENDOR_NEW_REGISTERATION"),
463
- link: `/digit-ui/employee/vendor/registry/new-vendor`
466
+ link: isCitizen ? `/digit-ui/citizen/vendor/registry/new-vendor` : `/digit-ui/employee/vendor/registry/new-vendor`
464
467
  }, {
465
468
  label: t("SEARCH_VENDOR"),
466
- link: `/digit-ui/employee/vendor/search-vendor`
469
+ link: isCitizen ? `/digit-ui/citizen/vendor/search-vendor` : `/digit-ui/employee/vendor/search-vendor`
467
470
  }];
468
471
  const VENDORRole = Digit.UserService.hasAccess(["WT_VENDOR"]);
469
472
  const propsForModuleCard = {
@@ -472,10 +475,18 @@ const VENDORCard = () => {
472
475
  kpis: [{
473
476
  count: total === null || total === void 0 ? void 0 : total.totalCount,
474
477
  label: t("Inbox"),
475
- link: `/digit-ui/employee/asset/assetservice/inbox`
478
+ link: isCitizen ? `/digit-ui/citizen/vendor/search-vendor` : `/digit-ui/employee/vendor/search-vendor`
476
479
  }],
477
- links: links.filter(link => !(link !== null && link !== void 0 && link.role) || VENDORRole)
480
+ links: links.filter(link => !(link !== null && link !== void 0 && link.role) || VENDORRole),
481
+ ...(isCitizen ? {
482
+ onDetailsClick: () => history.push("/digit-ui/citizen/vendor/search-vendor")
483
+ } : {})
478
484
  };
485
+ if (isCitizen) {
486
+ return /*#__PURE__*/React.createElement("div", {
487
+ className: "wt-citizen-card-premium"
488
+ }, /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard));
489
+ }
479
490
  return /*#__PURE__*/React.createElement(EmployeeModuleCard, propsForModuleCard);
480
491
  };
481
492
 
@@ -8080,7 +8091,8 @@ const SearchApplication = ({
8080
8091
  validate: searchValidation
8081
8092
  }), {
8082
8093
  watch: watch,
8083
- shouldUpdate: true
8094
+ shouldUpdate: true,
8095
+ placeholder: input.label
8084
8096
  }));
8085
8097
  }
8086
8098
  };
@@ -8819,7 +8831,9 @@ const VendorInbox = props => {
8819
8831
  option: vendors,
8820
8832
  select: value => onVehicleVendorSelect(row, value),
8821
8833
  style: {
8822
- textAlign: "left"
8834
+ textAlign: "left",
8835
+ width: "100%",
8836
+ minWidth: "250px"
8823
8837
  },
8824
8838
  optionKey: "name",
8825
8839
  t: t
@@ -9434,7 +9448,7 @@ const SearchVendor = () => {
9434
9448
  const searchFields = tab === "VEHICLE" ? [{
9435
9449
  label: t("ES_VEHICLE_SEARCH_VEHICLE_NUMBER"),
9436
9450
  name: "registrationNumber",
9437
- pattern: `[A-Z]{2}\\s{1}[0-9]{2}\\s{0,1}[A-Z]{1,2}\\s{1}[0-9]{4}`,
9451
+ pattern: "[A-Z]{2}[- ]?[0-9]{2}[- ]?[A-Z]{1,2}[- ]?[0-9]{4}",
9438
9452
  title: t("ES_FSM_VEHICLE_FORMAT_TIP")
9439
9453
  }] : tab === "DRIVER" ? [{
9440
9454
  label: t("ES_DRIVER_SEARCH_DRIVER_NAME"),
@@ -9596,9 +9610,17 @@ const DriverConfig = (t, disabled = false) => {
9596
9610
  type: "component",
9597
9611
  route: "select-service",
9598
9612
  hideInEmployee: false,
9599
- key: "additionalDetails",
9613
+ key: "serviceType",
9600
9614
  component: "SelectServiceType",
9601
9615
  disable: disabled,
9616
+ populators: {
9617
+ name: "serviceType",
9618
+ defaultValue: {
9619
+ code: "WT",
9620
+ name: "WT",
9621
+ i18nKey: "WT"
9622
+ }
9623
+ },
9602
9624
  texts: {
9603
9625
  headerCaption: "",
9604
9626
  header: "CS_COMMON_CHOOSE_GENDER",
@@ -9715,6 +9737,11 @@ const AddDriver = ({
9715
9737
  const Config = DriverConfig(t);
9716
9738
  const [canSubmit, setSubmitValve] = useState(false);
9717
9739
  const defaultValues = {
9740
+ serviceType: {
9741
+ code: "WT",
9742
+ name: "WT",
9743
+ i18nKey: "WT"
9744
+ },
9718
9745
  tripData: {
9719
9746
  noOfTrips: 1,
9720
9747
  amountPerTrip: null,
@@ -9742,18 +9769,20 @@ const AddDriver = ({
9742
9769
  const closeToast = () => {
9743
9770
  setShowToast(null);
9744
9771
  };
9772
+ const isCitizen = Digit.UserService.getType() === "WT_VENDOR";
9773
+ console.log(isCitizen, 'iscitizen');
9745
9774
  const onSubmit = data => {
9746
- var _data$selectGender, _data$additionalDetai;
9775
+ var _data$selectGender, _data$serviceType;
9747
9776
  const name = data === null || data === void 0 ? void 0 : data.driverName;
9748
9777
  const license = data === null || data === void 0 ? void 0 : data.license;
9749
9778
  const gender = data === null || data === void 0 ? void 0 : (_data$selectGender = data.selectGender) === null || _data$selectGender === void 0 ? void 0 : _data$selectGender.code;
9750
9779
  const emailId = data === null || data === void 0 ? void 0 : data.emailId;
9751
9780
  const phone = data === null || data === void 0 ? void 0 : data.phone;
9752
9781
  const dob = new Date(`${data.dob}`).getTime() || new Date(`1/1/1970`).getTime();
9753
- const additionalDetails = data === null || data === void 0 ? void 0 : (_data$additionalDetai = data.additionalDetails) === null || _data$additionalDetai === void 0 ? void 0 : _data$additionalDetai.code;
9782
+ const additionalDetails = data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code;
9754
9783
  const formData = {
9755
9784
  driver: {
9756
- tenantId: tenantId,
9785
+ tenantId: !isCitizen ? "dl.djb" : tenantId,
9757
9786
  name: name,
9758
9787
  licenseNumber: license,
9759
9788
  status: "ACTIVE",
@@ -10230,20 +10259,21 @@ const EditVendorDetails = props => {
10230
10259
  },
10231
10260
  className: "delete",
10232
10261
  fill: "#a82227"
10233
- })))), data === null || data === void 0 ? void 0 : (_data$values = data.values) === null || _data$values === void 0 ? void 0 : _data$values.map((value, index) => {
10234
- var _detail$values3;
10235
- return /*#__PURE__*/React.createElement(Row, {
10236
- key: t(String(value.title)),
10237
- label: t(String(value.title)),
10238
- text: value.value ? t(String(value.value)) : "N/A",
10239
- last: index === (detail === null || detail === void 0 ? void 0 : (_detail$values3 = detail.values) === null || _detail$values3 === void 0 ? void 0 : _detail$values3.length) - 1,
10240
- caption: value.caption,
10241
- className: "border-none",
10242
- textStyle: value.value === "ACTIVE" ? {
10243
- color: "green"
10244
- } : {}
10245
- });
10246
- }));
10262
+ })))), /*#__PURE__*/React.createElement("div", {
10263
+ className: "additional-grid",
10264
+ style: {
10265
+ padding: "8px 16px"
10266
+ }
10267
+ }, data === null || data === void 0 ? void 0 : (_data$values = data.values) === null || _data$values === void 0 ? void 0 : _data$values.map((value, index) => /*#__PURE__*/React.createElement(React.Fragment, {
10268
+ key: index
10269
+ }, /*#__PURE__*/React.createElement("div", {
10270
+ className: "additional-label"
10271
+ }, t(String(value.title))), /*#__PURE__*/React.createElement("div", {
10272
+ className: "additional-value",
10273
+ style: value.value === "ACTIVE" ? {
10274
+ color: "green"
10275
+ } : {}
10276
+ }, value.value ? t(String(value.value)) : "N/A")))));
10247
10277
  }), detail.type && /*#__PURE__*/React.createElement("div", {
10248
10278
  className: "add-details-link hover-button",
10249
10279
  onClick: () => onActionSelect(detail.type === "ES_FSM_REGISTRY_DETAILS_TYPE_DRIVER" ? "ADD_DRIVER" : "ADD_VEHICLE")
@@ -10566,9 +10596,10 @@ const AddVehicle = ({
10566
10596
  const gender = data === null || data === void 0 ? void 0 : (_data$selectGender = data.selectGender) === null || _data$selectGender === void 0 ? void 0 : _data$selectGender.code;
10567
10597
  const emailId = data === null || data === void 0 ? void 0 : data.emailId;
10568
10598
  const dob = new Date(`${data.dob}`).getTime() || new Date(`1/1/1970`).getTime();
10599
+ const isCitizen = Digit.UserService.getType() === "WT_VENDOR";
10569
10600
  const formData = {
10570
10601
  vehicle: {
10571
- tenantId: tenantId,
10602
+ tenantId: !isCitizen ? "dl.djb" : tenantId,
10572
10603
  registrationNumber: registrationNumber,
10573
10604
  model: vehicleModal,
10574
10605
  type: vehicleType,
@@ -11447,14 +11478,21 @@ const DriverDetails = props => {
11447
11478
  marginBottom: "16px",
11448
11479
  marginTop: "32px"
11449
11480
  }
11450
- }, t(detail.title)), /*#__PURE__*/React.createElement(StatusTable, null, detail === null || detail === void 0 ? void 0 : (_detail$values = detail.values) === null || _detail$values === void 0 ? void 0 : _detail$values.map((value, index) => {
11451
- var _detail$values2, _detail$values3;
11481
+ }, t(detail.title)), /*#__PURE__*/React.createElement(Card, {
11482
+ className: "card-with-background",
11483
+ style: {
11484
+ margin: "10px 16px",
11485
+ padding: "20px"
11486
+ }
11487
+ }, /*#__PURE__*/React.createElement("div", {
11488
+ className: "additional-grid"
11489
+ }, detail === null || detail === void 0 ? void 0 : (_detail$values = detail.values) === null || _detail$values === void 0 ? void 0 : _detail$values.map((value, index) => {
11452
11490
  return (value === null || value === void 0 ? void 0 : value.type) === "custom" ? /*#__PURE__*/React.createElement(React.Fragment, {
11453
11491
  key: index
11454
11492
  }, /*#__PURE__*/React.createElement("div", {
11455
- className: `${index === (detail === null || detail === void 0 ? void 0 : (_detail$values2 = detail.values) === null || _detail$values2 === void 0 ? void 0 : _detail$values2.length) - 1 ? "row last" : "row"} border-none`
11456
- }, /*#__PURE__*/React.createElement("h2", null, t(value.title)), /*#__PURE__*/React.createElement("div", {
11457
- className: "value",
11493
+ className: "additional-label"
11494
+ }, t(value.title)), /*#__PURE__*/React.createElement("div", {
11495
+ className: "additional-value",
11458
11496
  style: {
11459
11497
  color: "#a82227",
11460
11498
  display: "flex",
@@ -11462,40 +11500,37 @@ const DriverDetails = props => {
11462
11500
  alignItems: "center"
11463
11501
  }
11464
11502
  }, t(value.value) || "N/A", value.value === "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React.createElement("span", {
11465
- className: "add-details-link hover-button hover-button-round",
11466
- onClick: () => onActionSelect("ADD_VENDOR")
11503
+ className: "add-details-link hover-button",
11504
+ onClick: () => onActionSelect("ADD_VENDOR"),
11505
+ style: {
11506
+ cursor: "pointer"
11507
+ }
11467
11508
  }, /*#__PURE__*/React.createElement(AddIcon, {
11468
11509
  className: "",
11469
- fill: "#a82227",
11470
- styles: {
11471
- cursor: "pointer",
11472
- height: "24px"
11473
- }
11510
+ fill: "#a82227"
11474
11511
  })), value.value !== "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React.createElement("div", {
11475
- className: "add-details-link hover-button hover-button-round",
11476
- onClick: () => onActionSelect("EDIT_VENDOR")
11477
- }, /*#__PURE__*/React.createElement(EditIcon, {
11512
+ className: "add-details-link hover-button",
11513
+ onClick: () => onActionSelect("EDIT_VENDOR"),
11478
11514
  style: {
11479
11515
  cursor: "pointer"
11480
11516
  }
11481
- })), value.value !== "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React.createElement("div", {
11482
- className: "add-details-link hover-button hover-button-round",
11483
- onClick: () => onActionSelect("DELETE_VENDOR")
11484
- }, /*#__PURE__*/React.createElement(DeleteIcon, {
11485
- className: "delete",
11486
- fill: "#a82227",
11517
+ }, /*#__PURE__*/React.createElement(EditIcon, null)), value.value !== "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React.createElement("div", {
11518
+ className: "add-details-link hover-button",
11519
+ onClick: () => onActionSelect("DELETE_VENDOR"),
11487
11520
  style: {
11488
11521
  cursor: "pointer"
11489
11522
  }
11490
- }))))) : /*#__PURE__*/React.createElement(Row, {
11491
- key: t(value.title),
11492
- label: t(value.title),
11493
- text: t(value.value) || "N/A",
11494
- last: index === (detail === null || detail === void 0 ? void 0 : (_detail$values3 = detail.values) === null || _detail$values3 === void 0 ? void 0 : _detail$values3.length) - 1,
11495
- caption: value.caption,
11496
- className: "border-none"
11497
- });
11498
- })));
11523
+ }, /*#__PURE__*/React.createElement(DeleteIcon, {
11524
+ className: "delete",
11525
+ fill: "#a82227"
11526
+ })))) : /*#__PURE__*/React.createElement(React.Fragment, {
11527
+ key: index
11528
+ }, /*#__PURE__*/React.createElement("div", {
11529
+ className: "additional-label"
11530
+ }, t(value.title)), /*#__PURE__*/React.createElement("div", {
11531
+ className: "additional-value"
11532
+ }, t(value.value) || "N/A"));
11533
+ }))));
11499
11534
  }))), showModal && /*#__PURE__*/React.createElement(Modal, {
11500
11535
  headerBarMain: /*#__PURE__*/React.createElement(Heading$1, {
11501
11536
  label: t(modalHeading())
@@ -11859,14 +11894,21 @@ const VehicleDetails = props => {
11859
11894
  marginBottom: "16px",
11860
11895
  marginTop: "32px"
11861
11896
  }
11862
- }, t(detail.title)), /*#__PURE__*/React.createElement(StatusTable, null, detail === null || detail === void 0 ? void 0 : (_detail$values = detail.values) === null || _detail$values === void 0 ? void 0 : _detail$values.map((value, index) => {
11863
- var _detail$values2, _detail$values3;
11897
+ }, t(detail.title)), /*#__PURE__*/React.createElement(Card, {
11898
+ className: "card-with-background",
11899
+ style: {
11900
+ margin: "10px 16px",
11901
+ padding: "20px"
11902
+ }
11903
+ }, /*#__PURE__*/React.createElement("div", {
11904
+ className: "additional-grid"
11905
+ }, detail === null || detail === void 0 ? void 0 : (_detail$values = detail.values) === null || _detail$values === void 0 ? void 0 : _detail$values.map((value, index) => {
11864
11906
  return (value === null || value === void 0 ? void 0 : value.type) === "custom" ? /*#__PURE__*/React.createElement(React.Fragment, {
11865
11907
  key: index
11866
11908
  }, /*#__PURE__*/React.createElement("div", {
11867
- className: `${index === (detail === null || detail === void 0 ? void 0 : (_detail$values2 = detail.values) === null || _detail$values2 === void 0 ? void 0 : _detail$values2.length) - 1 ? "row last" : "row"} border-none`
11868
- }, /*#__PURE__*/React.createElement("h2", null, t(value.title)), /*#__PURE__*/React.createElement("div", {
11869
- className: "value add-details-link hover-button",
11909
+ className: "additional-label"
11910
+ }, t(value.title)), /*#__PURE__*/React.createElement("div", {
11911
+ className: "additional-value",
11870
11912
  style: {
11871
11913
  color: "#a82227",
11872
11914
  display: "flex",
@@ -11879,32 +11921,38 @@ const VehicleDetails = props => {
11879
11921
  color: "#a82227",
11880
11922
  display: "flex",
11881
11923
  alignItems: "center",
11882
- gap: "8px"
11924
+ gap: "8px",
11925
+ cursor: "pointer"
11883
11926
  }
11884
11927
  }, /*#__PURE__*/React.createElement(AddIcon, {
11885
11928
  className: "",
11886
11929
  fill: "#a82227"
11887
11930
  }), " ", t(value.value) || "N/A"), value.value !== "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React.createElement("div", {
11888
11931
  className: "add-details-link hover-button",
11889
- onClick: () => onActionSelect("EDIT_VENDOR")
11932
+ onClick: () => onActionSelect("EDIT_VENDOR"),
11933
+ style: {
11934
+ cursor: "pointer"
11935
+ }
11890
11936
  }, /*#__PURE__*/React.createElement(EditIcon, null)), value.value !== "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React.createElement("div", {
11891
11937
  className: "add-details-link hover-button",
11892
- onClick: () => onActionSelect("DELETE_VENDOR")
11938
+ onClick: () => onActionSelect("DELETE_VENDOR"),
11939
+ style: {
11940
+ cursor: "pointer"
11941
+ }
11893
11942
  }, /*#__PURE__*/React.createElement(DeleteIcon, {
11894
11943
  className: "delete",
11895
11944
  fill: "#a82227"
11896
- }))))) : /*#__PURE__*/React.createElement(Row, {
11897
- key: t(value.title),
11898
- label: t(value.title),
11899
- text: t(value.value) || "N/A",
11900
- last: index === (detail === null || detail === void 0 ? void 0 : (_detail$values3 = detail.values) === null || _detail$values3 === void 0 ? void 0 : _detail$values3.length) - 1,
11901
- caption: value.caption,
11902
- className: "border-none",
11903
- textStyle: value.value === "ACTIVE" ? {
11945
+ })))) : /*#__PURE__*/React.createElement(React.Fragment, {
11946
+ key: index
11947
+ }, /*#__PURE__*/React.createElement("div", {
11948
+ className: "additional-label"
11949
+ }, t(value.title)), /*#__PURE__*/React.createElement("div", {
11950
+ className: "additional-value",
11951
+ style: value.value === "ACTIVE" ? {
11904
11952
  color: "green"
11905
11953
  } : {}
11906
- });
11907
- })));
11954
+ }, t(value.value) || "N/A"));
11955
+ }))));
11908
11956
  })), showModal && /*#__PURE__*/React.createElement(Modal, {
11909
11957
  headerBarMain: /*#__PURE__*/React.createElement(Heading$2, {
11910
11958
  label: t(modalHeading())