@mseva/digit-ui-module-ndc 1.0.72-dev.1.1 → 1.0.72-dev.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.
@@ -1,9 +1,9 @@
1
- import { Card, Banner, ActionBar, SubmitBar as SubmitBar$1, PrivateRoute, BreadCrumb, AppContainer, Dropdown, UploadFile, Modal, FormComposer, Toast, Loader as Loader$1, LinkButton, CardSubHeader, StatusTable, Row, TextInput, CardLabel, FilterFormField, RadioButtons, Menu, EmployeeModuleCard, SearchField, ComplaintIcon, InboxComposer, FilterForm, Table, MobileNumber, CardLabelError, SearchAction, PopUp, DetailsCard, SearchForm, CloseSvg, CardHeader, LabelFieldPair, DeleteIcon, Header, KeyNote } from '@mseva/digit-ui-react-components';
1
+ import { Card, Banner, ActionBar, SubmitBar as SubmitBar$1, PrivateRoute, BreadCrumb, AppContainer, Dropdown, UploadFile, Modal, FormComposer, Toast, Loader as Loader$1, MultiLink, CardSubHeader, StatusTable, Row, TextInput, CardLabel, FilterFormField, RadioButtons, Menu, EmployeeModuleCard, SearchField, CheckBox, ComplaintIcon, Header, InboxComposer, MobileNumber, CardLabelError, SearchAction, PopUp, DetailsCard, SearchForm, CloseSvg, Table, CardHeader, LabelFieldPair, DeleteIcon, KeyNote } from '@mseva/digit-ui-react-components';
2
2
  import React, { Fragment as Fragment$1, useState, useEffect, useMemo, useRef, useReducer, useCallback, forwardRef } from 'react';
3
3
  import { useHistory, useLocation, Switch, Route, useRouteMatch, useParams, Link } from 'react-router-dom';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { useDispatch, useSelector } from 'react-redux';
6
- import { useForm, Controller, useController, useFormContext, FormProvider, useFieldArray } from 'react-hook-form';
6
+ import { useForm, Controller, useFormContext, FormProvider, useFieldArray } from 'react-hook-form';
7
7
  import 'react-query';
8
8
  import { combineReducers } from 'redux';
9
9
 
@@ -2153,7 +2153,9 @@ function NewApplicationTimeline({
2153
2153
  workflowDetails,
2154
2154
  t,
2155
2155
  tenantId = Digit.ULBService.getCurrentTenantId(),
2156
- timeObj
2156
+ timeObj,
2157
+ empUserName = null,
2158
+ handleSetEmpDesignation = () => {}
2157
2159
  }) {
2158
2160
  var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _workflowDetails$data4, _employeeData$data, _employeeData$data$Em;
2159
2161
  const {
@@ -2228,6 +2230,9 @@ function NewApplicationTimeline({
2228
2230
  const translationKey = `COMMON_MASTERS_DESIGNATION_${assignment === null || assignment === void 0 ? void 0 : assignment.designation}`;
2229
2231
  deptMap[emp === null || emp === void 0 ? void 0 : emp.code] = translationKey;
2230
2232
  });
2233
+ if (employeeData && empUserName) {
2234
+ handleSetEmpDesignation(t(deptMap[empUserName]));
2235
+ }
2231
2236
  if (isLoading) return /*#__PURE__*/React.createElement(Loader$1, null);
2232
2237
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
2233
2238
  className: "custom-timeline-container"
@@ -2551,7 +2556,7 @@ const availableOptions = [{
2551
2556
  name: "No"
2552
2557
  }];
2553
2558
  const ApplicationOverview = () => {
2554
- var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _user, _user$info, _user$info$roles, _user2, _user2$info, _user2$info$roles$fin, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetailsTemp$, _workflowDetailsTemp$2, _applicationDetails$A5, _applicationDetails$A6, _propertyDetailsFetch3, _applicationDetails$A7, _applicationDetails$A8, _Object$entries, _displayData$NdcDetai2, _displayData$Document, _applicationDetails$A21, _applicationDetails$A22, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _applicationDetails$A23, _applicationDetails$A24, _workflowDetails$data12;
2559
+ var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _applicationDetails$A2, _applicationDetails$A3, _applicationDetails$A4, _applicationDetails$A5, _user, _user$info, _user$info$roles, _user2, _user2$info, _user2$info$roles$fin, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetailsTemp$, _workflowDetailsTemp$2, _applicationDetails$A0, _applicationDetails$A1, _propertyDetailsFetch3, _Object$entries, _displayData$NdcDetai2, _displayData$Document, _applicationDetails$A24, _applicationDetails$A25, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _applicationDetails$A26, _applicationDetails$A27, _workflowDetails$data12;
2555
2560
  const {
2556
2561
  id
2557
2562
  } = useParams();
@@ -2584,6 +2589,7 @@ const ApplicationOverview = () => {
2584
2589
  const [showModal, setShowModal] = useState(false);
2585
2590
  const [getPropertyId, setPropertyId] = useState(null);
2586
2591
  const [approver, setApprover] = useState(null);
2592
+ const [showOptions, setShowOptions] = useState(false);
2587
2593
  const handleMarkPending = (consumerCode, value, index) => {
2588
2594
  setMarkedPending(prev => {
2589
2595
  const updated = {
@@ -2662,6 +2668,68 @@ const ApplicationOverview = () => {
2662
2668
  const empData = EmployeeData(tenantId, approver);
2663
2669
  console.log("approver for ndc", approver);
2664
2670
  console.log("officerData", empData);
2671
+ const {
2672
+ data: reciept_data,
2673
+ isLoading: recieptDataLoading
2674
+ } = Digit.Hooks.useRecieptSearch({
2675
+ tenantId: tenantId,
2676
+ businessService: "NDC",
2677
+ consumerCodes: id,
2678
+ isEmployee: false
2679
+ }, {
2680
+ enabled: id ? true : false
2681
+ });
2682
+ async function getRecieptSearch({
2683
+ tenantId,
2684
+ payments,
2685
+ ...params
2686
+ }) {
2687
+ setLoader(true);
2688
+ try {
2689
+ var _applicationDetails$A, _response;
2690
+ let response = null;
2691
+ let application = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A = applicationDetails.Applications) === null || _applicationDetails$A === void 0 ? void 0 : _applicationDetails$A[0];
2692
+ if (payments !== null && payments !== void 0 && payments.fileStoreId) {
2693
+ response = {
2694
+ filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
2695
+ };
2696
+ } else {
2697
+ response = await Digit.PaymentService.generatePdf(tenantId, {
2698
+ Payments: [{
2699
+ ...(payments || {}),
2700
+ ...application
2701
+ }]
2702
+ }, "ndc-receipt");
2703
+ }
2704
+ const fileStore = await Digit.PaymentService.printReciept(tenantId, {
2705
+ fileStoreIds: response.filestoreIds[0]
2706
+ });
2707
+ window.open(fileStore[(_response = response) === null || _response === void 0 ? void 0 : _response.filestoreIds[0]], "_blank");
2708
+ setLoader(false);
2709
+ } catch (error) {
2710
+ console.error(error);
2711
+ setLoader(false);
2712
+ }
2713
+ }
2714
+ const dowloadOptions = [];
2715
+ if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A2 = applicationDetails.Applications) === null || _applicationDetails$A2 === void 0 ? void 0 : (_applicationDetails$A3 = _applicationDetails$A2[0]) === null || _applicationDetails$A3 === void 0 ? void 0 : _applicationDetails$A3.applicationStatus) === "APPROVED" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A4 = applicationDetails.Applications) === null || _applicationDetails$A4 === void 0 ? void 0 : (_applicationDetails$A5 = _applicationDetails$A4[0]) === null || _applicationDetails$A5 === void 0 ? void 0 : _applicationDetails$A5.applicationStatus) === "REJECTED") {
2716
+ dowloadOptions.push({
2717
+ label: t("DOWNLOAD_CERTIFICATE"),
2718
+ onClick: () => handleDownloadPdf()
2719
+ });
2720
+ if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && !recieptDataLoading) {
2721
+ dowloadOptions.push({
2722
+ label: t("PTR_FEE_RECIEPT"),
2723
+ onClick: () => {
2724
+ var _reciept_data$Payment;
2725
+ return getRecieptSearch({
2726
+ tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment = reciept_data.Payments[0]) === null || _reciept_data$Payment === void 0 ? void 0 : _reciept_data$Payment.tenantId,
2727
+ payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
2728
+ });
2729
+ }
2730
+ });
2731
+ }
2732
+ }
2665
2733
  let user = Digit.UserService.getUser();
2666
2734
  const menuRef = useRef();
2667
2735
  if (window.location.href.includes("/obps") || window.location.href.includes("/noc")) {
@@ -2670,7 +2738,9 @@ const ApplicationOverview = () => {
2670
2738
  user = userInfo === null || userInfo === void 0 ? void 0 : userInfo.value;
2671
2739
  }
2672
2740
  const userRoles = (_user = user) === null || _user === void 0 ? void 0 : (_user$info = _user.info) === null || _user$info === void 0 ? void 0 : (_user$info$roles = _user$info.roles) === null || _user$info$roles === void 0 ? void 0 : _user$info$roles.map(e => e.code);
2741
+ console.log('userRoles', userRoles);
2673
2742
  const isCemp = (_user2 = user) === null || _user2 === void 0 ? void 0 : (_user2$info = _user2.info) === null || _user2$info === void 0 ? void 0 : (_user2$info$roles$fin = _user2$info.roles.find(role => role.code === "CEMP")) === null || _user2$info$roles$fin === void 0 ? void 0 : _user2$info$roles$fin.code;
2743
+ console.log('isCemp', isCemp);
2674
2744
  let actions = (workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data6 = workflowDetails.data) === null || _workflowDetails$data6 === void 0 ? void 0 : (_workflowDetails$data7 = _workflowDetails$data6.actionState) === null || _workflowDetails$data7 === void 0 ? void 0 : (_workflowDetails$data8 = _workflowDetails$data7.nextActions) === null || _workflowDetails$data8 === void 0 ? void 0 : _workflowDetails$data8.filter(e => {
2675
2745
  return (userRoles === null || userRoles === void 0 ? void 0 : userRoles.some(role => {
2676
2746
  var _e$roles;
@@ -2704,8 +2774,8 @@ const ApplicationOverview = () => {
2704
2774
  });
2705
2775
  };
2706
2776
  useEffect(() => {
2707
- var _applicationDetails$A;
2708
- const ndcObject = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A = applicationDetails.Applications) === null || _applicationDetails$A === void 0 ? void 0 : _applicationDetails$A[0];
2777
+ var _applicationDetails$A6;
2778
+ const ndcObject = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A6 = applicationDetails.Applications) === null || _applicationDetails$A6 === void 0 ? void 0 : _applicationDetails$A6[0];
2709
2779
  if (ndcObject) {
2710
2780
  var _ndcObject$owners, _ndcObject$owners$, _ndcObject$owners2, _ndcObject$owners2$, _ndcObject$owners3, _ndcObject$owners3$, _ndcObject$NdcDetails, _ndcObject$NdcDetails2, _ndcObject$NdcDetails3, _removeDuplicatesByUU;
2711
2781
  const applicantData = {
@@ -2770,9 +2840,9 @@ const ApplicationOverview = () => {
2770
2840
  }
2771
2841
  };
2772
2842
  function onActionSelect(action) {
2773
- var _action$state, _applicationDetails$A3, _applicationDetails$A4, _action$state2, _action$state2$action, _filterNexState$, _filterRoles$, _displayData$applican;
2843
+ var _action$state, _applicationDetails$A8, _applicationDetails$A9, _action$state2, _action$state2$action, _filterNexState$, _filterRoles$, _displayData$applican;
2774
2844
  console.log("action====???", action === null || action === void 0 ? void 0 : (_action$state = action.state) === null || _action$state === void 0 ? void 0 : _action$state.actions);
2775
- const ndcDetails = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A3 = applicationDetails.Applications) === null || _applicationDetails$A3 === void 0 ? void 0 : (_applicationDetails$A4 = _applicationDetails$A3[0]) === null || _applicationDetails$A4 === void 0 ? void 0 : _applicationDetails$A4.NdcDetails) || [];
2845
+ const ndcDetails = (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A8 = applicationDetails.Applications) === null || _applicationDetails$A8 === void 0 ? void 0 : (_applicationDetails$A9 = _applicationDetails$A8[0]) === null || _applicationDetails$A9 === void 0 ? void 0 : _applicationDetails$A9.NdcDetails) || [];
2776
2846
  const hasDuePending = ndcDetails === null || ndcDetails === void 0 ? void 0 : ndcDetails.some(item => item.isDuePending === true);
2777
2847
  console.log("hasDuePending", hasDuePending);
2778
2848
  const filterNexState = action === null || action === void 0 ? void 0 : (_action$state2 = action.state) === null || _action$state2 === void 0 ? void 0 : (_action$state2$action = _action$state2.actions) === null || _action$state2$action === void 0 ? void 0 : _action$state2$action.filter(item => item.action == (action === null || action === void 0 ? void 0 : action.action));
@@ -2911,7 +2981,7 @@ const ApplicationOverview = () => {
2911
2981
  enabled: getPropertyId ? true : false,
2912
2982
  privacy: Digit.Utils.getPrivacyObject()
2913
2983
  });
2914
- console.log("applicationDetails", applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A5 = applicationDetails.Applications) === null || _applicationDetails$A5 === void 0 ? void 0 : (_applicationDetails$A6 = _applicationDetails$A5[0]) === null || _applicationDetails$A6 === void 0 ? void 0 : _applicationDetails$A6.NdcDetails);
2984
+ console.log("applicationDetails", applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A0 = applicationDetails.Applications) === null || _applicationDetails$A0 === void 0 ? void 0 : (_applicationDetails$A1 = _applicationDetails$A0[0]) === null || _applicationDetails$A1 === void 0 ? void 0 : _applicationDetails$A1.NdcDetails);
2915
2985
  useEffect(() => {
2916
2986
  const handleClickOutside = event => {
2917
2987
  if (toastRef.current && !toastRef.current.contains(event.target)) {
@@ -2931,7 +3001,7 @@ const ApplicationOverview = () => {
2931
3001
  address = propertyDetailsFetch.Properties[0].address;
2932
3002
  formattedAddress = [(_address = address) === null || _address === void 0 ? void 0 : _address.doorNo, (_address2 = address) === null || _address2 === void 0 ? void 0 : _address2.buildingName, (_address3 = address) === null || _address3 === void 0 ? void 0 : _address3.street, (_address4 = address) === null || _address4 === void 0 ? void 0 : (_address4$locality = _address4.locality) === null || _address4$locality === void 0 ? void 0 : _address4$locality.name, (_address5 = address) === null || _address5 === void 0 ? void 0 : _address5.city].filter(Boolean).join(", ");
2933
3003
  }
2934
- if (isLoading || isDetailsLoading) {
3004
+ if (isLoading || isDetailsLoading || recieptDataLoading) {
2935
3005
  return /*#__PURE__*/React.createElement(Loader, null);
2936
3006
  }
2937
3007
  return /*#__PURE__*/React.createElement("div", {
@@ -2943,16 +3013,19 @@ const ApplicationOverview = () => {
2943
3013
  alignItems: "center",
2944
3014
  padding: "16px"
2945
3015
  }
2946
- }, isCemp && (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A7 = applicationDetails.Applications) === null || _applicationDetails$A7 === void 0 ? void 0 : (_applicationDetails$A8 = _applicationDetails$A7[0]) === null || _applicationDetails$A8 === void 0 ? void 0 : _applicationDetails$A8.applicationStatus) === "APPROVED" && /*#__PURE__*/React.createElement(LinkButton, {
2947
- className: "downLoadButton",
2948
- label: t("DOWNLOAD_CERTIFICATE"),
2949
- onClick: handleDownloadPdf
2950
- })), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("NDC_APPLICATION_DETAILS_OVERVIEW")), /*#__PURE__*/React.createElement(StatusTable, null, (displayData === null || displayData === void 0 ? void 0 : displayData.applicantData) && ((_Object$entries = Object.entries(displayData === null || displayData === void 0 ? void 0 : displayData.applicantData)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.map(([key, value]) => /*#__PURE__*/React.createElement(Row, {
3016
+ }, isCemp && /*#__PURE__*/React.createElement("div", {
3017
+ className: "cardHeaderWithOptions ral-app-details-header"
3018
+ }, getLoader && /*#__PURE__*/React.createElement(Loader, null), dowloadOptions && dowloadOptions.length > 0 && /*#__PURE__*/React.createElement(MultiLink, {
3019
+ className: "multilinkWrapper",
3020
+ onHeadClick: () => setShowOptions(!showOptions),
3021
+ displayOptions: showOptions,
3022
+ options: dowloadOptions
3023
+ }))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("NDC_APPLICATION_DETAILS_OVERVIEW")), /*#__PURE__*/React.createElement(StatusTable, null, (displayData === null || displayData === void 0 ? void 0 : displayData.applicantData) && ((_Object$entries = Object.entries(displayData === null || displayData === void 0 ? void 0 : displayData.applicantData)) === null || _Object$entries === void 0 ? void 0 : _Object$entries.map(([key, value]) => /*#__PURE__*/React.createElement(Row, {
2951
3024
  key: key,
2952
3025
  label: t(`${key === null || key === void 0 ? void 0 : key.toUpperCase()}`),
2953
3026
  text: Array.isArray(value) ? value.map(item => typeof item === "object" ? t((item === null || item === void 0 ? void 0 : item.code) || "N/A") : t(item || "N/A")).join(", ") : typeof value === "object" ? t((value === null || value === void 0 ? void 0 : value.code) || "N/A") : t(value || "N/A")
2954
3027
  }))))), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardSubHeader, null, t("NDC_APPLICATION_NDC_DETAILS_OVERVIEW")), displayData === null || displayData === void 0 ? void 0 : (_displayData$NdcDetai2 = displayData.NdcDetails) === null || _displayData$NdcDetai2 === void 0 ? void 0 : _displayData$NdcDetai2.map((detail, index) => {
2955
- var _applicationDetails$A9, _applicationDetails$A0, _applicationDetails$A1, _applicationDetails$A10, _applicationDetails$A11, _applicationDetails$A12, _applicationDetails$A13, _applicationDetails$A14, _applicationDetails$A15, _propertyDetailsFetch4, _propertyDetailsFetch5, _propertyDetailsFetch6, _propertyDetailsFetch7, _propertyDetailsFetch8, _propertyDetailsFetch9, _propertyDetailsFetch0, _propertyDetailsFetch1, _propertyDetailsFetch10, _propertyDetailsFetch11, _propertyDetailsFetch12, _propertyDetailsFetch13, _propertyDetailsFetch14, _propertyDetailsFetch15, _propertyDetailsFetch16, _propertyDetailsFetch17, _propertyDetailsFetch18, _propertyDetailsFetch19, _propertyDetailsFetch20, _propertyDetailsFetch21, _applicationDetails$A16, _applicationDetails$A17, _applicationDetails$A18, _applicationDetails$A19, _applicationDetails$A20;
3028
+ var _applicationDetails$A10, _applicationDetails$A11, _applicationDetails$A12, _applicationDetails$A13, _applicationDetails$A14, _applicationDetails$A15, _applicationDetails$A16, _applicationDetails$A17, _applicationDetails$A18, _propertyDetailsFetch4, _propertyDetailsFetch5, _propertyDetailsFetch6, _propertyDetailsFetch7, _propertyDetailsFetch8, _propertyDetailsFetch9, _propertyDetailsFetch0, _propertyDetailsFetch1, _propertyDetailsFetch10, _propertyDetailsFetch11, _propertyDetailsFetch12, _propertyDetailsFetch13, _propertyDetailsFetch14, _propertyDetailsFetch15, _propertyDetailsFetch16, _propertyDetailsFetch17, _propertyDetailsFetch18, _propertyDetailsFetch19, _propertyDetailsFetch20, _propertyDetailsFetch21, _applicationDetails$A19, _applicationDetails$A20, _applicationDetails$A21, _applicationDetails$A22, _applicationDetails$A23;
2956
3029
  const isPT = (detail === null || detail === void 0 ? void 0 : detail.businessService) === "NDC_PROPERTY_TAX";
2957
3030
  const isSW = (detail === null || detail === void 0 ? void 0 : detail.businessService) === "NDC_SEWERAGE_SERVICE_CONNECTION";
2958
3031
  const isWS = (detail === null || detail === void 0 ? void 0 : detail.businessService) === "NDC_WATER_SERVICE_CONNECTION";
@@ -3011,7 +3084,7 @@ const ApplicationOverview = () => {
3011
3084
  text: t(detail.propertyType) || detail.propertyType
3012
3085
  }), isPT && (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : propertyDetailsFetch.Properties) && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Row, {
3013
3086
  label: t("CHB_DISCOUNT_REASON"),
3014
- text: t(`${(applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A9 = applicationDetails.Applications) === null || _applicationDetails$A9 === void 0 ? void 0 : (_applicationDetails$A0 = _applicationDetails$A9[0]) === null || _applicationDetails$A0 === void 0 ? void 0 : _applicationDetails$A0.reason) == "OTHERS" ? applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A1 = applicationDetails.Applications) === null || _applicationDetails$A1 === void 0 ? void 0 : (_applicationDetails$A10 = _applicationDetails$A1[0]) === null || _applicationDetails$A10 === void 0 ? void 0 : (_applicationDetails$A11 = _applicationDetails$A10.NdcDetails) === null || _applicationDetails$A11 === void 0 ? void 0 : (_applicationDetails$A12 = _applicationDetails$A11.find(item => (item === null || item === void 0 ? void 0 : item.businessService) === "PT")) === null || _applicationDetails$A12 === void 0 ? void 0 : (_applicationDetails$A13 = _applicationDetails$A12.additionalDetails) === null || _applicationDetails$A13 === void 0 ? void 0 : _applicationDetails$A13.reason : applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A14 = applicationDetails.Applications) === null || _applicationDetails$A14 === void 0 ? void 0 : (_applicationDetails$A15 = _applicationDetails$A14[0]) === null || _applicationDetails$A15 === void 0 ? void 0 : _applicationDetails$A15.reason}`)
3087
+ text: t(`${(applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A10 = applicationDetails.Applications) === null || _applicationDetails$A10 === void 0 ? void 0 : (_applicationDetails$A11 = _applicationDetails$A10[0]) === null || _applicationDetails$A11 === void 0 ? void 0 : _applicationDetails$A11.reason) == "OTHERS" ? applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A12 = applicationDetails.Applications) === null || _applicationDetails$A12 === void 0 ? void 0 : (_applicationDetails$A13 = _applicationDetails$A12[0]) === null || _applicationDetails$A13 === void 0 ? void 0 : (_applicationDetails$A14 = _applicationDetails$A13.NdcDetails) === null || _applicationDetails$A14 === void 0 ? void 0 : (_applicationDetails$A15 = _applicationDetails$A14.find(item => (item === null || item === void 0 ? void 0 : item.businessService) === "PT")) === null || _applicationDetails$A15 === void 0 ? void 0 : (_applicationDetails$A16 = _applicationDetails$A15.additionalDetails) === null || _applicationDetails$A16 === void 0 ? void 0 : _applicationDetails$A16.reason : applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A17 = applicationDetails.Applications) === null || _applicationDetails$A17 === void 0 ? void 0 : (_applicationDetails$A18 = _applicationDetails$A17[0]) === null || _applicationDetails$A18 === void 0 ? void 0 : _applicationDetails$A18.reason}`)
3015
3088
  }), /*#__PURE__*/React.createElement(Row, {
3016
3089
  label: t("City"),
3017
3090
  text: propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch4 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch4 === void 0 ? void 0 : (_propertyDetailsFetch5 = _propertyDetailsFetch4[0]) === null || _propertyDetailsFetch5 === void 0 ? void 0 : (_propertyDetailsFetch6 = _propertyDetailsFetch5.address) === null || _propertyDetailsFetch6 === void 0 ? void 0 : _propertyDetailsFetch6.city
@@ -3035,7 +3108,7 @@ const ApplicationOverview = () => {
3035
3108
  text: propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch19 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch19 === void 0 ? void 0 : (_propertyDetailsFetch20 = _propertyDetailsFetch19[0]) === null || _propertyDetailsFetch20 === void 0 ? void 0 : (_propertyDetailsFetch21 = _propertyDetailsFetch20.additionalDetails) === null || _propertyDetailsFetch21 === void 0 ? void 0 : _propertyDetailsFetch21.yearConstruction
3036
3109
  }), /*#__PURE__*/React.createElement(Row, {
3037
3110
  label: t("Remarks"),
3038
- text: (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A16 = applicationDetails.Applications) === null || _applicationDetails$A16 === void 0 ? void 0 : (_applicationDetails$A17 = _applicationDetails$A16[0]) === null || _applicationDetails$A17 === void 0 ? void 0 : (_applicationDetails$A18 = _applicationDetails$A17.NdcDetails) === null || _applicationDetails$A18 === void 0 ? void 0 : (_applicationDetails$A19 = _applicationDetails$A18.find(item => (item === null || item === void 0 ? void 0 : item.businessService) === "PT")) === null || _applicationDetails$A19 === void 0 ? void 0 : (_applicationDetails$A20 = _applicationDetails$A19.additionalDetails) === null || _applicationDetails$A20 === void 0 ? void 0 : _applicationDetails$A20.remarks) || "N/A"
3111
+ text: (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A19 = applicationDetails.Applications) === null || _applicationDetails$A19 === void 0 ? void 0 : (_applicationDetails$A20 = _applicationDetails$A19[0]) === null || _applicationDetails$A20 === void 0 ? void 0 : (_applicationDetails$A21 = _applicationDetails$A20.NdcDetails) === null || _applicationDetails$A21 === void 0 ? void 0 : (_applicationDetails$A22 = _applicationDetails$A21.find(item => (item === null || item === void 0 ? void 0 : item.businessService) === "PT")) === null || _applicationDetails$A22 === void 0 ? void 0 : (_applicationDetails$A23 = _applicationDetails$A22.additionalDetails) === null || _applicationDetails$A23 === void 0 ? void 0 : _applicationDetails$A23.remarks) || "N/A"
3039
3112
  }))), canRaiseFlag && /*#__PURE__*/React.createElement("div", {
3040
3113
  className: "mychallan-custom"
3041
3114
  }, /*#__PURE__*/React.createElement(CardLabel, {
@@ -3063,7 +3136,7 @@ const ApplicationOverview = () => {
3063
3136
  }) : /*#__PURE__*/React.createElement("div", null, t("TL_NO_DOCUMENTS_MSG")))), /*#__PURE__*/React.createElement(NewApplicationTimeline, {
3064
3137
  workflowDetails: workflowDetails,
3065
3138
  t: t
3066
- }), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A21 = applicationDetails.Applications) === null || _applicationDetails$A21 === void 0 ? void 0 : (_applicationDetails$A22 = _applicationDetails$A21[0]) === null || _applicationDetails$A22 === void 0 ? void 0 : _applicationDetails$A22.applicationStatus) !== "INITIATED" && (actions === null || actions === void 0 ? void 0 : actions.length) > 0 && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu && (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data1 = workflowDetails.data) !== null && _workflowDetails$data1 !== void 0 && (_workflowDetails$data10 = _workflowDetails$data1.actionState) !== null && _workflowDetails$data10 !== void 0 && _workflowDetails$data10.nextActions || workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data11 = workflowDetails.data) !== null && _workflowDetails$data11 !== void 0 && _workflowDetails$data11.nextActions) ? /*#__PURE__*/React.createElement(Menu, {
3139
+ }), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A24 = applicationDetails.Applications) === null || _applicationDetails$A24 === void 0 ? void 0 : (_applicationDetails$A25 = _applicationDetails$A24[0]) === null || _applicationDetails$A25 === void 0 ? void 0 : _applicationDetails$A25.applicationStatus) !== "INITIATED" && actions && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu && (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data1 = workflowDetails.data) !== null && _workflowDetails$data1 !== void 0 && (_workflowDetails$data10 = _workflowDetails$data1.actionState) !== null && _workflowDetails$data10 !== void 0 && _workflowDetails$data10.nextActions || workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data11 = workflowDetails.data) !== null && _workflowDetails$data11 !== void 0 && _workflowDetails$data11.nextActions) ? /*#__PURE__*/React.createElement(Menu, {
3067
3140
  localeKeyPrefix: `WF_EDITRENEWAL`,
3068
3141
  options: actions,
3069
3142
  optionKey: "action",
@@ -3073,11 +3146,11 @@ const ApplicationOverview = () => {
3073
3146
  ref: menuRef,
3074
3147
  label: t("WF_TAKE_ACTION"),
3075
3148
  onSubmit: () => setDisplayMenu(!displayMenu)
3076
- })), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A23 = applicationDetails.Applications) === null || _applicationDetails$A23 === void 0 ? void 0 : (_applicationDetails$A24 = _applicationDetails$A23[0]) === null || _applicationDetails$A24 === void 0 ? void 0 : _applicationDetails$A24.applicationStatus) == "INITIATED" && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar$1, {
3149
+ })), (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A26 = applicationDetails.Applications) === null || _applicationDetails$A26 === void 0 ? void 0 : (_applicationDetails$A27 = _applicationDetails$A26[0]) === null || _applicationDetails$A27 === void 0 ? void 0 : _applicationDetails$A27.applicationStatus) == "INITIATED" && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar$1, {
3077
3150
  label: t("COMMON_EDIT"),
3078
3151
  onSubmit: () => {
3079
- var _applicationDetails$A25, _applicationDetails$A26;
3080
- const id = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A25 = applicationDetails.Applications) === null || _applicationDetails$A25 === void 0 ? void 0 : (_applicationDetails$A26 = _applicationDetails$A25[0]) === null || _applicationDetails$A26 === void 0 ? void 0 : _applicationDetails$A26.applicationNo;
3152
+ var _applicationDetails$A28, _applicationDetails$A29;
3153
+ const id = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A28 = applicationDetails.Applications) === null || _applicationDetails$A28 === void 0 ? void 0 : (_applicationDetails$A29 = _applicationDetails$A28[0]) === null || _applicationDetails$A29 === void 0 ? void 0 : _applicationDetails$A29.applicationNo;
3081
3154
  history.push(`/digit-ui/employee/ndc/create/${id}`);
