@djb25/digit-ui-module-vendor 1.0.25 → 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.
@@ -8091,7 +8091,8 @@ const SearchApplication = ({
8091
8091
  validate: searchValidation
8092
8092
  }), {
8093
8093
  watch: watch,
8094
- shouldUpdate: true
8094
+ shouldUpdate: true,
8095
+ placeholder: input.label
8095
8096
  }));
8096
8097
  }
8097
8098
  };
@@ -8830,7 +8831,9 @@ const VendorInbox = props => {
8830
8831
  option: vendors,
8831
8832
  select: value => onVehicleVendorSelect(row, value),
8832
8833
  style: {
8833
- textAlign: "left"
8834
+ textAlign: "left",
8835
+ width: "100%",
8836
+ minWidth: "250px"
8834
8837
  },
8835
8838
  optionKey: "name",
8836
8839
  t: t
@@ -9445,7 +9448,7 @@ const SearchVendor = () => {
9445
9448
  const searchFields = tab === "VEHICLE" ? [{
9446
9449
  label: t("ES_VEHICLE_SEARCH_VEHICLE_NUMBER"),
9447
9450
  name: "registrationNumber",
9448
- 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}",
9449
9452
  title: t("ES_FSM_VEHICLE_FORMAT_TIP")
9450
9453
  }] : tab === "DRIVER" ? [{
9451
9454
  label: t("ES_DRIVER_SEARCH_DRIVER_NAME"),
@@ -9607,9 +9610,17 @@ const DriverConfig = (t, disabled = false) => {
9607
9610
  type: "component",
9608
9611
  route: "select-service",
9609
9612
  hideInEmployee: false,
9610
- key: "additionalDetails",
9613
+ key: "serviceType",
9611
9614
  component: "SelectServiceType",
9612
9615
  disable: disabled,
9616
+ populators: {
9617
+ name: "serviceType",
9618
+ defaultValue: {
9619
+ code: "WT",
9620
+ name: "WT",
9621
+ i18nKey: "WT"
9622
+ }
9623
+ },
9613
9624
  texts: {
9614
9625
  headerCaption: "",
9615
9626
  header: "CS_COMMON_CHOOSE_GENDER",
@@ -9726,6 +9737,11 @@ const AddDriver = ({
9726
9737
  const Config = DriverConfig(t);
9727
9738
  const [canSubmit, setSubmitValve] = useState(false);
9728
9739
  const defaultValues = {
9740
+ serviceType: {
9741
+ code: "WT",
9742
+ name: "WT",
9743
+ i18nKey: "WT"
9744
+ },
9729
9745
  tripData: {
9730
9746
  noOfTrips: 1,
9731
9747
  amountPerTrip: null,
@@ -9753,18 +9769,20 @@ const AddDriver = ({
9753
9769
  const closeToast = () => {
9754
9770
  setShowToast(null);
9755
9771
  };
9772
+ const isCitizen = Digit.UserService.getType() === "WT_VENDOR";
9773
+ console.log(isCitizen, 'iscitizen');
9756
9774
  const onSubmit = data => {
9757
- var _data$selectGender, _data$additionalDetai;
9775
+ var _data$selectGender, _data$serviceType;
9758
9776
  const name = data === null || data === void 0 ? void 0 : data.driverName;
9759
9777
  const license = data === null || data === void 0 ? void 0 : data.license;
9760
9778
  const gender = data === null || data === void 0 ? void 0 : (_data$selectGender = data.selectGender) === null || _data$selectGender === void 0 ? void 0 : _data$selectGender.code;
9761
9779
  const emailId = data === null || data === void 0 ? void 0 : data.emailId;
9762
9780
  const phone = data === null || data === void 0 ? void 0 : data.phone;
9763
9781
  const dob = new Date(`${data.dob}`).getTime() || new Date(`1/1/1970`).getTime();
9764
- 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;
9765
9783
  const formData = {
9766
9784
  driver: {
9767
- tenantId: tenantId,
9785
+ tenantId: !isCitizen ? "dl.djb" : tenantId,
9768
9786
  name: name,
9769
9787
  licenseNumber: license,
9770
9788
  status: "ACTIVE",
@@ -10241,20 +10259,21 @@ const EditVendorDetails = props => {
10241
10259
  },
10242
10260
  className: "delete",
10243
10261
  fill: "#a82227"
10244
- })))), data === null || data === void 0 ? void 0 : (_data$values = data.values) === null || _data$values === void 0 ? void 0 : _data$values.map((value, index) => {
10245
- var _detail$values3;
10246
- return /*#__PURE__*/React.createElement(Row, {
10247
- key: t(String(value.title)),
10248
- label: t(String(value.title)),
10249
- text: value.value ? t(String(value.value)) : "N/A",
10250
- last: index === (detail === null || detail === void 0 ? void 0 : (_detail$values3 = detail.values) === null || _detail$values3 === void 0 ? void 0 : _detail$values3.length) - 1,
10251
- caption: value.caption,
10252
- className: "border-none",
10253
- textStyle: value.value === "ACTIVE" ? {
10254
- color: "green"
10255
- } : {}
10256
- });
10257
- }));
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")))));
10258
10277
  }), detail.type && /*#__PURE__*/React.createElement("div", {
10259
10278
  className: "add-details-link hover-button",
10260
10279
  onClick: () => onActionSelect(detail.type === "ES_FSM_REGISTRY_DETAILS_TYPE_DRIVER" ? "ADD_DRIVER" : "ADD_VEHICLE")
@@ -10577,9 +10596,10 @@ const AddVehicle = ({
10577
10596
  const gender = data === null || data === void 0 ? void 0 : (_data$selectGender = data.selectGender) === null || _data$selectGender === void 0 ? void 0 : _data$selectGender.code;
10578
10597
  const emailId = data === null || data === void 0 ? void 0 : data.emailId;
10579
10598
  const dob = new Date(`${data.dob}`).getTime() || new Date(`1/1/1970`).getTime();
10599
+ const isCitizen = Digit.UserService.getType() === "WT_VENDOR";
10580
10600
  const formData = {
10581
10601
  vehicle: {
10582
- tenantId: tenantId,
10602
+ tenantId: !isCitizen ? "dl.djb" : tenantId,
10583
10603
  registrationNumber: registrationNumber,
10584
10604
  model: vehicleModal,
10585
10605
  type: vehicleType,
@@ -11458,14 +11478,21 @@ const DriverDetails = props => {
11458
11478
  marginBottom: "16px",
11459
11479
  marginTop: "32px"
11460
11480
  }
11461
- }, 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) => {
11462
- 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) => {
11463
11490
  return (value === null || value === void 0 ? void 0 : value.type) === "custom" ? /*#__PURE__*/React.createElement(React.Fragment, {
11464
11491
  key: index
11465
11492
  }, /*#__PURE__*/React.createElement("div", {
11466
- 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`
11467
- }, /*#__PURE__*/React.createElement("h2", null, t(value.title)), /*#__PURE__*/React.createElement("div", {
11468
- className: "value",
11493
+ className: "additional-label"
11494
+ }, t(value.title)), /*#__PURE__*/React.createElement("div", {
11495
+ className: "additional-value",
11469
11496
  style: {
11470
11497
  color: "#a82227",
11471
11498
  display: "flex",
@@ -11473,40 +11500,37 @@ const DriverDetails = props => {
11473
11500
  alignItems: "center"
11474
11501
  }
11475
11502
  }, t(value.value) || "N/A", value.value === "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React.createElement("span", {
11476
- className: "add-details-link hover-button hover-button-round",
11477
- onClick: () => onActionSelect("ADD_VENDOR")
11503
+ className: "add-details-link hover-button",
11504
+ onClick: () => onActionSelect("ADD_VENDOR"),
11505
+ style: {
11506
+ cursor: "pointer"
11507
+ }
11478
11508
  }, /*#__PURE__*/React.createElement(AddIcon, {
11479
11509
  className: "",
11480
- fill: "#a82227",
11481
- styles: {
11482
- cursor: "pointer",
11483
- height: "24px"
11484
- }
11510
+ fill: "#a82227"
11485
11511
  })), value.value !== "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React.createElement("div", {
11486
- className: "add-details-link hover-button hover-button-round",
11487
- onClick: () => onActionSelect("EDIT_VENDOR")
11488
- }, /*#__PURE__*/React.createElement(EditIcon, {
11512
+ className: "add-details-link hover-button",
11513
+ onClick: () => onActionSelect("EDIT_VENDOR"),
11489
11514
  style: {
11490
11515
  cursor: "pointer"
11491
11516
  }
11492
- })), value.value !== "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React.createElement("div", {
11493
- className: "add-details-link hover-button hover-button-round",
11494
- onClick: () => onActionSelect("DELETE_VENDOR")
11495
- }, /*#__PURE__*/React.createElement(DeleteIcon, {
11496
- className: "delete",
11497
- 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"),
11498
11520
  style: {
11499
11521
  cursor: "pointer"
11500
11522
  }
11501
- }))))) : /*#__PURE__*/React.createElement(Row, {
11502
- key: t(value.title),
11503
- label: t(value.title),
11504
- text: t(value.value) || "N/A",
11505
- last: index === (detail === null || detail === void 0 ? void 0 : (_detail$values3 = detail.values) === null || _detail$values3 === void 0 ? void 0 : _detail$values3.length) - 1,
11506
- caption: value.caption,
11507
- className: "border-none"
11508
- });
11509
- })));
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
+ }))));
11510
11534
  }))), showModal && /*#__PURE__*/React.createElement(Modal, {
11511
11535
  headerBarMain: /*#__PURE__*/React.createElement(Heading$1, {
11512
11536
  label: t(modalHeading())
@@ -11870,14 +11894,21 @@ const VehicleDetails = props => {
11870
11894
  marginBottom: "16px",
11871
11895
  marginTop: "32px"
11872
11896
  }
11873
- }, 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) => {
11874
- 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) => {
11875
11906
  return (value === null || value === void 0 ? void 0 : value.type) === "custom" ? /*#__PURE__*/React.createElement(React.Fragment, {
11876
11907
  key: index
11877
11908
  }, /*#__PURE__*/React.createElement("div", {
11878
- 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`
11879
- }, /*#__PURE__*/React.createElement("h2", null, t(value.title)), /*#__PURE__*/React.createElement("div", {
11880
- className: "value add-details-link hover-button",
11909
+ className: "additional-label"
11910
+ }, t(value.title)), /*#__PURE__*/React.createElement("div", {
11911
+ className: "additional-value",
11881
11912
  style: {
11882
11913
  color: "#a82227",
11883
11914
  display: "flex",
@@ -11890,32 +11921,38 @@ const VehicleDetails = props => {
11890
11921
  color: "#a82227",
11891
11922
  display: "flex",
11892
11923
  alignItems: "center",
11893
- gap: "8px"
11924
+ gap: "8px",
11925
+ cursor: "pointer"
11894
11926
  }
11895
11927
  }, /*#__PURE__*/React.createElement(AddIcon, {
11896
11928
  className: "",
11897
11929
  fill: "#a82227"
11898
11930
  }), " ", t(value.value) || "N/A"), value.value !== "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React.createElement("div", {
11899
11931
  className: "add-details-link hover-button",
11900
- onClick: () => onActionSelect("EDIT_VENDOR")
11932
+ onClick: () => onActionSelect("EDIT_VENDOR"),
11933
+ style: {
11934
+ cursor: "pointer"
11935
+ }
11901
11936
  }, /*#__PURE__*/React.createElement(EditIcon, null)), value.value !== "ES_FSM_REGISTRY_DETAILS_ADD_VENDOR" && /*#__PURE__*/React.createElement("div", {
11902
11937
  className: "add-details-link hover-button",
11903
- onClick: () => onActionSelect("DELETE_VENDOR")
11938
+ onClick: () => onActionSelect("DELETE_VENDOR"),
11939
+ style: {
11940
+ cursor: "pointer"
11941
+ }
11904
11942
  }, /*#__PURE__*/React.createElement(DeleteIcon, {
11905
11943
  className: "delete",
11906
11944
  fill: "#a82227"
11907
- }))))) : /*#__PURE__*/React.createElement(Row, {
11908
- key: t(value.title),
11909
- label: t(value.title),
11910
- text: t(value.value) || "N/A",
11911
- last: index === (detail === null || detail === void 0 ? void 0 : (_detail$values3 = detail.values) === null || _detail$values3 === void 0 ? void 0 : _detail$values3.length) - 1,
11912
- caption: value.caption,
11913
- className: "border-none",
11914
- 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" ? {
11915
11952
  color: "green"
11916
11953
  } : {}
11917
- });
11918
- })));
11954
+ }, t(value.value) || "N/A"));
11955
+ }))));
11919
11956
  })), showModal && /*#__PURE__*/React.createElement(Modal, {
11920
11957
  headerBarMain: /*#__PURE__*/React.createElement(Heading$2, {
11921
11958
  label: t(modalHeading())