@djb25/digit-ui-module-fsm 1.0.21 → 1.0.22

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.
@@ -1,4 +1,4 @@
1
- import { AddNewIcon, ShippingTruck, EmployeeModuleCard, TickMark, FormStep as FormStep$1, RadioOrSelect, LabelFieldPair, CardLabel as CardLabel$1, Dropdown, TextInput as TextInput$1, RadioButtons, Loader, LocationSearchCard, TextArea as TextArea$1, CardLabelError as CardLabelError$1, CitizenInfoLabel, CardText as CardText$1, WrapUnMaskComponent, PitDimension, ImageUploadHandler, KeyNote, BackButton, PrivateRoute, LayoutWrapper, TelePhone, CardSectionHeader, CheckPoint, ConnectingCheckPoints, LinkButton as LinkButton$1, ActionLinks, Rating, SubmitBar as SubmitBar$1, Header, Card as Card$1, CardHeader as CardHeader$1, CardSubHeader, StatusTable, Row, Banner, RatingCard, ULBHomeCard, ViewReportIcon, InboxIcon, Table, CheckBox, CloseSvg, Localities, RemoveableTag, ActionBar, ApplyFilterBar, Label, LinkLabel, DatePicker as DatePicker$2, DetailsCard, SearchAction, FilterAction, PopUp, BreadCrumb, ModuleHeader, ArrowLeft, HomeIcon, Modal, FormComposer, UploadPitPhoto, ImageViewer, BreakLine, Toast, Menu, MultiUploadWrapper, AddIcon, ToggleSwitch, InfoIcon, EditIcon, DeleteIcon, VerticalTimeline, CustomTooltip, MobileNumber, CitizenHomeCard, CitizenTruck } from '@djb25/digit-ui-react-components';
1
+ import { AddNewIcon, ShippingTruck, EmployeeModuleCard, TickMark, FormStep as FormStep$1, RadioOrSelect, LabelFieldPair, CardLabel as CardLabel$1, Dropdown, TextInput as TextInput$1, RadioButtons, Loader, LocationSearchCard, TextArea as TextArea$1, CardLabelError as CardLabelError$1, CitizenInfoLabel, CardText as CardText$1, WrapUnMaskComponent, PitDimension, ImageUploadHandler, KeyNote, BackButton, PrivateRoute, LayoutWrapper, TelePhone, CardSectionHeader, CheckPoint, ConnectingCheckPoints, LinkButton as LinkButton$1, ActionLinks, Rating, SubmitBar as SubmitBar$1, Header, Card, CardHeader as CardHeader$1, CardSubHeader, StatusTable, Row, Banner, RatingCard, ULBHomeCard, ViewReportIcon, InboxIcon, Table, CheckBox, CloseSvg, Localities, RemoveableTag, ActionBar, ApplyFilterBar, Label, LinkLabel, DatePicker as DatePicker$2, DetailsCard, SearchAction, FilterAction, PopUp, BreadCrumb, ModuleHeader, ArrowLeft, HomeIcon, Modal, FormComposer, UploadPitPhoto, ImageViewer, BreakLine, Toast, Menu, MultiUploadWrapper, AddIcon, ToggleSwitch, InfoIcon, EditIcon, DeleteIcon, VerticalTimeline, CitizenHomeCard, CitizenTruck } from '@djb25/digit-ui-react-components';
2
2
  import React, { useState, useEffect, Fragment as Fragment$1, forwardRef, useCallback, useMemo, useRef } from 'react';
3
3
  import { useTranslation } from 'react-i18next';
4
4
  import { useLocation, useParams, Switch, Redirect, Link, useHistory, useRouteMatch, Route } from 'react-router-dom';
@@ -2205,13 +2205,15 @@ const InputCard = _ref => {
2205
2205
  isMultipleAllow = _ref$isMultipleAllow === void 0 ? false : _ref$isMultipleAllow,
2206
2206
  _ref$cardStyle = _ref.cardStyle,
2207
2207
  cardStyle = _ref$cardStyle === void 0 ? {} : _ref$cardStyle,
2208
- className = _ref.className;
2208
+ className = _ref.className,
2209
+ _ref$noGrid = _ref.noGrid,
2210
+ noGrid = _ref$noGrid === void 0 ? false : _ref$noGrid;
2209
2211
  const isMobile = window.Digit.Utils.browser.isMobile();
2210
2212
  return /*#__PURE__*/React.createElement("div", {
2211
2213
  className: className || "",
2212
2214
  style: cardStyle
2213
2215
  }, texts.headerCaption && /*#__PURE__*/React.createElement(CardCaption, null, t(texts.headerCaption)), (texts === null || texts === void 0 ? void 0 : texts.header) && /*#__PURE__*/React.createElement(CardHeader, null, t(texts.header)), (texts === null || texts === void 0 ? void 0 : texts.cardText) && /*#__PURE__*/React.createElement(CardText, null, t(texts.cardText)), /*#__PURE__*/React.createElement("div", {
2214
- className: "formcomposer-section-grid"
2216
+ className: noGrid ? "" : "formcomposer-section-grid"
2215
2217
  }, children), texts.submitBarLabel ? /*#__PURE__*/React.createElement("div", {
2216
2218
  className: "formcomposer-section-button"
2217
2219
  }, /*#__PURE__*/React.createElement(SubmitBar, {
@@ -2325,24 +2327,6 @@ const CollapsibleCardPage = _ref => {
2325
2327
  }, children(activeTab)) : children)));
2326
2328
  };
2327
2329
 
2328
- const _excluded = ["onClick", "style", "children", "className", "ReactRef"];
2329
- const Card = _ref => {
2330
- let onClick = _ref.onClick,
2331
- style = _ref.style,
2332
- children = _ref.children,
2333
- className = _ref.className,
2334
- ReactRef = _ref.ReactRef,
2335
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
2336
- return /*#__PURE__*/React.createElement("div", _extends({
2337
- key: props.key,
2338
- className: "employeeCard " + (className ? className : ""),
2339
- onClick: onClick,
2340
- style: style
2341
- }, props, {
2342
- ref: ReactRef
2343
- }), children);
2344
- };
2345
-
2346
2330
  const FormStep = _ref => {
2347
2331
  var _config$inputs, _config$texts;
2348
2332
  let t = _ref.t,
@@ -2372,8 +2356,7 @@ const FormStep = _ref => {
2372
2356
  isCollapsible = _ref$isCollapsible === void 0 ? true : _ref$isCollapsible,
2373
2357
  _ref$defaultOpen = _ref.defaultOpen,
2374
2358
  defaultOpen = _ref$defaultOpen === void 0 ? true : _ref$defaultOpen,
2375
- formClassName = _ref.formClassName,
2376
- cardClassName = _ref.cardClassName;
2359
+ formClassName = _ref.formClassName;
2377
2360
  const _useForm = useForm({
2378
2361
  defaultValues: _defaultValues
2379
2362
  }),
@@ -2456,8 +2439,6 @@ const FormStep = _ref => {
2456
2439
  flex: "1"
2457
2440
  },
2458
2441
  onSubmit: handleSubmit(goNext)
2459
- }, /*#__PURE__*/React.createElement(Card, {
2460
- className: "form-composer-card " + (cardClassName ? cardClassName : "")
2461
2442
  }, _isCollapsible ? /*#__PURE__*/React.createElement(CollapsibleCardPage, {
2462
2443
  title: t(config === null || config === void 0 ? void 0 : (_config$texts = config.texts) === null || _config$texts === void 0 ? void 0 : _config$texts.header),
2463
2444
  defaultOpen: _defaultOpen
@@ -2473,7 +2454,8 @@ const FormStep = _ref => {
2473
2454
  onSkip: onSkip,
2474
2455
  onAdd: onAdd,
2475
2456
  t: t,
2476
- className: className || ""
2457
+ className: className || "",
2458
+ noGrid: config.noGrid || false
2477
2459
  }), !childrenAtTheBottom && children, inputs, forcedError && !showErrorBelowChildren && /*#__PURE__*/React.createElement(CardLabelError, null, t(forcedError)), childrenAtTheBottom && children, forcedError && showErrorBelowChildren && /*#__PURE__*/React.createElement(CardLabelError, null, t(forcedError)))) : /*#__PURE__*/React.createElement(InputCard, _extends({
2478
2460
  isDisable: isDisable,
2479
2461
  isMultipleAllow: isMultipleAllow
@@ -2484,7 +2466,7 @@ const FormStep = _ref => {
2484
2466
  onAdd: onAdd,
2485
2467
  t: t,
2486
2468
  className: className || ""
2487
- }), !childrenAtTheBottom && children, inputs, forcedError && !showErrorBelowChildren && /*#__PURE__*/React.createElement(CardLabelError, null, t(forcedError)), childrenAtTheBottom && children, forcedError && showErrorBelowChildren && /*#__PURE__*/React.createElement(CardLabelError, null, t(forcedError)))));
2469
+ }), !childrenAtTheBottom && children, inputs, forcedError && !showErrorBelowChildren && /*#__PURE__*/React.createElement(CardLabelError, null, t(forcedError)), childrenAtTheBottom && children, forcedError && showErrorBelowChildren && /*#__PURE__*/React.createElement(CardLabelError, null, t(forcedError))));
2488
2470
  };