3082
3155
  }
3083
3156
  })), showModal ? /*#__PURE__*/React.createElement(NDCModal, {
@@ -10420,7 +10493,7 @@ var lodash = createCommonjsModule(function (module, exports) {
10420
10493
  });
10421
10494
 
10422
10495
  const CitizenApplicationOverview = () => {
10423
- var _user, _user$info, _user$info$roles, _propertyDetailsFetch3, _propertyDetailsFetch4, _propertyDetailsFetch5, _ownerForName$map, _ownerForName$map$fil, _applicationDetails$A3, _applicationDetails$A4, _applicationDetails$A5, _applicationDetails$A6, _applicationDetails$A7, _applicationDetails$A8, _applicationDetails$A9, _Object$entries, _Object$entries$filte, _displayData$NdcDetai2, _displayData$Document;
10496
+ var _applicationDetails$A2, _applicationDetails$A3, _applicationDetails$A4, _applicationDetails$A5, _user, _user$info, _user$info$roles, _propertyDetailsFetch3, _propertyDetailsFetch4, _propertyDetailsFetch5, _ownerForName$map, _ownerForName$map$fil, _applicationDetails$A8, _applicationDetails$A9, _applicationDetails$A0, _applicationDetails$A1, _applicationDetails$A10, _Object$entries, _Object$entries$filte, _displayData$NdcDetai2, _displayData$Document;
10424
10497
  const {
10425
10498
  id
10426
10499
  } = useParams();
@@ -10433,6 +10506,7 @@ const CitizenApplicationOverview = () => {
10433
10506
  const [appDetails, setAppDetails] = useState({});
10434
10507
  const [showToast, setShowToast] = useState(null);
10435
10508
  const [approver, setApprover] = useState(null);
10509
+ const [showOptions, setShowOptions] = useState(false);
10436
10510
  const [ndcDatils, setNdcDetails] = useState([]);
10437
10511
  const [displayData, setDisplayData] = useState({});
10438
10512
  const [getLoader, setLoader] = useState(false);
@@ -10478,6 +10552,68 @@ const CitizenApplicationOverview = () => {
10478
10552
  const userInfo = userInfos ? JSON.parse(userInfos) : {};
10479
10553
  user = userInfo === null || userInfo === void 0 ? void 0 : userInfo.value;
10480
10554
  }
10555
+ const {
10556
+ data: reciept_data,
10557
+ isLoading: recieptDataLoading
10558
+ } = Digit.Hooks.useRecieptSearch({
10559
+ tenantId: tenantId,
10560
+ businessService: "NDC",
10561
+ consumerCodes: id,
10562
+ isEmployee: false
10563
+ }, {
10564
+ enabled: id ? true : false
10565
+ });
10566
+ async function getRecieptSearch({
10567
+ tenantId,
10568
+ payments,
10569
+ ...params
10570
+ }) {
10571
+ setLoader(true);
10572
+ try {
10573
+ var _applicationDetails$A, _response;
10574
+ let response = null;
10575
+ let application = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A = applicationDetails.Applications) === null || _applicationDetails$A === void 0 ? void 0 : _applicationDetails$A[0];
10576
+ if (payments !== null && payments !== void 0 && payments.fileStoreId) {
10577
+ response = {
10578
+ filestoreIds: [payments === null || payments === void 0 ? void 0 : payments.fileStoreId]
10579
+ };
10580
+ } else {
10581
+ response = await Digit.PaymentService.generatePdf(tenantId, {
10582
+ Payments: [{
10583
+ ...(payments || {}),
10584
+ ...application
10585
+ }]
10586
+ }, "ndc-receipt");
10587
+ }
10588
+ const fileStore = await Digit.PaymentService.printReciept(tenantId, {
10589
+ fileStoreIds: response.filestoreIds[0]
10590
+ });
10591
+ window.open(fileStore[(_response = response) === null || _response === void 0 ? void 0 : _response.filestoreIds[0]], "_blank");
10592
+ setLoader(false);
10593
+ } catch (error) {
10594
+ console.error(error);
10595
+ setLoader(false);
10596
+ }
10597
+ }
10598
+ const dowloadOptions = [];
10599
+ if ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A2 = applicationDetails.Applications) === null || _applicationDetails$A2 === void 0 ? void 0 : (_applicationDetails$A3 = _applicationDetails$A2[0]) === null || _applicationDetails$A3 === void 0 ? void 0 : _applicationDetails$A3.applicationStatus) === "APPROVED" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A4 = applicationDetails.Applications) === null || _applicationDetails$A4 === void 0 ? void 0 : (_applicationDetails$A5 = _applicationDetails$A4[0]) === null || _applicationDetails$A5 === void 0 ? void 0 : _applicationDetails$A5.applicationStatus) === "REJECTED") {
10600
+ dowloadOptions.push({
10601
+ label: t("DOWNLOAD_CERTIFICATE"),
10602
+ onClick: () => handleDownloadPdf()
10603
+ });
10604
+ }
10605
+ if (reciept_data && (reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments.length) > 0 && !recieptDataLoading) {
10606
+ dowloadOptions.push({
10607
+ label: t("PTR_FEE_RECIEPT"),
10608
+ onClick: () => {
10609
+ var _reciept_data$Payment;
10610
+ return getRecieptSearch({
10611
+ tenantId: reciept_data === null || reciept_data === void 0 ? void 0 : (_reciept_data$Payment = reciept_data.Payments[0]) === null || _reciept_data$Payment === void 0 ? void 0 : _reciept_data$Payment.tenantId,
10612
+ payments: reciept_data === null || reciept_data === void 0 ? void 0 : reciept_data.Payments[0]
10613
+ });
10614
+ }
10615
+ });
10616
+ }
10481
10617
  const userRoles = (_user = user) === null || _user === void 0 ? void 0 : (_user$info = _user.info) === null || _user$info === void 0 ? void 0 : (_user$info$roles = _user$info.roles) === null || _user$info$roles === void 0 ? void 0 : _user$info$roles.map(e => e.code);
