@mseva/digit-ui-module-ndc 1.0.37 → 1.0.38

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.
@@ -11952,7 +11952,7 @@ const NewNDCStepFormOne = ({
11952
11952
  }
11953
11953
  };
11954
11954
  const updateApplication = async data => {
11955
- var _Digit$UserService$ge2, _user$info5, _user$info6, _data$PropertyDetails1, _user$info7, _user$info8, _checkFormData$respon3, _checkFormData$respon4, _checkFormData$respon5, _data$NDCReason2, _data$cpt1, _data$cpt1$details, _response$ResponseInf2;
11955
+ var _Digit$UserService$ge2, _user$info5, _user$info6, _data$PropertyDetails1, _user$info7, _user$info8, _checkFormData$respon3, _checkFormData$respon4, _checkFormData$respon5, _data$NDCReason2, _data$cpt1, _data$cpt1$details, _checkFormData$respon6, _checkFormData$respon7, _response$ResponseInf2;
11956
11956
  const applicant = ((_Digit$UserService$ge2 = Digit.UserService.getUser()) === null || _Digit$UserService$ge2 === void 0 ? void 0 : _Digit$UserService$ge2.info) || {};
11957
11957
  const applicantId = applicant === null || applicant === void 0 ? void 0 : applicant.uuid;
11958
11958
  console.log("data===?????", data);
@@ -12025,7 +12025,8 @@ const NewNDCStepFormOne = ({
12025
12025
  active: true,
12026
12026
  reason: data === null || data === void 0 ? void 0 : (_data$NDCReason2 = data.NDCReason) === null || _data$NDCReason2 === void 0 ? void 0 : _data$NDCReason2.code,
12027
12027
  auditDetails: data === null || data === void 0 ? void 0 : (_data$cpt1 = data.cpt) === null || _data$cpt1 === void 0 ? void 0 : (_data$cpt1$details = _data$cpt1.details) === null || _data$cpt1$details === void 0 ? void 0 : _data$cpt1$details.auditDetails,
12028
- uuid: id,
12028
+ applicationNo: id,
12029
+ uuid: checkFormData === null || checkFormData === void 0 ? void 0 : (_checkFormData$respon6 = checkFormData.responseData) === null || _checkFormData$respon6 === void 0 ? void 0 : (_checkFormData$respon7 = _checkFormData$respon6[0]) === null || _checkFormData$respon7 === void 0 ? void 0 : _checkFormData$respon7.uuid,
12029
12030
  workflow: {
12030
12031
  action: "DRAFT"
12031
12032
  }
@@ -13424,7 +13425,7 @@ const SelectNDCDocuments = ({
13424
13425
  goNext();
13425
13426
  }, [documents]);
13426
13427
  if (isLoading) {
13427
- return /*#__PURE__*/React.createElement(Loader$1, null);
13428
+ return /*#__PURE__*/React.createElement(Loader, null);
13428
13429
  }
13429
13430
  return /*#__PURE__*/React.createElement("div", null, ndcDocuments === null || ndcDocuments === void 0 ? void 0 : ndcDocuments.map((document, index) => {
13430
13431
  return /*#__PURE__*/React.createElement(SelectDocument, {
@@ -13464,6 +13465,7 @@ function SelectDocument({
13464
13465
  return item === null || item === void 0 ? void 0 : (_item$documentType = item.documentType) === null || _item$documentType === void 0 ? void 0 : _item$documentType.includes(doc === null || doc === void 0 ? void 0 : doc.code);
13465
13466
  })[0];
13466
13467
  const tenantId = Digit.ULBService.getCurrentTenantId();
13468
+ const [getLoader, setLoader] = useState(false);
13467
13469
  const [file, setFile] = useState(null);
13468
13470
  const [uploadedFile, setUploadedFile] = useState(() => (filteredDocument === null || filteredDocument === void 0 ? void 0 : filteredDocument.fileStoreId) || null);
13469
13471
  function selectfile(e) {
@@ -13496,8 +13498,10 @@ function SelectDocument({
13496
13498
  (async () => {
13497
13499
  setError(null);
13498
13500
  if (file) {
13501
+ setLoader(true);
13499
13502
  if (file.size >= 5242880) {
13500
13503
  setError(t("CS_MAXIMUM_UPLOAD_SIZE_EXCEEDED"));
13504
+ setLoader(false);
13501
13505
  if (!formState.errors[config.key]) setFormError(config.key, {
13502
13506
  type: doc === null || doc === void 0 ? void 0 : doc.code
13503
13507
  });
@@ -13506,6 +13510,7 @@ function SelectDocument({
13506
13510
  var _response$data, _response$data$files;
13507
13511
  setUploadedFile(null);
13508
13512
  const response = await Digit.UploadServices.Filestorage("PT", file, Digit.ULBService.getStateId());
13513
+ setLoader(false);
13509
13514
  if ((response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : (_response$data$files = _response$data.files) === null || _response$data$files === void 0 ? void 0 : _response$data$files.length) > 0) {
13510
13515
  var _response$data2, _response$data2$files;
13511
13516
  setUploadedFile(response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : (_response$data2$files = _response$data2.files[0]) === null || _response$data2$files === void 0 ? void 0 : _response$data2$files.fileStoreId);
@@ -13513,6 +13518,7 @@ function SelectDocument({
13513
13518
  setError(t("CS_FILE_UPLOAD_ERROR"));
13514
13519
  }
13515
13520
  } catch (err) {
13521
+ setLoader(false);
13516
13522
  setError(t("CS_FILE_UPLOAD_ERROR"));
13517
13523
  }
13518
13524
  }
@@ -13538,7 +13544,9 @@ function SelectDocument({
13538
13544
  width: "100%"
13539
13545
  },
13540
13546
  accept: "image/*,.pdf"
13541
- }))));
13547
+ }))), getLoader && /*#__PURE__*/React.createElement(Loader, {
13548
+ page: true
13549
+ }));
13542
13550
  }
13543
13551
 
13544
13552
  const NewNDCStepFormTwo = ({
@@ -13872,8 +13880,10 @@ const NDCNewFormSummaryStepThreeCitizen = ({
13872
13880
  const tenantId = window.localStorage.getItem("CITIZEN.CITY");
13873
13881
  const user = Digit.UserService.getUser();
13874
13882
  const formData = useSelector(state => state.ndc.NDCForm.formData || {});
13883
+ console.log("formData 4th step", formData);
13875
13884
  const goNext = async action => {
13876
13885
  const actionStatus = action === null || action === void 0 ? void 0 : action.action;
13886
+ console.log("actionStatus", actionStatus);
13877
13887
  try {
13878
13888
  const res = await onSubmit(formData, actionStatus);
13879
13889
  if (res !== null && res !== void 0 && res.isSuccess) {
@@ -13889,7 +13899,7 @@ const NDCNewFormSummaryStepThreeCitizen = ({
13889
13899
  function mapToNDCPayload(inputData, actionStatus) {
13890
13900
  var _Digit$UserService$ge, _user$info, _user$info2, _formData$NDCDetails, _formData$NDCDetails$, _user$info3, _user$info4, _formData$responseDat, _formData$apiData, _formData$apiData$App, _inputData$DocummentD, _inputData$DocummentD2;
13891
13901
  const applicant = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
13892
- console.log("formData mobile number", formData);
13902
+ console.log("inputData", inputData);
13893
13903
  const owners = [{
13894
13904
  name: user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.name,
13895
13905
  mobileNumber: user === null || user === void 0 ? void 0 : (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : _user$info2.mobileNumber,
@@ -13898,6 +13908,7 @@ const NDCNewFormSummaryStepThreeCitizen = ({
13898
13908
  type: user === null || user === void 0 ? void 0 : (_user$info4 = user.info) === null || _user$info4 === void 0 ? void 0 : _user$info4.type
13899
13909
  }];
13900
13910
  const baseApplication = (formData === null || formData === void 0 ? void 0 : (_formData$responseDat = formData.responseData) === null || _formData$responseDat === void 0 ? void 0 : _formData$responseDat[0]) || (formData === null || formData === void 0 ? void 0 : (_formData$apiData = formData.apiData) === null || _formData$apiData === void 0 ? void 0 : (_formData$apiData$App = _formData$apiData.Applications) === null || _formData$apiData$App === void 0 ? void 0 : _formData$apiData$App[0]) || {};
13911
+ console.log("baseApplication", baseApplication);
13901
13912
  const updatedApplication = {
13902
13913
  ...baseApplication,
13903
13914
  workflow: {
@@ -13918,14 +13929,16 @@ const NDCNewFormSummaryStepThreeCitizen = ({
13918
13929
  const payload = {
13919
13930
  Applications: [updatedApplication]
13920
13931
  };
13932
+ console.log("updatedApplication", updatedApplication);
13921
13933
  return payload;
13922
13934
  }
13923
13935
  const onSubmit = async (data, actionStatus) => {
13924
13936
  var _response$ResponseInf;
13925
13937
  const finalPayload = mapToNDCPayload(data, actionStatus);
13938
+ console.log("finalPayload", finalPayload);
13926
13939
  const response = await Digit.NDCService.NDCUpdate({
13927
13940
  tenantId,
13928
- finalPayload
13941
+ details: finalPayload
13929
13942
  });
13930
13943
  dispatch(resetNDCForm());
13931
13944
  if ((response === null || response === void 0 ? void 0 : (_response$ResponseInf = response.ResponseInfo) === null || _response$ResponseInf === void 0 ? void 0 : _response$ResponseInf.status) === "successful") {