@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.
package/dist/index.js CHANGED
@@ -2208,13 +2208,15 @@ const InputCard = _ref => {
2208
2208
  isMultipleAllow = _ref$isMultipleAllow === void 0 ? false : _ref$isMultipleAllow,
2209
2209
  _ref$cardStyle = _ref.cardStyle,
2210
2210
  cardStyle = _ref$cardStyle === void 0 ? {} : _ref$cardStyle,
2211
- className = _ref.className;
2211
+ className = _ref.className,
2212
+ _ref$noGrid = _ref.noGrid,
2213
+ noGrid = _ref$noGrid === void 0 ? false : _ref$noGrid;
2212
2214
  const isMobile = window.Digit.Utils.browser.isMobile();
2213
2215
  return /*#__PURE__*/React__default.createElement("div", {
2214
2216
  className: className || "",
2215
2217
  style: cardStyle
2216
2218
  }, texts.headerCaption && /*#__PURE__*/React__default.createElement(CardCaption, null, t(texts.headerCaption)), (texts === null || texts === void 0 ? void 0 : texts.header) && /*#__PURE__*/React__default.createElement(CardHeader, null, t(texts.header)), (texts === null || texts === void 0 ? void 0 : texts.cardText) && /*#__PURE__*/React__default.createElement(CardText, null, t(texts.cardText)), /*#__PURE__*/React__default.createElement("div", {
2217
- className: "formcomposer-section-grid"
2219
+ className: noGrid ? "" : "formcomposer-section-grid"
2218
2220
  }, children), texts.submitBarLabel ? /*#__PURE__*/React__default.createElement("div", {
2219
2221
  className: "formcomposer-section-button"
2220
2222
  }, /*#__PURE__*/React__default.createElement(SubmitBar, {
@@ -2328,24 +2330,6 @@ const CollapsibleCardPage = _ref => {
2328
2330
  }, children(activeTab)) : children)));
2329
2331
  };
2330
2332
 
2331
- const _excluded = ["onClick", "style", "children", "className", "ReactRef"];
2332
- const Card = _ref => {
2333
- let onClick = _ref.onClick,
2334
- style = _ref.style,
2335
- children = _ref.children,
2336
- className = _ref.className,
2337
- ReactRef = _ref.ReactRef,
2338
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
2339
- return /*#__PURE__*/React__default.createElement("div", _extends({
2340
- key: props.key,
2341
- className: "employeeCard " + (className ? className : ""),
2342
- onClick: onClick,
2343
- style: style
2344
- }, props, {
2345
- ref: ReactRef
2346
- }), children);
2347
- };
2348
-
2349
2333
  const FormStep = _ref => {
2350
2334
  var _config$inputs, _config$texts;
2351
2335
  let t = _ref.t,
@@ -2375,8 +2359,7 @@ const FormStep = _ref => {
2375
2359
  isCollapsible = _ref$isCollapsible === void 0 ? true : _ref$isCollapsible,
2376
2360
  _ref$defaultOpen = _ref.defaultOpen,
2377
2361
  defaultOpen = _ref$defaultOpen === void 0 ? true : _ref$defaultOpen,
2378
- formClassName = _ref.formClassName,
2379
- cardClassName = _ref.cardClassName;
2362
+ formClassName = _ref.formClassName;
2380
2363
  const _useForm = reactHookForm.useForm({
2381
2364
  defaultValues: _defaultValues
2382
2365
  }),
@@ -2459,8 +2442,6 @@ const FormStep = _ref => {
2459
2442
  flex: "1"
2460
2443
  },
2461
2444
  onSubmit: handleSubmit(goNext)
2462
- }, /*#__PURE__*/React__default.createElement(Card, {
2463
- className: "form-composer-card " + (cardClassName ? cardClassName : "")
2464
2445
  }, _isCollapsible ? /*#__PURE__*/React__default.createElement(CollapsibleCardPage, {
2465
2446
  title: t(config === null || config === void 0 ? void 0 : (_config$texts = config.texts) === null || _config$texts === void 0 ? void 0 : _config$texts.header),
2466
2447
  defaultOpen: _defaultOpen
@@ -2476,7 +2457,8 @@ const FormStep = _ref => {
2476
2457
  onSkip: onSkip,
2477
2458
  onAdd: onAdd,
2478
2459
  t: t,
2479
- className: className || ""
2460
+ className: className || "",
2461
+ noGrid: config.noGrid || false
2480
2462
  }), !childrenAtTheBottom && children, inputs, forcedError && !showErrorBelowChildren && /*#__PURE__*/React__default.createElement(CardLabelError, null, t(forcedError)), childrenAtTheBottom && children, forcedError && showErrorBelowChildren && /*#__PURE__*/React__default.createElement(CardLabelError, null, t(forcedError)))) : /*#__PURE__*/React__default.createElement(InputCard, _extends({
2481
2463
  isDisable: isDisable,
2482
2464
  isMultipleAllow: isMultipleAllow
@@ -2487,7 +2469,7 @@ const FormStep = _ref => {
2487
2469
  onAdd: onAdd,
2488
2470
  t: t,
2489
2471
  className: className || ""
2490
- }), !childrenAtTheBottom && children, inputs, forcedError && !showErrorBelowChildren && /*#__PURE__*/React__default.createElement(CardLabelError, null, t(forcedError)), childrenAtTheBottom && children, forcedError && showErrorBelowChildren && /*#__PURE__*/React__default.createElement(CardLabelError, null, t(forcedError)))));
2472
+ }), !childrenAtTheBottom && children, inputs, forcedError && !showErrorBelowChildren && /*#__PURE__*/React__default.createElement(CardLabelError, null, t(forcedError)), childrenAtTheBottom && children, forcedError && showErrorBelowChildren && /*#__PURE__*/React__default.createElement(CardLabelError, null, t(forcedError))));
2491
2473
  };
2492
2474
  FormStep.propTypes = {
2493
2475
  config: propTypes.shape({}),
@@ -9740,7 +9722,6 @@ const CitizenApp = _ref => {
9740
9722
  const DsoDashboard = Digit.ComponentRegistryService.getComponent("FSMDsoDashboard");
9741
9723
  const Inbox = Digit.ComponentRegistryService.getComponent("FSMEmpInbox");
9742
9724
  const EditVendor = Digit.ComponentRegistryService.getComponent("EditVendor");
9743
- console.log(path + "/registry/modify-vendor/:id");
9744
9725
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
9745
9726
  className: "fsm-citizen-wrapper"
9746
9727
  }, location.pathname.includes("/response") || location.pathname.split("/").includes("check") ? null : location.pathname.includes("/street") ? /*#__PURE__*/React__default.createElement(digitUiReactComponents.BackButton, {
@@ -11484,14 +11465,14 @@ const AssignedTo = _ref => {
11484
11465
  }));
11485
11466
  };