10482
10618
  const removeDuplicatesByUUID = arr => {
10483
10619
  const seen = new Set();
@@ -10491,8 +10627,8 @@ const CitizenApplicationOverview = () => {
10491
10627
  });
10492
10628
  };
10493
10629
  useEffect(() => {
10494
- var _applicationDetails$A;
10495
- const ndcObject = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A = applicationDetails.Applications) === null || _applicationDetails$A === void 0 ? void 0 : _applicationDetails$A[0];
10630
+ var _applicationDetails$A6;
10631
+ const ndcObject = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A6 = applicationDetails.Applications) === null || _applicationDetails$A6 === void 0 ? void 0 : _applicationDetails$A6[0];
10496
10632
  console.log("ndcObject", ndcObject);
10497
10633
  if (ndcObject) {
10498
10634
  var _ndcObject$owners, _ndcObject$owners2, _removeDuplicatesByUU;
@@ -10597,14 +10733,14 @@ const CitizenApplicationOverview = () => {
10597
10733
  address = propertyDetailsFetch.Properties[0].address;
10598
10734
  formattedAddress = [(_address = address) === null || _address === void 0 ? void 0 : _address.doorNo, (_address2 = address) === null || _address2 === void 0 ? void 0 : _address2.buildingName, (_address3 = address) === null || _address3 === void 0 ? void 0 : _address3.street, (_address4 = address) === null || _address4 === void 0 ? void 0 : (_address4$locality = _address4.locality) === null || _address4$locality === void 0 ? void 0 : _address4$locality.name, (_address5 = address) === null || _address5 === void 0 ? void 0 : _address5.city].filter(Boolean).join(", ");
10599
10735
  }
10600
- if (isLoading || isDetailsLoading) {
10736
+ if (isLoading || isDetailsLoading || recieptDataLoading) {
10601
10737
  return /*#__PURE__*/React.createElement(Loader, null);
10602
10738
  }
10603
10739
  console.log("propertyDetailsFetch", propertyDetailsFetch);
10604
10740
  console.log("displayData?.applicantData", displayData);
10605
10741
  const ownerForName = (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch4 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch4 === void 0 ? void 0 : (_propertyDetailsFetch5 = _propertyDetailsFetch4[0]) === null || _propertyDetailsFetch5 === void 0 ? void 0 : _propertyDetailsFetch5.owners) || [];
10606
10742
  const ownerNames = ownerForName === null || ownerForName === void 0 ? void 0 : (_ownerForName$map = ownerForName.map(owner => owner === null || owner === void 0 ? void 0 : owner.name)) === null || _ownerForName$map === void 0 ? void 0 : (_ownerForName$map$fil = _ownerForName$map.filter(Boolean)) === null || _ownerForName$map$fil === void 0 ? void 0 : _ownerForName$map$fil.join(", ");
10607
- console.log("applicationDetails?.[0]", applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A3 = applicationDetails.Applications) === null || _applicationDetails$A3 === void 0 ? void 0 : _applicationDetails$A3[0]);
10743
+ console.log("applicationDetails?.[0]", applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A8 = applicationDetails.Applications) === null || _applicationDetails$A8 === void 0 ? void 0 : _applicationDetails$A8[0]);
10608
10744
  return /*#__PURE__*/React.createElement("div", {
10609
10745
  className: "employee-main-application-details"
10610
10746
  }, /*#__PURE__*/React.createElement("div", {
@@ -10616,15 +10752,18 @@ const CitizenApplicationOverview = () => {
10616
10752
  alignItems: "center",
10617
10753
  padding: "16px"
10618
10754
  }
10619
- }, (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A4 = applicationDetails.Applications) === null || _applicationDetails$A4 === void 0 ? void 0 : (_applicationDetails$A5 = _applicationDetails$A4[0]) === null || _applicationDetails$A5 === void 0 ? void 0 : _applicationDetails$A5.applicationStatus) === "APPROVED" && /*#__PURE__*/React.createElement(LinkButton, {
10620
- className: "downLoadButton",
10621
- label: t("DOWNLOAD_CERTIFICATE"),
10622
- onClick: handleDownloadPdf
10623
- })), ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A6 = applicationDetails.Applications) === null || _applicationDetails$A6 === void 0 ? void 0 : (_applicationDetails$A7 = _applicationDetails$A6[0]) === null || _applicationDetails$A7 === void 0 ? void 0 : _applicationDetails$A7.applicationStatus) == "INITIATED" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A8 = applicationDetails.Applications) === null || _applicationDetails$A8 === void 0 ? void 0 : (_applicationDetails$A9 = _applicationDetails$A8[0]) === null || _applicationDetails$A9 === void 0 ? void 0 : _applicationDetails$A9.applicationStatus) == "CITIZENACTIONREQUIRED") && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar$1, {
10755
+ }, /*#__PURE__*/React.createElement("div", {
10756
+ className: "cardHeaderWithOptions ral-app-details-header"
10757
+ }, getLoader && /*#__PURE__*/React.createElement(Loader, null), dowloadOptions && dowloadOptions.length > 0 && /*#__PURE__*/React.createElement(MultiLink, {
10758
+ className: "multilinkWrapper",
10759
+ onHeadClick: () => setShowOptions(!showOptions),
10760
+ displayOptions: showOptions,
10761
+ options: dowloadOptions
10762
+ }))), ((applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A9 = applicationDetails.Applications) === null || _applicationDetails$A9 === void 0 ? void 0 : (_applicationDetails$A0 = _applicationDetails$A9[0]) === null || _applicationDetails$A0 === void 0 ? void 0 : _applicationDetails$A0.applicationStatus) == "INITIATED" || (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A1 = applicationDetails.Applications) === null || _applicationDetails$A1 === void 0 ? void 0 : (_applicationDetails$A10 = _applicationDetails$A1[0]) === null || _applicationDetails$A10 === void 0 ? void 0 : _applicationDetails$A10.applicationStatus) == "CITIZENACTIONREQUIRED") && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar$1, {
10624
10763
  label: t("COMMON_EDIT"),
10625
10764
  onSubmit: () => {
10626
- var _applicationDetails$A0, _applicationDetails$A1;
10627
- const id = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A0 = applicationDetails.Applications) === null || _applicationDetails$A0 === void 0 ? void 0 : (_applicationDetails$A1 = _applicationDetails$A0[0]) === null || _applicationDetails$A1 === void 0 ? void 0 : _applicationDetails$A1.applicationNo;
10765
+ var _applicationDetails$A11, _applicationDetails$A12;
10766
+ const id = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A11 = applicationDetails.Applications) === null || _applicationDetails$A11 === void 0 ? void 0 : (_applicationDetails$A12 = _applicationDetails$A11[0]) === null || _applicationDetails$A12 === void 0 ? void 0 : _applicationDetails$A12.applicationNo;
10628
10767
  history.push(`/digit-ui/citizen/ndc/new-application/${id}`);
10629
10768
  }
10630
10769
  }))), /*#__PURE__*/React.createElement(Card, {
@@ -10643,7 +10782,7 @@ const CitizenApplicationOverview = () => {
10643
10782
  }, /*#__PURE__*/React.createElement(CardSubHeader, {
10644
10783
  className: "ndc_label"
10645
10784
  }, t("NDC_APPLICATION_NDC_DETAILS_OVERVIEW")), displayData === null || displayData === void 0 ? void 0 : (_displayData$NdcDetai2 = displayData.NdcDetails) === null || _displayData$NdcDetai2 === void 0 ? void 0 : _displayData$NdcDetai2.map((detail, index) => {
10646
- var _detail$dueAmount, _applicationDetails$A10, _applicationDetails$A11, _applicationDetails$A12, _applicationDetails$A13, _applicationDetails$A14, _applicationDetails$A15, _applicationDetails$A16, _applicationDetails$A17, _applicationDetails$A18, _propertyDetailsFetch6, _propertyDetailsFetch7, _propertyDetailsFetch8, _propertyDetailsFetch9, _propertyDetailsFetch0, _propertyDetailsFetch1, _propertyDetailsFetch10, _propertyDetailsFetch11, _propertyDetailsFetch12, _propertyDetailsFetch13, _propertyDetailsFetch14, _propertyDetailsFetch15, _propertyDetailsFetch16, _propertyDetailsFetch17, _propertyDetailsFetch18, _propertyDetailsFetch19, _propertyDetailsFetch20, _propertyDetailsFetch21, _propertyDetailsFetch22, _propertyDetailsFetch23, _applicationDetails$A19, _applicationDetails$A20, _applicationDetails$A21, _applicationDetails$A22, _applicationDetails$A23;
10785
+ var _detail$dueAmount, _applicationDetails$A13, _applicationDetails$A14, _applicationDetails$A15, _applicationDetails$A16, _applicationDetails$A17, _applicationDetails$A18, _applicationDetails$A19, _applicationDetails$A20, _applicationDetails$A21, _propertyDetailsFetch6, _propertyDetailsFetch7, _propertyDetailsFetch8, _propertyDetailsFetch9, _propertyDetailsFetch0, _propertyDetailsFetch1, _propertyDetailsFetch10, _propertyDetailsFetch11, _propertyDetailsFetch12, _propertyDetailsFetch13, _propertyDetailsFetch14, _propertyDetailsFetch15, _propertyDetailsFetch16, _propertyDetailsFetch17, _propertyDetailsFetch18, _propertyDetailsFetch19, _propertyDetailsFetch20, _propertyDetailsFetch21, _propertyDetailsFetch22, _propertyDetailsFetch23, _applicationDetails$A22, _applicationDetails$A23, _applicationDetails$A24, _applicationDetails$A25, _applicationDetails$A26;
10647
10786
  console.log("detail", detail);
10648
10787
  const isRed = detail.dueAmount > 0;
10649
10788
  return /*#__PURE__*/React.createElement("div", {
@@ -10673,7 +10812,7 @@ const CitizenApplicationOverview = () => {
10673
10812
  text: t(detail.propertyType) || detail.propertyType
10674
10813
  }), (detail === null || detail === void 0 ? void 0 : detail.businessService) == "NDC_PROPERTY_TAX" && (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : propertyDetailsFetch.Properties) && /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Row, {
10675
10814
  label: t("CHB_DISCOUNT_REASON"),
10676
- text: t(`${(applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A10 = applicationDetails.Applications) === null || _applicationDetails$A10 === void 0 ? void 0 : (_applicationDetails$A11 = _applicationDetails$A10[0]) === null || _applicationDetails$A11 === void 0 ? void 0 : _applicationDetails$A11.reason) === "OTHERS" ? applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A12 = applicationDetails.Applications) === null || _applicationDetails$A12 === void 0 ? void 0 : (_applicationDetails$A13 = _applicationDetails$A12[0]) === null || _applicationDetails$A13 === void 0 ? void 0 : (_applicationDetails$A14 = _applicationDetails$A13.NdcDetails) === null || _applicationDetails$A14 === void 0 ? void 0 : (_applicationDetails$A15 = _applicationDetails$A14.find(item => (item === null || item === void 0 ? void 0 : item.businessService) === "PT")) === null || _applicationDetails$A15 === void 0 ? void 0 : (_applicationDetails$A16 = _applicationDetails$A15.additionalDetails) === null || _applicationDetails$A16 === void 0 ? void 0 : _applicationDetails$A16.reason : applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A17 = applicationDetails.Applications) === null || _applicationDetails$A17 === void 0 ? void 0 : (_applicationDetails$A18 = _applicationDetails$A17[0]) === null || _applicationDetails$A18 === void 0 ? void 0 : _applicationDetails$A18.reason}`)
10815
+ text: t(`${(applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A13 = applicationDetails.Applications) === null || _applicationDetails$A13 === void 0 ? void 0 : (_applicationDetails$A14 = _applicationDetails$A13[0]) === null || _applicationDetails$A14 === void 0 ? void 0 : _applicationDetails$A14.reason) === "OTHERS" ? applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A15 = applicationDetails.Applications) === null || _applicationDetails$A15 === void 0 ? void 0 : (_applicationDetails$A16 = _applicationDetails$A15[0]) === null || _applicationDetails$A16 === void 0 ? void 0 : (_applicationDetails$A17 = _applicationDetails$A16.NdcDetails) === null || _applicationDetails$A17 === void 0 ? void 0 : (_applicationDetails$A18 = _applicationDetails$A17.find(item => (item === null || item === void 0 ? void 0 : item.businessService) === "PT")) === null || _applicationDetails$A18 === void 0 ? void 0 : (_applicationDetails$A19 = _applicationDetails$A18.additionalDetails) === null || _applicationDetails$A19 === void 0 ? void 0 : _applicationDetails$A19.reason : applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A20 = applicationDetails.Applications) === null || _applicationDetails$A20 === void 0 ? void 0 : (_applicationDetails$A21 = _applicationDetails$A20[0]) === null || _applicationDetails$A21 === void 0 ? void 0 : _applicationDetails$A21.reason}`)
10677
10816
  }), /*#__PURE__*/React.createElement(Row, {
10678
10817
  label: t("City"),
10679
10818
  text: (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch6 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch6 === void 0 ? void 0 : (_propertyDetailsFetch7 = _propertyDetailsFetch6[0]) === null || _propertyDetailsFetch7 === void 0 ? void 0 : (_propertyDetailsFetch8 = _propertyDetailsFetch7.address) === null || _propertyDetailsFetch8 === void 0 ? void 0 : _propertyDetailsFetch8.city) || "N/A"
@@ -10697,7 +10836,7 @@ const CitizenApplicationOverview = () => {
10697
10836
  text: propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch21 = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch21 === void 0 ? void 0 : (_propertyDetailsFetch22 = _propertyDetailsFetch21[0]) === null || _propertyDetailsFetch22 === void 0 ? void 0 : (_propertyDetailsFetch23 = _propertyDetailsFetch22.additionalDetails) === null || _propertyDetailsFetch23 === void 0 ? void 0 : _propertyDetailsFetch23.yearConstruction
10698
10837
  }), /*#__PURE__*/React.createElement(Row, {
10699
10838
  label: t("Remarks"),
10700
- text: (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A19 = applicationDetails.Applications) === null || _applicationDetails$A19 === void 0 ? void 0 : (_applicationDetails$A20 = _applicationDetails$A19[0]) === null || _applicationDetails$A20 === void 0 ? void 0 : (_applicationDetails$A21 = _applicationDetails$A20.NdcDetails) === null || _applicationDetails$A21 === void 0 ? void 0 : (_applicationDetails$A22 = _applicationDetails$A21.find(item => (item === null || item === void 0 ? void 0 : item.businessService) === "PT")) === null || _applicationDetails$A22 === void 0 ? void 0 : (_applicationDetails$A23 = _applicationDetails$A22.additionalDetails) === null || _applicationDetails$A23 === void 0 ? void 0 : _applicationDetails$A23.remarks) || "N/A"
10839
+ text: (applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A22 = applicationDetails.Applications) === null || _applicationDetails$A22 === void 0 ? void 0 : (_applicationDetails$A23 = _applicationDetails$A22[0]) === null || _applicationDetails$A23 === void 0 ? void 0 : (_applicationDetails$A24 = _applicationDetails$A23.NdcDetails) === null || _applicationDetails$A24 === void 0 ? void 0 : (_applicationDetails$A25 = _applicationDetails$A24.find(item => (item === null || item === void 0 ? void 0 : item.businessService) === "PT")) === null || _applicationDetails$A25 === void 0 ? void 0 : (_applicationDetails$A26 = _applicationDetails$A25.additionalDetails) === null || _applicationDetails$A26 === void 0 ? void 0 : _applicationDetails$A26.remarks) || "N/A"
10701
10840
  }))));