2489
2471
  FormStep.propTypes = {
2490
2472
  config: propTypes.shape({}),
@@ -9737,7 +9719,6 @@ const CitizenApp = _ref => {
9737
9719
  const DsoDashboard = Digit.ComponentRegistryService.getComponent("FSMDsoDashboard");
9738
9720
  const Inbox = Digit.ComponentRegistryService.getComponent("FSMEmpInbox");
9739
9721
  const EditVendor = Digit.ComponentRegistryService.getComponent("EditVendor");
9740
- console.log(path + "/registry/modify-vendor/:id");
9741
9722
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
9742
9723
  className: "fsm-citizen-wrapper"
9743
9724
  }, location.pathname.includes("/response") || location.pathname.split("/").includes("check") ? null : location.pathname.includes("/street") ? /*#__PURE__*/React.createElement(BackButton, {
@@ -10031,7 +10012,7 @@ const ApplicationDetails = () => {
10031
10012
  color: "#A52A2A"
10032
10013
  },
10033
10014
  onClick: handleViewTimeline
10034
- }))), /*#__PURE__*/React.createElement(Card$1, {
10015
+ }))), /*#__PURE__*/React.createElement(Card, {
10035
10016
  style: {
10036
10017
  position: "relative"
10037
10018
  }
@@ -10059,7 +10040,7 @@ const MyApplication = _ref => {
10059
10040
  let application = _ref.application;
10060
10041
  const _useTranslation = useTranslation(),
10061
10042
  t = _useTranslation.t;
10062
- return /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(KeyNote, {
10043
+ return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(KeyNote, {
10063
10044
  keyValue: t("CS_FSM_APPLICATION_APPLICATION_NO"),
10064
10045
  note: application.applicationNo
10065
10046
  }), /*#__PURE__*/React.createElement(KeyNote, {
@@ -10103,7 +10084,7 @@ const MyApplications = () => {
10103
10084
  key: index
10104
10085
  }, /*#__PURE__*/React.createElement(MyApplication, {
10105
10086
  application: application
10106
- }))), applicationsList.length === 0 && /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement("p", {
10087
+ }))), applicationsList.length === 0 && /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("p", {
10107
10088
  style: {
10108
10089
  textAlign: "center"
10109
10090
  }
@@ -10165,7 +10146,7 @@ const CheckPage = _ref2 => {
10165
10146
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Timeline, {
10166
10147
  currentStep: 4,
10167
10148
  flow: "APPLY"
10168
- }), /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(CardHeader$1, null, t("CS_CHECK_CHECK_YOUR_ANSWERS")), /*#__PURE__*/React.createElement(CardText$1, null, t("CS_CHECK_CHECK_YOUR_ANSWERS_TEXT")), /*#__PURE__*/React.createElement(CardSubHeader, null, t("CS_CHECK_PROPERTY_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, selectTripNo && (selectTripNo === null || selectTripNo === void 0 ? void 0 : selectTripNo.tripNo) && /*#__PURE__*/React.createElement(Row, {
10149
+ }), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardHeader$1, null, t("CS_CHECK_CHECK_YOUR_ANSWERS")), /*#__PURE__*/React.createElement(CardText$1, null, t("CS_CHECK_CHECK_YOUR_ANSWERS_TEXT")), /*#__PURE__*/React.createElement(CardSubHeader, null, t("CS_CHECK_PROPERTY_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, selectTripNo && (selectTripNo === null || selectTripNo === void 0 ? void 0 : selectTripNo.tripNo) && /*#__PURE__*/React.createElement(Row, {
10169
10150
  label: t("ES_FSM_ACTION_NUMBER_OF_TRIPS"),
10170
10151
  text: t(selectTripNo === null || selectTripNo === void 0 ? void 0 : (_selectTripNo$tripNo = selectTripNo.tripNo) === null || _selectTripNo$tripNo === void 0 ? void 0 : _selectTripNo$tripNo.i18nKey),
10171
10152
  actionButton: /*#__PURE__*/React.createElement(ActionButton, {
@@ -10586,7 +10567,7 @@ const Response = _ref => {
10586
10567
  Digit.Utils.pdf.generate(data);
10587
10568
  };
10588
10569
  const isSuccess = !successData ? mutation === null || mutation === void 0 ? void 0 : mutation.isSuccess : true;
10589
- return mutation.isLoading || mutation.isIdle && !mutationHappened ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(BannerPicker, {
10570
+ return mutation.isLoading || mutation.isIdle && !mutationHappened ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(BannerPicker, {
10590
10571
  t: t,
10591
10572
  data: Data,
10592
10573
  isSuccess: isSuccess,
@@ -11040,7 +11021,7 @@ const RateView = props => {
11040
11021
  if (isLoading || isWorkflowLoading) {
11041
11022
  return /*#__PURE__*/React.createElement(Loader, null);
11042
11023
  }
11043
- return /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(CardHeader$1, null, t("CS_RATE_HELP_US")), /*#__PURE__*/React.createElement(KeyNote, {
11024
+ return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardHeader$1, null, t("CS_RATE_HELP_US")), /*#__PURE__*/React.createElement(KeyNote, {
11044
11025
  keyValue: t("CS_FSM_YOU_RATED")
11045
11026
  }, /*#__PURE__*/React.createElement(Rating, {
11046
11027
  currentRating: data === null || data === void 0 ? void 0 : (_data$timeline$ = data.timeline[0]) === null || _data$timeline$ === void 0 ? void 0 : _data$timeline$.rating
@@ -11329,7 +11310,7 @@ const FSMLink = _ref => {
11329
11310
  }, /*#__PURE__*/React.createElement(ShippingTruck, null)), " ", /*#__PURE__*/React.createElement("span", {
11330
11311
  className: "text"
11331
11312
  }, t("ES_TITLE_FAECAL_SLUDGE_MGMT")));
11332
- return /*#__PURE__*/React.createElement(Card$1, {
11313
+ return /*#__PURE__*/React.createElement(Card, {
11333
11314
  className: "employeeCard inboxLinksFSM"
11334
11315
  }, /*#__PURE__*/React.createElement("div", {
11335
11316
  className: "complaint-links-container"
@@ -11481,14 +11462,14 @@ const AssignedTo = _ref => {
11481
11462
  }));
11482
11463
  };
11483
11464
 
11484
- const _excluded$1 = ["searchParams", "paginationParms", "onFilterChange", "onSearch", "removeParam"];
11465
+ const _excluded = ["searchParams", "paginationParms", "onFilterChange", "onSearch", "removeParam"];
11485
11466
  const Filter = _ref => {
11486
11467
  var _mergedRoleDetails$st, _mergedRoleDetails$st2, _props$applications, _props$applications2;
11487
11468
  let searchParams = _ref.searchParams,
11488
11469
  paginationParms = _ref.paginationParms,
11489
11470
  onFilterChange = _ref.onFilterChange,
11490
11471
  onSearch = _ref.onSearch,
11491
- props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
11472
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
11492
11473
  const _useTranslation = useTranslation(),
11493
11474
  t = _useTranslation.t;
11494
11475
  const location = useLocation();
@@ -11978,7 +11959,7 @@ const DesktopInbox = props => {
11978
11959
  if (props.isLoading) {
11979
11960
  result = /*#__PURE__*/React.createElement(Loader, null);
11980
11961
  } else if (props.isSearch && !props.shouldSearch || (props === null || props === void 0 ? void 0 : (_props$data = props.data) === null || _props$data === void 0 ? void 0 : (_props$data$table = _props$data.table) === null || _props$data$table === void 0 ? void 0 : _props$data$table.length) === 0) {
11981
- result = /*#__PURE__*/React.createElement(Card$1, {
11962
+ result = /*#__PURE__*/React.createElement(Card, {
11982
11963
  style: {
11983
11964
  marginTop: 20
11984
11965
  }
@@ -12168,7 +12149,7 @@ const ApplicationCard = _ref => {
12168
12149
  }
12169
12150
  let result;
12170
12151
  if (!data || (data === null || data === void 0 ? void 0 : data.length) === 0) {
12171
- result = /*#__PURE__*/React.createElement(Card$1, {
12152
+ result = /*#__PURE__*/React.createElement(Card, {
12172
12153
  style: {
12173
12154
  marginTop: 20
12174
12155
  }
@@ -14388,7 +14369,7 @@ const ApplicationDetails$1 = props => {
14388
14369
  color: "#A52A2A"
14389
14370
  },
14390
14371
  onClick: handleViewTimeline
14391
- })), /*#__PURE__*/React.createElement(Card$1, {
14372
+ })), /*#__PURE__*/React.createElement(Card, {
14392
14373
  className: "fsm",
14393
14374
  style: {
14394
14375
  position: "relative"
@@ -15934,7 +15915,7 @@ const FstpOperatorDetails = () => {
15934
15915
  styles: {
15935
15916
  marginLeft: "16px"
15936
15917
  }
15937
- }, t("ES_INBOX_VEHICLE_LOG")), /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(StatusTable, null, vehicleData === null || vehicleData === void 0 ? void 0 : vehicleData.map((row, index) => /*#__PURE__*/React.createElement(Row, {
15918
+ }, t("ES_INBOX_VEHICLE_LOG")), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(StatusTable, null, vehicleData === null || vehicleData === void 0 ? void 0 : vehicleData.map((row, index) => /*#__PURE__*/React.createElement(Row, {
15938
15919
  rowContainerStyle: isMobile && history.location.pathname.includes("new-vehicle-entry") ? {
15939
15920
  display: "block"
15940
15921
  } : {
@@ -17232,7 +17213,7 @@ const Response$1 = props => {
17232
17213
  ACTIONS = [...ACTIONS, "ASSIGN_TO_DSO"];
17233
17214
  }
17234
17215
  const isSuccess = !successData ? mutation === null || mutation === void 0 ? void 0 : mutation.isSuccess : true;
17235
- return /*#__PURE__*/React.createElement(Card$1, null, /*#__PURE__*/React.createElement(BannerPicker$1, {
17216
+ return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(BannerPicker$1, {
17236
17217
  t: t,
17237
17218
  data: Data,
17238
17219
  action: state.action,
@@ -17961,7 +17942,7 @@ const RegisryInbox = props => {
17961
17942
  emptyCardText = "ES_FSM_REGISTRY_EMPTY_CARD_DRIVER";
17962
17943
  emptyButtonText = "ES_FSM_REGISTRY_EMPTY_BUTTON_DRIVER";
17963
17944
  }
17964
- result = /*#__PURE__*/React.createElement(Card$1, {
17945
+ result = /*#__PURE__*/React.createElement(Card, {
17965
17946
  style: {
17966
17947
  display: "flex",
17967
17948
  justifyContent: "center",
@@ -18603,7 +18584,7 @@ const VehicleDetails = props => {
18603
18584
  }
18604
18585
  return !isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
18605
18586
  className: "employee-form-content"
18606
- }, /*#__PURE__*/React.createElement(Card$1, {
18587
+ }, /*#__PURE__*/React.createElement(Card, {
18607
18588
  style: {
18608
18589
  position: "relative",
18609
18590
  backgroundColor: "#fff"
@@ -18617,7 +18598,7 @@ const VehicleDetails = props => {
18617
18598
  marginBottom: "16px",
18618
18599
  marginTop: "32px"
18619
18600
  }
18620
- }, t(detail.title)), /*#__PURE__*/React.createElement(Card$1, {
18601
+ }, t(detail.title)), /*#__PURE__*/React.createElement(Card, {
18621
18602
  className: "card-with-background",
18622
18603
  style: {
18623
18604
  margin: "10px 16px",
@@ -18682,7 +18663,7 @@ const VehicleDetails = props => {
18682
18663
  actionSaveLabel: t(selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? "ES_EVENT_DELETE" : "CS_COMMON_SUBMIT"),
18683
18664
  actionSaveOnSubmit: handleModalAction,
18684
18665
  formId: "modal-action"
18685
- }, selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? renderModalContent() : /*#__PURE__*/React.createElement(Card$1, {
18666
+ }, selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? renderModalContent() : /*#__PURE__*/React.createElement(Card, {
18686
18667
  style: {
18687
18668
  boxShadow: "none"
18688
18669
  }
@@ -19551,7 +19532,7 @@ const DriverDetails = props => {
19551
19532
  }
19552
19533
  return !isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
19553
19534
  className: "employee-form-content"
19554
- }, /*#__PURE__*/React.createElement(Card$1, {
19535
+ }, /*#__PURE__*/React.createElement(Card, {
19555
19536
  style: {
19556
19537
  position: "relative",
19557
19538
  backgroundColor: "#fff"
@@ -19565,7 +19546,7 @@ const DriverDetails = props => {
19565
19546
  marginBottom: "16px",
19566
19547
  marginTop: "32px"
19567
19548
  }
19568
- }, t(detail.title)), /*#__PURE__*/React.createElement(Card$1, {
19549
+ }, t(detail.title)), /*#__PURE__*/React.createElement(Card, {
19569
19550
  className: "card-with-background",
19570
19551
  style: {
19571
19552
  margin: "10px 16px",
@@ -19630,7 +19611,7 @@ const DriverDetails = props => {
19630
19611
  actionSaveLabel: t(selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? "ES_EVENT_DELETE" : "CS_COMMON_SUBMIT"),
19631
19612
  actionSaveOnSubmit: handleModalAction,
19632
19613
  formId: "modal-action"
19633
- }, selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? renderModalContent() : /*#__PURE__*/React.createElement(Card$1, {
19614
+ }, selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? renderModalContent() : /*#__PURE__*/React.createElement(Card, {
19634
19615
  style: {
19635
19616
  boxShadow: "none"
19636
19617
  }
@@ -20757,15 +20738,12 @@ const convertEpochToDate$1 = (dateEpoch, businessService) => {
20757
20738
  }
20758
20739
  };
20759
20740
 
20760
- const VendorConfig = function (t, disabled, formData) {
20761
- var _formData, _formData$serviceType;
20762
- if (disabled === void 0) {
20763
- disabled = false;
20741
+ const VendorConfig = function (t, module, genderMenu, update) {
20742
+ var _module;
20743
+ if (module === void 0) {
20744
+ module = "";
20764
20745
  }
20765
- if (formData === void 0) {
20766
- formData = {};
20767
- }
20768
- const isEkyc = ((_formData = formData) === null || _formData === void 0 ? void 0 : (_formData$serviceType = _formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code) === "EKYC";
20746
+ const isEkyc = ((_module = module) === null || _module === void 0 ? void 0 : _module.toLocaleUpperCase()) === "EKYC";
20769
20747
  return [{
20770
20748
  head: "ES_VRNDOR_NEW_VENDOR_DETAILS",
20771
20749
  isCollapsible: true,
@@ -20774,7 +20752,7 @@ const VendorConfig = function (t, disabled, formData) {
20774
20752
  label: "ES_FSM_REGISTRY_NEW_VENDOR_NAME",
20775
20753
  isMandatory: true,
20776
20754
  type: "text",
20777
- disable: disabled,
20755
+ disable: false,
20778
20756
  populators: {
20779
20757
  name: "vendorName",
20780
20758
  validation: {
@@ -20785,27 +20763,12 @@ const VendorConfig = function (t, disabled, formData) {
20785
20763
  defaultValue: "",
20786
20764
  className: "payment-form-text-input-correction"
20787
20765
  }
20788
- }, {
20789
- label: "ES_FSM_REGISTRY_NEW_EMAIL",
20790
- isMandatory: false,
20791
- type: "text",
20792
- key: "emailId",
20793
- populators: {
20794
- name: "emailId",
20795
- validation: {
20796
- required: false,
20797
- pattern: /^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+$/
20798
- },
20799
- error: t("FSM_REGISTRY_INVALID_EMAIL"),
20800
- defaultValue: "",
20801
- className: "payment-form-text-input-correction"
20802
- }
20803
20766
  }, {
20804
20767
  label: "ES_FSM_REGISTRY_NEW_VENDOR_PHONE",
20805
20768
  isMandatory: true,
20806
20769
  type: "mobileNumber",
20807
20770
  key: "phone",
20808
- disable: disabled,
20771
+ disable: false,
20809
20772
  populators: {
20810
20773
  name: "phone",
20811
20774
  validation: {
@@ -20820,13 +20783,28 @@ const VendorConfig = function (t, disabled, formData) {
20820
20783
  defaultValue: "",
20821
20784
  className: "payment-form-text-input-correction"
20822
20785
  }
20786
+ }, {
20787
+ label: "ES_FSM_REGISTRY_NEW_EMAIL",
20788
+ isMandatory: false,
20789
+ type: "text",
20790
+ key: "emailId",
20791
+ populators: {
20792
+ name: "emailId",
20793
+ validation: {
20794
+ required: false,
20795
+ pattern: /^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+$/
20796
+ },
20797
+ error: t("FSM_REGISTRY_INVALID_EMAIL"),
20798
+ defaultValue: "",
20799
+ className: "payment-form-text-input-correction"
20800
+ }
20823
20801
  }, {
20824
20802
  label: "ES_VENDOR_REGISTRY_SERVICE_TYPE",
20825
20803
  isMandatory: true,
20826
20804
  type: "component",
20827
20805
  key: "serviceType",
20828
20806
  component: "SelectServiceType",
20829
- disable: disabled,
20807
+ disable: update,
20830
20808
  populators: {
20831
20809
  name: "serviceType",
20832
20810
  defaultValue: {
@@ -20896,17 +20874,8 @@ const VendorConfig = function (t, disabled, formData) {
20896
20874
  component: "SelectEkycDropdown",
20897
20875
  populators: {
20898
20876
  name: "gender",
20899
- options: [{
20900
- code: "MALE",
20901
- name: "ES_COMMON_GENDER_MALE"
20902
- }, {
20903
- code: "FEMALE",
20904
- name: "ES_COMMON_GENDER_FEMALE"
20905
- }, {
20906
- code: "OTHER",
20907
- name: "ES_COMMON_GENDER_OTHER"
20908
- }],
20909
- optionsKey: "name"
20877
+ options: genderMenu,
20878
+ optionsKey: "i18nKey"
20910
20879
  }
20911
20880
  }, {
20912
20881
  label: "ES_FSM_REGISTRY_NEW_DOB",
@@ -20932,791 +20901,57 @@ const VendorConfig = function (t, disabled, formData) {
20932
20901
  body: [{
20933
20902
  type: "component",
20934
20903
  key: "propertyAddress",
20935
- component: "CPTPropertyLocationDetails",
20904
+ component: "PropertyLocationDetails",
20936
20905
  withoutLabel: true,
20937
20906
  props: {
20938
20907
  hidePropertySearch: true,
20939
20908
  hideZRO: true
20909
+ },
20910
+ texts: {
20911
+ header: "PT_LOCATION_DETAILS"
20940
20912
  }
20941
20913
  }]
20942
20914
  }];
20943
20915
  };
20944
20916
 
20945
- const EditVendor = () => {
20946
- const tenantId = Digit.ULBService.getCurrentTenantId();
20947
- let _useParams = useParams(),
20948
- dsoId = _useParams.id;
20949
- const _useState = useState(null),
20950
- showToast = _useState[0],
20951
- setShowToast = _useState[1];
20952
- const _useState2 = useState(false),
20953
- canSubmit = _useState2[0],
20954
- setSubmitValve = _useState2[1];
20955
- const _useState3 = useState({}),
20956
- defaultValues = _useState3[0],
20957
- setDefaultValues = _useState3[1];
20958
- const _useState4 = useState({}),
20959
- dsoDetails = _useState4[0],
20960
- setDsoDetails = _useState4[1];
20961
- const queryClient = useQueryClient();
20962
- const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("FSM_MUTATION_HAPPENED", false),
20963
- setMutationHappened = _Digit$Hooks$useSessi[1];
20964
- const _Digit$Hooks$useSessi2 = Digit.Hooks.useSessionStorage("FSM_ERROR_DATA", false),
20965
- clearError = _Digit$Hooks$useSessi2[2];
20966
- const _Digit$Hooks$useSessi3 = Digit.Hooks.useSessionStorage("FSM_MUTATION_SUCCESS_DATA", false),
20967
- clearSuccessData = _Digit$Hooks$useSessi3[2];
20968
- const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
20969
- ids: dsoId
20970
- }, {
20971
- staleTime: Infinity
20972
- }),
20973
- dsoData = _Digit$Hooks$fsm$useD.data,
20974
- daoDataLoading = _Digit$Hooks$fsm$useD.isLoading;
20975
- const _Digit$Hooks$fsm$useV = Digit.Hooks.fsm.useVendorUpdate(tenantId),
20976
- mutate = _Digit$Hooks$fsm$useV.mutate;
20977
- useEffect(() => {
20978
- setMutationHappened(false);
20979
- clearSuccessData();
20980
- clearError();
20981
- }, []);
20982
- useEffect(() => {
20983
- if (dsoData && dsoData[0]) {
20984
- var _dsoDetails$dsoDetail, _dsoDetails$dsoDetail2, _dsoDetails$dsoDetail3, _dsoDetails$dsoDetail4, _dsoDetails$dsoDetail5, _dsoDetails$dsoDetail6, _dsoDetails$dsoDetail7, _dsoDetails$dsoDetail8, _dsoDetails$dsoDetail9, _dsoDetails$dsoDetail0, _dsoDetails$dsoDetail1, _dsoDetails$dsoDetail10, _dsoDetails$dsoDetail11, _dsoDetails$dsoDetail12, _dsoDetails$dsoDetail13, _dsoDetails$dsoDetail14, _dsoDetails$dsoDetail15, _dsoDetails$dsoDetail16, _dsoDetails$dsoDetail17, _dsoDetails$dsoDetail18, _dsoDetails$dsoDetail19, _dsoDetails$dsoDetail20, _dsoDetails$dsoDetail21, _dsoDetails$dsoDetail22, _dsoDetails$dsoDetail23, _dsoDetails$dsoDetail24, _dsoDetails$dsoDetail25, _dsoDetails$dsoDetail26, _dsoDetails$dsoDetail27, _dsoDetails$dsoDetail28, _dsoDetails$dsoDetail29, _dsoDetails$dsoDetail30, _dsoDetails$dsoDetail31, _dsoDetails$dsoDetail32, _dsoDetails$dsoDetail33, _dsoDetails$dsoDetail34, _dsoDetails$dsoDetail35, _dsoDetails$dsoDetail36;
20985
- let dsoDetails = dsoData[0];
20986
- setDsoDetails(dsoDetails === null || dsoDetails === void 0 ? void 0 : dsoDetails.dsoDetails);
20987
- let values = {
20988
- vendorName: dsoDetails === null || dsoDetails === void 0 ? void 0 : dsoDetails.name,
20989
- street: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail === void 0 ? void 0 : (_dsoDetails$dsoDetail2 = _dsoDetails$dsoDetail.address) === null || _dsoDetails$dsoDetail2 === void 0 ? void 0 : _dsoDetails$dsoDetail2.street,
20990
- doorNo: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail3 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail3 === void 0 ? void 0 : (_dsoDetails$dsoDetail4 = _dsoDetails$dsoDetail3.address) === null || _dsoDetails$dsoDetail4 === void 0 ? void 0 : _dsoDetails$dsoDetail4.doorNo,
20991
- plotNo: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail5 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail5 === void 0 ? void 0 : (_dsoDetails$dsoDetail6 = _dsoDetails$dsoDetail5.address) === null || _dsoDetails$dsoDetail6 === void 0 ? void 0 : _dsoDetails$dsoDetail6.plotNo,
20992
- landmark: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail7 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail7 === void 0 ? void 0 : (_dsoDetails$dsoDetail8 = _dsoDetails$dsoDetail7.address) === null || _dsoDetails$dsoDetail8 === void 0 ? void 0 : _dsoDetails$dsoDetail8.landmark,
20993
- pincode: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail9 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail9 === void 0 ? void 0 : (_dsoDetails$dsoDetail0 = _dsoDetails$dsoDetail9.address) === null || _dsoDetails$dsoDetail0 === void 0 ? void 0 : _dsoDetails$dsoDetail0.pincode,
20994
- buildingName: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail1 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail1 === void 0 ? void 0 : (_dsoDetails$dsoDetail10 = _dsoDetails$dsoDetail1.address) === null || _dsoDetails$dsoDetail10 === void 0 ? void 0 : _dsoDetails$dsoDetail10.buildingName,
20995
- address: {
20996
- pincode: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail11 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail11 === void 0 ? void 0 : (_dsoDetails$dsoDetail12 = _dsoDetails$dsoDetail11.address) === null || _dsoDetails$dsoDetail12 === void 0 ? void 0 : _dsoDetails$dsoDetail12.pincode,
20997
- locality: _extends({}, dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail13 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail13 === void 0 ? void 0 : (_dsoDetails$dsoDetail14 = _dsoDetails$dsoDetail13.address) === null || _dsoDetails$dsoDetail14 === void 0 ? void 0 : _dsoDetails$dsoDetail14.locality, {
20998
- i18nkey: (dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail15 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail15 === void 0 ? void 0 : _dsoDetails$dsoDetail15.tenantId.toUpperCase().split(".").join("_")) + "_REVENUE_" + (dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail16 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail16 === void 0 ? void 0 : _dsoDetails$dsoDetail16.address.locality.code)
20999
- })
21000
- },
21001
- phone: dsoDetails === null || dsoDetails === void 0 ? void 0 : dsoDetails.mobileNumber,
21002
- ownerName: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail17 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail17 === void 0 ? void 0 : (_dsoDetails$dsoDetail18 = _dsoDetails$dsoDetail17.owner) === null || _dsoDetails$dsoDetail18 === void 0 ? void 0 : _dsoDetails$dsoDetail18.name,
21003
- fatherOrHusbandName: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail19 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail19 === void 0 ? void 0 : (_dsoDetails$dsoDetail20 = _dsoDetails$dsoDetail19.owner) === null || _dsoDetails$dsoDetail20 === void 0 ? void 0 : _dsoDetails$dsoDetail20.fatherOrHusbandName,
21004
- relationship: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail21 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail21 === void 0 ? void 0 : (_dsoDetails$dsoDetail22 = _dsoDetails$dsoDetail21.owner) === null || _dsoDetails$dsoDetail22 === void 0 ? void 0 : _dsoDetails$dsoDetail22.relationship,
21005
- selectGender: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail23 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail23 === void 0 ? void 0 : (_dsoDetails$dsoDetail24 = _dsoDetails$dsoDetail23.owner) === null || _dsoDetails$dsoDetail24 === void 0 ? void 0 : _dsoDetails$dsoDetail24.gender,
21006
- dob: (dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail25 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail25 === void 0 ? void 0 : (_dsoDetails$dsoDetail26 = _dsoDetails$dsoDetail25.owner) === null || _dsoDetails$dsoDetail26 === void 0 ? void 0 : _dsoDetails$dsoDetail26.dob) && Digit.DateUtils.ConvertTimestampToDate(dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail27 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail27 === void 0 ? void 0 : (_dsoDetails$dsoDetail28 = _dsoDetails$dsoDetail27.owner) === null || _dsoDetails$dsoDetail28 === void 0 ? void 0 : _dsoDetails$dsoDetail28.dob, "yyyy-MM-dd"),
21007
- emailId: (dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail29 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail29 === void 0 ? void 0 : (_dsoDetails$dsoDetail30 = _dsoDetails$dsoDetail29.owner) === null || _dsoDetails$dsoDetail30 === void 0 ? void 0 : _dsoDetails$dsoDetail30.emailId) === "abc@egov.com" ? "" : dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail31 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail31 === void 0 ? void 0 : (_dsoDetails$dsoDetail32 = _dsoDetails$dsoDetail31.owner) === null || _dsoDetails$dsoDetail32 === void 0 ? void 0 : _dsoDetails$dsoDetail32.emailId,
21008
- correspondenceAddress: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail33 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail33 === void 0 ? void 0 : (_dsoDetails$dsoDetail34 = _dsoDetails$dsoDetail33.owner) === null || _dsoDetails$dsoDetail34 === void 0 ? void 0 : _dsoDetails$dsoDetail34.correspondenceAddress,
21009
- additionalDetails: dsoDetails === null || dsoDetails === void 0 ? void 0 : (_dsoDetails$dsoDetail35 = dsoDetails.dsoDetails) === null || _dsoDetails$dsoDetail35 === void 0 ? void 0 : (_dsoDetails$dsoDetail36 = _dsoDetails$dsoDetail35.additionalDetails) === null || _dsoDetails$dsoDetail36 === void 0 ? void 0 : _dsoDetails$dsoDetail36.description
21010
- };
21011
- setDefaultValues(values);
21012
- }
21013
- }, [dsoData]);
21014
- const _useTranslation = useTranslation(),
21015
- t = _useTranslation.t;
21016
- const history = useHistory();
21017
- const Config = VendorConfig(t, true);
21018
- const onFormValueChange = (setValue, formData) => {
21019
- var _formData$address;
21020
- if (formData !== null && formData !== void 0 && formData.phone && formData !== null && formData !== void 0 && (_formData$address = formData.address) !== null && _formData$address !== void 0 && _formData$address.locality) {
21021
- setSubmitValve(true);
21022
- } else {
21023
- setSubmitValve(false);
21024
- }
21025
- };
21026
- const closeToast = () => {
21027
- setShowToast(null);
21028
- };
21029
- const onSubmit = data => {
21030
- var _data$street, _data$doorNo, _data$plotNo, _data$landmark, _data$address, _data$address$city, _data$address2, _data$address2$city, _data$address3, _data$address3$city, _data$address4, _data$address4$city, _data$buildingName, _data$address5, _data$address5$locali, _data$address6, _data$address6$locali, _data$address7, _data$address7$locali, _data$selectGender, _data$address8, _data$address9, _dsoDetails$owner, _dsoDetails$owner2;
21031
- const name = data === null || data === void 0 ? void 0 : data.vendorName;
21032
- const phone = data === null || data === void 0 ? void 0 : data.phone;
21033
- const pincode = data === null || data === void 0 ? void 0 : data.pincode;
21034
- const street = data === null || data === void 0 ? void 0 : (_data$street = data.street) === null || _data$street === void 0 ? void 0 : _data$street.trim();
21035
- const doorNo = data === null || data === void 0 ? void 0 : (_data$doorNo = data.doorNo) === null || _data$doorNo === void 0 ? void 0 : _data$doorNo.trim();
21036
- const plotNo = data === null || data === void 0 ? void 0 : (_data$plotNo = data.plotNo) === null || _data$plotNo === void 0 ? void 0 : _data$plotNo.trim();
21037
- const landmark = data === null || data === void 0 ? void 0 : (_data$landmark = data.landmark) === null || _data$landmark === void 0 ? void 0 : _data$landmark.trim();
21038
- const city = data === null || data === void 0 ? void 0 : (_data$address = data.address) === null || _data$address === void 0 ? void 0 : (_data$address$city = _data$address.city) === null || _data$address$city === void 0 ? void 0 : _data$address$city.name;
21039
- const state = data === null || data === void 0 ? void 0 : (_data$address2 = data.address) === null || _data$address2 === void 0 ? void 0 : (_data$address2$city = _data$address2.city) === null || _data$address2$city === void 0 ? void 0 : _data$address2$city.state;
21040
- const district = data === null || data === void 0 ? void 0 : (_data$address3 = data.address) === null || _data$address3 === void 0 ? void 0 : (_data$address3$city = _data$address3.city) === null || _data$address3$city === void 0 ? void 0 : _data$address3$city.name;
21041
- const region = data === null || data === void 0 ? void 0 : (_data$address4 = data.address) === null || _data$address4 === void 0 ? void 0 : (_data$address4$city = _data$address4.city) === null || _data$address4$city === void 0 ? void 0 : _data$address4$city.name;
21042
- const buildingName = data === null || data === void 0 ? void 0 : (_data$buildingName = data.buildingName) === null || _data$buildingName === void 0 ? void 0 : _data$buildingName.trim();
21043
- const localityCode = data === null || data === void 0 ? void 0 : (_data$address5 = data.address) === null || _data$address5 === void 0 ? void 0 : (_data$address5$locali = _data$address5.locality) === null || _data$address5$locali === void 0 ? void 0 : _data$address5$locali.code;
21044
- const localityName = data === null || data === void 0 ? void 0 : (_data$address6 = data.address) === null || _data$address6 === void 0 ? void 0 : (_data$address6$locali = _data$address6.locality) === null || _data$address6$locali === void 0 ? void 0 : _data$address6$locali.name;
21045
- const localityArea = data === null || data === void 0 ? void 0 : (_data$address7 = data.address) === null || _data$address7 === void 0 ? void 0 : (_data$address7$locali = _data$address7.locality) === null || _data$address7$locali === void 0 ? void 0 : _data$address7$locali.area;
21046
- const additionalDetails = data === null || data === void 0 ? void 0 : data.additionalDetails;
21047
- const gender = data === null || data === void 0 ? void 0 : (_data$selectGender = data.selectGender) === null || _data$selectGender === void 0 ? void 0 : _data$selectGender.code;
21048
- const emailId = data === null || data === void 0 ? void 0 : data.emailId;
21049
- const dob = new Date("" + data.dob).getTime() || new Date("1/1/1970").getTime();
21050
- const formData = {
21051
- vendor: _extends({}, dsoDetails, {
21052
- name,
21053
- address: _extends({}, dsoDetails.address, {
21054
- landmark,
21055
- doorNo,
21056
- plotNo,
21057
- street,
21058
- city,
21059
- district,
21060
- region,
21061
- state,
21062
- country: "in",
21063
- pincode,
21064
- buildingName,
21065
- locality: _extends({}, dsoDetails.address.locality, {
21066
- code: localityCode || "",
21067
- name: localityName || "",
21068
- label: "Locality",
21069
- area: localityArea || ""
21070
- }),
21071
- geoLocation: _extends({}, dsoDetails.address.geoLocation, {
21072
- latitude: (data === null || data === void 0 ? void 0 : (_data$address8 = data.address) === null || _data$address8 === void 0 ? void 0 : _data$address8.latitude) || 0,
21073
- longitude: (data === null || data === void 0 ? void 0 : (_data$address9 = data.address) === null || _data$address9 === void 0 ? void 0 : _data$address9.longitude) || 0
21074
- })
21075
- }),
21076
- owner: _extends({}, dsoDetails.owner, {
21077
- gender: gender || ((_dsoDetails$owner = dsoDetails.owner) === null || _dsoDetails$owner === void 0 ? void 0 : _dsoDetails$owner.gender) || "OTHER",
21078
- dob: dob,
21079
- emailId: emailId || "abc@egov.com",
21080
- mobileNumber: phone,
21081
- relationship: ((_dsoDetails$owner2 = dsoDetails.owner) === null || _dsoDetails$owner2 === void 0 ? void 0 : _dsoDetails$owner2.relationship) || "OTHER"
21082
- }),
21083
- additionalDetails: _extends({}, dsoDetails.additionalDetails, {
21084
- description: additionalDetails
21085
- })
21086
- })
21087
- };
21088
- mutate(formData, {
21089
- onError: (error, variables) => {
21090
- setShowToast({
21091
- key: "error",
21092
- action: error
21093
- });
21094
- setTimeout(closeToast, 5000);
21095
- },
21096
- onSuccess: (data, variables) => {
21097
- setShowToast({
21098
- key: "success",
21099
- action: "UPDATE_VENDOR"
21100
- });
21101
- setTimeout(closeToast, 5000);
21102
- queryClient.invalidateQueries("DSO_SEARCH");
21103
- setTimeout(() => {
21104
- closeToast();
21105
- history.push("/digit-ui/employee/fsm/registry/vendor-details/" + dsoId);
21106
- }, 5000);
21107
- }
21108
- });
21109
- };
21110
- if (daoDataLoading || Object.keys(defaultValues).length === 0) {
21111
- return /*#__PURE__*/React.createElement(Loader, null);
21112
- }
21113
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(VerticalTimeline, {
21114
- config: [{
21115
- timeLine: [{
21116
- actions: t("ES_FSM_REGISTRY_TITLE_EDIT_VENDOR"),
21117
- currentStep: 1
21118
- }]
21119
- }],
21120
- currentActiveIndex: 0,
21121
- showFinalStep: false
21122
- }), /*#__PURE__*/React.createElement("div", {
21123
- style: {
21124
- flex: "1",
21125
- overflowY: "auto"
21126
- }
21127
- }, /*#__PURE__*/React.createElement(FormComposer, {
21128
- isDisabled: !canSubmit,
21129
- label: t("ES_COMMON_APPLICATION_SUBMIT"),
21130
- config: Config.filter(i => !i.hideInEmployee).map(config => {
21131
- return _extends({}, config, {
21132
- body: config.body.filter(a => !a.hideInEmployee)
21133
- });
21134
- }),
21135
- fieldStyle: {
21136
- marginRight: 0
21137
- },
21138
- onSubmit: onSubmit,
21139
- defaultValues: defaultValues,
21140
- onFormValueChange: onFormValueChange,
21141
- noBreakLine: true
21142
- }), showToast && /*#__PURE__*/React.createElement(Toast, {
21143
- error: showToast.key === "error" ? true : false,
21144
- label: t(showToast.key === "success" ? "ES_FSM_REGISTRY_" + showToast.action + "_SUCCESS" : showToast.action),
21145
- onClose: closeToast
21146
- })));
21147
- };
21148
-
21149
- const VendorDetails = _ref => {
21150
- var _formData$ownerKey, _formData$ownerKey2, _formData$ownerKey3, _formData$ownerKey4;
21151
- let t = _ref.t,
21152
- config = _ref.config,
21153
- onSelect = _ref.onSelect,
21154
- userType = _ref.userType,
21155
- formData = _ref.formData;
21156
- let index = 0;
21157
- const user = Digit.UserService.getUser().info;
21158
- const applicantName = formData.ownerKey && formData.ownerKey[index] && formData.ownerKey[index].applicantName || (formData === null || formData === void 0 ? void 0 : (_formData$ownerKey = formData.ownerKey) === null || _formData$ownerKey === void 0 ? void 0 : _formData$ownerKey.applicantName) || "";
21159
- const emailId = formData.ownerKey && formData.ownerKey[index] && formData.ownerKey[index].emailId || (formData === null || formData === void 0 ? void 0 : (_formData$ownerKey2 = formData.ownerKey) === null || _formData$ownerKey2 === void 0 ? void 0 : _formData$ownerKey2.emailId) || "";
21160
- const mobileNumber = formData.ownerKey && formData.ownerKey[index] && formData.ownerKey[index].mobileNumber || (formData === null || formData === void 0 ? void 0 : (_formData$ownerKey3 = formData.ownerKey) === null || _formData$ownerKey3 === void 0 ? void 0 : _formData$ownerKey3.mobileNumber) || (user === null || user === void 0 ? void 0 : user.mobileNumber);
21161
- const altMobileNumber = formData.ownerKey && formData.ownerKey[index] && formData.ownerKey[index].altMobileNumber || (formData === null || formData === void 0 ? void 0 : (_formData$ownerKey4 = formData.ownerKey) === null || _formData$ownerKey4 === void 0 ? void 0 : _formData$ownerKey4.altmobileNumber) || "";
21162
- const _useState = useState(""),
21163
- VendorCategory = _useState[0],
21164
- setVendorCategory = _useState[1];
21165
- const _useState2 = useState(""),
21166
- VendorId = _useState2[0],
21167
- setVendorId = _useState2[1];
21168
- const _useState3 = useState(""),
21169
- userName = _useState3[0],
21170
- setUserName = _useState3[1];
21171
- const _useState4 = useState(""),
21172
- Bank = _useState4[0],
21173
- setBank = _useState4[1];
21174
- const _useState5 = useState(),
21175
- BankbranchName = _useState5[0],
21176
- setBankbranchName = _useState5[1];
21177
- const _useState6 = useState(""),
21178
- IFSC = _useState6[0],
21179
- setIFSC = _useState6[1];
21180
- const _useState7 = useState(""),
21181
- AccountNo = _useState7[0],
21182
- setAccountNo = _useState7[1];
21183
- const _useState8 = useState(""),
21184
- PanNo = _useState8[0],
21185
- setPanNo = _useState8[1];
21186
- const _useState9 = useState(""),
21187
- GstNo = _useState9[0],
21188
- setGstNo = _useState9[1];
21189
- const _useState0 = useState(""),
21190
- GstState = _useState0[0],
21191
- setGstState = _useState0[1];
21192
- const _useState1 = useState(""),
21193
- RegistrationNo = _useState1[0],
21194
- setRegistrationNo = _useState1[1];
21195
- const _useState10 = useState(""),
21196
- EpfNo = _useState10[0],
21197
- setEpfNo = _useState10[1];
21198
- const _useState11 = useState(""),
21199
- EsiNo = _useState11[0],
21200
- setEsiNo = _useState11[1];
21201
- const _useState12 = useState(""),
21202
- VendorType = _useState12[0],
21203
- setVendorType = _useState12[1];
21204
- const _useState13 = useState(""),
21205
- Status = _useState13[0],
21206
- setStatus = _useState13[1];
21207
- const _useState14 = useState(""),
21208
- micrNo = _useState14[0],
21209
- setmicrNo = _useState14[1];
21210
- const _useState15 = useState(""),
21211
- PhoneNo = _useState15[0],
21212
- setPhoneNo = _useState15[1];
21213
- const _useState16 = useState(""),
21214
- ContactPerson = _useState16[0],
21215
- setContactPerson = _useState16[1];
21216
- useEffect(() => {
21217
- if (IFSC.length === 11 && !Bank && !BankbranchName && !micrNo) {
21218
- fetch("https://ifsc.razorpay.com/" + IFSC).then(response => response.json()).then(data => {
21219
- if (data && data.BANK && data.BRANCH && data.MICR) {
21220
- setBank(data.BANK);
21221
- setBankbranchName(data.BRANCH);
21222
- setmicrNo(data.MICR);
21223
- }
21224
- }).catch(() => {});
21225
- } else {
21226
- if (IFSC.length === 11 && Bank && BankbranchName) {
21227
- setBank(Bank);
21228
- setBankbranchName(BankbranchName);
21229
- setmicrNo(micrNo);
21230
- } else {
21231
- setBank("");
21232
- setBankbranchName("");
21233
- setmicrNo("");
21234
- }
21235
- }
21236
- }, [IFSC]);
21237
- function setvendorbank(e) {
21238
- setBank(e.target.value);
21239
- }
21240
- function setBankbranch(e) {
21241
- setBankbranchName(e.target.value);
21242
- }
21243
- function setvendorifsc(e) {
21244
- const input = e.target.value.replace(/[^a-zA-Z0-9]/g, "");
21245
- if (input.length <= 11) {
21246
- setIFSC(input);
21247
- }
21248
- }
21249
- function setvendoraccountno(e) {
21250
- setAccountNo(e.target.value);
21251
- }
21252
- function setpanno(e) {
21253
- setPanNo(e.target.value);
21254
- }
21255
- function setgstno(e) {
21256
- setGstNo(e.target.value);
21257
- }
21258
- function setgststate(e) {
21259
- setGstState(e.target.value);
21260
- }
21261
- function setregistrationno(e) {
21262
- setRegistrationNo(e.target.value);
21263
- }
21264
- function setepfno(e) {
21265
- setEpfNo(e.target.value);
21266
- }
21267
- function setesino(e) {
21268
- setEsiNo(e.target.value);
21269
- }
21270
- function setcontactperson(e) {
21271
- setContactPerson(e.target.value);
21272
- }
21273
- const tenantId = Digit.ULBService.getCurrentTenantId();
21274
- const _useForm = useForm(),
21275
- control = _useForm.control;
21276
- const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
21277
- staleTime: Infinity
21278
- }),
21279
- dsoData = _Digit$Hooks$fsm$useD.data;
21280
- useEffect(() => {
21281
- if (dsoData) {
21282
- const vendor = dsoData.find(item => item.id);
21283
- if (vendor) {
21284
- setUserName(vendor.name);
21285
- setVendorId(vendor.id);
21286
- }
21287
- }
21288
- }, [dsoData]);
21289
- const goNext = () => {
21290
- let owner = formData.ownerKey && formData.ownerKey[index];
21291
- let ownerStep;
21292
- if (userType === "citizen") {
21293
- ownerStep = _extends({}, owner, {
21294
- applicantName,
21295
- mobileNumber,
21296
- altMobileNumber,
21297
- emailId
21298
- });
21299
- onSelect(config.key, _extends({}, formData[config.key], ownerStep), false, index);
21300
- } else {
21301
- ownerStep = _extends({}, owner, {
21302
- VendorCategory,
21303
- name: userName,
21304
- VendorId: VendorId,
21305
- Bank,
21306
- BankbranchName,
21307
- IFSC,
21308
- AccountNo,
21309
- PanNo,
21310
- GstNo,
21311
- GstState,
21312
- RegistrationNo,
21313
- EpfNo,
21314
- EsiNo,
21315
- VendorType,
21316
- Status,
21317
- micrNo,
21318
- PhoneNo,
21319
- ContactPerson
21320
- });
21321
- onSelect(config.key, ownerStep, false, index);
21322
- }
21323
- };
21324
- useEffect(() => {
21325
- if (userType === "citizen") {
21326
- goNext();
21327
- }
21328
- }, [VendorCategory, VendorId, userName, Bank, BankbranchName, IFSC, AccountNo, PanNo, GstNo, GstState, RegistrationNo, EpfNo, EsiNo, VendorType, Status, micrNo, PhoneNo, ContactPerson, userType]);
21329
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(VerticalTimeline, {
21330
- config: [{
21331
- timeLine: [{
21332
- actions: t("VENDOR_ADDITIONAL_DETAILS"),
21333
- currentStep: 1
21334
- }]
21335
- }, {
21336
- timeLine: [{
21337
- actions: t("VENDOR_DOCUMENT_DETAILS"),
21338
- currentStep: 2
21339
- }]
21340
- }, {
21341
- timeLine: [{
21342
- actions: t("VENDOR_SUMMARY"),
21343
- currentStep: 3
21344
- }]
21345
- }],
21346
- currentActiveIndex: 0,
21347
- showFinalStep: false
21348
- }), /*#__PURE__*/React.createElement("div", {
21349
- style: {
21350
- flex: "1",
21351
- overflowY: "auto"
21352
- }
21353
- }, /*#__PURE__*/React.createElement(FormStep$1, {
21354
- config: config,
21355
- onSelect: goNext,
21356
- t: t,
21357
- className: "formcomposer-grid-container-form"
21358
- }, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, {
21359
- className: "card-label-smaller"
21360
- }, /*#__PURE__*/React.createElement(CustomTooltip, {
21361
- label: "" + t("IFSC_CODE"),
21362
- isMandatory: false,
21363
- message: t("INVALID_IFSC_CODE_ERROR_MESSAGE")
21364
- })), /*#__PURE__*/React.createElement(TextInput$1, {
21365
- t: t,
21366
- type: "text",
21367
- isMandatory: false,
21368
- optionKey: "i18nKey",
21369
- name: "IFSC",
21370
- value: IFSC,
21371
- placeholder: "Enter IFSC Code",
21372
- onChange: setvendorifsc,
21373
- style: {
21374
- width: "100%"
21375
- },
21376
- maxLength: 11,
21377
- ValidationRequired: true,
21378
- validation: {
21379
- isRequired: true,
21380
- pattern: "^[A-Z]{4}0[A-Z0-9]{6}$",
21381
- type: "text",
21382
- title: t("INVALID_IFSC_CODE_ERROR_MESSAGE")
21383
- }
21384
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, "" + t("VENDOR_BANK_NAME"), " ", /*#__PURE__*/React.createElement("span", {
21385
- className: "check-page-link-button"
21386
- }, "*")), /*#__PURE__*/React.createElement(TextInput$1, {
21387
- t: t,
21388
- type: "text",
21389
- isMandatory: false,
21390
- optionKey: "i18nKey",
21391
- name: "bankName",
21392
- placeholder: "Bank Name Auto Select",
21393
- style: {
21394
- width: "100%"
21395
- },
21396
- value: Bank,
21397
- onChange: setvendorbank,
21398
- disabled: true
21399
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, "" + t("VENDOR_BANK_BRANCH_NAME"), " ", /*#__PURE__*/React.createElement("span", {
21400
- className: "check-page-link-button"
21401
- }, "*")), /*#__PURE__*/React.createElement(TextInput$1, {
21402
- t: t,
21403
- type: "text",
21404
- isMandatory: false,
21405
- optionKey: "i18nKey",
21406
- name: "BankbranchName",
21407
- value: BankbranchName,
21408
- style: {
21409
- width: "100%"
21410
- },
21411
- placeholder: "Bank Branch Name Auto Select",
21412
- onChange: setBankbranch,
21413
- disabled: false
21414
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, "" + t("VENDOR_MICR_NO"), " ", /*#__PURE__*/React.createElement("span", {
21415
- className: "check-page-link-button"
21416
- }, "*")), /*#__PURE__*/React.createElement(TextInput$1, {
21417
- t: t,
21418
- type: "text",
21419
- isMandatory: false,
21420
- optionKey: "i18nKey",
21421
- name: "MicrNo",
21422
- value: micrNo,
21423
- style: {
21424
- width: "100%"
21425
- },
21426
- placeholder: "MICR No",
21427
- onChange: setmicrNo,
21428
- disabled: false
21429
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, "" + t("ACCOUNT_NO")), /*#__PURE__*/React.createElement(TextInput$1, {
21430
- t: t,
21431
- type: "text",
21432
- isMandatory: false,
21433
- optionKey: "i18nKey",
21434
- name: "AccountNo",
21435
- value: AccountNo,
21436
- onChange: setvendoraccountno,
21437
- style: {
21438
- width: "100%"
21439
- },
21440
- ValidationRequired: true,
21441
- validation: {
21442
- isRequired: true,
21443
- pattern: "[0-9]{9,18}",
21444
- type: "text",
21445
- title: t("INVALID_ACCOUNT_NO_ERROR_MESSAGE")
21446
- }
21447
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, "" + t("PHONE_NO")), /*#__PURE__*/React.createElement(MobileNumber, {
21448
- value: PhoneNo,
21449
- name: "PhoneNo",
21450
- onChange: setPhoneNo,
21451
- style: {
21452
- width: "100%"
21453
- }
21454
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, "" + t("CONTACT_PERSON")), /*#__PURE__*/React.createElement(TextInput$1, {
21455
- t: t,
21456
- type: "text",
21457
- isMandatory: false,
21458
- optionKey: "i18nKey",
21459
- name: "ContactPerson",
21460
- value: ContactPerson,
21461
- onChange: setcontactperson,
21462
- style: {
21463
- width: "100%"
21464
- },
21465
- ValidationRequired: true,
21466
- validation: {
21467
- isRequired: true,
21468
- pattern: "^[a-zA-Z0-9/-]{1,20}$",
21469
- type: "text",
21470
- title: t("INVALID_ACCOUNT_NO_ERROR_MESSAGE")
21471
- }
21472
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, "" + t("PAN_NO")), /*#__PURE__*/React.createElement(TextInput$1, {
21473
- t: t,
21474
- type: "text",
21475
- isMandatory: false,
21476
- optionKey: "i18nKey",
21477
- name: "PanNo",
21478
- value: PanNo,
21479
- onChange: setpanno,
21480
- style: {
21481
- width: "100%"
21482
- },
21483
- ValidationRequired: true,
21484
- validation: {
21485
- isRequired: true,
21486
- pattern: "[A-Z]{5}[0-9]{4}[A-Z]{1}",
21487
- type: "text",
21488
- title: t("INVALID_PAN_NO_ERROR_MESSAGE")
21489
- }
21490
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, "" + t("GST_NO")), /*#__PURE__*/React.createElement(TextInput$1, {
21491
- t: t,
21492
- type: "text",
21493
- isMandatory: false,
21494
- optionKey: "i18nKey",
21495
- name: "GstNo",
21496
- value: GstNo,
21497
- onChange: setgstno,
21498
- style: {
21499
- width: "100%"
21500
- },
21501
- ValidationRequired: true,
21502
- validation: {
21503
- isRequired: true,
21504
- pattern: "^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[A-Z0-9]{1}[Z]{1}[A-Z0-9]{1}$",
21505
- type: "text",
21506
- title: t("INVALID_GST_NO_ERROR_MESSAGE")
21507
- }
21508
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, "" + t("GST_REGISTERED_STATE/UT")), /*#__PURE__*/React.createElement(TextInput$1, {
21509
- t: t,
21510
- type: "text",
21511
- isMandatory: false,
21512
- optionKey: "i18nKey",
21513
- name: "GstState",
21514
- value: GstState,
21515
- onChange: setgststate,
21516
- style: {
21517
- width: "100%"
21518
- },
21519
- ValidationRequired: true,
21520
- validation: {
21521
- isRequired: true,
21522
- pattern: "^[a-zA-Z0-9/-]{1,20}$",
21523
- type: "text",
21524
- title: t("PT_NAME_ERROR_MESSAGE")
21525
- }
21526
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, "" + t("REGISTRATION_NO")), /*#__PURE__*/React.createElement(TextInput$1, {
21527
- t: t,
21528
- type: "text",
21529
- isMandatory: false,
21530
- optionKey: "i18nKey",
21531
- name: "RegistrationNo",
21532
- value: RegistrationNo,
21533
- onChange: setregistrationno,
21534
- style: {
21535
- width: "100%"
21536
- },
21537
- ValidationRequired: true,
21538
- validation: {
21539
- isRequired: true,
21540
- pattern: "^[a-zA-Z0-9/-]{1,20}$",
21541
- type: "text",
21542
- title: t("INVALID_REGISTRATION_NO_ERROR_MESSAGE")
21543
- }
21544
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, "" + t("EPF_NO")), /*#__PURE__*/React.createElement(TextInput$1, {
21545
- t: t,
21546
- type: "text",
21547
- isMandatory: false,
21548
- optionKey: "i18nKey",
21549
- name: "EpfNo",
21550
- value: EpfNo,
21551
- onChange: setepfno,
21552
- style: {
21553
- width: "100%"
21554
- },
21555
- ValidationRequired: true,
21556
- validation: {
21557
- isRequired: true,
21558
- pattern: "^[a-zA-Z0-9/-]{1,15}$",
21559
- type: "text",
21560
- title: t("INVALID_EPF_NO_ERROR_MESSAGE")
21561
- }
21562
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel$1, null, "" + t("ESI_NO")), /*#__PURE__*/React.createElement(TextInput$1, {
21563
- t: t,
21564
- type: "text",
21565
- isMandatory: false,
21566
- optionKey: "i18nKey",
21567
- name: "EsiNo",
21568
- value: EsiNo,
21569
- onChange: setesino,
21570
- style: {
21571
- width: "100%"
21572
- },
21573
- ValidationRequired: true,
21574
- validation: {
21575
- isRequired: true,
21576
- pattern: "^[a-zA-Z0-9/-]{1,20}$",
21577
- type: "text",
21578
- title: t("INVALID_ESI_NO_ERROR_MESSAGE")
21579
- }
21580
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement("div", null, t("VENDOR_TYPE"), /*#__PURE__*/React.createElement("div", {
21581
- className: "tooltip",
21582
- style: {
21583
- width: "12px",
21584
- height: "5px",
21585
- marginLeft: "10px",
21586
- display: "inline-flex",
21587
- alignItems: "center"
21588
- }
21589
- }, /*#__PURE__*/React.createElement("span", {
21590
- className: "tooltiptext",
21591
- style: {
21592
- whiteSpace: "pre-wrap",
21593
- fontSize: "small",
21594
- wordWrap: "break-word",
21595
- width: "300px",
21596
- marginLeft: "15px",
21597
- marginBottom: "-10px"
21598
- }
21599
- }, "" + t("AST_CLASSIFICATION_ASSET")))), /*#__PURE__*/React.createElement(Controller, {
21600
- control: control,
21601
- name: "VendorType",
21602
- defaultValue: VendorType,
21603
- rules: {
21604
- required: t("CORE_COMMON_REQUIRED_ERRMSG")
21605
- },
21606
- render: props => /*#__PURE__*/React.createElement(Dropdown, {
21607
- selected: VendorType,
21608
- select: setVendorType,
21609
- option: [{
21610
- i18nKey: "Supplier",
21611
- code: "SUPPLIER"
21612
- }, {
21613
- i18nKey: "Contractor",
21614
- code: "CONTRACTOR"
21615
- }],
21616
- optionKey: "i18nKey",
21617
- placeholder: "Select",
21618
- t: t
21619
- })
21620
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement("div", null, t("VENOR_CATEGORY"), /*#__PURE__*/React.createElement("div", {
21621
- className: "tooltip",
21622
- style: {
21623
- width: "12px",
21624
- height: "5px",
21625
- marginLeft: "10px",
21626
- display: "inline-flex",
21627
- alignItems: "center"
21628
- }
21629
- }, /*#__PURE__*/React.createElement("span", {
21630
- className: "tooltiptext",
21631
- style: {
21632
- whiteSpace: "pre-wrap",
21633
- fontSize: "small",
21634
- wordWrap: "break-word",
21635
- width: "300px",
21636
- marginLeft: "15px",
21637
- marginBottom: "-10px"
21638
- }
21639
- }))), /*#__PURE__*/React.createElement(Controller, {
21640
- control: control,
21641
- name: "VendorCategory",
21642
- defaultValue: VendorCategory,
21643
- rules: {
21644
- required: t("CORE_COMMON_REQUIRED_ERRMSG")
21645
- },
21646
- render: props => /*#__PURE__*/React.createElement(Dropdown, {
21647
- selected: VendorCategory,
21648
- select: setVendorCategory,
21649
- option: [{
21650
- i18nKey: "Firm",
21651
- code: "FIRM"
21652
- }, {
21653
- i18nKey: "Individual",
21654
- code: "Individual"
21655
- }],
21656
- optionKey: "i18nKey",
21657
- placeholder: "Select",
21658
- t: t
21659
- })
21660
- })), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement("div", null, t("STATUS"), /*#__PURE__*/React.createElement("div", {
21661
- className: "tooltip",
21662
- style: {
21663
- width: "12px",
21664
- height: "5px",
21665
- marginLeft: "10px",
21666
- display: "inline-flex",
21667
- alignItems: "center"
21668
- }
21669
- }, /*#__PURE__*/React.createElement("span", {
21670
- className: "tooltiptext",
21671
- style: {
21672
- whiteSpace: "pre-wrap",
21673
- fontSize: "small",
21674
- wordWrap: "break-word",
21675
- width: "300px",
21676
- marginLeft: "15px",
21677
- marginBottom: "-10px"
21678
- }
21679
- }, "" + t("AST_CLASSIFICATION_ASSET")))), /*#__PURE__*/React.createElement(Controller, {
21680
- control: control,
21681
- name: "Status",
21682
- defaultValue: Status,
21683
- rules: {
21684
- required: t("CORE_COMMON_REQUIRED_ERRMSG")
21685
- },
21686
- render: props => /*#__PURE__*/React.createElement(Dropdown, {
21687
- selected: Status,
21688
- select: setStatus,
21689
- option: [{
21690
- i18nKey: "Active",
21691
- code: "ACTIVE"
21692
- }, {
21693
- i18nKey: "Inactive",
21694
- code: "INACTIVE"
21695
- }],
21696
- optionKey: "i18nKey",
21697
- placeholder: "Select",
21698
- t: t
21699
- })
21700
- })))));
21701
- };
21702
-
21703
- const AddVendor = _ref => {
20917
+ const AddVendor = () => {
20918
+ var _Digit$UserService$ge, _formData$serviceType2;
21704
20919
  const tenantId = Digit.ULBService.getCurrentTenantId();
21705
20920
  const _useTranslation = useTranslation(),
21706
20921
  t = _useTranslation.t;
21707
20922
  const history = useHistory();
20923
+ const userInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
20924
+ const userType = userInfo === null || userInfo === void 0 ? void 0 : userInfo.type;
21708
20925
  const _useState = useState(1),
21709
20926
  currentStep = _useState[0],
21710
20927
  setCurrentStep = _useState[1];
21711
20928
  const _useState2 = useState(null),
21712
20929
  showToast = _useState2[0],
21713
20930
  setShowToast = _useState2[1];
20931
+ const _useState3 = useState([]),
20932
+ genderMenu = _useState3[0],
20933
+ setGenderMenu = _useState3[1];
21714
20934
  const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("FSM_MUTATION_HAPPENED", false),
21715
20935
  setMutationHappened = _Digit$Hooks$useSessi[1];
21716
20936
  const _Digit$Hooks$useSessi2 = Digit.Hooks.useSessionStorage("FSM_ERROR_DATA", false),
21717
20937
  clearError = _Digit$Hooks$useSessi2[2];
21718
20938
  const _Digit$Hooks$useSessi3 = Digit.Hooks.useSessionStorage("FSM_MUTATION_SUCCESS_DATA", false),
21719
20939
  clearSuccessData = _Digit$Hooks$useSessi3[2];
20940
+ const stateId = Digit.ULBService.getStateId();
20941
+ const _Digit$Hooks$obps$use = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]),
20942
+ genderTypeData = _Digit$Hooks$obps$use.data;
20943
+ useEffect(() => {
20944
+ var _genderTypeData$commo, _genderTypeData$commo2;
20945
+ if (genderTypeData && (_genderTypeData$commo = genderTypeData["common-masters"]) !== null && _genderTypeData$commo !== void 0 && (_genderTypeData$commo2 = _genderTypeData$commo.GenderType) !== null && _genderTypeData$commo2 !== void 0 && _genderTypeData$commo2.length) {
20946
+ var _genderTypeData$commo3, _genderTypeData$commo4;
20947
+ const menuItems = (_genderTypeData$commo3 = genderTypeData["common-masters"]) === null || _genderTypeData$commo3 === void 0 ? void 0 : (_genderTypeData$commo4 = _genderTypeData$commo3.GenderType) === null || _genderTypeData$commo4 === void 0 ? void 0 : _genderTypeData$commo4.filter(data => data.active).map(genderDetails => ({
20948
+ i18nKey: "COMMON_GENDER_" + genderDetails.code,
20949
+ code: "" + genderDetails.code,
20950
+ value: "" + genderDetails.code
20951
+ }));
20952
+ setGenderMenu(menuItems);
20953
+ }
20954
+ }, [genderTypeData]);
21720
20955
  const _Digit$Hooks$fsm$useV = Digit.Hooks.fsm.useVendorCreate(tenantId),
21721
20956
  mutate = _Digit$Hooks$fsm$useV.mutate;
21722
20957
  useEffect(() => {
@@ -21736,19 +20971,19 @@ const AddVendor = _ref => {
21736
20971
  amount: null
21737
20972
  }
21738
20973
  };
21739
- const _useState3 = useState(defaultValues),
21740
- formData = _useState3[0],
21741
- setFormData = _useState3[1];
21742
- const Config = VendorConfig(t, false, formData);
20974
+ const _useState4 = useState(defaultValues),
20975
+ formData = _useState4[0],
20976
+ setFormData = _useState4[1];
20977
+ const Config = React.useMemo(() => {
20978
+ var _formData$serviceType;
20979
+ return VendorConfig(t, (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code, genderMenu);
20980
+ }, [t, formData === null || formData === void 0 ? void 0 : (_formData$serviceType2 = formData.serviceType) === null || _formData$serviceType2 === void 0 ? void 0 : _formData$serviceType2.i18nKey, genderMenu]);
21743
20981
  const onFormValueChange = (setValue, data) => {
21744
- var _data$zoneIds, _data$serviceType, _formData$serviceType, _data$serviceType2;
21745
- const currentZoneCodes = (data === null || data === void 0 ? void 0 : (_data$zoneIds = data.zoneIds) === null || _data$zoneIds === void 0 ? void 0 : _data$zoneIds.map(item => {
21746
- var _item$;
21747
- return item === null || item === void 0 ? void 0 : (_item$ = item[1]) === null || _item$ === void 0 ? void 0 : _item$.code;
21748
- })) || [];
20982
+ var _data$zoneIds, _data$serviceType, _formData$serviceType3, _data$serviceType2;
20983
+ const currentZoneCodes = (data === null || data === void 0 ? void 0 : (_data$zoneIds = data.zoneIds) === null || _data$zoneIds === void 0 ? void 0 : _data$zoneIds.map(item => item === null || item === void 0 ? void 0 : item.code)) || [];
21749
20984
  const previousZoneCodes = (formData === null || formData === void 0 ? void 0 : formData.zoneIds) || [];
21750
20985
  const zoneChanged = currentZoneCodes.join(",") !== previousZoneCodes.join(",");
21751
- if ((data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code) !== (formData === null || formData === void 0 ? void 0 : (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code) || zoneChanged) {
20986
+ if ((data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code) !== (formData === null || formData === void 0 ? void 0 : (_formData$serviceType3 = formData.serviceType) === null || _formData$serviceType3 === void 0 ? void 0 : _formData$serviceType3.code) || zoneChanged) {
21752
20987
  setFormData(prev => _extends({}, prev, {
21753
20988
  serviceType: data === null || data === void 0 ? void 0 : data.serviceType
21754
20989
  }));
@@ -21758,6 +20993,19 @@ const AddVendor = _ref => {
21758
20993
  zoneIds: currentZoneCodes
21759
20994
  }));
21760
20995
  }
20996
+ const startDate = data === null || data === void 0 ? void 0 : data.contractStartDate;
20997
+ const endDate = data === null || data === void 0 ? void 0 : data.contractEndDate;
20998
+ if (startDate && endDate) {
20999
+ const isInvalid = new Date(endDate) < new Date(startDate);
21000
+ if (isInvalid && (showToast === null || showToast === void 0 ? void 0 : showToast.action) !== "INVALID_CONTRACT_DATE") {
21001
+ setShowToast({
21002
+ key: "error",
21003
+ action: "INVALID_CONTRACT_DATE"
21004
+ });
21005
+ } else if (!isInvalid && showToast) {
21006
+ setShowToast(null);
21007
+ }
21008
+ }
21761
21009
  const isVendorDetailsFilled = (data === null || data === void 0 ? void 0 : data.vendorName) && (data === null || data === void 0 ? void 0 : data.phone) && (data === null || data === void 0 ? void 0 : (_data$serviceType2 = data.serviceType) === null || _data$serviceType2 === void 0 ? void 0 : _data$serviceType2.code);
21762
21010
  if (isVendorDetailsFilled) {
21763
21011
  if (currentStep === 1) {
@@ -21868,10 +21116,7 @@ const AddVendor = _ref => {
21868
21116
  if (isEkyc) {
21869
21117
  var _mergedData$zoneIds, _mergedData$clusterId;
21870
21118
  vendorData = _extends({}, vendorData, {
21871
- zoneIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$zoneIds = mergedData.zoneIds) === null || _mergedData$zoneIds === void 0 ? void 0 : _mergedData$zoneIds.map(z => {
21872
- var _z$;
21873
- return z === null || z === void 0 ? void 0 : (_z$ = z[1]) === null || _z$ === void 0 ? void 0 : _z$.code;
21874
- })) || [],
21119
+ zoneIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$zoneIds = mergedData.zoneIds) === null || _mergedData$zoneIds === void 0 ? void 0 : _mergedData$zoneIds.map(z => z === null || z === void 0 ? void 0 : z.name)) || [],
21875
21120
  clusterIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$clusterId = mergedData.clusterIds) === null || _mergedData$clusterId === void 0 ? void 0 : _mergedData$clusterId.map(c => {
21876
21121
  var _c$;
21877
21122
  return c === null || c === void 0 ? void 0 : (_c$ = c[1]) === null || _c$ === void 0 ? void 0 : _c$.code;
@@ -21895,17 +21140,18 @@ const AddVendor = _ref => {
21895
21140
  key: "error",
21896
21141
  action: error
21897
21142
  });
21898
- setTimeout(closeToast, 5000);
21899
21143
  },
21900
- onSuccess: (data, variables) => {
21901
- setShowToast({
21902
- key: "success",
21903
- action: "ADD_VENDOR"
21144
+ onSuccess: () => {
21145
+ history.push({
21146
+ pathname: "/digit-ui/" + userType + "/vendor/search-vendor",
21147
+ state: {
21148
+ showSuccessToast: true,
21149
+ message: {
21150
+ key: "success",
21151
+ action: "ES_VENDOR_ADD_VENDOR"
21152
+ }
21153
+ }
21904
21154
  });
21905
- setTimeout(() => {
21906
- closeToast();
21907
- history.push("/digit-ui/employee/vendor/search-vendor");
21908
- }, 2000);
21909
21155
  }
21910
21156
  });
21911
21157
  };
@@ -21932,7 +21178,7 @@ const AddVendor = _ref => {
21932
21178
  }
21933
21179
  }, /*#__PURE__*/React.createElement(FormComposer, {
21934
21180
  config: Config,
21935
- userType: "employee",
21181
+ userType: userType,
21936
21182
  onFormValueChange: onFormValueChange,
21937
21183
  label: t("ES_COMMON_APPLICATION_SUBMIT"),
21938
21184
  onSubmit: onSubmit,
@@ -21941,7 +21187,7 @@ const AddVendor = _ref => {
21941
21187
  noBreakLine: true
21942
21188
  }), showToast && /*#__PURE__*/React.createElement(Toast, {
21943
21189
  error: showToast.key === "error",
21944
- label: t(showToast.key === "success" ? "ES_FSM_REGISTRY_" + showToast.action + "_SUCCESS" : showToast.action),
21190
+ label: showToast.action === "INVALID_CONTRACT_DATE" ? t("ES_VENDOR_CONTRACT_END_DATE") + " cannot be earlier than " + t("ES_VENDOR_CONTRACT_START_DATE") : t(showToast.key === "success" ? "ES_FSM_REGISTRY_" + showToast.action + "_SUCCESS" : showToast.action),
21945
21191
  onClose: closeToast
21946
21192
  })));
21947
21193
  };
@@ -22102,9 +21348,7 @@ const componentsToRegister = {
22102
21348
  FSMSelectRating: SelectRating,
22103
21349
  FSMDsoDashboard: DsoDashboard,
22104
21350
  FSMRegistry,
22105
- VendorDetails,
22106
21351
  AddVendor,
22107
- EditVendor,
22108
21352
  VehicleDetails,
22109
21353
  AddVehicle,
22110
21354
  EditVehicle,