@mseva/upyog-ui-module-chb 1.1.1 → 1.1.3

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.
@@ -47661,7 +47661,8 @@ const CHBCitizenDetailsNew = ({
47661
47661
  onGoBack
47662
47662
  }) => {
47663
47663
  var _user$info, _user$info2, _user$info3;
47664
- const tenantId = Digit.ULBService.getCurrentTenantId();
47664
+ const tenantId = window.location.href.includes("citizen") ? window.localStorage.getItem("CITIZEN.CITY") : window.localStorage.getItem("Employee.tenant-id");
47665
+ const isCitizen = window.location.href.includes("citizen");
47665
47666
  const stateId = Digit.ULBService.getStateId();
47666
47667
  const user = Digit.UserService.getUser();
47667
47668
  const [loader, setLoader] = useState(false);
@@ -47674,18 +47675,15 @@ const CHBCitizenDetailsNew = ({
47674
47675
  }
47675
47676
  } = useForm({
47676
47677
  defaultValues: {
47677
- name: (user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.name) || "",
47678
- emailId: (user === null || user === void 0 ? void 0 : (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : _user$info2.emailId) || "",
47679
- mobileNumber: (user === null || user === void 0 ? void 0 : (_user$info3 = user.info) === null || _user$info3 === void 0 ? void 0 : _user$info3.mobileNumber) || "",
47678
+ name: isCitizen && (user === null || user === void 0 ? void 0 : (_user$info = user.info) === null || _user$info === void 0 ? void 0 : _user$info.name) || "",
47679
+ emailId: isCitizen && (user === null || user === void 0 ? void 0 : (_user$info2 = user.info) === null || _user$info2 === void 0 ? void 0 : _user$info2.emailId) || "",
47680
+ mobileNumber: isCitizen && (user === null || user === void 0 ? void 0 : (_user$info3 = user.info) === null || _user$info3 === void 0 ? void 0 : _user$info3.mobileNumber) || "",
47680
47681
  address: ""
47681
47682
  }
47682
47683
  });
47683
47684
  const onSubmit = async data => {
47684
47685
  var _currentStepData$venu, _currentStepData$venu2;
47685
47686
  setLoader(true);
47686
- console.log("data", data);
47687
- console.log("user", user);
47688
- console.log("currentStepData", currentStepData);
47689
47687
  if (currentStepData !== null && currentStepData !== void 0 && (_currentStepData$venu = currentStepData.venueDetails) !== null && _currentStepData$venu !== void 0 && (_currentStepData$venu2 = _currentStepData$venu[0]) !== null && _currentStepData$venu2 !== void 0 && _currentStepData$venu2.bookingNo) {
47690
47688
  goNext(currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.venueDetails);
47691
47689
  } else {
@@ -47715,10 +47713,8 @@ const CHBCitizenDetailsNew = ({
47715
47713
  owners
47716
47714
  }
47717
47715
  };
47718
- console.log("final payload", payload);
47719
47716
  try {
47720
47717
  const response = await Digit.CHBServices.create(payload);
47721
- console.log("response", response);
47722
47718
  setLoader(false);
47723
47719
  goNext(response === null || response === void 0 ? void 0 : response.hallsBookingApplication);
47724
47720
  } catch (error) {
@@ -47728,7 +47724,6 @@ const CHBCitizenDetailsNew = ({
47728
47724
  };
47729
47725
  useEffect(() => {
47730
47726
  var _currentStepData$venu3;
47731
- console.log("currentStepData", currentStepData);
47732
47727
  const formattedData = currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$venu3 = currentStepData.venueDetails) === null || _currentStepData$venu3 === void 0 ? void 0 : _currentStepData$venu3[0];
47733
47728
  if (formattedData) {
47734
47729
  var _formattedData$addres, _formattedData$applic;
@@ -48094,7 +48089,7 @@ function CHBSummary({
48094
48089
  goNext,
48095
48090
  onGoBack
48096
48091
  }) {
48097
- var _formData$documents, _formData$documents$d, _formData$apiData, _formData$apiData$App, _formData$apiData$App2, _formData$venueDetail, _formData$venueDetail2, _user$info, _user$info$roles, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _formData$venueDetail3, _formData$venueDetail4, _formData$venueDetail5, _formData$venueDetail0, _formData$venueDetail1, _formData$venueDetail10, _formData$venueDetail11, _formData$venueDetail12, _formData$venueDetail13, _formData$venueDetail14, _formData$venueDetail15, _formData$venueDetail16, _formData$venueDetail17, _formData$venueDetail18, _formData$venueDetail19, _formData$venueDetail20, _formData$venueDetail21, _formData$venueDetail22, _formData$venueDetail23, _formData$venueDetail24, _formData$venueDetail25, _formData$venueDetail26, _formData$venueDetail27, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8;
48092
+ var _formData$documents, _formData$documents$d, _formData$apiData, _formData$apiData$App, _formData$apiData$App2, _formData$venueDetail, _formData$venueDetail2, _user$info, _user$info$roles, _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _workflowDetails$data5, _formData$venueDetail3, _formData$venueDetail4, _formData$venueDetail5, _formData$venueDetail0, _formData$venueDetail1, _formData$venueDetail10, _formData$venueDetail11, _formData$venueDetail12, _formData$venueDetail13, _formData$venueDetail14, _formData$venueDetail15, _formData$venueDetail16, _formData$venueDetail17, _formData$venueDetail18, _formData$venueDetail19, _formData$ownerDetail, _formData$ownerDetail2, _formData$ownerDetail3, _formData$ownerDetail4, _formData$ownerDetail5, _formData$ownerDetail6, _formData$ownerDetail7, _formData$ownerDetail8, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8;
48098
48093
  const {
48099
48094
  pathname: url
48100
48095
  } = useLocation();
@@ -48215,7 +48210,7 @@ function CHBSummary({
48215
48210
  style: {
48216
48211
  fontSize: "24px"
48217
48212
  }
48218
- }, t("CHB_EVENT_DETAILS")), renderLabel(t("CHB_SPECIAL_CATEGORY"), formData === null || formData === void 0 ? void 0 : (_formData$venueDetail20 = formData.venueDetails) === null || _formData$venueDetail20 === void 0 ? void 0 : (_formData$venueDetail21 = _formData$venueDetail20[0]) === null || _formData$venueDetail21 === void 0 ? void 0 : (_formData$venueDetail22 = _formData$venueDetail21.specialCategory) === null || _formData$venueDetail22 === void 0 ? void 0 : _formData$venueDetail22.category), renderLabel(t("CHB_PURPOSE"), formData === null || formData === void 0 ? void 0 : (_formData$venueDetail23 = formData.venueDetails) === null || _formData$venueDetail23 === void 0 ? void 0 : (_formData$venueDetail24 = _formData$venueDetail23[0]) === null || _formData$venueDetail24 === void 0 ? void 0 : (_formData$venueDetail25 = _formData$venueDetail24.purpose) === null || _formData$venueDetail25 === void 0 ? void 0 : _formData$venueDetail25.purpose), renderLabel(t("CHB_PURPOSE_DESCRIPTION"), formData === null || formData === void 0 ? void 0 : (_formData$venueDetail26 = formData.venueDetails) === null || _formData$venueDetail26 === void 0 ? void 0 : (_formData$venueDetail27 = _formData$venueDetail26[0]) === null || _formData$venueDetail27 === void 0 ? void 0 : _formData$venueDetail27.purposeDescription)), /*#__PURE__*/React.createElement(ApplicationTable, {
48213
+ }, t("CHB_EVENT_DETAILS")), renderLabel(t("CHB_SPECIAL_CATEGORY"), formData === null || formData === void 0 ? void 0 : (_formData$ownerDetail = formData.ownerDetails) === null || _formData$ownerDetail === void 0 ? void 0 : (_formData$ownerDetail2 = _formData$ownerDetail.hallsBookingApplication) === null || _formData$ownerDetail2 === void 0 ? void 0 : (_formData$ownerDetail3 = _formData$ownerDetail2.specialCategory) === null || _formData$ownerDetail3 === void 0 ? void 0 : _formData$ownerDetail3.category), renderLabel(t("CHB_PURPOSE"), formData === null || formData === void 0 ? void 0 : (_formData$ownerDetail4 = formData.ownerDetails) === null || _formData$ownerDetail4 === void 0 ? void 0 : (_formData$ownerDetail5 = _formData$ownerDetail4.hallsBookingApplication) === null || _formData$ownerDetail5 === void 0 ? void 0 : (_formData$ownerDetail6 = _formData$ownerDetail5.purpose) === null || _formData$ownerDetail6 === void 0 ? void 0 : _formData$ownerDetail6.purpose), renderLabel(t("CHB_PURPOSE_DESCRIPTION"), formData === null || formData === void 0 ? void 0 : (_formData$ownerDetail7 = formData.ownerDetails) === null || _formData$ownerDetail7 === void 0 ? void 0 : (_formData$ownerDetail8 = _formData$ownerDetail7.hallsBookingApplication) === null || _formData$ownerDetail8 === void 0 ? void 0 : _formData$ownerDetail8.purposeDescription)), /*#__PURE__*/React.createElement(ApplicationTable, {
48219
48214
  t: t,
48220
48215
  data: slotlistRows,
48221
48216
  columns: columns,
@@ -48286,15 +48281,11 @@ const NewADSStepFormFour = ({
48286
48281
  const currentStepData = useSelector(function (state) {
48287
48282
  return state.chb.CHBApplicationFormReducer.formData || {};
48288
48283
  });
48289
- console.log("currentStepData===", currentStepData);
48290
48284
  const goNext = async data => {
48291
- console.log("data", data);
48292
- console.log("currentStepData", currentStepData);
48293
48285
  const actionStatus = data === null || data === void 0 ? void 0 : data.action;
48294
48286
  try {
48295
48287
  var _res$response, _res$response$hallsBo, _res$response$hallsBo2;
48296
48288
  const res = await onSubmit(currentStepData, actionStatus);
48297
- console.log("res", res);
48298
48289
  const id = res === null || res === void 0 ? void 0 : (_res$response = res.response) === null || _res$response === void 0 ? void 0 : (_res$response$hallsBo = _res$response.hallsBookingApplication) === null || _res$response$hallsBo === void 0 ? void 0 : (_res$response$hallsBo2 = _res$response$hallsBo[0]) === null || _res$response$hallsBo2 === void 0 ? void 0 : _res$response$hallsBo2.bookingNo;
48299
48290
  if (res !== null && res !== void 0 && res.isSuccess) {
48300
48291
  if (isCitizen) {
@@ -48310,10 +48301,12 @@ const NewADSStepFormFour = ({
48310
48301
  }
48311
48302
  };
48312
48303
  function mapToNDCPayload(inputData, actionStatus) {
48313
- var _inputData$venueDetai, _ref, _inputData$documents, _inputData$documents$;
48304
+ var _inputData$venueDetai, _currentStepData$owne, _ref, _inputData$documents, _inputData$documents$;
48314
48305
  const baseApplication = (inputData === null || inputData === void 0 ? void 0 : (_inputData$venueDetai = inputData.venueDetails) === null || _inputData$venueDetai === void 0 ? void 0 : _inputData$venueDetai[0]) || {};
48306
+ const hallInfo = (currentStepData === null || currentStepData === void 0 ? void 0 : (_currentStepData$owne = currentStepData.ownerDetails) === null || _currentStepData$owne === void 0 ? void 0 : _currentStepData$owne.hallsBookingApplication) || {};
48315
48307
  const updatedApplication = {
48316
48308
  ...baseApplication,
48309
+ ...hallInfo,
48317
48310
  workflow: {
48318
48311
  ...(baseApplication === null || baseApplication === void 0 ? void 0 : baseApplication.workflow),
48319
48312
  action: actionStatus
@@ -48335,12 +48328,10 @@ const NewADSStepFormFour = ({
48335
48328
  const onSubmit = async (data, actionStatus) => {
48336
48329
  var _response$responseInf;
48337
48330
  const finalPayload = mapToNDCPayload(data, actionStatus);
48338
- console.log("finalPayload", finalPayload);
48339
48331
  const response = await Digit.CHBServices.update({
48340
48332
  tenantId,
48341
48333
  ...finalPayload
48342
48334
  });
48343
- console.log("response", response);
48344
48335
  dispatch(RESET_CHB_APPLICATION_FORM());
48345
48336
  if ((response === null || response === void 0 ? void 0 : (_response$responseInf = response.responseInfo) === null || _response$responseInf === void 0 ? void 0 : _response$responseInf.status) == "SUCCESSFUL") {
48346
48337
  return {