10702
10841
  })), /*#__PURE__*/React.createElement(Card, {
10703
10842
  className: "ndc_card_main"
@@ -10808,7 +10947,7 @@ function _extends() {
10808
10947
  }, _extends.apply(null, arguments);
10809
10948
  }
10810
10949
 
10811
- const NewSearchFormFieldsComponent = ({
10950
+ const SearchFormFieldsComponents = ({
10812
10951
  registerRef,
10813
10952
  searchFormState,
10814
10953
  searchFieldComponents
@@ -10817,6 +10956,7 @@ const NewSearchFormFieldsComponent = ({
10817
10956
  t
10818
10957
  } = useTranslation();
10819
10958
  const isMobile = window.Digit.Utils.browser.isMobile();
10959
+ console.log("searchFieldComponents", searchFieldComponents);
10820
10960
  if (!isMobile) {
10821
10961
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
10822
10962
  className: "search-container ndc-search-container-custom"
@@ -10834,7 +10974,7 @@ const NewSearchFormFieldsComponent = ({
10834
10974
  className: "search-action-wrapper ndc-search-action-wrapper"
10835
10975
  }, searchFieldComponents)))));
10836
10976
  }
10837
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")), /*#__PURE__*/React.createElement(TextInput, {
10977
+ return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL")), /*#__PURE__*/React.createElement(TextInput, {
10838
10978
  name: "applicationNo",
10839
10979
  inputRef: registerRef({})
10840
10980
  })), /*#__PURE__*/React.createElement(SearchField, null, /*#__PURE__*/React.createElement("label", null, t("CORE_COMMON_PHONE_NUMBER")), /*#__PURE__*/React.createElement(TextInput, {
@@ -10843,7 +10983,7 @@ const NewSearchFormFieldsComponent = ({
10843
10983
  })));
10844
10984
  };
10845
10985
 