11486
11467
 
11487
- const _excluded$1 = ["searchParams", "paginationParms", "onFilterChange", "onSearch", "removeParam"];
11468
+ const _excluded = ["searchParams", "paginationParms", "onFilterChange", "onSearch", "removeParam"];
11488
11469
  const Filter = _ref => {
11489
11470
  var _mergedRoleDetails$st, _mergedRoleDetails$st2, _props$applications, _props$applications2;
11490
11471
  let searchParams = _ref.searchParams,
11491
11472
  paginationParms = _ref.paginationParms,
11492
11473
  onFilterChange = _ref.onFilterChange,
11493
11474
  onSearch = _ref.onSearch,
11494
- props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
11475
+ props = _objectWithoutPropertiesLoose(_ref, _excluded);
11495
11476
  const _useTranslation = reactI18next.useTranslation(),
11496
11477
  t = _useTranslation.t;
11497
11478
  const location = reactRouterDom.useLocation();
@@ -20760,15 +20741,12 @@ const convertEpochToDate$1 = (dateEpoch, businessService) => {
20760
20741
  }
20761
20742
  };
20762
20743
 
20763
- const VendorConfig = function (t, disabled, formData) {
20764
- var _formData, _formData$serviceType;
20765
- if (disabled === void 0) {
20766
- disabled = false;
20767
- }
20768
- if (formData === void 0) {
20769
- formData = {};
20744
+ const VendorConfig = function (t, module, genderMenu, update) {
20745
+ var _module;
20746
+ if (module === void 0) {
20747
+ module = "";
20770
20748
  }
20771
- 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";
20749
+ const isEkyc = ((_module = module) === null || _module === void 0 ? void 0 : _module.toLocaleUpperCase()) === "EKYC";
20772
20750
  return [{
20773
20751
  head: "ES_VRNDOR_NEW_VENDOR_DETAILS",
20774
20752
  isCollapsible: true,
@@ -20777,7 +20755,7 @@ const VendorConfig = function (t, disabled, formData) {
20777
20755
  label: "ES_FSM_REGISTRY_NEW_VENDOR_NAME",
20778
20756
  isMandatory: true,
20779
20757
  type: "text",
20780
- disable: disabled,
20758
+ disable: false,
20781
20759
  populators: {
20782
20760
  name: "vendorName",
20783
20761
  validation: {
@@ -20788,27 +20766,12 @@ const VendorConfig = function (t, disabled, formData) {
20788
20766
  defaultValue: "",
20789
20767
  className: "payment-form-text-input-correction"
20790
20768
  }
20791
- }, {
20792
- label: "ES_FSM_REGISTRY_NEW_EMAIL",
20793
- isMandatory: false,
20794
- type: "text",
20795
- key: "emailId",
20796
- populators: {
20797
- name: "emailId",
20798
- validation: {
20799
- required: false,
20800
- pattern: /^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+$/
20801
- },
20802
- error: t("FSM_REGISTRY_INVALID_EMAIL"),
20803
- defaultValue: "",
20804
- className: "payment-form-text-input-correction"
20805
- }
20806
20769
  }, {
20807
20770
  label: "ES_FSM_REGISTRY_NEW_VENDOR_PHONE",
20808
20771
  isMandatory: true,
20809
20772
  type: "mobileNumber",
20810
20773
  key: "phone",
20811
- disable: disabled,
20774
+ disable: false,
20812
20775
  populators: {
20813
20776
  name: "phone",
20814
20777
  validation: {
@@ -20823,13 +20786,28 @@ const VendorConfig = function (t, disabled, formData) {
20823
20786
  defaultValue: "",
20824
20787
  className: "payment-form-text-input-correction"
20825
20788
  }
20789
+ }, {
20790
+ label: "ES_FSM_REGISTRY_NEW_EMAIL",
20791
+ isMandatory: false,
20792
+ type: "text",
20793
+ key: "emailId",
20794
+ populators: {
20795
+ name: "emailId",
20796
+ validation: {
20797
+ required: false,
20798
+ pattern: /^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+$/
20799
+ },
20800
+ error: t("FSM_REGISTRY_INVALID_EMAIL"),
20801
+ defaultValue: "",
20802
+ className: "payment-form-text-input-correction"
20803
+ }
20826
20804
  }, {
20827
20805
  label: "ES_VENDOR_REGISTRY_SERVICE_TYPE",
20828
20806
  isMandatory: true,
20829
20807
  type: "component",
20830
20808
  key: "serviceType",
20831
20809
  component: "SelectServiceType",
20832
- disable: disabled,
20810
+ disable: update,
20833
20811
  populators: {
20834
20812
  name: "serviceType",
20835
20813
  defaultValue: {
@@ -20899,17 +20877,8 @@ const VendorConfig = function (t, disabled, formData) {
20899
20877
  component: "SelectEkycDropdown",
20900
20878
  populators: {
20901
20879
  name: "gender",
20902
- options: [{
20903
- code: "MALE",
20904
- name: "ES_COMMON_GENDER_MALE"
20905
- }, {
20906
- code: "FEMALE",
20907
- name: "ES_COMMON_GENDER_FEMALE"
20908
- }, {
20909
- code: "OTHER",
20910
- name: "ES_COMMON_GENDER_OTHER"
20911
- }],
20912
- optionsKey: "name"
20880
+ options: genderMenu,
20881
+ optionsKey: "i18nKey"
20913
20882
  }
20914
20883
  }, {
20915
20884
  label: "ES_FSM_REGISTRY_NEW_DOB",
@@ -20935,791 +20904,57 @@ const VendorConfig = function (t, disabled, formData) {
20935
20904
  body: [{
20936
20905
  type: "component",
20937
20906
  key: "propertyAddress",
20938
- component: "CPTPropertyLocationDetails",
20907
+ component: "PropertyLocationDetails",
20939
20908
  withoutLabel: true,
20940
20909
  props: {
20941
20910
  hidePropertySearch: true,
20942
20911
  hideZRO: true
20912
+ },
20913
+ texts: {
20914
+ header: "PT_LOCATION_DETAILS"
20943
20915
  }
20944
20916
  }]
20945
20917
  }];
20946
20918
  };
20947
20919
 
20948
- const EditVendor = () => {
20949
- const tenantId = Digit.ULBService.getCurrentTenantId();
20950
- let _useParams = reactRouterDom.useParams(),
20951
- dsoId = _useParams.id;
20952
- const _useState = React.useState(null),
20953
- showToast = _useState[0],
20954
- setShowToast = _useState[1];
20955
- const _useState2 = React.useState(false),
20956
- canSubmit = _useState2[0],
20957
- setSubmitValve = _useState2[1];
20958
- const _useState3 = React.useState({}),
20959
- defaultValues = _useState3[0],
20960
- setDefaultValues = _useState3[1];
20961
- const _useState4 = React.useState({}),
20962
- dsoDetails = _useState4[0],
20963
- setDsoDetails = _useState4[1];
20964
- const queryClient = reactQuery.useQueryClient();
20965
- const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("FSM_MUTATION_HAPPENED", false),
20966
- setMutationHappened = _Digit$Hooks$useSessi[1];
20967
- const _Digit$Hooks$useSessi2 = Digit.Hooks.useSessionStorage("FSM_ERROR_DATA", false),
20968
- clearError = _Digit$Hooks$useSessi2[2];
20969
- const _Digit$Hooks$useSessi3 = Digit.Hooks.useSessionStorage("FSM_MUTATION_SUCCESS_DATA", false),
20970
- clearSuccessData = _Digit$Hooks$useSessi3[2];
20971
- const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
20972
- ids: dsoId
20973
- }, {
20974
- staleTime: Infinity
20975
- }),
20976
- dsoData = _Digit$Hooks$fsm$useD.data,
20977
- daoDataLoading = _Digit$Hooks$fsm$useD.isLoading;
20978
- const _Digit$Hooks$fsm$useV = Digit.Hooks.fsm.useVendorUpdate(tenantId),
20979
- mutate = _Digit$Hooks$fsm$useV.mutate;
20980
- React.useEffect(() => {
20981
- setMutationHappened(false);
20982
- clearSuccessData();
20983
- clearError();
20984
- }, []);
20985
- React.useEffect(() => {
20986
- if (dsoData && dsoData[0]) {
20987
- 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;
20988
- let dsoDetails = dsoData[0];
20989
- setDsoDetails(dsoDetails === null || dsoDetails === void 0 ? void 0 : dsoDetails.dsoDetails);
20990
- let values = {
20991
- vendorName: dsoDetails === null || dsoDetails === void 0 ? void 0 : dsoDetails.name,
20992
- 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,
20993
- 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,
20994
- 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,
20995
- 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,
20996
- 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,
20997
- 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,
20998
- address: {
20999
- 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,
21000
- 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, {
21001
- 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)
21002
- })
21003
- },
21004
- phone: dsoDetails === null || dsoDetails === void 0 ? void 0 : dsoDetails.mobileNumber,
21005
- 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,
21006
- 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,
21007
- 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,
21008
- 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,
21009
- 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"),
21010
- 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,
21011
- 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,
21012
- 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
21013
- };
21014
- setDefaultValues(values);
21015
- }
21016
- }, [dsoData]);
21017
- const _useTranslation = reactI18next.useTranslation(),
21018
- t = _useTranslation.t;
21019
- const history = reactRouterDom.useHistory();
21020
- const Config = VendorConfig(t, true);
21021
- const onFormValueChange = (setValue, formData) => {
21022
- var _formData$address;
21023
- 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) {
21024
- setSubmitValve(true);
21025
- } else {
21026
- setSubmitValve(false);
21027
- }
21028
- };
21029
- const closeToast = () => {
21030
- setShowToast(null);
21031
- };
21032
- const onSubmit = data => {
21033
- 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;
21034
- const name = data === null || data === void 0 ? void 0 : data.vendorName;
21035
- const phone = data === null || data === void 0 ? void 0 : data.phone;
21036
- const pincode = data === null || data === void 0 ? void 0 : data.pincode;
21037
- const street = data === null || data === void 0 ? void 0 : (_data$street = data.street) === null || _data$street === void 0 ? void 0 : _data$street.trim();
21038
- const doorNo = data === null || data === void 0 ? void 0 : (_data$doorNo = data.doorNo) === null || _data$doorNo === void 0 ? void 0 : _data$doorNo.trim();
21039
- const plotNo = data === null || data === void 0 ? void 0 : (_data$plotNo = data.plotNo) === null || _data$plotNo === void 0 ? void 0 : _data$plotNo.trim();
21040
- const landmark = data === null || data === void 0 ? void 0 : (_data$landmark = data.landmark) === null || _data$landmark === void 0 ? void 0 : _data$landmark.trim();
21041
- 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;
21042
- 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;
21043
- 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;
21044
- 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;
21045
- const buildingName = data === null || data === void 0 ? void 0 : (_data$buildingName = data.buildingName) === null || _data$buildingName === void 0 ? void 0 : _data$buildingName.trim();
21046
- 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;
21047
- 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;
21048
- 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;
21049
- const additionalDetails = data === null || data === void 0 ? void 0 : data.additionalDetails;
21050
- const gender = data === null || data === void 0 ? void 0 : (_data$selectGender = data.selectGender) === null || _data$selectGender === void 0 ? void 0 : _data$selectGender.code;
21051
- const emailId = data === null || data === void 0 ? void 0 : data.emailId;
21052
- const dob = new Date("" + data.dob).getTime() || new Date("1/1/1970").getTime();
21053
- const formData = {
21054
- vendor: _extends({}, dsoDetails, {
21055
- name,
21056
- address: _extends({}, dsoDetails.address, {
21057
- landmark,
21058
- doorNo,
21059
- plotNo,
21060
- street,
21061
- city,
21062
- district,
21063
- region,
21064
- state,
21065
- country: "in",
21066
- pincode,
21067
- buildingName,
21068
- locality: _extends({}, dsoDetails.address.locality, {
21069
- code: localityCode || "",
21070
- name: localityName || "",
21071
- label: "Locality",
21072
- area: localityArea || ""
21073
- }),
21074
- geoLocation: _extends({}, dsoDetails.address.geoLocation, {
21075
- latitude: (data === null || data === void 0 ? void 0 : (_data$address8 = data.address) === null || _data$address8 === void 0 ? void 0 : _data$address8.latitude) || 0,
21076
- longitude: (data === null || data === void 0 ? void 0 : (_data$address9 = data.address) === null || _data$address9 === void 0 ? void 0 : _data$address9.longitude) || 0
21077
- })
21078
- }),
21079
- owner: _extends({}, dsoDetails.owner, {
21080
- gender: gender || ((_dsoDetails$owner = dsoDetails.owner) === null || _dsoDetails$owner === void 0 ? void 0 : _dsoDetails$owner.gender) || "OTHER",
21081
- dob: dob,
21082
- emailId: emailId || "abc@egov.com",
21083
- mobileNumber: phone,
21084
- relationship: ((_dsoDetails$owner2 = dsoDetails.owner) === null || _dsoDetails$owner2 === void 0 ? void 0 : _dsoDetails$owner2.relationship) || "OTHER"
21085
- }),
21086
- additionalDetails: _extends({}, dsoDetails.additionalDetails, {
21087
- description: additionalDetails
21088
- })
21089
- })
21090
- };
21091
- mutate(formData, {
21092
- onError: (error, variables) => {
21093
- setShowToast({
21094
- key: "error",
21095
- action: error
21096
- });
21097
- setTimeout(closeToast, 5000);
21098
- },
21099
- onSuccess: (data, variables) => {
21100
- setShowToast({
21101
- key: "success",
21102
- action: "UPDATE_VENDOR"
21103
- });
21104
- setTimeout(closeToast, 5000);
21105
- queryClient.invalidateQueries("DSO_SEARCH");
21106
- setTimeout(() => {
21107
- closeToast();
21108
- history.push("/digit-ui/employee/fsm/registry/vendor-details/" + dsoId);
21109
- }, 5000);
21110
- }
21111
- });
21112
- };
21113
- if (daoDataLoading || Object.keys(defaultValues).length === 0) {
21114
- return /*#__PURE__*/React__default.createElement(digitUiReactComponents.Loader, null);
21115
- }
21116
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.VerticalTimeline, {
21117
- config: [{
21118
- timeLine: [{
21119
- actions: t("ES_FSM_REGISTRY_TITLE_EDIT_VENDOR"),
21120
- currentStep: 1
21121
- }]
21122
- }],
21123
- currentActiveIndex: 0,
21124
- showFinalStep: false
21125
- }), /*#__PURE__*/React__default.createElement("div", {
21126
- style: {
21127
- flex: "1",
21128
- overflowY: "auto"
21129
- }
21130
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormComposer, {
21131
- isDisabled: !canSubmit,
21132
- label: t("ES_COMMON_APPLICATION_SUBMIT"),
21133
- config: Config.filter(i => !i.hideInEmployee).map(config => {
21134
- return _extends({}, config, {
21135
- body: config.body.filter(a => !a.hideInEmployee)
21136
- });
21137
- }),
21138
- fieldStyle: {
21139
- marginRight: 0
21140
- },
21141
- onSubmit: onSubmit,
21142
- defaultValues: defaultValues,
21143
- onFormValueChange: onFormValueChange,
21144
- noBreakLine: true
21145
- }), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
21146
- error: showToast.key === "error" ? true : false,
21147
- label: t(showToast.key === "success" ? "ES_FSM_REGISTRY_" + showToast.action + "_SUCCESS" : showToast.action),
21148
- onClose: closeToast
21149
- })));
21150
- };
21151
-
21152
- const VendorDetails = _ref => {
21153
- var _formData$ownerKey, _formData$ownerKey2, _formData$ownerKey3, _formData$ownerKey4;
21154
- let t = _ref.t,
21155
- config = _ref.config,
21156
- onSelect = _ref.onSelect,
21157
- userType = _ref.userType,
21158
- formData = _ref.formData;
21159
- let index = 0;
21160
- const user = Digit.UserService.getUser().info;
21161
- 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) || "";
21162
- 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) || "";
21163
- 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);
21164
- 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) || "";
21165
- const _useState = React.useState(""),
21166
- VendorCategory = _useState[0],
21167
- setVendorCategory = _useState[1];
21168
- const _useState2 = React.useState(""),
21169
- VendorId = _useState2[0],
21170
- setVendorId = _useState2[1];
21171
- const _useState3 = React.useState(""),
21172
- userName = _useState3[0],
21173
- setUserName = _useState3[1];
21174
- const _useState4 = React.useState(""),
21175
- Bank = _useState4[0],
21176
- setBank = _useState4[1];
21177
- const _useState5 = React.useState(),
21178
- BankbranchName = _useState5[0],
21179
- setBankbranchName = _useState5[1];
21180
- const _useState6 = React.useState(""),
21181
- IFSC = _useState6[0],
21182
- setIFSC = _useState6[1];
21183
- const _useState7 = React.useState(""),
21184
- AccountNo = _useState7[0],
21185
- setAccountNo = _useState7[1];
21186
- const _useState8 = React.useState(""),
21187
- PanNo = _useState8[0],
21188
- setPanNo = _useState8[1];
21189
- const _useState9 = React.useState(""),
21190
- GstNo = _useState9[0],
21191
- setGstNo = _useState9[1];
21192
- const _useState0 = React.useState(""),
21193
- GstState = _useState0[0],
21194
- setGstState = _useState0[1];
21195
- const _useState1 = React.useState(""),
21196
- RegistrationNo = _useState1[0],
21197
- setRegistrationNo = _useState1[1];
21198
- const _useState10 = React.useState(""),
21199
- EpfNo = _useState10[0],
21200
- setEpfNo = _useState10[1];
21201
- const _useState11 = React.useState(""),
21202
- EsiNo = _useState11[0],
21203
- setEsiNo = _useState11[1];
21204
- const _useState12 = React.useState(""),
21205
- VendorType = _useState12[0],
21206
- setVendorType = _useState12[1];
21207
- const _useState13 = React.useState(""),
21208
- Status = _useState13[0],
21209
- setStatus = _useState13[1];
21210
- const _useState14 = React.useState(""),
21211
- micrNo = _useState14[0],
21212
- setmicrNo = _useState14[1];
21213
- const _useState15 = React.useState(""),
21214
- PhoneNo = _useState15[0],
21215
- setPhoneNo = _useState15[1];
21216
- const _useState16 = React.useState(""),
21217
- ContactPerson = _useState16[0],
21218
- setContactPerson = _useState16[1];
21219
- React.useEffect(() => {
21220
- if (IFSC.length === 11 && !Bank && !BankbranchName && !micrNo) {
21221
- fetch("https://ifsc.razorpay.com/" + IFSC).then(response => response.json()).then(data => {
21222
- if (data && data.BANK && data.BRANCH && data.MICR) {
21223
- setBank(data.BANK);
21224
- setBankbranchName(data.BRANCH);
21225
- setmicrNo(data.MICR);
21226
- }
21227
- }).catch(() => {});
21228
- } else {
21229
- if (IFSC.length === 11 && Bank && BankbranchName) {
21230
- setBank(Bank);
21231
- setBankbranchName(BankbranchName);
21232
- setmicrNo(micrNo);
21233
- } else {
21234
- setBank("");
21235
- setBankbranchName("");
21236
- setmicrNo("");
21237
- }
21238
- }
21239
- }, [IFSC]);
21240
- function setvendorbank(e) {
21241
- setBank(e.target.value);
21242
- }
21243
- function setBankbranch(e) {
21244
- setBankbranchName(e.target.value);
21245
- }
21246
- function setvendorifsc(e) {
21247
- const input = e.target.value.replace(/[^a-zA-Z0-9]/g, "");
21248
- if (input.length <= 11) {
21249
- setIFSC(input);
21250
- }
21251
- }
21252
- function setvendoraccountno(e) {
21253
- setAccountNo(e.target.value);
21254
- }
21255
- function setpanno(e) {
21256
- setPanNo(e.target.value);
21257
- }
21258
- function setgstno(e) {
21259
- setGstNo(e.target.value);
21260
- }
21261
- function setgststate(e) {
21262
- setGstState(e.target.value);
21263
- }
21264
- function setregistrationno(e) {
21265
- setRegistrationNo(e.target.value);
21266
- }
21267
- function setepfno(e) {
21268
- setEpfNo(e.target.value);
21269
- }
21270
- function setesino(e) {
21271
- setEsiNo(e.target.value);
21272
- }
21273
- function setcontactperson(e) {
21274
- setContactPerson(e.target.value);
21275
- }
21276
- const tenantId = Digit.ULBService.getCurrentTenantId();
21277
- const _useForm = reactHookForm.useForm(),
21278
- control = _useForm.control;
21279
- const _Digit$Hooks$fsm$useD = Digit.Hooks.fsm.useDsoSearch(tenantId, {
21280
- staleTime: Infinity
21281
- }),
21282
- dsoData = _Digit$Hooks$fsm$useD.data;
21283
- React.useEffect(() => {
21284
- if (dsoData) {
21285
- const vendor = dsoData.find(item => item.id);
21286
- if (vendor) {
21287
- setUserName(vendor.name);
21288
- setVendorId(vendor.id);
21289
- }
21290
- }
21291
- }, [dsoData]);
21292
- const goNext = () => {
21293
- let owner = formData.ownerKey && formData.ownerKey[index];
21294
- let ownerStep;
21295
- if (userType === "citizen") {
21296
- ownerStep = _extends({}, owner, {
21297
- applicantName,
21298
- mobileNumber,
21299
- altMobileNumber,
21300
- emailId
21301
- });
21302
- onSelect(config.key, _extends({}, formData[config.key], ownerStep), false, index);
21303
- } else {
21304
- ownerStep = _extends({}, owner, {
21305
- VendorCategory,
21306
- name: userName,
21307
- VendorId: VendorId,
21308
- Bank,
21309
- BankbranchName,
21310
- IFSC,
21311
- AccountNo,
21312
- PanNo,
21313
- GstNo,
21314
- GstState,
21315
- RegistrationNo,
21316
- EpfNo,
21317
- EsiNo,
21318
- VendorType,
21319
- Status,
21320
- micrNo,
21321
- PhoneNo,
21322
- ContactPerson
21323
- });
21324
- onSelect(config.key, ownerStep, false, index);
21325
- }
21326
- };
21327
- React.useEffect(() => {
21328
- if (userType === "citizen") {
21329
- goNext();
21330
- }
21331
- }, [VendorCategory, VendorId, userName, Bank, BankbranchName, IFSC, AccountNo, PanNo, GstNo, GstState, RegistrationNo, EpfNo, EsiNo, VendorType, Status, micrNo, PhoneNo, ContactPerson, userType]);
21332
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.VerticalTimeline, {
21333
- config: [{
21334
- timeLine: [{
21335
- actions: t("VENDOR_ADDITIONAL_DETAILS"),
21336
- currentStep: 1
21337
- }]
21338
- }, {
21339
- timeLine: [{
21340
- actions: t("VENDOR_DOCUMENT_DETAILS"),
21341
- currentStep: 2
21342
- }]
21343
- }, {
21344
- timeLine: [{
21345
- actions: t("VENDOR_SUMMARY"),
21346
- currentStep: 3
21347
- }]
21348
- }],
21349
- currentActiveIndex: 0,
21350
- showFinalStep: false
21351
- }), /*#__PURE__*/React__default.createElement("div", {
21352
- style: {
21353
- flex: "1",
21354
- overflowY: "auto"
21355
- }
21356
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormStep, {
21357
- config: config,
21358
- onSelect: goNext,
21359
- t: t,
21360
- className: "formcomposer-grid-container-form"
21361
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, {
21362
- className: "card-label-smaller"
21363
- }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CustomTooltip, {
21364
- label: "" + t("IFSC_CODE"),
21365
- isMandatory: false,
21366
- message: t("INVALID_IFSC_CODE_ERROR_MESSAGE")
21367
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
21368
- t: t,
21369
- type: "text",
21370
- isMandatory: false,
21371
- optionKey: "i18nKey",
21372
- name: "IFSC",
21373
- value: IFSC,
21374
- placeholder: "Enter IFSC Code",
21375
- onChange: setvendorifsc,
21376
- style: {
21377
- width: "100%"
21378
- },
21379
- maxLength: 11,
21380
- ValidationRequired: true,
21381
- validation: {
21382
- isRequired: true,
21383
- pattern: "^[A-Z]{4}0[A-Z0-9]{6}$",
21384
- type: "text",
21385
- title: t("INVALID_IFSC_CODE_ERROR_MESSAGE")
21386
- }
21387
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("VENDOR_BANK_NAME"), " ", /*#__PURE__*/React__default.createElement("span", {
21388
- className: "check-page-link-button"
21389
- }, "*")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
21390
- t: t,
21391
- type: "text",
21392
- isMandatory: false,
21393
- optionKey: "i18nKey",
21394
- name: "bankName",
21395
- placeholder: "Bank Name Auto Select",
21396
- style: {
21397
- width: "100%"
21398
- },
21399
- value: Bank,
21400
- onChange: setvendorbank,
21401
- disabled: true
21402
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("VENDOR_BANK_BRANCH_NAME"), " ", /*#__PURE__*/React__default.createElement("span", {
21403
- className: "check-page-link-button"
21404
- }, "*")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
21405
- t: t,
21406
- type: "text",
21407
- isMandatory: false,
21408
- optionKey: "i18nKey",
21409
- name: "BankbranchName",
21410
- value: BankbranchName,
21411
- style: {
21412
- width: "100%"
21413
- },
21414
- placeholder: "Bank Branch Name Auto Select",
21415
- onChange: setBankbranch,
21416
- disabled: false
21417
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("VENDOR_MICR_NO"), " ", /*#__PURE__*/React__default.createElement("span", {
21418
- className: "check-page-link-button"
21419
- }, "*")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
21420
- t: t,
21421
- type: "text",
21422
- isMandatory: false,
21423
- optionKey: "i18nKey",
21424
- name: "MicrNo",
21425
- value: micrNo,
21426
- style: {
21427
- width: "100%"
21428
- },
21429
- placeholder: "MICR No",
21430
- onChange: setmicrNo,
21431
- disabled: false
21432
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("ACCOUNT_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
21433
- t: t,
21434
- type: "text",
21435
- isMandatory: false,
21436
- optionKey: "i18nKey",
21437
- name: "AccountNo",
21438
- value: AccountNo,
21439
- onChange: setvendoraccountno,
21440
- style: {
21441
- width: "100%"
21442
- },
21443
- ValidationRequired: true,
21444
- validation: {
21445
- isRequired: true,
21446
- pattern: "[0-9]{9,18}",
21447
- type: "text",
21448
- title: t("INVALID_ACCOUNT_NO_ERROR_MESSAGE")
21449
- }
21450
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("PHONE_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.MobileNumber, {
21451
- value: PhoneNo,
21452
- name: "PhoneNo",
21453
- onChange: setPhoneNo,
21454
- style: {
21455
- width: "100%"
21456
- }
21457
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("CONTACT_PERSON")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
21458
- t: t,
21459
- type: "text",
21460
- isMandatory: false,
21461
- optionKey: "i18nKey",
21462
- name: "ContactPerson",
21463
- value: ContactPerson,
21464
- onChange: setcontactperson,
21465
- style: {
21466
- width: "100%"
21467
- },
21468
- ValidationRequired: true,
21469
- validation: {
21470
- isRequired: true,
21471
- pattern: "^[a-zA-Z0-9/-]{1,20}$",
21472
- type: "text",
21473
- title: t("INVALID_ACCOUNT_NO_ERROR_MESSAGE")
21474
- }
21475
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("PAN_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
21476
- t: t,
21477
- type: "text",
21478
- isMandatory: false,
21479
- optionKey: "i18nKey",
21480
- name: "PanNo",
21481
- value: PanNo,
21482
- onChange: setpanno,
21483
- style: {
21484
- width: "100%"
21485
- },
21486
- ValidationRequired: true,
21487
- validation: {
21488
- isRequired: true,
21489
- pattern: "[A-Z]{5}[0-9]{4}[A-Z]{1}",
21490
- type: "text",
21491
- title: t("INVALID_PAN_NO_ERROR_MESSAGE")
21492
- }
21493
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("GST_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
21494
- t: t,
21495
- type: "text",
21496
- isMandatory: false,
21497
- optionKey: "i18nKey",
21498
- name: "GstNo",
21499
- value: GstNo,
21500
- onChange: setgstno,
21501
- style: {
21502
- width: "100%"
21503
- },
21504
- ValidationRequired: true,
21505
- validation: {
21506
- isRequired: true,
21507
- pattern: "^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[A-Z0-9]{1}[Z]{1}[A-Z0-9]{1}$",
21508
- type: "text",
21509
- title: t("INVALID_GST_NO_ERROR_MESSAGE")
21510
- }
21511
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("GST_REGISTERED_STATE/UT")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
21512
- t: t,
21513
- type: "text",
21514
- isMandatory: false,
21515
- optionKey: "i18nKey",
21516
- name: "GstState",
21517
- value: GstState,
21518
- onChange: setgststate,
21519
- style: {
21520
- width: "100%"
21521
- },
21522
- ValidationRequired: true,
21523
- validation: {
21524
- isRequired: true,
21525
- pattern: "^[a-zA-Z0-9/-]{1,20}$",
21526
- type: "text",
21527
- title: t("PT_NAME_ERROR_MESSAGE")
21528
- }
21529
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("REGISTRATION_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
21530
- t: t,
21531
- type: "text",
21532
- isMandatory: false,
21533
- optionKey: "i18nKey",
21534
- name: "RegistrationNo",
21535
- value: RegistrationNo,
21536
- onChange: setregistrationno,
21537
- style: {
21538
- width: "100%"
21539
- },
21540
- ValidationRequired: true,
21541
- validation: {
21542
- isRequired: true,
21543
- pattern: "^[a-zA-Z0-9/-]{1,20}$",
21544
- type: "text",
21545
- title: t("INVALID_REGISTRATION_NO_ERROR_MESSAGE")
21546
- }
21547
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("EPF_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
21548
- t: t,
21549
- type: "text",
21550
- isMandatory: false,
21551
- optionKey: "i18nKey",
21552
- name: "EpfNo",
21553
- value: EpfNo,
21554
- onChange: setepfno,
21555
- style: {
21556
- width: "100%"
21557
- },
21558
- ValidationRequired: true,
21559
- validation: {
21560
- isRequired: true,
21561
- pattern: "^[a-zA-Z0-9/-]{1,15}$",
21562
- type: "text",
21563
- title: t("INVALID_EPF_NO_ERROR_MESSAGE")
21564
- }
21565
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement(digitUiReactComponents.CardLabel, null, "" + t("ESI_NO")), /*#__PURE__*/React__default.createElement(digitUiReactComponents.TextInput, {
21566
- t: t,
21567
- type: "text",
21568
- isMandatory: false,
21569
- optionKey: "i18nKey",
21570
- name: "EsiNo",
21571
- value: EsiNo,
21572
- onChange: setesino,
21573
- style: {
21574
- width: "100%"
21575
- },
21576
- ValidationRequired: true,
21577
- validation: {
21578
- isRequired: true,
21579
- pattern: "^[a-zA-Z0-9/-]{1,20}$",
21580
- type: "text",
21581
- title: t("INVALID_ESI_NO_ERROR_MESSAGE")
21582
- }
21583
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement("div", null, t("VENDOR_TYPE"), /*#__PURE__*/React__default.createElement("div", {
21584
- className: "tooltip",
21585
- style: {
21586
- width: "12px",
21587
- height: "5px",
21588
- marginLeft: "10px",
21589
- display: "inline-flex",
21590
- alignItems: "center"
21591
- }
21592
- }, /*#__PURE__*/React__default.createElement("span", {
21593
- className: "tooltiptext",
21594
- style: {
21595
- whiteSpace: "pre-wrap",
21596
- fontSize: "small",
21597
- wordWrap: "break-word",
21598
- width: "300px",
21599
- marginLeft: "15px",
21600
- marginBottom: "-10px"
21601
- }
21602
- }, "" + t("AST_CLASSIFICATION_ASSET")))), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
21603
- control: control,
21604
- name: "VendorType",
21605
- defaultValue: VendorType,
21606
- rules: {
21607
- required: t("CORE_COMMON_REQUIRED_ERRMSG")
21608
- },
21609
- render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
21610
- selected: VendorType,
21611
- select: setVendorType,
21612
- option: [{
21613
- i18nKey: "Supplier",
21614
- code: "SUPPLIER"
21615
- }, {
21616
- i18nKey: "Contractor",
21617
- code: "CONTRACTOR"
21618
- }],
21619
- optionKey: "i18nKey",
21620
- placeholder: "Select",
21621
- t: t
21622
- })
21623
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement("div", null, t("VENOR_CATEGORY"), /*#__PURE__*/React__default.createElement("div", {
21624
- className: "tooltip",
21625
- style: {
21626
- width: "12px",
21627
- height: "5px",
21628
- marginLeft: "10px",
21629
- display: "inline-flex",
21630
- alignItems: "center"
21631
- }
21632
- }, /*#__PURE__*/React__default.createElement("span", {
21633
- className: "tooltiptext",
21634
- style: {
21635
- whiteSpace: "pre-wrap",
21636
- fontSize: "small",
21637
- wordWrap: "break-word",
21638
- width: "300px",
21639
- marginLeft: "15px",
21640
- marginBottom: "-10px"
21641
- }
21642
- }))), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
21643
- control: control,
21644
- name: "VendorCategory",
21645
- defaultValue: VendorCategory,
21646
- rules: {
21647
- required: t("CORE_COMMON_REQUIRED_ERRMSG")
21648
- },
21649
- render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
21650
- selected: VendorCategory,
21651
- select: setVendorCategory,
21652
- option: [{
21653
- i18nKey: "Firm",
21654
- code: "FIRM"
21655
- }, {
21656
- i18nKey: "Individual",
21657
- code: "Individual"
21658
- }],
21659
- optionKey: "i18nKey",
21660
- placeholder: "Select",
21661
- t: t
21662
- })
21663
- })), /*#__PURE__*/React__default.createElement(digitUiReactComponents.LabelFieldPair, null, /*#__PURE__*/React__default.createElement("div", null, t("STATUS"), /*#__PURE__*/React__default.createElement("div", {
21664
- className: "tooltip",
21665
- style: {
21666
- width: "12px",
21667
- height: "5px",
21668
- marginLeft: "10px",
21669
- display: "inline-flex",
21670
- alignItems: "center"
21671
- }
21672
- }, /*#__PURE__*/React__default.createElement("span", {
21673
- className: "tooltiptext",
21674
- style: {
21675
- whiteSpace: "pre-wrap",
21676
- fontSize: "small",
21677
- wordWrap: "break-word",
21678
- width: "300px",
21679
- marginLeft: "15px",
21680
- marginBottom: "-10px"
21681
- }
21682
- }, "" + t("AST_CLASSIFICATION_ASSET")))), /*#__PURE__*/React__default.createElement(reactHookForm.Controller, {
21683
- control: control,
21684
- name: "Status",
21685
- defaultValue: Status,
21686
- rules: {
21687
- required: t("CORE_COMMON_REQUIRED_ERRMSG")
21688
- },
21689
- render: props => /*#__PURE__*/React__default.createElement(digitUiReactComponents.Dropdown, {
21690
- selected: Status,
21691
- select: setStatus,
21692
- option: [{
21693
- i18nKey: "Active",
21694
- code: "ACTIVE"
21695
- }, {
21696
- i18nKey: "Inactive",
21697
- code: "INACTIVE"
21698
- }],
21699
- optionKey: "i18nKey",
21700
- placeholder: "Select",
21701
- t: t
21702
- })
21703
- })))));
21704
- };
21705
-
21706
- const AddVendor = _ref => {
20920
+ const AddVendor = () => {
20921
+ var _Digit$UserService$ge, _formData$serviceType2;
21707
20922
  const tenantId = Digit.ULBService.getCurrentTenantId();
21708
20923
  const _useTranslation = reactI18next.useTranslation(),
21709
20924
  t = _useTranslation.t;
21710
20925
  const history = reactRouterDom.useHistory();
20926
+ const userInfo = (_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info;
20927
+ const userType = userInfo === null || userInfo === void 0 ? void 0 : userInfo.type;
21711
20928
  const _useState = React.useState(1),
21712
20929
  currentStep = _useState[0],
21713
20930
  setCurrentStep = _useState[1];
21714
20931
  const _useState2 = React.useState(null),
21715
20932
  showToast = _useState2[0],
21716
20933
  setShowToast = _useState2[1];
20934
+ const _useState3 = React.useState([]),
20935
+ genderMenu = _useState3[0],
20936
+ setGenderMenu = _useState3[1];
21717
20937
  const _Digit$Hooks$useSessi = Digit.Hooks.useSessionStorage("FSM_MUTATION_HAPPENED", false),
21718
20938
  setMutationHappened = _Digit$Hooks$useSessi[1];
21719
20939
  const _Digit$Hooks$useSessi2 = Digit.Hooks.useSessionStorage("FSM_ERROR_DATA", false),
21720
20940
  clearError = _Digit$Hooks$useSessi2[2];
21721
20941
  const _Digit$Hooks$useSessi3 = Digit.Hooks.useSessionStorage("FSM_MUTATION_SUCCESS_DATA", false),
21722
20942
  clearSuccessData = _Digit$Hooks$useSessi3[2];
20943
+ const stateId = Digit.ULBService.getStateId();
20944
+ const _Digit$Hooks$obps$use = Digit.Hooks.obps.useMDMS(stateId, "common-masters", ["GenderType"]),
20945
+ genderTypeData = _Digit$Hooks$obps$use.data;
20946
+ React.useEffect(() => {
20947
+ var _genderTypeData$commo, _genderTypeData$commo2;
20948
+ 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) {
20949
+ var _genderTypeData$commo3, _genderTypeData$commo4;
20950
+ 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 => ({
20951
+ i18nKey: "COMMON_GENDER_" + genderDetails.code,
20952
+ code: "" + genderDetails.code,
20953
+ value: "" + genderDetails.code
20954
+ }));
20955
+ setGenderMenu(menuItems);
20956
+ }
20957
+ }, [genderTypeData]);
21723
20958
  const _Digit$Hooks$fsm$useV = Digit.Hooks.fsm.useVendorCreate(tenantId),
21724
20959
  mutate = _Digit$Hooks$fsm$useV.mutate;
21725
20960
  React.useEffect(() => {
@@ -21739,19 +20974,19 @@ const AddVendor = _ref => {
21739
20974
  amount: null
21740
20975
  }
21741
20976
  };
21742
- const _useState3 = React.useState(defaultValues),
21743
- formData = _useState3[0],
21744
- setFormData = _useState3[1];
21745
- const Config = VendorConfig(t, false, formData);
20977
+ const _useState4 = React.useState(defaultValues),
20978
+ formData = _useState4[0],
20979
+ setFormData = _useState4[1];
20980
+ const Config = React__default.useMemo(() => {
20981
+ var _formData$serviceType;
20982
+ return VendorConfig(t, (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code, genderMenu);
20983
+ }, [t, formData === null || formData === void 0 ? void 0 : (_formData$serviceType2 = formData.serviceType) === null || _formData$serviceType2 === void 0 ? void 0 : _formData$serviceType2.i18nKey, genderMenu]);
21746
20984
  const onFormValueChange = (setValue, data) => {
21747
- var _data$zoneIds, _data$serviceType, _formData$serviceType, _data$serviceType2;
21748
- const currentZoneCodes = (data === null || data === void 0 ? void 0 : (_data$zoneIds = data.zoneIds) === null || _data$zoneIds === void 0 ? void 0 : _data$zoneIds.map(item => {
21749
- var _item$;
21750
- return item === null || item === void 0 ? void 0 : (_item$ = item[1]) === null || _item$ === void 0 ? void 0 : _item$.code;
21751
- })) || [];
20985
+ var _data$zoneIds, _data$serviceType, _formData$serviceType3, _data$serviceType2;
20986
+ 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)) || [];
21752
20987
  const previousZoneCodes = (formData === null || formData === void 0 ? void 0 : formData.zoneIds) || [];
21753
20988
  const zoneChanged = currentZoneCodes.join(",") !== previousZoneCodes.join(",");
21754
- 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) {
20989
+ 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) {
21755
20990
  setFormData(prev => _extends({}, prev, {
21756
20991
  serviceType: data === null || data === void 0 ? void 0 : data.serviceType
21757
20992
  }));
@@ -21761,6 +20996,19 @@ const AddVendor = _ref => {
21761
20996
  zoneIds: currentZoneCodes
21762
20997
  }));
21763
20998
  }
