@djb25/digit-ui-module-wt 1.0.55 → 1.0.56

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.
@@ -159,7 +159,7 @@ const VerticalTimeline = ({
159
159
  steps.push({
160
160
  key: "final-submit",
161
161
  label: "Review & Submit",
162
- routes: ["check", "wt-acknowledgement", "mt-acknowledgement", "tp-acknowledgement"],
162
+ routes: ["check", "wt-acknowledgement", "mt-acknowledgement", "tp-acknowledgement", "fp-check", "fp-wt-acknowledgement"],
163
163
  stepNumber: steps.length + 1
164
164
  });
165
165
  }
@@ -28004,7 +28004,7 @@ const WTEmergencyFixedPointCheckPage = ({
28004
28004
  onSubmit,
28005
28005
  value: _value = {}
28006
28006
  }) => {
28007
- var _serviceType$serviceT, _serviceType$serviceT2, _owner$isExistingFixe, _address$city, _address$city$city, _address$locality, _dispatchDetails$fill, _dispatchDetails$vend, _dispatchDetails$vehi, _dispatchDetails$driv, _requestDetails$tanke, _requestDetails$water, _requestDetails$tanke2, _requestDetails$water2, _serviceType$serviceT3, _toiletRequestDetails, _serviceType$serviceT4, _treePruningRequestDe;
28007
+ var _serviceType$serviceT, _serviceType$serviceT2, _owner$isExistingFixe, _address$city, _address$city$city, _address$locality, _address$assembly, _address$block, _address$ward, _address$zone, _dispatchDetails$fill, _dispatchDetails$vend, _dispatchDetails$vehi, _dispatchDetails$driv, _requestDetails$tanke, _requestDetails$water, _requestDetails$tanke2, _requestDetails$water2, _serviceType$serviceT3, _toiletRequestDetails, _serviceType$serviceT4, _treePruningRequestDe;
28008
28008
  const {
28009
28009
  t
28010
28010
  } = useTranslation();
@@ -28039,7 +28039,7 @@ const WTEmergencyFixedPointCheckPage = ({
28039
28039
  }, [requestDetails === null || requestDetails === void 0 ? void 0 : requestDetails.fileStoreId]);
28040
28040
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Card, {
28041
28041
  className: "overflow-y-scroll"
28042
- }, /*#__PURE__*/React.createElement(CardHeader, null, t("WT_SUMMARY_PAGE")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("ES_TITILE_OWNER_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
28042
+ }, /*#__PURE__*/React.createElement(CardHeader, null, t("WT_SUMMARY_PAGE")), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("ES_APPLICANT_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, {
28043
28043
  style: {
28044
28044
  marginTop: "30px",
28045
28045
  marginBottom: "30px"
@@ -28085,6 +28085,21 @@ const WTEmergencyFixedPointCheckPage = ({
28085
28085
  }), /*#__PURE__*/React.createElement(Row, {
28086
28086
  label: t("PINCODE"),
28087
28087
  text: `${t(checkForNA(address === null || address === void 0 ? void 0 : address.pincode))}`
28088
+ }), /*#__PURE__*/React.createElement(Row, {
28089
+ label: t("LATITUDE"),
28090
+ text: `${t(checkForNA(address === null || address === void 0 ? void 0 : address.latitude))}`
28091
+ }), /*#__PURE__*/React.createElement(Row, {
28092
+ label: t("LONGITUDE"),
28093
+ text: `${t(checkForNA(address === null || address === void 0 ? void 0 : address.longitude))}`
28094
+ }), /*#__PURE__*/React.createElement(Row, {
28095
+ label: t("ASSEMBLY"),
28096
+ text: `${t(checkForNA(typeof (address === null || address === void 0 ? void 0 : address.assembly) === 'string' ? address === null || address === void 0 ? void 0 : address.assembly : address === null || address === void 0 ? void 0 : (_address$assembly = address.assembly) === null || _address$assembly === void 0 ? void 0 : _address$assembly.name))}`
28097
+ }), /*#__PURE__*/React.createElement(Row, {
28098
+ label: t("BLOCK"),
28099
+ text: `${t(checkForNA(typeof (address === null || address === void 0 ? void 0 : address.block) === 'string' ? address === null || address === void 0 ? void 0 : address.block : (address === null || address === void 0 ? void 0 : (_address$block = address.block) === null || _address$block === void 0 ? void 0 : _address$block.name) || (address === null || address === void 0 ? void 0 : (_address$ward = address.ward) === null || _address$ward === void 0 ? void 0 : _address$ward.name)))}`
28100
+ }), /*#__PURE__*/React.createElement(Row, {
28101
+ label: t("ZONE"),
28102
+ text: `${t(checkForNA(typeof (address === null || address === void 0 ? void 0 : address.zone) === 'string' ? address === null || address === void 0 ? void 0 : address.zone : address === null || address === void 0 ? void 0 : (_address$zone = address.zone) === null || _address$zone === void 0 ? void 0 : _address$zone.name))}`
28088
28103
  }), /*#__PURE__*/React.createElement(Row, {
28089
28104
  label: t("LANDMARK"),
28090
28105
  text: `${t(checkForNA(address === null || address === void 0 ? void 0 : address.landmark))}`
@@ -28507,7 +28522,6 @@ const fixedPointConfig = [{
28507
28522
  nextStep: "fp-address-details",
28508
28523
  isMandatory: true,
28509
28524
  texts: {
28510
- submitBarLabel: "COMMON_SAVE_NEXT",
28511
28525
  header: "ES_APPLICANT_DETAILS"
28512
28526
  },
28513
28527
  timeLine: [{
@@ -28526,7 +28540,6 @@ const fixedPointConfig = [{
28526
28540
  isMandatory: true,
28527
28541
  nextStep: "fp-dispatch-details",
28528
28542
  texts: {
28529
- submitBarLabel: "COMMON_SAVE_NEXT",
28530
28543
  header: "ES_ADDRESS_DETAILS"
28531
28544
  },
28532
28545
  timeLine: [{
@@ -28545,7 +28558,6 @@ const fixedPointConfig = [{
28545
28558
  isMandatory: true,
28546
28559
  nextStep: "fp-request-details",
28547
28560
  texts: {
28548
- submitBarLabel: "COMMON_SAVE_NEXT",
28549
28561
  header: "WT_DISPATCH_DETAILS"
28550
28562
  },
28551
28563
  timeLine: [{
@@ -28564,7 +28576,7 @@ const fixedPointConfig = [{
28564
28576
  isMandatory: true,
28565
28577
  nextStep: null,
28566
28578
  texts: {
28567
- submitBarLabel: "COMMON_SAVE_NEXT",
28579
+ submitBarLabel: "CS_COMMON_SAVE",
28568
28580
  header: "WT_REQUEST_DETAILS"
28569
28581
  },
28570
28582
  timeLine: [{
@@ -28664,13 +28676,25 @@ const WTEmergencyFixedPointCreate = () => {
28664
28676
  ...newParams[k],
28665
28677
  ...data[k]
28666
28678
  };
28667
- if (JSON.stringify(newParams[k]) !== JSON.stringify(updatedValue)) {
28679
+ let isDifferent = true;
28680
+ try {
28681
+ isDifferent = JSON.stringify(newParams[k]) !== JSON.stringify(updatedValue);
28682
+ } catch (e) {
28683
+ isDifferent = Object.keys(updatedValue).some(key => {
28684
+ var _newParams$k;
28685
+ return ((_newParams$k = newParams[k]) === null || _newParams$k === void 0 ? void 0 : _newParams$k[key]) !== updatedValue[key];
28686
+ });
28687
+ }
28688
+ if (isDifferent) {
28668
28689
  newParams[k] = updatedValue;
28669
28690
  hasChanged = true;
28670
28691
  }
28671
28692
  }
28672
28693
  });
28673
- if (hasChanged) setParams(newParams);
28694
+ if (hasChanged) {
28695
+ setParams(newParams);
28696
+ paramsRef.current = newParams;
28697
+ }
28674
28698
  if (data.silent) return;
28675
28699
  const navigationKey = data.navigationKey || Object.keys(data)[0];
28676
28700
  goNext(skipStep, index, isAddMultiple, navigationKey);
@@ -28678,30 +28702,63 @@ const WTEmergencyFixedPointCreate = () => {
28678
28702
  }
28679
28703
  if (key === "owners") {
28680
28704
  let owners = currentParams.owners || [];
28681
- if (JSON.stringify(owners[index]) !== JSON.stringify(data)) {
28705
+ let isDifferent = true;
28706
+ try {
28707
+ isDifferent = JSON.stringify(owners[index]) !== JSON.stringify(data);
28708
+ } catch (e) {
28709
+ isDifferent = Object.keys(data).some(k => {
28710
+ var _owners$index;
28711
+ return ((_owners$index = owners[index]) === null || _owners$index === void 0 ? void 0 : _owners$index[k]) !== data[k];
28712
+ });
28713
+ }
28714
+ if (isDifferent) {
28682
28715
  owners[index] = data;
28683
- setParams({
28716
+ const newParams = {
28684
28717
  ...currentParams,
28685
28718
  [key]: [...owners]
28686
- });
28719
+ };
28720
+ setParams(newParams);
28721
+ paramsRef.current = newParams;
28687
28722
  }
28688
28723
  } else if (key === "units") {
28689
- if (JSON.stringify(currentParams.units) !== JSON.stringify(data)) {
28690
- setParams({
28724
+ let isDifferent = true;
28725
+ try {
28726
+ isDifferent = JSON.stringify(currentParams.units) !== JSON.stringify(data);
28727
+ } catch (e) {
28728
+ isDifferent = Object.keys(data).some(k => {
28729
+ var _currentParams$units;
28730
+ return ((_currentParams$units = currentParams.units) === null || _currentParams$units === void 0 ? void 0 : _currentParams$units[k]) !== data[k];
28731
+ });
28732
+ }
28733
+ if (isDifferent) {
28734
+ const newParams = {
28691
28735
  ...currentParams,
28692
28736
  units: data
28693
- });
28737
+ };
28738
+ setParams(newParams);
28739
+ paramsRef.current = newParams;
28694
28740
  }
28695
28741
  } else {
28696
28742
  const updatedValue = {
28697
28743
  ...currentParams[key],
28698
28744
  ...data
28699
28745
  };
28700
- if (JSON.stringify(currentParams[key]) !== JSON.stringify(updatedValue)) {
28701
- setParams({
28746
+ let isDifferent = true;
28747
+ try {
28748
+ isDifferent = JSON.stringify(currentParams[key]) !== JSON.stringify(updatedValue);
28749
+ } catch (e) {
28750
+ isDifferent = Object.keys(updatedValue).some(k => {
28751
+ var _currentParams$key;
28752
+ return ((_currentParams$key = currentParams[key]) === null || _currentParams$key === void 0 ? void 0 : _currentParams$key[k]) !== updatedValue[k];
28753
+ });
28754
+ }
28755
+ if (isDifferent) {
28756
+ const newParams = {
28702
28757
  ...currentParams,
28703
28758
  [key]: updatedValue
28704
- });
28759
+ };
28760
+ setParams(newParams);
28761
+ paramsRef.current = newParams;
28705
28762
  }
28706
28763
  }
28707
28764
  if (data !== null && data !== void 0 && data.silent) return;
@@ -28989,6 +29046,44 @@ const EmergencyFixedPointApplicantDetails = ({
28989
29046
  onSelect(config.key, applicantDetails, false);
28990
29047
  }
28991
29048
  };
29049
+ const lastSentValue = React.useRef(null);
29050
+ React.useEffect(() => {
29051
+ let finalApplicantName = "";
29052
+ if ((isExistingFixedPoint === null || isExistingFixedPoint === void 0 ? void 0 : isExistingFixedPoint.code) === "YES") {
29053
+ var _fixedPoint$applicant2;
29054
+ finalApplicantName = (fixedPoint === null || fixedPoint === void 0 ? void 0 : (_fixedPoint$applicant2 = fixedPoint.applicantDetail) === null || _fixedPoint$applicant2 === void 0 ? void 0 : _fixedPoint$applicant2.name) || (fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.name) || "";
29055
+ } else {
29056
+ finalApplicantName = typeof fixedPoint === "string" ? fixedPoint : (fixedPoint === null || fixedPoint === void 0 ? void 0 : fixedPoint.name) || "";
29057
+ }
29058
+ let applicantDetails = {
29059
+ applicantName: finalApplicantName,
29060
+ mobileNumber,
29061
+ gender,
29062
+ dateOfBirth,
29063
+ alternateNumber,
29064
+ relationShipType,
29065
+ guardianName,
29066
+ emailId,
29067
+ fixedPoint,
29068
+ isExistingFixedPoint
29069
+ };
29070
+ let isDifferent = true;
29071
+ try {
29072
+ isDifferent = JSON.stringify(lastSentValue.current) !== JSON.stringify(applicantDetails);
29073
+ } catch (e) {
29074
+ isDifferent = Object.keys(applicantDetails).some(k => {
29075
+ var _lastSentValue$curren;
29076
+ return ((_lastSentValue$curren = lastSentValue.current) === null || _lastSentValue$curren === void 0 ? void 0 : _lastSentValue$curren[k]) !== applicantDetails[k];
29077
+ });
29078
+ }
29079
+ if (isDifferent) {
29080
+ lastSentValue.current = applicantDetails;
29081
+ onSelect(config.key, {
29082
+ ...applicantDetails,
29083
+ silent: true
29084
+ }, false);
29085
+ }
29086
+ }, [fixedPoint, isExistingFixedPoint, mobileNumber, gender, dateOfBirth, alternateNumber, relationShipType, guardianName, emailId, onSelect, config.key]);
28992
29087
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
28993
29088
  config: config,
28994
29089
  onSelect: goNext,
@@ -29259,6 +29354,31 @@ const EmergencyFixedPointDispatchDetails = ({
29259
29354
  driver
29260
29355
  }, false);
29261
29356
  };
29357
+ const lastSentValue = React.useRef(null);
29358
+ React.useEffect(() => {
29359
+ const dispatchDetails = {
29360
+ fillingPoint,
29361
+ vendor,
29362
+ vehicle,
29363
+ driver
29364
+ };
29365
+ let isDifferent = true;
29366
+ try {
29367
+ isDifferent = JSON.stringify(lastSentValue.current) !== JSON.stringify(dispatchDetails);
29368
+ } catch (e) {
29369
+ isDifferent = Object.keys(dispatchDetails).some(k => {
29370
+ var _lastSentValue$curren;
29371
+ return ((_lastSentValue$curren = lastSentValue.current) === null || _lastSentValue$curren === void 0 ? void 0 : _lastSentValue$curren[k]) !== dispatchDetails[k];
29372
+ });
29373
+ }
29374
+ if (isDifferent) {
29375
+ lastSentValue.current = dispatchDetails;
29376
+ onSelect(config.key, {
29377
+ ...dispatchDetails,
29378
+ silent: true
29379
+ }, false);
29380
+ }
29381
+ }, [fillingPoint, vendor, vehicle, driver, onSelect, config.key]);
29262
29382
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormStep, {
29263
29383
  config: config,
29264
29384
  onSelect: goNext,