10846
- const NewFilterFormFieldsComponent = ({
10986
+ const FilterFormFieldsComponent = ({
10847
10987
  statuses,
10848
10988
  controlFilterForm,
10849
10989
  applicationTypesOfBPA,
@@ -10852,7 +10992,15 @@ const NewFilterFormFieldsComponent = ({
10852
10992
  const {
10853
10993
  t
10854
10994
  } = useTranslation();
10855
- const [showAllStatuses, setShowAllStatuses] = useState(false);
10995
+ const tenantId = Digit.ULBService.getStateId();
10996
+ const [tlfilters, setTLFilters] = useState({
10997
+ applicationStatus: []
10998
+ });
10999
+ useEffect(() => {
11000
+ if (tlfilters) {
11001
+ handleFilter(tlfilters);
11002
+ }
11003
+ }, [tlfilters]);
10856
11004
  const availableOptions = [{
10857
11005
  code: "ASSIGNED_TO_ME",
10858
11006
  name: `${t("ES_INBOX_ASSIGNED_TO_ME")}`
@@ -10864,128 +11012,43 @@ const NewFilterFormFieldsComponent = ({
10864
11012
  type.name = t(`WF_BPA_${type.code}`);
10865
11013
  type.i18nKey = t(`WF_BPA_${type.code}`);
10866
11014
  });
10867
- const getVariantFromCode = code => {
10868
- const value = String(code || "").toLowerCase();
10869
- if (value.includes("approved")) return "success";
10870
- if (value.includes("rejected")) return "danger";
10871
- if (value.includes("pending")) return "warning";
10872
- if (value.includes("inbox")) return "primary";
10873
- if (value.includes("assigned")) return "primary";
10874
- return "info";
10875
- };
10876
- const colorVariants = ["primary", "success", "warning", "danger", "info", "indigo", "teal", "pink", "amber", "slate"];
10877
- const getVariantByIndex = (index, fallback) => colorVariants[index % colorVariants.length] || fallback;
10878
- const {
10879
- field: assigneeField
10880
- } = useController({
11015
+ return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(FilterFormField, null, /*#__PURE__*/React.createElement(Controller, {
10881
11016
  name: "assignee",
10882
- control: controlFilterForm
10883
- });
10884
- const {
10885
- field: statusField
10886
- } = useController({
11017
+ control: controlFilterForm,
11018
+ render: props => /*#__PURE__*/React.createElement(RadioButtons, {
11019
+ onSelect: e => {
11020
+ props.onChange(e.code);
11021
+ },
11022
+ selectedOption: availableOptions.filter(option => option.code === props.value)[0],
11023
+ optionsKey: "name",
11024
+ options: availableOptions
11025
+ })
11026
+ })), /*#__PURE__*/React.createElement(FilterFormField, null, /*#__PURE__*/React.createElement(Controller, {
10887
11027
  name: "applicationStatus",
10888
11028
  control: controlFilterForm,
10889
- defaultValue: []
10890
- });
10891
- const statusValues = Array.isArray(statusField.value) ? statusField.value : [];
10892
- const toggleStatus = statusCode => {
10893
- let newStatusValues;
10894
- if (statusValues.includes(statusCode)) {
10895
- newStatusValues = statusValues.filter(code => code !== statusCode);
10896
- } else {
10897
- newStatusValues = [...statusValues, statusCode];
10898
- }
10899
- statusField.onChange(newStatusValues);
10900
- if (typeof handleFilter === "function") {
10901
- handleFilter({
10902
- applicationStatus: newStatusValues.map(code => ({
10903
- code
10904
- }))
10905
- });
10906
- }
10907
- };
10908
- const cards = [...availableOptions.map(option => ({
10909
- key: option.code,
10910
- type: "assignee",
10911
- label: option.name,
10912
- subtitle: t("ES_INBOX_ASSIGNED"),
10913
- count: null,
10914
- code: option.code,
10915
- icon: "⌂"
10916
- })), ...(statuses || []).map(status => ({
10917
- key: status.applicationstatus,
10918
- type: "status",
10919
- label: t(status.applicationstatus),
10920
- subtitle: null,
10921
- count: status.totalCount ?? status.count ?? status.noOfRecords ?? status.totalRecords ?? status.applicationCount ?? 0,
10922
- code: status.applicationstatus,
10923
- icon: "◎"
10924
- }))];
10925
- const visibleCards = showAllStatuses ? cards : cards.slice(0, 6);
10926
- return /*#__PURE__*/React.createElement("div", {
10927
- className: "ndc-new-inbox-filter-card",
10928
- style: {
10929
- marginTop: 16,
10930
- marginBottom: 16
10931
- }
10932
- }, /*#__PURE__*/React.createElement(FilterFormField, null, /*#__PURE__*/React.createElement("div", {
10933
- className: "ndc-new-filter-status-wrapper"
10934
- }, /*#__PURE__*/React.createElement("div", {
10935
- className: "ndc-new-filter-status-grid ndc-new-filter-card-grid"
10936
- }, visibleCards.map((card, index) => {
10937
- const isActive = card.type === "assignee" ? assigneeField.value === card.code : statusValues.includes(card.code);
10938
- const variant = getVariantByIndex(index, getVariantFromCode(card.code));
10939
- return /*#__PURE__*/React.createElement("button", {
10940
- key: card.key,
10941
- type: "button",
10942
- className: `ndc-new-filter-status-card ndc-new-filter-option-card ndc-new-filter-card ${variant} ${isActive ? "active" : ""}`,
10943
- onClick: () => {
10944
- if (card.type === "assignee") {
10945
- assigneeField.onChange(card.code);
10946
- if (typeof handleFilter === "function") {
10947
- handleFilter({
10948
- assignee: card.code,
10949
- applicationStatus: statusValues.map(code => ({
10950
- code
10951
- }))
10952
- });
10953
- }
11029
+ defaultValue: [],
11030
+ render: props => {
11031
+ const toggleStatus = statusCode => {
11032
+ console.log(statusCode, "statusCode");
11033
+ if (props.value.includes(statusCode)) {
11034
+ props.onChange(props.value.filter(code => code !== statusCode));
10954
11035
  } else {
10955
- toggleStatus(card.code);
10956
- }
10957
- }
10958
- }, isActive ? /*#__PURE__*/React.createElement("span", {
10959
- className: "ndc-new-filter-card-check",
10960
- "aria-hidden": "true"
10961
- }, "\u2713") : null, /*#__PURE__*/React.createElement("div", {
10962
- className: "ndc-new-filter-status-title ndc-new-filter-option-title"
10963
- }, card.label), card.subtitle ? /*#__PURE__*/React.createElement("div", {
10964
- className: "ndc-new-filter-option-subtitle"
10965
- }, card.subtitle) : /*#__PURE__*/React.createElement("div", {
10966
- className: "ndc-new-filter-status-count"
10967
- }, card.count !== null && card.count !== undefined ? card.count : ""), /*#__PURE__*/React.createElement("span", {
10968
- className: "ndc-new-filter-card-icon",
10969
- "aria-hidden": "true"
10970
- }, /*#__PURE__*/React.createElement("span", null, card.icon)));
10971
- })), cards.length > 6 ? /*#__PURE__*/React.createElement("div", {
10972
- style: {
10973
- display: "flex",
10974
- justifyContent: "center",
10975
- marginTop: 8
11036
+ props.onChange([...props.value, statusCode]);
11037
+ }
11038
+ };
11039
+ return /*#__PURE__*/React.createElement(Fragment$1, null, statuses === null || statuses === void 0 ? void 0 : statuses.map((status, index) => /*#__PURE__*/React.createElement(CheckBox, {
11040
+ key: status.applicationstatus,
11041
+ label: `${t(status.applicationstatus)} - ${status.count}`,
11042
+ value: status.applicationstatus,
11043
+ checked: props.value.includes(status.applicationstatus),
11044
+ onChange: () => toggleStatus(status.applicationstatus),
11045
+ index: index
11046
+ })));
10976
11047
  }
10977
- }, /*#__PURE__*/React.createElement("button", {
10978
- type: "button",
10979
- className: "ndc-new-filter-show-more",
10980
- onClick: () => setShowAllStatuses(prev => !prev),
10981
- "aria-label": showAllStatuses ? t("ES_COMMON_SHOW_LESS") : t("ES_COMMON_SHOW_MORE")
10982
- }, /*#__PURE__*/React.createElement("span", {
10983
- className: "ndc-new-filter-show-more-icon",
10984
- "aria-hidden": "true"
10985
- }, showAllStatuses ? "▲" : "▼"))) : null)));
11048
+ })));
10986
11049
  };
10987
11050
 
10988
- const useNewInboxTableConfig = ({
11051
+ const useInboxTableConfig = ({
10989
11052
  parentRoute,
10990
11053
  onPageSizeChange,
10991
11054
  formState,
@@ -10998,87 +11061,33 @@ const useNewInboxTableConfig = ({
10998
11061
  const {
10999
11062
  t
11000
11063
  } = useTranslation();
11001
- const getStatusClass = status => {
11002
- const value = String(status || "").toLowerCase();
11003
- if (value.includes("approved")) return "approved";
11004
- if (value.includes("rejected")) return "rejected";
11005
- if (value.includes("forward")) return "forwarded";
11006
- if (value.includes("process")) return "in-progress";
11007
- if (value.includes("pending")) return "pending";
11008
- if (value.includes("new")) return "new";
11009
- return "default";
11010
- };
11011
- const renderStatusIcon = statusClass => {
11012
- switch (statusClass) {
11013
- case "approved":
11014
- return /*#__PURE__*/React.createElement("svg", {
11015
- viewBox: "0 0 24 24",
11016
- width: "14",
11017
- height: "14",
11018
- fill: "none",
11019
- stroke: "currentColor",
11020
- strokeWidth: "2"
11021
- }, /*#__PURE__*/React.createElement("path", {
11022
- d: "M20 6L9 17l-5-5"
11023
- }));
11024
- case "rejected":
11025
- return /*#__PURE__*/React.createElement("svg", {
11026
- viewBox: "0 0 24 24",
11027
- width: "14",
11028
- height: "14",
11029
- fill: "none",
11030
- stroke: "currentColor",
11031
- strokeWidth: "2"
11032
- }, /*#__PURE__*/React.createElement("path", {
11033
- d: "M18 6L6 18"
11034
- }), /*#__PURE__*/React.createElement("path", {
11035
- d: "M6 6l12 12"
11036
- }));
11037
- case "forwarded":
11038
- return /*#__PURE__*/React.createElement("svg", {
11039
- viewBox: "0 0 24 24",
11040
- width: "14",
11041
- height: "14",
11042
- fill: "none",
11043
- stroke: "currentColor",
11044
- strokeWidth: "2"
11045
- }, /*#__PURE__*/React.createElement("path", {
11046
- d: "M5 12h14"
11047
- }), /*#__PURE__*/React.createElement("path", {
11048
- d: "M13 5l7 7-7 7"
11049
- }));
11050
- default:
11051
- return null;
11052
- }
11053
- };
11064
+ const GetCell = value => /*#__PURE__*/React.createElement("span", {
11065
+ className: "cell-text styled-cell"
11066
+ }, value);
11054
11067
  const tableColumnConfig = useMemo(() => {
11055
11068
  return [{
11056
11069
  Header: t("NOC_HOME_SEARCH_RESULTS_APP_NO_LABEL"),
11057
- accessor: "applicationId",
11070
+ accessor: "uuid",
11058
11071
  disableSortBy: true,
11059
- className: "ndc-new-table-app",
11060
11072
  Cell: ({
11061
11073
  row
11062
11074
  }) => {
11063
- var _row$original, _row$original2, _row$original3, _row$original4, _row$original5;
11064
- return /*#__PURE__*/React.createElement("div", {
11065
- className: "ndc-new-cell-stack"
11066
- }, /*#__PURE__*/React.createElement(Link, {
11067
- to: `${parentRoute}/inbox/application-overview/${(_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.applicationId}`,
11068
- className: "ndc-new-app-link"
11069
- }, ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.applicationId) || ((_row$original3 = row.original) === null || _row$original3 === void 0 ? void 0 : _row$original3.applicationNo) || "-"), (_row$original4 = row.original) !== null && _row$original4 !== void 0 && _row$original4.locality ? /*#__PURE__*/React.createElement("div", {
11070
- className: "ndc-new-cell-secondary"
11071
- }, (_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.locality) : null);
11075
+ var _row$original, _row$original2;
11076
+ console.log("row", row);
11077
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Link, {
11078
+ to: `${parentRoute}/inbox/application-overview/${(_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.applicationId}`
11079
+ }, /*#__PURE__*/React.createElement("span", {
11080
+ className: "link"
11081
+ }, (_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.applicationId)));
11072
11082
  }
11073
11083
  }, {
11074
11084
  Header: t("TL_COMMON_TABLE_COL_APP_DATE"),
11075
- accessor: "date",
11085
+ accessor: "createdtime",
11076
11086
  Cell: ({
11077
11087
  row
11078
11088
  }) => {
11079
- var _row$original6, _row$original7;
11080
- const dateValue = ((_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.date) || ((_row$original7 = row.original) === null || _row$original7 === void 0 ? void 0 : _row$original7.createdTime);
11081
- return dateValue ? format(new Date(dateValue), "dd/MM/yyyy") : "-";
11089
+ var _row$original3, _row$original4;
11090
+ return (_row$original3 = row.original) !== null && _row$original3 !== void 0 && _row$original3.date ? GetCell(format(new Date((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : _row$original4.date), "dd/MM/yyyy")) : "";
11082
11091
  }
11083
11092
  }, {
11084
11093
  Header: t("PT_COMMON_TABLE_COL_STATUS_LABEL"),
@@ -11086,56 +11095,18 @@ const useNewInboxTableConfig = ({
11086
11095
  Cell: ({
11087
11096
  row
11088
11097
  }) => {
11089
- var _row$original8, _row$original9;
11090
- const statusValue = ((_row$original8 = row.original) === null || _row$original8 === void 0 ? void 0 : _row$original8.status) || ((_row$original9 = row.original) === null || _row$original9 === void 0 ? void 0 : _row$original9.applicationStatus) || "-";
11091
- const statusClass = getStatusClass(statusValue);
11092
- return /*#__PURE__*/React.createElement("span", {
11093
- className: `ndc-new-status-pill ${statusClass}`
11094
- }, renderStatusIcon(statusClass), /*#__PURE__*/React.createElement("span", null, String(statusValue || "-").toLowerCase()));
11095
- }
11096
- }, {
11097
- Header: t("CS_COMMON_ACTION"),
11098
- accessor: "action",
11099
- disableSortBy: true,
11100
- className: "ndc-new-table-action",
11101
- Cell: ({
11102
- row
11103
- }) => {
11104
- var _row$original0;
11105
- return /*#__PURE__*/React.createElement("span", {
11106
- className: "ndc-new-action-group"
11107
- }, /*#__PURE__*/React.createElement(Link, {
11108
- to: `${parentRoute}/inbox/application-overview/${(_row$original0 = row.original) === null || _row$original0 === void 0 ? void 0 : _row$original0.applicationId}`,
11109
- className: "ndc-new-icon ndc-new-icon-link",
11110
- "aria-label": t("ES_COMMON_VIEW")
11111
- }, /*#__PURE__*/React.createElement("svg", {
11112
- viewBox: "0 0 24 24",
11113
- width: "18",
11114
- height: "18",
11115
- fill: "none",
11116
- stroke: "currentColor",
11117
- strokeWidth: "2"
11118
- }, /*#__PURE__*/React.createElement("path", {
11119
- d: "M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z"
11120
- }), /*#__PURE__*/React.createElement("circle", {
11121
- cx: "12",
11122
- cy: "12",
11123
- r: "3"
11124
- }))));
11098
+ var _row$original5;
11099
+ return t((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : _row$original5.status);
11125
11100
  }
11126
11101
  }];
11127
- }, [parentRoute, t]);
11102
+ });
11128
11103
  return {
11129
- getCellProps: () => ({
11130
- style: {
11131
- padding: "16px 20px",
11132
- fontSize: "14px"
11133
- }
11134
- }),
11135
- getRowProps: row => {
11136
- var _row$original1, _row$original10;
11104
+ getCellProps: cellInfo => {
11137
11105
  return {
11138
- className: `ndc-new-row ${getStatusClass((row === null || row === void 0 ? void 0 : (_row$original1 = row.original) === null || _row$original1 === void 0 ? void 0 : _row$original1.status) || (row === null || row === void 0 ? void 0 : (_row$original10 = row.original) === null || _row$original10 === void 0 ? void 0 : _row$original10.applicationStatus))}`
11106
+ style: {
11107
+ padding: "20px 18px",
11108
+ fontSize: "16px"
11109
+ }
11139
11110
  };
11140
11111
  },
11141
11112
  disableSort: false,
@@ -11190,7 +11161,7 @@ const useNewInboxTableConfig = ({
11190
11161
  };
11191
11162
  };
11192
11163
 
11193
- const useNewInboxMobileCardsData = ({
11164
+ const useInboxMobileCardsData = ({
11194
11165
  parentRoute,
11195
11166
  table
11196
11167
  }) => {
@@ -11240,37 +11211,33 @@ const useNewInboxMobileCardsData = ({
11240
11211
  };
11241
11212
  };
11242
11213
 
11243
- const NewNDCInbox = ({
11244
- parentRoute,
11245
- tableColumns
11214
+ const Inbox = ({
11215
+ parentRoute
11246
11216
  }) => {
11247
- var _formState$filterForm3, _formState$filterForm4, _formState$filterForm5, _formState$tableForm5, _formState$tableForm6, _formState$tableForm7, _formState$tableForm8, _formState$tableForm9, _formState$tableForm0, _formState$tableForm1;
11248
11217
  const {
11249
11218
  t
11250
11219
  } = useTranslation();
11251
11220
  const tenantId = window.localStorage.getItem("Employee.tenant-id");
11252
- const [activeStatusTab, setActiveStatusTab] = useState("ALL");
11253
- const [topBarSearch, setTopBarSearch] = useState("");
11254
- const businessServices = useMemo(() => businessServiceList(true) || [], []);
11255
- const searchFormDefaultValues = useMemo(() => ({}), []);
11256
- const filterFormDefaultValues = useMemo(() => ({
11221
+ const [getFilter, setFilter] = useState();
11222
+ const searchFormDefaultValues = {};
11223
+ const filterFormDefaultValues = {
11257
11224
  moduleName: "ndc-services",
11258
11225
  applicationStatus: [],
11259
11226
  businessService: null,
11260
11227
  locality: [],
11261
11228
  assignee: "ASSIGNED_TO_ALL",
11262
- businessServiceArray: businessServices
11263
- }), [businessServices]);
11264
- const tableOrderFormDefaultValues = useMemo(() => ({
11229
+ businessServiceArray: businessServiceList(true) || []
11230
+ };
11231
+ const tableOrderFormDefaultValues = {
11265
11232
  sortBy: "",
11266
11233
  limit: window.Digit.Utils.browser.isMobile() ? 50 : 10,
11267
11234
  offset: 0,
11268
11235
  sortOrder: "DESC"
11269
- }), []);
11236
+ };
11270
11237
  function formReducer(state, payload) {
11271
11238
  switch (payload.action) {
11272
11239
  case "mutateSearchForm":
11273
- Digit.SessionStorage.set("NDC.NEW_INBOX", {
11240
+ Digit.SessionStorage.set("NDC.INBOX", {
11274
11241
  ...state,
11275
11242
  searchForm: payload.data
11276
11243
  });
@@ -11279,7 +11246,7 @@ const NewNDCInbox = ({
11279
11246
  searchForm: payload.data
11280
11247
  };
11281
11248
  case "mutateFilterForm":
11282
- Digit.SessionStorage.set("NDC.NEW_INBOX", {
11249
+ Digit.SessionStorage.set("NDC.INBOX", {
11283
11250
  ...state,
11284
11251
  filterForm: payload.data
11285
11252
  });
@@ -11288,7 +11255,7 @@ const NewNDCInbox = ({
11288
11255
  filterForm: payload.data
11289
11256
  };
11290
11257
  case "mutateTableForm":
11291
- Digit.SessionStorage.set("NDC.NEW_INBOX", {
11258
+ Digit.SessionStorage.set("NDC.INBOX", {
11292
11259
  ...state,
11293
11260
  tableForm: payload.data
11294
11261
  });
@@ -11298,7 +11265,7 @@ const NewNDCInbox = ({
11298
11265
  };
11299
11266
  }
11300
11267
  }
11301
- const InboxObjectInSessionStorage = Digit.SessionStorage.get("NDC.NEW_INBOX");
11268
+ const InboxObjectInSessionStorage = Digit.SessionStorage.get("NDC.INBOX");
11302
11269
  const onSearchFormReset = setSearchFormValue => {
11303
11270
  setSearchFormValue("sourceRefId", null);
11304
11271
  setSearchFormValue("applicationNo", null);
@@ -11309,8 +11276,8 @@ const NewNDCInbox = ({
11309
11276
  });
11310
11277
  };
11311
11278
  const onFilterFormReset = setFilterFormValue => {
11312
- setFilterFormValue("moduleName", "ndc-services");
11313
- setFilterFormValue("applicationStatus", []);
11279
+ setFilterFormValue("moduleName", "bpa-services");
11280
+ setFilterFormValue("applicationStatus", "");
11314
11281
  setFilterFormValue("locality", []);
11315
11282
  setFilterFormValue("assignee", "ASSIGNED_TO_ALL");
11316
11283
  setFilterFormValue("applicationType", []);
@@ -11343,26 +11310,6 @@ const NewNDCInbox = ({
11343
11310
  }
11344
11311
  });
11345
11312
  };
11346
- const onNextPage = () => {
11347
- var _formState$tableForm, _formState$tableForm2;
11348
- return dispatch({
11349
- action: "mutateTableForm",
11350
- data: {
11351
- ...formState.tableForm,
11352
- offset: parseInt((_formState$tableForm = formState.tableForm) === null || _formState$tableForm === void 0 ? void 0 : _formState$tableForm.offset) + parseInt((_formState$tableForm2 = formState.tableForm) === null || _formState$tableForm2 === void 0 ? void 0 : _formState$tableForm2.limit)
11353
- }
11354
- });
11355
- };
11356
- const onPrevPage = () => {
11357
- var _formState$tableForm3, _formState$tableForm4;
11358
- return dispatch({
11359
- action: "mutateTableForm",
11360
- data: {
11361
- ...formState.tableForm,
11362
- offset: parseInt((_formState$tableForm3 = formState.tableForm) === null || _formState$tableForm3 === void 0 ? void 0 : _formState$tableForm3.offset) - parseInt((_formState$tableForm4 = formState.tableForm) === null || _formState$tableForm4 === void 0 ? void 0 : _formState$tableForm4.limit)
11363
- }
11364
- });
11365
- };
11366
11313
  const onSortingByData = e => {
11367
11314
  if (e.length > 0) {
11368
11315
  const [{
@@ -11399,54 +11346,17 @@ const NewNDCInbox = ({
11399
11346
  data: localitiesForEmployeesCurrentTenant,
11400
11347
  isLoading: loadingLocalitiesForEmployeesCurrentTenant
11401
11348
  } = Digit.Hooks.useBoundaryLocalities(tenantId, "revenue", {}, t);
11402
- const {
11403
- register: registerFilterFormField,
11404
- control: controlFilterForm,
11405
- handleSubmit: handleFilterFormSubmit,
11406
- setValue: setFilterFormValue,
11407
- getValues: getFilterFormValue,
11408
- reset: resetFilterForm
11409
- } = useForm({
11410
- defaultValues: {
11411
- ...filterFormDefaultValues
11412
- }
11413
- });
11414
- const handleFilter = useCallback(filterData => {
11415
- var _filterData$applicati, _formState$filterForm, _formState$filterForm2;
11416
- if (filterData.applicationStatus) {
11417
- setFilterFormValue("applicationStatus", filterData.applicationStatus.map(item => item.code || item));
11418
- }
11419
- if (filterData.assignee) {
11420
- setFilterFormValue("assignee", filterData.assignee);
11421
- }
11422
- dispatch({
11423
- action: "mutateFilterForm",
11424
- data: {
11425
- ...(formState === null || formState === void 0 ? void 0 : formState.filterForm),
11426
- applicationStatus: ((_filterData$applicati = filterData.applicationStatus) === null || _filterData$applicati === void 0 ? void 0 : _filterData$applicati.map(item => item.code || item)) || (formState === null || formState === void 0 ? void 0 : (_formState$filterForm = formState.filterForm) === null || _formState$filterForm === void 0 ? void 0 : _formState$filterForm.applicationStatus) || [],
11427
- assignee: filterData.assignee || (formState === null || formState === void 0 ? void 0 : (_formState$filterForm2 = formState.filterForm) === null || _formState$filterForm2 === void 0 ? void 0 : _formState$filterForm2.assignee) || "ASSIGNED_TO_ALL"
11428
- }
11429
- });
11430
- }, [formState === null || formState === void 0 ? void 0 : formState.filterForm, setFilterFormValue]);
11431
- const prevFilterRef = useRef("");
11432
- const searchDebounceRef = useRef(null);
11433
- const hasInitializedFilterForm = useRef(false);
11434
- useEffect(() => {
11435
- if (formState !== null && formState !== void 0 && formState.filterForm) {
11436
- setFilterFormValue("assignee", formState.filterForm.assignee || "ASSIGNED_TO_ALL");
11437
- setFilterFormValue("applicationStatus", formState.filterForm.applicationStatus || []);
11438
- setFilterFormValue("moduleName", formState.filterForm.moduleName || "ndc-services");
11439
- }
11440
- }, [formState === null || formState === void 0 ? void 0 : (_formState$filterForm3 = formState.filterForm) === null || _formState$filterForm3 === void 0 ? void 0 : _formState$filterForm3.assignee, formState === null || formState === void 0 ? void 0 : (_formState$filterForm4 = formState.filterForm) === null || _formState$filterForm4 === void 0 ? void 0 : _formState$filterForm4.applicationStatus, formState === null || formState === void 0 ? void 0 : (_formState$filterForm5 = formState.filterForm) === null || _formState$filterForm5 === void 0 ? void 0 : _formState$filterForm5.moduleName, setFilterFormValue]);
11349
+ const handleFilter = filterStatus => {
11350
+ setFilter(filterStatus);
11351
+ };
11441
11352
  const {
11442
11353
  isLoading: isInboxLoading,
11443
11354
  data
11444
11355
  } = Digit.Hooks.ndc.useInbox({
11445
11356
  tenantId,
11446
11357
  filters: {
11447
- filterForm: (formState === null || formState === void 0 ? void 0 : formState.filterForm) || filterFormDefaultValues,
11448
- searchForm: (formState === null || formState === void 0 ? void 0 : formState.searchForm) || searchFormDefaultValues,
11449
- tableForm: (formState === null || formState === void 0 ? void 0 : formState.tableForm) || tableOrderFormDefaultValues
11358
+ ...formState,
11359
+ getFilter
11450
11360
  }
11451
11361
  });
11452
11362
  const [table, setTable] = useState([]);
@@ -11472,7 +11382,7 @@ const NewNDCInbox = ({
11472
11382
  registerRef,
11473
11383
  searchFormState,
11474
11384
  searchFieldComponents
11475
- }) => /*#__PURE__*/React.createElement(NewSearchFormFieldsComponent, {
11385
+ }) => /*#__PURE__*/React.createElement(SearchFormFieldsComponents, {
11476
11386
  registerRef,
11477
11387
  searchFormState,
11478
11388
  searchFieldComponents
@@ -11482,7 +11392,7 @@ const NewNDCInbox = ({
11482
11392
  controlFilterForm,
11483
11393
  setFilterFormValue,
11484
11394
  getFilterFormValue
11485
- }) => /*#__PURE__*/React.createElement(NewFilterFormFieldsComponent, Object.assign({}, {
11395
+ }) => /*#__PURE__*/React.createElement(FilterFormFieldsComponent, Object.assign({}, {
11486
11396
  statuses,
11487
11397
  isInboxLoading,
11488
11398
  registerRef,
@@ -11535,7 +11445,7 @@ const NewNDCInbox = ({
11535
11445
  resetFilterFormDefaultValues: filterFormDefaultValues,
11536
11446
  onFilterFormReset
11537
11447
  };
11538
- const propsForInboxTable = useNewInboxTableConfig({
11448
+ const propsForInboxTable = useInboxTableConfig({
11539
11449
  ...{
11540
11450
  parentRoute,
11541
11451
  onPageSizeChange,
@@ -11546,7 +11456,7 @@ const NewNDCInbox = ({
11546
11456
  onSortingByData
11547
11457
  }
11548
11458
  });
11549
- const propsForInboxMobileCards = useNewInboxMobileCardsData({
11459
+ const propsForInboxMobileCards = useInboxMobileCardsData({
11550
11460
  parentRoute,
11551
11461
  table
11552
11462
  });
@@ -11555,689 +11465,18 @@ const NewNDCInbox = ({
11555
11465
  sortFormDefaultValues: formState === null || formState === void 0 ? void 0 : formState.tableForm,
11556
11466
  onSortFormReset
11557
11467
  };
11558
- const resolvedTableColumns = tableColumns || (propsForInboxTable === null || propsForInboxTable === void 0 ? void 0 : propsForInboxTable.columns);
11559
- useEffect(() => {
11560
- const serialized = JSON.stringify((formState === null || formState === void 0 ? void 0 : formState.filterForm) || {});
11561
- if (prevFilterRef.current === serialized) return;
11562
- prevFilterRef.current = serialized;
11563
- }, [formState]);
11564
- useEffect(() => {
11565
- if (searchDebounceRef.current) clearTimeout(searchDebounceRef.current);
11566
- searchDebounceRef.current = setTimeout(() => {
11567
- const value = String(topBarSearch || "").trim();
11568
- const nextSearchForm = value ? {
11569
- applicationNo: value
11570
- } : {};
11571
- dispatch({
11572
- action: "mutateTableForm",
11573
- data: {
11574
- ...tableOrderFormDefaultValues
11575
- }
11576
- });
11577
- dispatch({
11578
- action: "mutateSearchForm",
11579
- data: nextSearchForm
11580
- });
11581
- }, 400);
11582
- return () => clearTimeout(searchDebounceRef.current);
11583
- }, [topBarSearch, tableOrderFormDefaultValues]);
11584
- const onResetFilterForm = () => {
11585
- onFilterFormReset(setFilterFormValue);
11586
- };
11587
- const normalizeStatus = useCallback(value => String(value || "").replace(/[\s-_]+/g, "").toUpperCase(), []);
11588
- const onStatusTabClick = useCallback((label, statusCode) => {
11589
- setActiveStatusTab(statusCode || label);
11590
- if (label === "CLEAR") {
11591
- setTopBarSearch("");
11592
- return;
11593
- }
11594
- if (label === "ALL") {
11595
- setFilterFormValue("applicationStatus", [], {
11596
- shouldDirty: true,
11597
- shouldTouch: true
11598
- });
11599
- handleFilterFormSubmit(onFilterFormSubmit)();
11600
- return;
11601
- }
11602
- const resolvedCode = statusCode || label;
11603
- setFilterFormValue("applicationStatus", [resolvedCode], {
11604
- shouldDirty: true,
11605
- shouldTouch: true
11606
- });
11607
- handleFilterFormSubmit(onFilterFormSubmit)();
11608
- }, [handleFilterFormSubmit, onFilterFormSubmit, setFilterFormValue]);
11609
- useEffect(() => {
11610
- if (hasInitializedFilterForm.current) return;
11611
- if (resetFilterForm && formState) {
11612
- resetFilterForm(formState === null || formState === void 0 ? void 0 : formState.filterForm);
11613
- hasInitializedFilterForm.current = true;
11614
- }
11615
- }, [formState, resetFilterForm]);
11616
- const isMobile = window.Digit.Utils.browser.isMobile();
11617
- if (isMobile) {
11618
- return /*#__PURE__*/React.createElement("div", {
11619
- className: "ndc-new-inbox"
11620
- }, /*#__PURE__*/React.createElement(InboxComposer, _extends({
11621
- isInboxLoading,
11622
- PropsForInboxLinks
11623
- }, propsForSearchForm, propsForFilterForm, propsForMobileSortForm, {
11624
- propsForInboxTable,
11625
- propsForInboxMobileCards,
11626
- formState
11627
- })));
11628
- }
11629
- return /*#__PURE__*/React.createElement("div", {
11630
- className: "ndc-new-inbox"
11631
- }, /*#__PURE__*/React.createElement("style", null, `
11632
- .ndc-new-inbox {
11633
- margin-top: 32px;
11634
- padding: 20px;
11635
- background: #f8fafc;
11636
- border-radius: 12px;
11637
- }
11638
- .ndc-new-inbox .ndc-new-header {
11639
- display: flex;
11640
- align-items: center;
11641
- gap: 10px;
11642
- font-size: 24px;
11643
- font-weight: 700;
11644
- margin-bottom: 12px;
11645
- }
11646
- .ndc-new-inbox .ndc-new-count-pill {
11647
- display: inline-flex;
11648
- align-items: center;
11649
- justify-content: center;
11650
- min-width: 28px;
11651
- height: 28px;
11652
- padding: 0 8px;
11653
- border-radius: 999px;
11654
- background: #2563eb;
11655
- color: #ffffff;
11656
- font-size: 12px;
11657
- font-weight: 700;
11658
- }
11659
-
11660
- .ndc-new-inbox .ndc-new-filter-card-grid {
11661
- display: grid;
11662
- grid-template-columns: repeat(6, 1fr);
11663
- gap: 14px;
11664
- }
11665
- .ndc-new-inbox .ndc-new-filter-option-card {
11666
- background: #f8fafc;
11667
- border: 1px solid #e5e7eb;
11668
- border-radius: 12px;
11669
- padding: 16px;
11670
- min-height: 88px;
11671
- text-align: left;
11672
- cursor: pointer;
11673
- transition: all 0.2s ease;
11674
- position: relative;
11675
- overflow: hidden;
11676
- }
11677
- .ndc-new-inbox .ndc-new-filter-option-card.active {
11678
- background: #e0f2fe;
11679
- border-color: #38bdf8;
11680
- box-shadow: 0 4px 12px rgba(2, 132, 199, 0.18);
11681
- }
11682
- .ndc-new-inbox .ndc-new-filter-option-title {
11683
- font-weight: 700;
11684
- font-size: 14px;
11685
- }
11686
- .ndc-new-inbox .ndc-new-filter-option-subtitle {
11687
- font-size: 12px;
11688
- margin-top: 6px;
11689
- color: white;
11690
- }
11691
- .ndc-new-inbox .ndc-new-filter-status-grid {
11692
- display: grid;
11693
- grid-template-columns: repeat(6, 1fr);
11694
- gap: 14px;
11695
- }
11696
- .ndc-new-inbox .ndc-new-filter-status-card {
11697
- background: #ffffff;
11698
- border: 1px solid #e5e7eb;
11699
- border-radius: 12px;
11700
- padding: 16px;
11701
- min-height: 88px;
11702
- text-align: left;
11703
- cursor: pointer;
11704
- transition: all 0.2s ease;
11705
- width: 100%;
11706
- box-sizing: border-box;
11707
- position: relative;
11708
- overflow: hidden;
11709
- }
11710
- .ndc-new-inbox .ndc-new-filter-status-card.active {
11711
- background: #e0f2fe;
11712
- border-color: #38bdf8;
11713
- box-shadow: 0 4px 12px rgba(2, 132, 199, 0.18);
11714
- }
11715
- .ndc-new-inbox .ndc-new-filter-status-title {
11716
- font-weight: 700;
11717
- font-size: 14px;
11718
- }
11719
- .ndc-new-inbox .ndc-new-filter-status-count {
11720
- font-size: 22px;
11721
- font-weight: 700;
11722
- margin-top: 8px;
11723
- color: inherit;
11724
- }
11725
- .ndc-new-inbox .ndc-new-filter-card-icon {
11726
- position: absolute;
11727
- top: 12px;
11728
- right: 12px;
11729
- width: 36px;
11730
- height: 36px;
11731
- border-radius: 999px;
11732
- background: rgba(255, 255, 255, 0.2);
11733
- display: inline-flex;
11734
- align-items: center;
11735
- justify-content: center;
11736
- color: #ffffff;
11737
- font-size: 16px;
11738
- }
11739
- .ndc-new-inbox .ndc-new-filter-card-check {
11740
- position: absolute;
11741
- top: 10px;
11742
- left: 12px;
11743
- width: 22px;
11744
- height: 22px;
11745
- border-radius: 999px;
11746
- display: inline-flex;
11747
- align-items: center;
11748
- justify-content: center;
11749
- font-size: 12px;
11750
- font-weight: 700;
11751
- background: rgba(255, 255, 255, 0.9);
11752
- color: #111827;
11753
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
11754
- }
11755
- .ndc-new-inbox .ndc-new-filter-card {
11756
- color: #ffffff;
11757
- border-color: transparent;
11758
- }
11759
- .ndc-new-inbox .ndc-new-filter-card.primary {
11760
- background: #2563eb;
11761
- }
11762
- .ndc-new-inbox .ndc-new-filter-card.success {
11763
- background: #16a34a;
11764
- }
11765
- .ndc-new-inbox .ndc-new-filter-card.warning {
11766
- background: #ea580c;
11767
- }
11768
- .ndc-new-inbox .ndc-new-filter-card.info {
11769
- background: #7c3aed;
11770
- }
11771
- .ndc-new-inbox .ndc-new-filter-card.danger {
11772
- background: #dc2626;
11773
- }
11774
- .ndc-new-inbox .ndc-new-filter-card.indigo {
11775
- background: #4f46e5;
11776
- }
11777
- .ndc-new-inbox .ndc-new-filter-card.teal {
11778
- background: #0f766e;
11779
- }
11780
- .ndc-new-inbox .ndc-new-filter-card.pink {
11781
- background: #db2777;
11782
- }
11783
- .ndc-new-inbox .ndc-new-filter-card.amber {
11784
- background: #d97706;
11785
- }
11786
- .ndc-new-inbox .ndc-new-filter-card.slate {
11787
- background: #475569;
11788
- }
11789
- .ndc-new-inbox .ndc-new-filter-card.active {
11790
- box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
11791
- transform: translateY(-1px);
11792
- }
11793
- .ndc-new-inbox .ndc-new-filter-show-more {
11794
- margin-top: 12px;
11795
- cursor: pointer;
11796
- font-weight: 600;
11797
- font-size: 12px;
11798
- color: #2563eb;
11799
- display: inline-flex;
11800
- align-items: center;
11801
- gap: 6px;
11802
- transition: all 0.2s ease;
11803
- }
11804
- .ndc-new-inbox .ndc-new-filter-show-more-icon {
11805
- width: 28px;
11806
- height: 28px;
11807
- border-radius: 999px;
11808
- display: inline-flex;
11809
- align-items: center;
11810
- justify-content: center;
11811
- font-size: 12px;
11812
- color: #457fff;
11813
- background: #eff6ff;
11814
- }
11815
- .ndc-new-inbox .ndc-new-filter-show-more:hover {
11816
- background: #eff6ff;
11817
- border-color: #bfdbfe;
11818
- }
11819
- .ndc-new-inbox .ndc-new-layout {
11820
- display: block;
11821
- }
11822
- .ndc-new-inbox .filter-card .heading {
11823
- display: none;
11824
- }
11825
- .ndc-new-inbox .filter-card .submit-bar,
11826
- .ndc-new-inbox .filter-card button[type="submit"] {
11827
- display: none;
11828
- }
11829
- .ndc-new-inbox .ndc-new-top-filters {
11830
- margin: 12px 0 16px;
11831
- background: #ffffff;
11832
- border: 1px solid #e2e8f0;
11833
- border-radius: 16px;
11834
- padding: 18px;
11835
- box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
11836
- }
11837
- .ndc-new-inbox .ndc-new-inbox-filter-card {
11838
- margin: 0;
11839
- }
11840
- .ndc-new-inbox .ndc-new-filter-card-grid {
11841
- grid-template-columns: repeat(6, 1fr);
11842
- }
11843
- .ndc-new-inbox .ndc-new-filter-status-grid {
11844
- grid-template-columns: repeat(6, 1fr);
11845
- }
11846
- @media (max-width: 1400px) {
11847
- .ndc-new-inbox .ndc-new-filter-card-grid,
11848
- .ndc-new-inbox .ndc-new-filter-status-grid {
11849
- grid-template-columns: repeat(4, minmax(140px, 1fr));
11850
- }
11851
- }
11852
- @media (max-width: 1100px) {
11853
- .ndc-new-inbox .ndc-new-filter-card-grid,
11854
- .ndc-new-inbox .ndc-new-filter-status-grid {
11855
- grid-template-columns: repeat(3, minmax(140px, 1fr));
11856
- }
11857
- }
11858
- @media (max-width: 900px) {
11859
- .ndc-new-inbox .ndc-new-filter-card-grid,
11860
- .ndc-new-inbox .ndc-new-filter-status-grid {
11861
- grid-template-columns: repeat(2, minmax(140px, 1fr));
11862
- }
11863
- }
11864
- @media (max-width: 640px) {
11865
- .ndc-new-inbox .ndc-new-filter-card-grid,
11866
- .ndc-new-inbox .ndc-new-filter-status-grid {
11867
- grid-template-columns: 1fr;
11868
- }
11869
- }
11870
- .ndc-new-inbox .ndc-new-table-card {
11871
- margin-top: 16px;
11872
- background: #ffffff;
11873
- border: 1px solid #e2e8f0;
11874
- border-radius: 16px;
11875
- box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
11876
- overflow: hidden;
11877
- }
11878
- .ndc-new-inbox .ndc-new-table-topbar {
11879
- display: flex;
11880
- align-items: center;
11881
- justify-content: space-between;
11882
- gap: 16px;
11883
- padding: 16px;
11884
- border-radius: 16px;
11885
- border: 1px solid #e2e8f0;
11886
- background: #ffffff;
11887
- box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
11888
- }
11889
- .ndc-new-inbox .ndc-new-tabs {
11890
- display: flex;
11891
- gap: 8px;
11892
- flex-wrap: nowrap;
11893
- overflow-x: auto;
11894
- max-width: calc(100% - 280px);
11895
- padding-bottom: 4px;
11896
- scrollbar-width: none;
11897
- }
11898
- .ndc-new-inbox .ndc-new-tabs::-webkit-scrollbar {
11899
- width: 0;
11900
- height: 0;
11901
- }
11902
- .ndc-new-inbox .ndc-new-tab {
11903
- padding: 6px 10px;
11904
- border-radius: 999px;
11905
- border: 1px solid #e5e7eb;
11906
- background: #f8fafc;
11907
- font-weight: 600;
11908
- font-size: 11px;
11909
- cursor: pointer;
11910
- white-space: nowrap;
11911
- }
11912
- .ndc-new-inbox .ndc-new-tab.active {
11913
- background: #2563eb;
11914
- color: #ffffff;
11915
- border-color: #2563eb;
11916
- box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25);
11917
- }
11918
- .ndc-new-inbox .ndc-new-search {
11919
- display: flex;
11920
- align-items: center;
11921
- gap: 8px;
11922
- padding: 10px 14px;
11923
- border: 1px solid #e2e8f0;
11924
- border-radius: 10px;
11925
- min-width: 260px;
11926
- background: #f8fafc;
11927
- color: #6b7280;
11928
- font-size: 12px;
11929
- }
11930
- .ndc-new-inbox .ndc-new-search input {
11931
- border: none;
11932
- outline: none;
11933
- background: transparent;
11934
- width: 100%;
11935
- font-size: 12px;
11936
- color: #111827;
11937
- }
11938
- .ndc-new-inbox .ndc-new-table-header {
11939
- padding: 18px 20px;
11940
- font-size: 18px;
11941
- font-weight: 700;
11942
- border-bottom: 1px solid #e2e8f0;
11943
- }
11944
- .ndc-new-inbox .ndc-new-table-wrapper {
11945
- display: block;
11946
- overflow-x: auto;
11947
- }
11948
- .ndc-new-inbox .ndc-new-table {
11949
- width: 100%;
11950
- border-collapse: collapse;
11951
- }
11952
- .ndc-new-inbox .ndc-new-table th {
11953
- text-align: left;
11954
- font-size: 12px;
11955
- letter-spacing: 0.08em;
11956
- color: #6b7280;
11957
- padding: 14px 20px;
11958
- background: #f8fafc;
11959
- border-bottom: 1px solid #e2e8f0;
11960
- }
11961
- .ndc-new-inbox .ndc-new-table td {
11962
- padding: 16px 20px;
11963
- border-bottom: 1px solid #eef2f7;
11964
- font-size: 14px;
11965
- color: #334155;
11966
- }
11967
- .ndc-new-inbox .ndc-new-cell-stack {
11968
- display: flex;
11969
- flex-direction: column;
11970
- gap: 4px;
11971
- }
11972
- .ndc-new-inbox .ndc-new-cell-primary {
11973
- font-weight: 600;
11974
- color: #111827;
11975
- }
11976
- .ndc-new-inbox .ndc-new-cell-secondary {
11977
- font-size: 12px;
11978
- color: #64748b;
11979
- }
11980
- .ndc-new-inbox .ndc-new-row.pending {
11981
- background: #fff7ed;
11982
- }
11983
- .ndc-new-inbox .ndc-new-row.rejected {
11984
- background: #fef2f2;
11985
- }
11986
- .ndc-new-inbox .ndc-new-row.approved {
11987
- background: #f0fdf4;
11988
- }
11989
- .ndc-new-inbox .ndc-new-table-app {
11990
- font-weight: 600;
11991
- color: #111827;
11992
- }
11993
- .ndc-new-inbox .ndc-new-table-action {
11994
- text-align: left;
11995
- white-space: nowrap;
11996
- }
11997
- .ndc-new-inbox .ndc-new-status-pill {
11998
- display: inline-flex;
11999
- align-items: center;
12000
- gap: 6px;
12001
- padding: 4px 10px;
12002
- border-radius: 999px;
12003
- font-size: 12px;
12004
- font-weight: 600;
12005
- background: #e2e8f0;
12006
- color: #111827;
12007
- border: 1px solid transparent;
12008
- }
12009
- .ndc-new-inbox .ndc-new-status-pill.approved {
12010
- background: #f0fdf4;
12011
- color: #15803d;
12012
- border-color: #86efac;
12013
- }
12014
- .ndc-new-inbox .ndc-new-status-pill.rejected {
12015
- background: #fef2f2;
12016
- color: #b91c1c;
12017
- border-color: #fecaca;
12018
- }
12019
- .ndc-new-inbox .ndc-new-status-pill.forwarded {
12020
- background: #eff6ff;
12021
- color: #1d4ed8;
12022
- border-color: #bfdbfe;
12023
- }
12024
- .ndc-new-inbox .ndc-new-status-pill.in-progress {
12025
- background: #dbeafe;
12026
- color: #1d4ed8;
12027
- }
12028
- .ndc-new-inbox .ndc-new-status-pill.pending {
12029
- background: #ffedd5;
12030
- color: #c2410c;
12031
- }
12032
- .ndc-new-inbox .ndc-new-status-pill.new {
12033
- background: #f3f4f6;
12034
- color: #111827;
12035
- }
12036
- .ndc-new-inbox .ndc-new-icon {
12037
- display: inline-flex;
12038
- align-items: center;
12039
- justify-content: center;
12040
- width: 28px;
12041
- height: 28px;
12042
- margin-left: 8px;
12043
- border-radius: 50%;
12044
- border: 1px solid #e5e7eb;
12045
- color: #94a3b8;
12046
- }
12047
- .ndc-new-inbox .ndc-new-action-group {
12048
- display: inline-flex;
12049
- align-items: center;
12050
- gap: 8px;
12051
- }
12052
- .ndc-new-inbox .ndc-new-icon-link {
12053
- text-decoration: none;
12054
- }
12055
- .ndc-new-inbox .ndc-new-app-link {
12056
- color: #2563eb;
12057
- text-decoration: none;
12058
- }
12059
- .ndc-new-inbox .ndc-new-app-link:hover {
12060
- text-decoration: underline;
12061
- }
12062
- .ndc-new-inbox .ndc-new-pagination {
12063
- display: flex;
12064
- align-items: center;
12065
- justify-content: flex-end;
12066
- gap: 12px;
12067
- padding: 12px 20px 18px;
12068
- border-top: 1px solid #eef2f7;
12069
- font-size: 12px;
12070
- color: #6b7280;
12071
- }
12072
- .ndc-new-inbox .ndc-new-pagination button {
12073
- border: 1px solid #e5e7eb;
12074
- background: #ffffff;
12075
- border-radius: 8px;
12076
- padding: 4px 8px;
12077
- cursor: pointer;
12078
- }
12079
- .ndc-new-inbox .ndc-new-pagination button:disabled {
12080
- opacity: 0.5;
12081
- cursor: not-allowed;
12082
- }
12083
- .ndc-new-inbox .ndc-new-pagination select {
12084
- border: 1px solid #e5e7eb;
12085
- border-radius: 8px;
12086
- padding: 4px 8px;
12087
- background: #ffffff;
12088
- }
12089
- @media (max-width: 768px) {
12090
- .ndc-new-inbox .ndc-new-top-filters {
12091
- padding: 0;
12092
- }
12093
- .ndc-new-inbox .ndc-new-table-topbar {
12094
- flex-wrap: wrap;
12095
- }
12096
- .ndc-new-inbox .ndc-new-tabs {
12097
- max-width: 100%;
12098
- overflow-x: visible;
12099
- flex-wrap: wrap;
12100
- }
12101
- .ndc-new-inbox .ndc-new-search {
12102
- width: 100%;
12103
- min-width: 0;
12104
- }
12105
- .ndc-new-inbox .ndc-new-table-header {
12106
- font-size: 16px;
12107
- padding: 14px 16px;
12108
- }
12109
- .ndc-new-inbox .ndc-new-table th,
12110
- .ndc-new-inbox .ndc-new-table td {
12111
- padding: 12px 14px;
12112
- font-size: 12px;
12113
- }
12114
- .ndc-new-inbox .ndc-new-status-pill {
12115
- font-size: 11px;
12116
- padding: 3px 8px;
12117
- }
12118
- }
12119
- .ndc-new-inbox .ndc-new-tab-count {
12120
- margin-left: 6px;
12121
- padding: 2px 6px;
12122
- border-radius: 999px;
12123
- background: #e2e8f0;
12124
- color: #475569;
12125
- font-size: 11px;
12126
- font-weight: 700;
12127
- }
12128
- .ndc-new-inbox .ndc-new-tab.active .ndc-new-tab-count {
12129
- background: rgba(255, 255, 255, 0.2);
12130
- color: #ffffff;
12131
- }
12132
- `), /*#__PURE__*/React.createElement("div", {
12133
- className: "ndc-new-header"
12134
- }, /*#__PURE__*/React.createElement("span", null, t("NDC Inbox")), totalCount ? /*#__PURE__*/React.createElement("span", {
12135
- className: "ndc-new-count-pill"
11468
+ return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Header, null, t("ES_COMMON_INBOX"), totalCount ? /*#__PURE__*/React.createElement("p", {
11469
+ className: "inbox-count"
12136
11470
  }, totalCount) : null), /*#__PURE__*/React.createElement("div", {
12137
- className: "ndc-new-layout"
12138
- }, /*#__PURE__*/React.createElement("div", {
12139
- className: "ndc-new-top-filters"
12140
- }, /*#__PURE__*/React.createElement(FilterForm, {
12141
- onSubmit: onFilterFormSubmit,
12142
- handleSubmit: handleFilterFormSubmit,
12143
- id: "filter-form",
12144
- onResetFilterForm: onResetFilterForm
12145
- }, /*#__PURE__*/React.createElement(NewFilterFormFieldsComponent, Object.assign({
12146
- registerRef: registerFilterFormField
12147
- }, {
12148
- controlFilterForm,
12149
- handleFilterFormSubmit,
12150
- setFilterFormValue,
12151
- getFilterFormValue,
12152
- statuses
12153
- }, {
12154
- handleFilter: handleFilter
12155
- })))), /*#__PURE__*/React.createElement("div", {
12156
- className: "ndc-new-table-topbar"
12157
- }, /*#__PURE__*/React.createElement("div", {
12158
- className: "ndc-new-tabs"
12159
- }, /*#__PURE__*/React.createElement("button", {
12160
- type: "button",
12161
- className: `ndc-new-tab ${activeStatusTab === "ALL" ? "active" : ""}`,
12162
- onClick: () => onStatusTabClick("ALL")
12163
- }, t("ALL"), /*#__PURE__*/React.createElement("span", {
12164
- className: "ndc-new-tab-count"
12165
- }, totalCount || 0)), (statuses || []).map(status => /*#__PURE__*/React.createElement("button", {
12166
- key: status === null || status === void 0 ? void 0 : status.applicationstatus,
12167
- type: "button",
12168
- className: `ndc-new-tab ${activeStatusTab === (status === null || status === void 0 ? void 0 : status.applicationstatus) ? "active" : ""}`,
12169
- onClick: () => onStatusTabClick(status === null || status === void 0 ? void 0 : status.applicationstatus, status === null || status === void 0 ? void 0 : status.applicationstatus)
12170
- }, t(status === null || status === void 0 ? void 0 : status.applicationstatus), /*#__PURE__*/React.createElement("span", {
12171
- className: "ndc-new-tab-count"
12172
- }, (status === null || status === void 0 ? void 0 : status.count) ?? 0))), /*#__PURE__*/React.createElement("button", {
12173
- type: "button",
12174
- className: `ndc-new-tab ${activeStatusTab === "CLEAR" ? "active" : ""}`,
12175
- onClick: () => onStatusTabClick("CLEAR")
12176
- }, t("CLEAR"))), /*#__PURE__*/React.createElement("div", {
12177
- className: "ndc-new-search"
12178
- }, /*#__PURE__*/React.createElement("span", {
12179
- "aria-hidden": "true"
12180
- }, /*#__PURE__*/React.createElement("svg", {
12181
- width: "16",
12182
- height: "16",
12183
- viewBox: "0 0 24 24",
12184
- fill: "none",
12185
- xmlns: "http://www.w3.org/2000/svg"
12186
- }, /*#__PURE__*/React.createElement("circle", {
12187
- cx: "11",
12188
- cy: "11",
12189
- r: "7",
12190
- stroke: "#6B7280",
12191
- strokeWidth: "2"
12192
- }), /*#__PURE__*/React.createElement("line", {
12193
- x1: "16.65",
12194
- y1: "16.65",
12195
- x2: "21",
12196
- y2: "21",
12197
- stroke: "#6B7280",
12198
- strokeWidth: "2",
12199
- strokeLinecap: "round"
12200
- }))), /*#__PURE__*/React.createElement("input", {
12201
- type: "text",
12202
- value: topBarSearch,
12203
- onChange: e => setTopBarSearch(e.target.value),
12204
- placeholder: "Search by application no..."
12205
- }))), isInboxLoading ? /*#__PURE__*/React.createElement(Loader$1, null) : (table === null || table === void 0 ? void 0 : table.length) < 1 ? /*#__PURE__*/React.createElement(Card, {
12206
- className: "margin-unset text-align-center"
12207
- }, t("CS_MYAPPLICATIONS_NO_APPLICATION")) : /*#__PURE__*/React.createElement("div", {
12208
- className: "ndc-new-table-card"
12209
- }, /*#__PURE__*/React.createElement("div", {
12210
- className: "ndc-new-table-header"
12211
- }, t("Assigned Applications")), /*#__PURE__*/React.createElement(Table, Object.assign({
12212
- className: "ndc-new-table",
12213
- customTableWrapperClassName: "ndc-new-table-wrapper",
12214
- isPaginationRequired: false
12215
- }, propsForInboxTable, {
12216
- columns: resolvedTableColumns,
12217
- getRowProps: propsForInboxTable === null || propsForInboxTable === void 0 ? void 0 : propsForInboxTable.getRowProps
12218
- }))), totalCount > 0 ? /*#__PURE__*/React.createElement("div", {
12219
- className: "ndc-new-pagination"
12220
- }, t("CS_COMMON_ROWS_PER_PAGE"), ":", /*#__PURE__*/React.createElement("select", {
12221
- value: (_formState$tableForm5 = formState.tableForm) === null || _formState$tableForm5 === void 0 ? void 0 : _formState$tableForm5.limit,
12222
- onChange: onPageSizeChange
12223
- }, [10, 20, 30, 40, 50].map(pageSize => /*#__PURE__*/React.createElement("option", {
12224
- key: pageSize,
12225
- value: pageSize
12226
- }, pageSize))), /*#__PURE__*/React.createElement("span", null, ((_formState$tableForm6 = formState.tableForm) === null || _formState$tableForm6 === void 0 ? void 0 : _formState$tableForm6.offset) + 1, "-", Math.min(((_formState$tableForm7 = formState.tableForm) === null || _formState$tableForm7 === void 0 ? void 0 : _formState$tableForm7.offset) + ((_formState$tableForm8 = formState.tableForm) === null || _formState$tableForm8 === void 0 ? void 0 : _formState$tableForm8.limit), totalCount), " of ", totalCount), /*#__PURE__*/React.createElement("button", {
12227
- onClick: onPrevPage,
12228
- disabled: ((_formState$tableForm9 = formState.tableForm) === null || _formState$tableForm9 === void 0 ? void 0 : _formState$tableForm9.offset) <= 0
12229
- }, "\u2039"), /*#__PURE__*/React.createElement("button", {
12230
- onClick: onNextPage,
12231
- disabled: ((_formState$tableForm0 = formState.tableForm) === null || _formState$tableForm0 === void 0 ? void 0 : _formState$tableForm0.offset) + ((_formState$tableForm1 = formState.tableForm) === null || _formState$tableForm1 === void 0 ? void 0 : _formState$tableForm1.limit) >= totalCount
12232
- }, "\u203A")) : null));
12233
- };
12234
-
12235
- const Inbox = ({
12236
- parentRoute
12237
- }) => {
12238
- return /*#__PURE__*/React.createElement(NewNDCInbox, {
12239
- parentRoute: parentRoute
12240
- });
11471
+ className: "NDCSection"
11472
+ }, /*#__PURE__*/React.createElement(InboxComposer, _extends({
11473
+ isInboxLoading,
11474
+ PropsForInboxLinks
11475
+ }, propsForSearchForm, propsForFilterForm, propsForMobileSortForm, {
11476
+ propsForInboxTable,
11477
+ propsForInboxMobileCards,
11478
+ formState
11479
+ }))));
12241
11480
  };
12242
11481
 
12243
11482
  const SearchFormFieldsComponent = props => {
@@ -13606,25 +12845,14 @@ function SelectNDCReason({
13606
12845
  }, [ndcReason]);
13607
12846
  useEffect(() => {
13608
12847
  if (apiDataCheck && (ndcReasonOptions === null || ndcReasonOptions === void 0 ? void 0 : ndcReasonOptions.length) > 0) {
13609
- var _formData$NDCReason;
13610
12848
  console.log("check apiDataCheck", apiDataCheck);
13611
12849
  const matchedOption = ndcReasonOptions.find(opt => {
13612
12850
  var _apiDataCheck$;
13613
12851
  return (opt === null || opt === void 0 ? void 0 : opt.code) === (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$ = apiDataCheck[0]) === null || _apiDataCheck$ === void 0 ? void 0 : _apiDataCheck$.reason);
13614
12852
  });
13615
- if (matchedOption && (lodash.isEmpty(formData === null || formData === void 0 ? void 0 : formData.NDCReason) || !(formData !== null && formData !== void 0 && (_formData$NDCReason = formData.NDCReason) !== null && _formData$NDCReason !== void 0 && _formData$NDCReason.code))) {
13616
- let updatedOption = {
13617
- ...matchedOption
13618
- };
13619
- if (matchedOption.code === "OTHERS") {
13620
- var _apiDataCheck$2, _apiDataCheck$2$NdcDe, _ptDetail$additionalD;
13621
- const ptDetail = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$2 = apiDataCheck[0]) === null || _apiDataCheck$2 === void 0 ? void 0 : (_apiDataCheck$2$NdcDe = _apiDataCheck$2.NdcDetails) === null || _apiDataCheck$2$NdcDe === void 0 ? void 0 : _apiDataCheck$2$NdcDe.find(detail => detail.businessService === "PT");
13622
- if (ptDetail !== null && ptDetail !== void 0 && (_ptDetail$additionalD = ptDetail.additionalDetails) !== null && _ptDetail$additionalD !== void 0 && _ptDetail$additionalD.reason) {
13623
- updatedOption.reason = ptDetail.additionalDetails.reason;
13624
- }
13625
- }
13626
- setNDCReason(updatedOption);
13627
- setValue("NDCReason", updatedOption);
12853
+ if (matchedOption) {
12854
+ setNDCReason(matchedOption);
12855
+ setValue("NDCReason", matchedOption);
13628
12856
  }
13629
12857
  }
13630
12858
  }, [apiDataCheck, ndcReasonOptions]);
@@ -13688,7 +12916,7 @@ const PropertyDetailsForm$1 = ({
13688
12916
  formState,
13689
12917
  clearErrors
13690
12918
  }) => {
13691
- var _formData$cpt, _formData$cpt$details, _checkApiDataCheck$Ap, _formData$cpt4, _Digit, _Digit$ComponentRegis, _formData$cpt5, _apiDataCheck$8, _propertyDetails$wate, _propertyDetails$sewe, _formData$cpt6, _formData$cpt6$detail;
12919
+ var _formData$cpt, _formData$cpt$details, _checkApiDataCheck$Ap, _formData$cpt4, _Digit, _Digit$ComponentRegis, _formData$cpt5, _apiDataCheck$7, _propertyDetails$wate, _propertyDetails$sewe, _formData$cpt6, _formData$cpt6$detail;
13692
12920
  const {
13693
12921
  control,
13694
12922
  formState: localFormState,
@@ -13779,7 +13007,7 @@ const PropertyDetailsForm$1 = ({
13779
13007
  }
13780
13008
  }];
13781
13009
  useEffect(() => {
13782
- var _formData$cpt3, _formData$cpt3$detail, _ownerForName$map, _ownerForName$map$fil, _apiDataCheck$, _apiDataCheck$$owners, _apiDataCheck$$owners2, _formData$PropertyDet, _formData$PropertyDet2, _formData$PropertyDet3, _apiDataCheck$2, _apiDataCheck$2$NdcDe, _ptDetail$additionalD, _formData$PropertyDet4;
13010
+ var _formData$cpt3, _formData$cpt3$detail, _ownerForName$map, _ownerForName$map$fil, _apiDataCheck$, _apiDataCheck$$owners, _apiDataCheck$$owners2, _formData$PropertyDet, _formData$PropertyDet2, _formData$PropertyDet3;
13783
13011
  const ownerForName = (formData === null || formData === void 0 ? void 0 : (_formData$cpt3 = formData.cpt) === null || _formData$cpt3 === void 0 ? void 0 : (_formData$cpt3$detail = _formData$cpt3.details) === null || _formData$cpt3$detail === void 0 ? void 0 : _formData$cpt3$detail.owners) || [];
13784
13012
  const ownerNames = ownerForName === null || ownerForName === void 0 ? void 0 : (_ownerForName$map = ownerForName.map(owner => owner === null || owner === void 0 ? void 0 : owner.name)) === null || _ownerForName$map === void 0 ? void 0 : (_ownerForName$map$fil = _ownerForName$map.filter(Boolean)) === null || _ownerForName$map$fil === void 0 ? void 0 : _ownerForName$map$fil.join(", ");
13785
13013
  const ownerObj = selectedRow;
@@ -13800,10 +13028,6 @@ const PropertyDetailsForm$1 = ({
13800
13028
  isLoading: false,
13801
13029
  billData: (formData === null || formData === void 0 ? void 0 : (_formData$PropertyDet2 = formData.PropertyDetails) === null || _formData$PropertyDet2 === void 0 ? void 0 : (_formData$PropertyDet3 = _formData$PropertyDet2.propertyBillData) === null || _formData$PropertyDet3 === void 0 ? void 0 : _formData$PropertyDet3.billData) || {}
13802
13030
  };
13803
- const ptDetail = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$2 = apiDataCheck[0]) === null || _apiDataCheck$2 === void 0 ? void 0 : (_apiDataCheck$2$NdcDe = _apiDataCheck$2.NdcDetails) === null || _apiDataCheck$2$NdcDe === void 0 ? void 0 : _apiDataCheck$2$NdcDe.find(detail => detail.businessService === "PT");
13804
- if (ptDetail !== null && ptDetail !== void 0 && (_ptDetail$additionalD = ptDetail.additionalDetails) !== null && _ptDetail$additionalD !== void 0 && _ptDetail$additionalD.remarks && !(formData !== null && formData !== void 0 && (_formData$PropertyDet4 = formData.PropertyDetails) !== null && _formData$PropertyDet4 !== void 0 && _formData$PropertyDet4.remarks)) {
13805
- combinedObject.remarks = ptDetail.additionalDetails.remarks;
13806
- }
13807
13031
  setPropertyDetails(prev => {
13808
13032
  return {
13809
13033
  ...prev,
@@ -13812,11 +13036,11 @@ const PropertyDetailsForm$1 = ({
13812
13036
  });
13813
13037
  }, [formData === null || formData === void 0 ? void 0 : (_formData$cpt4 = formData.cpt) === null || _formData$cpt4 === void 0 ? void 0 : _formData$cpt4.details, apiDataCheck, selectedRow]);
13814
13038
  useEffect(() => {
13815
- var _apiDataCheck$3;
13039
+ var _apiDataCheck$2;
13816
13040
  let waterConnection;
13817
- if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$3 = apiDataCheck[0]) !== null && _apiDataCheck$3 !== void 0 && _apiDataCheck$3.NdcDetails) {
13818
- var _apiDataCheck$4, _apiDataCheck$4$NdcDe;
13819
- const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$4 = apiDataCheck[0]) === null || _apiDataCheck$4 === void 0 ? void 0 : (_apiDataCheck$4$NdcDe = _apiDataCheck$4.NdcDetails) === null || _apiDataCheck$4$NdcDe === void 0 ? void 0 : _apiDataCheck$4$NdcDe.filter(item => {
13041
+ if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$2 = apiDataCheck[0]) !== null && _apiDataCheck$2 !== void 0 && _apiDataCheck$2.NdcDetails) {
13042
+ var _apiDataCheck$3, _apiDataCheck$3$NdcDe;
13043
+ const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$3 = apiDataCheck[0]) === null || _apiDataCheck$3 === void 0 ? void 0 : (_apiDataCheck$3$NdcDe = _apiDataCheck$3.NdcDetails) === null || _apiDataCheck$3$NdcDe === void 0 ? void 0 : _apiDataCheck$3$NdcDe.filter(item => {
13820
13044
  return item.businessService == "WS";
13821
13045
  });
13822
13046
  waterConnection = (resData === null || resData === void 0 ? void 0 : resData.map(item => ({
@@ -13841,11 +13065,11 @@ const PropertyDetailsForm$1 = ({
13841
13065
  }));
13842
13066
  }, [waterConnectionData, apiDataCheck]);
13843
13067
  useEffect(() => {
13844
- var _apiDataCheck$5;
13068
+ var _apiDataCheck$4;
13845
13069
  let sewerageConnection;
13846
- if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$5 = apiDataCheck[0]) !== null && _apiDataCheck$5 !== void 0 && _apiDataCheck$5.NdcDetails) {
13847
- var _apiDataCheck$6, _apiDataCheck$6$NdcDe;
13848
- const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$6 = apiDataCheck[0]) === null || _apiDataCheck$6 === void 0 ? void 0 : (_apiDataCheck$6$NdcDe = _apiDataCheck$6.NdcDetails) === null || _apiDataCheck$6$NdcDe === void 0 ? void 0 : _apiDataCheck$6$NdcDe.filter(item => {
13070
+ if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$4 = apiDataCheck[0]) !== null && _apiDataCheck$4 !== void 0 && _apiDataCheck$4.NdcDetails) {
13071
+ var _apiDataCheck$5, _apiDataCheck$5$NdcDe;
13072
+ const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$5 = apiDataCheck[0]) === null || _apiDataCheck$5 === void 0 ? void 0 : (_apiDataCheck$5$NdcDe = _apiDataCheck$5.NdcDetails) === null || _apiDataCheck$5$NdcDe === void 0 ? void 0 : _apiDataCheck$5$NdcDe.filter(item => {
13849
13073
  return item.businessService == "SW";
13850
13074
  });
13851
13075
  sewerageConnection = (resData === null || resData === void 0 ? void 0 : resData.map(item => ({
@@ -14129,8 +13353,8 @@ const PropertyDetailsForm$1 = ({
14129
13353
  useEffect(() => {
14130
13354
  var _checkApiDataCheck$Ap2;
14131
13355
  if (checkApiDataCheck !== null && checkApiDataCheck !== void 0 && (_checkApiDataCheck$Ap2 = checkApiDataCheck.Applications) !== null && _checkApiDataCheck$Ap2 !== void 0 && _checkApiDataCheck$Ap2[0] || apiDataCheck !== null && apiDataCheck !== void 0 && apiDataCheck[0]) {
14132
- var _checkApiDataCheck$Ap3, _checkApiDataCheck$Ap4, _apiDataCheck$7;
14133
- const checkOwners = (checkApiDataCheck === null || checkApiDataCheck === void 0 ? void 0 : (_checkApiDataCheck$Ap3 = checkApiDataCheck.Applications) === null || _checkApiDataCheck$Ap3 === void 0 ? void 0 : (_checkApiDataCheck$Ap4 = _checkApiDataCheck$Ap3[0]) === null || _checkApiDataCheck$Ap4 === void 0 ? void 0 : _checkApiDataCheck$Ap4.owners) || (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$7 = apiDataCheck[0]) === null || _apiDataCheck$7 === void 0 ? void 0 : _apiDataCheck$7.owners);
13356
+ var _checkApiDataCheck$Ap3, _checkApiDataCheck$Ap4, _apiDataCheck$6;
13357
+ const checkOwners = (checkApiDataCheck === null || checkApiDataCheck === void 0 ? void 0 : (_checkApiDataCheck$Ap3 = checkApiDataCheck.Applications) === null || _checkApiDataCheck$Ap3 === void 0 ? void 0 : (_checkApiDataCheck$Ap4 = _checkApiDataCheck$Ap3[0]) === null || _checkApiDataCheck$Ap4 === void 0 ? void 0 : _checkApiDataCheck$Ap4.owners) || (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$6 = apiDataCheck[0]) === null || _apiDataCheck$6 === void 0 ? void 0 : _apiDataCheck$6.owners);
14134
13358
  const filterRow = checkOwners === null || checkOwners === void 0 ? void 0 : checkOwners.find(owner => owner === null || owner === void 0 ? void 0 : owner.isPrimaryOwner);
14135
13359
  console.log("filterRow===", filterRow);
14136
13360
  setSelectedRow(filterRow);
@@ -14140,7 +13364,7 @@ const PropertyDetailsForm$1 = ({
14140
13364
  style: {
14141
13365
  marginBottom: "16px"
14142
13366
  }
14143
- }, ((formData === null || formData === void 0 ? void 0 : (_formData$cpt5 = formData.cpt) === null || _formData$cpt5 === void 0 ? void 0 : _formData$cpt5.details) || (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$8 = apiDataCheck[0]) === null || _apiDataCheck$8 === void 0 ? void 0 : _apiDataCheck$8.NdcDetails)) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
13367
+ }, ((formData === null || formData === void 0 ? void 0 : (_formData$cpt5 = formData.cpt) === null || _formData$cpt5 === void 0 ? void 0 : _formData$cpt5.details) || (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$7 = apiDataCheck[0]) === null || _apiDataCheck$7 === void 0 ? void 0 : _apiDataCheck$7.NdcDetails)) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
14144
13368
  style: {
14145
13369
  marginTop: "40px"
14146
13370
  }
@@ -14155,7 +13379,7 @@ const PropertyDetailsForm$1 = ({
14155
13379
  width: "100%"
14156
13380
  }
14157
13381
  }, propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$wate = propertyDetails.waterConnection) === null || _propertyDetails$wate === void 0 ? void 0 : _propertyDetails$wate.map((item, index) => {
14158
- var _apiDataCheck$9, _item$billData, _item$billData2, _item$billData3, _item$billData4;
13382
+ var _apiDataCheck$8, _item$billData, _item$billData2, _item$billData3, _item$billData4;
14159
13383
  return /*#__PURE__*/React.createElement("div", {
14160
13384
  className: "ndc_property_search",
14161
13385
  key: index,
@@ -14196,7 +13420,7 @@ const PropertyDetailsForm$1 = ({
14196
13420
  alignItems: "center",
14197
13421
  gap: "12px"
14198
13422
  }
14199
- }, !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$9 = apiDataCheck[0]) !== null && _apiDataCheck$9 !== void 0 && _apiDataCheck$9.NdcDetails) && (item === null || item === void 0 ? void 0 : item.connectionNo) && !(item !== null && item !== void 0 && (_item$billData = item.billData) !== null && _item$billData !== void 0 && _item$billData.id) && (item === null || item === void 0 ? void 0 : (_item$billData2 = item.billData) === null || _item$billData2 === void 0 ? void 0 : _item$billData2.totalAmount) != 0 && /*#__PURE__*/React.createElement("button", {
13423
+ }, !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$8 = apiDataCheck[0]) !== null && _apiDataCheck$8 !== void 0 && _apiDataCheck$8.NdcDetails) && (item === null || item === void 0 ? void 0 : item.connectionNo) && !(item !== null && item !== void 0 && (_item$billData = item.billData) !== null && _item$billData !== void 0 && _item$billData.id) && (item === null || item === void 0 ? void 0 : (_item$billData2 = item.billData) === null || _item$billData2 === void 0 ? void 0 : _item$billData2.totalAmount) != 0 && /*#__PURE__*/React.createElement("button", {
14200
13424
  className: "submit-bar",
14201
13425
  type: "button",
14202
13426
  style: {
@@ -14263,7 +13487,7 @@ const PropertyDetailsForm$1 = ({
14263
13487
  width: "100%"
14264
13488
  }
14265
13489
  }, propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$sewe = propertyDetails.sewerageConnection) === null || _propertyDetails$sewe === void 0 ? void 0 : _propertyDetails$sewe.map((item, index) => {
14266
- var _apiDataCheck$0, _item$billData5, _item$billData6, _item$billData7, _item$billData8;
13490
+ var _apiDataCheck$9, _item$billData5, _item$billData6, _item$billData7, _item$billData8;
14267
13491
  return /*#__PURE__*/React.createElement("div", {
14268
13492
  className: "ndc_property_search",
14269
13493
  key: index,
@@ -14304,7 +13528,7 @@ const PropertyDetailsForm$1 = ({
14304
13528
  alignItems: "center",
14305
13529
  gap: "12px"
14306
13530
  }
14307
- }, !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$0 = apiDataCheck[0]) !== null && _apiDataCheck$0 !== void 0 && _apiDataCheck$0.NdcDetails) && (item === null || item === void 0 ? void 0 : item.connectionNo) && !(item !== null && item !== void 0 && (_item$billData5 = item.billData) !== null && _item$billData5 !== void 0 && _item$billData5.id) && (item === null || item === void 0 ? void 0 : (_item$billData6 = item.billData) === null || _item$billData6 === void 0 ? void 0 : _item$billData6.totalAmount) != 0 && /*#__PURE__*/React.createElement("button", {
13531
+ }, !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$9 = apiDataCheck[0]) !== null && _apiDataCheck$9 !== void 0 && _apiDataCheck$9.NdcDetails) && (item === null || item === void 0 ? void 0 : item.connectionNo) && !(item !== null && item !== void 0 && (_item$billData5 = item.billData) !== null && _item$billData5 !== void 0 && _item$billData5.id) && (item === null || item === void 0 ? void 0 : (_item$billData6 = item.billData) === null || _item$billData6 === void 0 ? void 0 : _item$billData6.totalAmount) != 0 && /*#__PURE__*/React.createElement("button", {
14308
13532
  className: "submit-bar",
14309
13533
  type: "button",
14310
13534
  style: {
@@ -15534,7 +14758,7 @@ const PayWSBillModal = ({
15534
14758
  d: "M0 0h24v24H0V0z",
15535
14759
  fill: "none"
15536
14760
  }), /*#__PURE__*/React.createElement("path", {
15537
- d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
14761
+ d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 \r 17.59 19 19 17.59 13.41 12 19 6.41z"
15538
14762
  }));
15539
14763
  const CloseBtn = ({
15540
14764
  onClick
@@ -16154,7 +15378,7 @@ const NDCNewFormSummaryStepThreeEmployee = ({
16154
15378
  }
16155
15379
  };
16156
15380
  function mapToNDCPayload(inputData, actionStatus) {
16157
- var _Digit$UserService$ge, _ref, _inputData$apiData, _inputData$apiData$Ap, _inputData$apiData$Ap2, _formData$responseDat, _formData$apiData, _formData$apiData$App, _baseApplication$NdcD, _formData$NDCDetails4, _formData$NDCDetails5, _inputData$DocummentD, _inputData$DocummentD2;
15381
+ var _Digit$UserService$ge, _ref, _inputData$apiData, _inputData$apiData$Ap, _inputData$apiData$Ap2, _formData$responseDat, _formData$apiData, _formData$apiData$App, _inputData$DocummentD, _inputData$DocummentD2;
16158
15382
  const applicant = ((_Digit$UserService$ge = Digit.UserService.getUser()) === null || _Digit$UserService$ge === void 0 ? void 0 : _Digit$UserService$ge.info) || {};
16159
15383
  console.log("checkFormData", formData);
16160
15384
  const owners = (_ref = (inputData === null || inputData === void 0 ? void 0 : (_inputData$apiData = inputData.apiData) === null || _inputData$apiData === void 0 ? void 0 : (_inputData$apiData$Ap = _inputData$apiData.Applications) === null || _inputData$apiData$Ap === void 0 ? void 0 : (_inputData$apiData$Ap2 = _inputData$apiData$Ap[0]) === null || _inputData$apiData$Ap2 === void 0 ? void 0 : _inputData$apiData$Ap2.owners) || []) === null || _ref === void 0 ? void 0 : _ref.map(({
@@ -16169,21 +15393,7 @@ const NDCNewFormSummaryStepThreeEmployee = ({
16169
15393
  action: actionStatus
16170
15394
  },
16171
15395
  owners: owners,
16172
- NdcDetails: baseApplication === null || baseApplication === void 0 ? void 0 : (_baseApplication$NdcD = baseApplication.NdcDetails) === null || _baseApplication$NdcD === void 0 ? void 0 : _baseApplication$NdcD.map(detail => {
16173
- if (detail.businessService === "PT") {
16174
- var _formData$NDCDetails, _formData$NDCDetails$, _formData$NDCDetails2, _formData$NDCDetails3;
16175
- return {
16176
- ...detail,
16177
- additionalDetails: {
16178
- ...detail.additionalDetails,
16179
- reason: formData === null || formData === void 0 ? void 0 : (_formData$NDCDetails = formData.NDCDetails) === null || _formData$NDCDetails === void 0 ? void 0 : (_formData$NDCDetails$ = _formData$NDCDetails.NDCReason) === null || _formData$NDCDetails$ === void 0 ? void 0 : _formData$NDCDetails$.reason,
16180
- remarks: formData === null || formData === void 0 ? void 0 : (_formData$NDCDetails2 = formData.NDCDetails) === null || _formData$NDCDetails2 === void 0 ? void 0 : (_formData$NDCDetails3 = _formData$NDCDetails2.PropertyDetails) === null || _formData$NDCDetails3 === void 0 ? void 0 : _formData$NDCDetails3.remarks
16181
- }
16182
- };
16183
- }
16184
- return detail;
16185
- }),
16186
- reason: formData === null || formData === void 0 ? void 0 : (_formData$NDCDetails4 = formData.NDCDetails) === null || _formData$NDCDetails4 === void 0 ? void 0 : (_formData$NDCDetails5 = _formData$NDCDetails4.NDCReason) === null || _formData$NDCDetails5 === void 0 ? void 0 : _formData$NDCDetails5.code,
15396
+ NdcDetails: baseApplication === null || baseApplication === void 0 ? void 0 : baseApplication.NdcDetails,
16187
15397
  Documents: []
16188
15398
  };
16189
15399
  ((inputData === null || inputData === void 0 ? void 0 : (_inputData$DocummentD = inputData.DocummentDetails) === null || _inputData$DocummentD === void 0 ? void 0 : (_inputData$DocummentD2 = _inputData$DocummentD.documents) === null || _inputData$DocummentD2 === void 0 ? void 0 : _inputData$DocummentD2.documents) || []).forEach(doc => {