20999
+ const startDate = data === null || data === void 0 ? void 0 : data.contractStartDate;
21000
+ const endDate = data === null || data === void 0 ? void 0 : data.contractEndDate;
21001
+ if (startDate && endDate) {
21002
+ const isInvalid = new Date(endDate) < new Date(startDate);
21003
+ if (isInvalid && (showToast === null || showToast === void 0 ? void 0 : showToast.action) !== "INVALID_CONTRACT_DATE") {
21004
+ setShowToast({
21005
+ key: "error",
21006
+ action: "INVALID_CONTRACT_DATE"
21007
+ });
21008
+ } else if (!isInvalid && showToast) {
21009
+ setShowToast(null);
21010
+ }
21011
+ }
21764
21012
  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);
21765
21013
  if (isVendorDetailsFilled) {
21766
21014
  if (currentStep === 1) {
@@ -21871,10 +21119,7 @@ const AddVendor = _ref => {
21871
21119
  if (isEkyc) {
21872
21120
  var _mergedData$zoneIds, _mergedData$clusterId;
21873
21121
  vendorData = _extends({}, vendorData, {
21874
- zoneIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$zoneIds = mergedData.zoneIds) === null || _mergedData$zoneIds === void 0 ? void 0 : _mergedData$zoneIds.map(z => {
21875
- var _z$;
21876
- return z === null || z === void 0 ? void 0 : (_z$ = z[1]) === null || _z$ === void 0 ? void 0 : _z$.code;
21877
- })) || [],
21122
+ 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)) || [],
21878
21123
  clusterIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$clusterId = mergedData.clusterIds) === null || _mergedData$clusterId === void 0 ? void 0 : _mergedData$clusterId.map(c => {
21879
21124
  var _c$;
21880
21125
  return c === null || c === void 0 ? void 0 : (_c$ = c[1]) === null || _c$ === void 0 ? void 0 : _c$.code;
@@ -21898,17 +21143,18 @@ const AddVendor = _ref => {
21898
21143
  key: "error",
21899
21144
  action: error
21900
21145
  });
21901
- setTimeout(closeToast, 5000);
21902
21146
  },
21903
- onSuccess: (data, variables) => {
21904
- setShowToast({
21905
- key: "success",
21906
- action: "ADD_VENDOR"
21147
+ onSuccess: () => {
21148
+ history.push({
21149
+ pathname: "/digit-ui/" + userType + "/vendor/search-vendor",
21150
+ state: {
21151
+ showSuccessToast: true,
21152
+ message: {
21153
+ key: "success",
21154
+ action: "ES_VENDOR_ADD_VENDOR"
21155
+ }
21156
+ }
21907
21157
  });
21908
- setTimeout(() => {
21909
- closeToast();
21910
- history.push("/digit-ui/employee/vendor/search-vendor");
21911
- }, 2000);
21912
21158
  }
21913
21159
  });
21914
21160
  };
@@ -21935,7 +21181,7 @@ const AddVendor = _ref => {
21935
21181
  }
21936
21182
  }, /*#__PURE__*/React__default.createElement(digitUiReactComponents.FormComposer, {
21937
21183
  config: Config,
21938
- userType: "employee",
21184
+ userType: userType,
21939
21185
  onFormValueChange: onFormValueChange,
21940
21186
  label: t("ES_COMMON_APPLICATION_SUBMIT"),
21941
21187
  onSubmit: onSubmit,
@@ -21944,7 +21190,7 @@ const AddVendor = _ref => {
21944
21190
  noBreakLine: true
21945
21191
  }), showToast && /*#__PURE__*/React__default.createElement(digitUiReactComponents.Toast, {
21946
21192
  error: showToast.key === "error",
21947
- label: t(showToast.key === "success" ? "ES_FSM_REGISTRY_" + showToast.action + "_SUCCESS" : showToast.action),
21193
+ 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),
21948
21194
  onClose: closeToast
21949
21195
  })));
21950
21196
  };
@@ -22105,9 +21351,7 @@ const componentsToRegister = {
22105
21351
  FSMSelectRating: SelectRating,
22106
21352
  FSMDsoDashboard: DsoDashboard,
22107
21353
  FSMRegistry,
22108
- VendorDetails,
22109
21354
  AddVendor,
22110
- EditVendor,
22111
21355
  VehicleDetails,
22112
21356
  AddVehicle,
22113
21357
  EditVehicle,