@mseva/digit-ui-module-ndc 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +14569 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +223 -93
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Card, Banner, ActionBar, SubmitBar as SubmitBar$1, PrivateRoute, BreadCrumb, AppContainer, Loader, Dropdown, UploadFile, Modal, FormComposer, Toast, Header, CardSubHeader, StatusTable, Row, CheckPoint, ConnectingCheckPoints, DisplayPhotos, Menu, LinkButton, EmployeeModuleCard, SearchField, TextInput, FilterFormField, RadioButtons, CheckBox,
|
|
1
|
+
import { Card, Banner, ActionBar, SubmitBar as SubmitBar$1, PrivateRoute, BreadCrumb, BackButton, AppContainer, Loader, Dropdown, UploadFile, Modal, FormComposer, Toast, Header, CardSubHeader, StatusTable, Row, CheckPoint, ConnectingCheckPoints, DisplayPhotos, Menu, LinkButton, EmployeeModuleCard, SearchField, TextInput, FilterFormField, RadioButtons, CheckBox, ComplaintIcon, InboxComposer, MobileNumber, CardLabelError, SearchAction, PopUp, DetailsCard, SearchForm, CloseSvg, Table, CardHeader, LabelFieldPair, CardLabel, DeleteIcon, KeyNote } from '@mseva/digit-ui-react-components';
|
|
2
2
|
import React, { Fragment as Fragment$1, useState, useEffect, useRef, useMemo, 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';
|
|
@@ -642,14 +642,16 @@ const App = () => {
|
|
|
642
642
|
url,
|
|
643
643
|
...match
|
|
644
644
|
} = useRouteMatch();
|
|
645
|
-
|
|
645
|
+
const {
|
|
646
|
+
t
|
|
647
|
+
} = useTranslation();
|
|
646
648
|
const NewNDCStepForm = Digit.ComponentRegistryService.getComponent("NewNDCStepFormCitizen");
|
|
647
649
|
const MyApplications = Digit.ComponentRegistryService.getComponent("MyApplications");
|
|
648
650
|
const NDCResponseCitizen = Digit.ComponentRegistryService.getComponent("NDCResponseCitizen");
|
|
649
651
|
const ApplicationOverview = (_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ComponentRegis = _Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("CitizenApplicationOverview");
|
|
650
652
|
return /*#__PURE__*/React.createElement("span", {
|
|
651
653
|
className: "tl-citizen"
|
|
652
|
-
}, /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
654
|
+
}, /*#__PURE__*/React.createElement(BackButton, null, t("CS_COMMON_BACK")), /*#__PURE__*/React.createElement(Switch, null, /*#__PURE__*/React.createElement(AppContainer, null, /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
653
655
|
path: `${path}/new-application`,
|
|
654
656
|
component: NewNDCStepForm
|
|
655
657
|
}), /*#__PURE__*/React.createElement(PrivateRoute, {
|
|
@@ -1079,7 +1081,6 @@ const getTimelineCaptions = (checkpoint, index, arr, t) => {
|
|
|
1079
1081
|
thumbnailsToShow,
|
|
1080
1082
|
wfDocuments
|
|
1081
1083
|
} = checkpoint;
|
|
1082
|
-
console.log("wfDocuments", wfDocuments);
|
|
1083
1084
|
const caption = {
|
|
1084
1085
|
date: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$auditDeta = checkpoint.auditDetails) === null || _checkpoint$auditDeta === void 0 ? void 0 : _checkpoint$auditDeta.lastModified,
|
|
1085
1086
|
name: checkpoint === null || checkpoint === void 0 ? void 0 : (_checkpoint$assigner = checkpoint.assigner) === null || _checkpoint$assigner === void 0 ? void 0 : _checkpoint$assigner.name,
|
|
@@ -1112,7 +1113,7 @@ const getTimelineCaptions = (checkpoint, index, arr, t) => {
|
|
|
1112
1113
|
}, caption.date && /*#__PURE__*/React.createElement("p", null, caption.date), caption.name && /*#__PURE__*/React.createElement("p", null, caption.name), caption.mobileNumber && /*#__PURE__*/React.createElement("p", null, caption.mobileNumber), caption.source && /*#__PURE__*/React.createElement("p", null, t("ES_COMMON_FILED_VIA_" + caption.source.toUpperCase()))));
|
|
1113
1114
|
};
|
|
1114
1115
|
const ApplicationOverview = () => {
|
|
1115
|
-
var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _user, _user$info, _user$info$roles, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetailsTemp$, _workflowDetailsTemp$2, _Object$entries, _displayData$NdcDetai, _displayData$Document, _workflowDetails$data9, _workflowDetails$data0, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _workflowDetails$data12, _workflowDetails$data13, _workflowDetails$data14, _workflowDetails$data15;
|
|
1116
|
+
var _workflowDetails$data, _workflowDetails$data2, _workflowDetails$data3, _user, _user$info, _user$info$roles, _workflowDetails$data6, _workflowDetails$data7, _workflowDetails$data8, _workflowDetailsTemp$, _workflowDetailsTemp$2, _Object$entries, _displayData$NdcDetai, _displayData$Document, _workflowDetails$data9, _workflowDetails$data0, _workflowDetails$data1, _workflowDetails$data10, _workflowDetails$data11, _applicationDetails$A3, _applicationDetails$A4, _workflowDetails$data12, _workflowDetails$data13, _workflowDetails$data14, _applicationDetails$A5, _applicationDetails$A6, _workflowDetails$data15;
|
|
1116
1117
|
const {
|
|
1117
1118
|
id
|
|
1118
1119
|
} = useParams();
|
|
@@ -1221,7 +1222,6 @@ const ApplicationOverview = () => {
|
|
|
1221
1222
|
useEffect(() => {
|
|
1222
1223
|
var _applicationDetails$A;
|
|
1223
1224
|
const ndcObject = applicationDetails === null || applicationDetails === void 0 ? void 0 : (_applicationDetails$A = applicationDetails.Applications) === null || _applicationDetails$A === void 0 ? void 0 : _applicationDetails$A[0];
|
|
1224
|
-
console.log("ndcObject", ndcObject);
|
|
1225
1225
|
if (ndcObject) {
|
|
1226
1226
|
var _ndcObject$owners, _ndcObject$owners$, _ndcObject$owners2, _ndcObject$owners2$, _ndcObject$owners3, _ndcObject$owners3$, _ndcObject$NdcDetails, _ndcObject$NdcDetails2, _ndcObject$NdcDetails3, _removeDuplicatesByUU;
|
|
1227
1227
|
const applicantData = {
|
|
@@ -1250,14 +1250,12 @@ const ApplicationOverview = () => {
|
|
|
1250
1250
|
}
|
|
1251
1251
|
}, [applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications]);
|
|
1252
1252
|
useEffect(() => {
|
|
1253
|
-
console.log("applicationDetails", applicationDetails);
|
|
1254
1253
|
if (applicationDetails) {
|
|
1255
1254
|
setIsDetailsLoading(true);
|
|
1256
1255
|
setIsDetailsLoading(false);
|
|
1257
1256
|
}
|
|
1258
1257
|
}, [applicationDetails]);
|
|
1259
1258
|
function onActionSelect(action) {
|
|
1260
|
-
console.log("action", action);
|
|
1261
1259
|
const payload = {
|
|
1262
1260
|
Licenses: [action]
|
|
1263
1261
|
};
|
|
@@ -1275,7 +1273,6 @@ const ApplicationOverview = () => {
|
|
|
1275
1273
|
const submitAction = async data => {
|
|
1276
1274
|
var _data$Licenses;
|
|
1277
1275
|
const payloadData = applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications[0];
|
|
1278
|
-
console.log("data", data);
|
|
1279
1276
|
const updatedApplicant = {
|
|
1280
1277
|
...payloadData,
|
|
1281
1278
|
workflow: {}
|
|
@@ -1287,7 +1284,6 @@ const ApplicationOverview = () => {
|
|
|
1287
1284
|
comment: filtData === null || filtData === void 0 ? void 0 : filtData.comment,
|
|
1288
1285
|
documents: filtData === null || filtData === void 0 ? void 0 : filtData.wfDocuments
|
|
1289
1286
|
};
|
|
1290
|
-
console.log("filtData", filtData);
|
|
1291
1287
|
if (!(filtData !== null && filtData !== void 0 && filtData.assignee) && filtData.action == "FORWARD") {
|
|
1292
1288
|
setShowToast({
|
|
1293
1289
|
key: "error"
|
|
@@ -1382,9 +1378,9 @@ const ApplicationOverview = () => {
|
|
|
1382
1378
|
}) : /*#__PURE__*/React.createElement(ConnectingCheckPoints, null, workflowDetails === null || workflowDetails === void 0 ? void 0 : (_workflowDetails$data11 = workflowDetails.data) === null || _workflowDetails$data11 === void 0 ? void 0 : _workflowDetails$data11.timeline.map((checkpoint, index, arr) => /*#__PURE__*/React.createElement(CheckPoint, {
|
|
1383
1379
|
keyValue: index,
|
|
1384
1380
|
isCompleted: index === 0,
|
|
1385
|
-
label: t(
|
|
1381
|
+
label: t(checkpoint.status),
|
|
1386
1382
|
customChild: getTimelineCaptions(checkpoint, index, arr, t)
|
|
1387
|
-
})))), actions && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu && (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data12 = workflowDetails.data) !== null && _workflowDetails$data12 !== void 0 && (_workflowDetails$data13 = _workflowDetails$data12.actionState) !== null && _workflowDetails$data13 !== void 0 && _workflowDetails$data13.nextActions || workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data14 = workflowDetails.data) !== null && _workflowDetails$data14 !== void 0 && _workflowDetails$data14.nextActions) ? /*#__PURE__*/React.createElement(Menu, {
|
|
1383
|
+
})))), (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.applicationStatus) !== "INITIATED" && actions && /*#__PURE__*/React.createElement(ActionBar, null, displayMenu && (workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data12 = workflowDetails.data) !== null && _workflowDetails$data12 !== void 0 && (_workflowDetails$data13 = _workflowDetails$data12.actionState) !== null && _workflowDetails$data13 !== void 0 && _workflowDetails$data13.nextActions || workflowDetails !== null && workflowDetails !== void 0 && (_workflowDetails$data14 = workflowDetails.data) !== null && _workflowDetails$data14 !== void 0 && _workflowDetails$data14.nextActions) ? /*#__PURE__*/React.createElement(Menu, {
|
|
1388
1384
|
localeKeyPrefix: `WF_EMPLOYEE_${"NDC"}`,
|
|
1389
1385
|
options: actions,
|
|
1390
1386
|
optionKey: "action",
|
|
@@ -1394,6 +1390,13 @@ const ApplicationOverview = () => {
|
|
|
1394
1390
|
ref: menuRef,
|
|
1395
1391
|
label: t("WF_TAKE_ACTION"),
|
|
1396
1392
|
onSubmit: () => setDisplayMenu(!displayMenu)
|
|
1393
|
+
})), (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.applicationStatus) == "INITIATED" && /*#__PURE__*/React.createElement(ActionBar, null, /*#__PURE__*/React.createElement(SubmitBar$1, {
|
|
1394
|
+
label: t("COMMON_EDIT"),
|
|
1395
|
+
onSubmit: () => {
|
|
1396
|
+
var _applicationDetails$A7, _applicationDetails$A8;
|
|
1397
|
+
const id = 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.uuid;
|
|
1398
|
+
history.push(`/digit-ui/employee/ndc/create/${id}`);
|
|
1399
|
+
}
|
|
1397
1400
|
})), showModal ? /*#__PURE__*/React.createElement(NDCModal, {
|
|
1398
1401
|
t: t,
|
|
1399
1402
|
action: selectedAction,
|
|
@@ -9543,7 +9546,7 @@ const Inbox = ({
|
|
|
9543
9546
|
}, [data]);
|
|
9544
9547
|
const PropsForInboxLinks = {
|
|
9545
9548
|
logoIcon: /*#__PURE__*/React.createElement(ComplaintIcon, null),
|
|
9546
|
-
headerText: "
|
|
9549
|
+
headerText: `${t("MODULE_NKS_NO_DUE_CERTIFICATE_FEES")}`,
|
|
9547
9550
|
links: [{
|
|
9548
9551
|
text: "Create NDC Application",
|
|
9549
9552
|
link: "/digit-ui/employee/ndc/create"
|
|
@@ -11439,6 +11442,12 @@ const config = [{
|
|
|
11439
11442
|
head: "",
|
|
11440
11443
|
stepNumber: 1,
|
|
11441
11444
|
body: [{
|
|
11445
|
+
name: "NDC_COMMON_NDC_REASON",
|
|
11446
|
+
type: "component",
|
|
11447
|
+
component: "SelectNDCReason",
|
|
11448
|
+
key: "NDCReason",
|
|
11449
|
+
withoutLabel: true
|
|
11450
|
+
}, {
|
|
11442
11451
|
name: "",
|
|
11443
11452
|
type: "component",
|
|
11444
11453
|
component: "NDCPropertySearch",
|
|
@@ -11450,12 +11459,6 @@ const config = [{
|
|
|
11450
11459
|
component: "PropertyDetailsFormCitizen",
|
|
11451
11460
|
key: "PropertyDetails",
|
|
11452
11461
|
withoutLabel: true
|
|
11453
|
-
}, {
|
|
11454
|
-
name: "NDC_COMMON_NDC_REASON",
|
|
11455
|
-
type: "component",
|
|
11456
|
-
component: "SelectNDCReason",
|
|
11457
|
-
key: "NDCReason",
|
|
11458
|
-
withoutLabel: true
|
|
11459
11462
|
}]
|
|
11460
11463
|
}, {
|
|
11461
11464
|
head: "NDC_COMMON_DOCUMENTS_REQUIRED",
|
|
@@ -11793,6 +11796,10 @@ function SelectNDCReason({
|
|
|
11793
11796
|
const {
|
|
11794
11797
|
t
|
|
11795
11798
|
} = useTranslation();
|
|
11799
|
+
const apiDataCheck = useSelector(state => {
|
|
11800
|
+
var _state$ndc$NDCForm, _state$ndc$NDCForm$fo;
|
|
11801
|
+
return (_state$ndc$NDCForm = state.ndc.NDCForm) === null || _state$ndc$NDCForm === void 0 ? void 0 : (_state$ndc$NDCForm$fo = _state$ndc$NDCForm.formData) === null || _state$ndc$NDCForm$fo === void 0 ? void 0 : _state$ndc$NDCForm$fo.responseData;
|
|
11802
|
+
});
|
|
11796
11803
|
const {
|
|
11797
11804
|
data: menuList,
|
|
11798
11805
|
isLoading
|
|
@@ -11816,6 +11823,18 @@ function SelectNDCReason({
|
|
|
11816
11823
|
useEffect(() => {
|
|
11817
11824
|
onSelect("NDCReason", ndcReason, config);
|
|
11818
11825
|
}, [ndcReason]);
|
|
11826
|
+
useEffect(() => {
|
|
11827
|
+
if (apiDataCheck && (ndcReasonOptions === null || ndcReasonOptions === void 0 ? void 0 : ndcReasonOptions.length) > 0) {
|
|
11828
|
+
const matchedOption = ndcReasonOptions.find(opt => {
|
|
11829
|
+
var _apiDataCheck$;
|
|
11830
|
+
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);
|
|
11831
|
+
});
|
|
11832
|
+
if (matchedOption) {
|
|
11833
|
+
setNDCReason(matchedOption);
|
|
11834
|
+
setValue("NDCReason", matchedOption);
|
|
11835
|
+
}
|
|
11836
|
+
}
|
|
11837
|
+
}, [apiDataCheck, ndcReasonOptions]);
|
|
11819
11838
|
if (isLoading) {
|
|
11820
11839
|
return /*#__PURE__*/React.createElement(Loader, null);
|
|
11821
11840
|
}
|
|
@@ -11827,10 +11846,10 @@ function SelectNDCReason({
|
|
|
11827
11846
|
};
|
|
11828
11847
|
return /*#__PURE__*/React.createElement("div", {
|
|
11829
11848
|
style: {
|
|
11830
|
-
|
|
11849
|
+
paddingBottom: "16px"
|
|
11831
11850
|
}
|
|
11832
11851
|
}, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
11833
|
-
className: "card-label-smaller"
|
|
11852
|
+
className: "card-label-smaller ndc_card_labels"
|
|
11834
11853
|
}, `${t("NDC_NEW_NDC_APPLICATION_NDC_REASON")} * `), /*#__PURE__*/React.createElement(Controller, {
|
|
11835
11854
|
name: "NDCReason",
|
|
11836
11855
|
rules: {
|
|
@@ -11844,6 +11863,7 @@ function SelectNDCReason({
|
|
|
11844
11863
|
option: ndcReasonOptions,
|
|
11845
11864
|
select: e => {
|
|
11846
11865
|
setNDCReason(e);
|
|
11866
|
+
props.onChange(e);
|
|
11847
11867
|
},
|
|
11848
11868
|
optionKey: "i18nKey",
|
|
11849
11869
|
onBlur: props.onBlur,
|
|
@@ -11862,7 +11882,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
11862
11882
|
formState,
|
|
11863
11883
|
clearErrors
|
|
11864
11884
|
}) => {
|
|
11865
|
-
var _formData$cpt, _formData$cpt$details, _formData$cpt3, _Digit, _Digit$ComponentRegis, _formData$cpt4, _propertyDetails$wate, _propertyDetails$sewe;
|
|
11885
|
+
var _formData$cpt, _formData$cpt$details, _formData$cpt3, _Digit, _Digit$ComponentRegis, _formData$cpt4, _apiDataCheck$6, _propertyDetails$wate, _propertyDetails$sewe;
|
|
11866
11886
|
const {
|
|
11867
11887
|
control,
|
|
11868
11888
|
formState: localFormState,
|
|
@@ -11875,6 +11895,10 @@ const PropertyDetailsForm$1 = ({
|
|
|
11875
11895
|
t
|
|
11876
11896
|
} = useTranslation();
|
|
11877
11897
|
const tenantId = window.location.href.includes("citizen") ? window.localStorage.getItem("CITIZEN.CITY") : window.localStorage.getItem("Employee.tenant-id");
|
|
11898
|
+
const apiDataCheck = useSelector(state => {
|
|
11899
|
+
var _state$ndc$NDCForm, _state$ndc$NDCForm$fo;
|
|
11900
|
+
return (_state$ndc$NDCForm = state.ndc.NDCForm) === null || _state$ndc$NDCForm === void 0 ? void 0 : (_state$ndc$NDCForm$fo = _state$ndc$NDCForm.formData) === null || _state$ndc$NDCForm$fo === void 0 ? void 0 : _state$ndc$NDCForm$fo.responseData;
|
|
11901
|
+
});
|
|
11878
11902
|
const [showToast, setShowToast] = useState(null);
|
|
11879
11903
|
const [propertyLoader, setPropertyLoader] = useState(false);
|
|
11880
11904
|
const [showPayModal, setShowPayModal] = useState(false);
|
|
@@ -11943,39 +11967,63 @@ const PropertyDetailsForm$1 = ({
|
|
|
11943
11967
|
});
|
|
11944
11968
|
}, [formData === null || formData === void 0 ? void 0 : (_formData$cpt3 = formData.cpt) === null || _formData$cpt3 === void 0 ? void 0 : _formData$cpt3.details]);
|
|
11945
11969
|
useEffect(() => {
|
|
11946
|
-
var
|
|
11947
|
-
|
|
11948
|
-
|
|
11949
|
-
|
|
11950
|
-
|
|
11951
|
-
|
|
11952
|
-
|
|
11953
|
-
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
|
|
11957
|
-
|
|
11958
|
-
}
|
|
11959
|
-
|
|
11970
|
+
var _apiDataCheck$;
|
|
11971
|
+
let waterConnection;
|
|
11972
|
+
if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$ = apiDataCheck[0]) !== null && _apiDataCheck$ !== void 0 && _apiDataCheck$.NdcDetails) {
|
|
11973
|
+
var _apiDataCheck$2;
|
|
11974
|
+
const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$2 = apiDataCheck[0]) === null || _apiDataCheck$2 === void 0 ? void 0 : _apiDataCheck$2.NdcDetails.filter(item => {
|
|
11975
|
+
return item.businessService == "WS";
|
|
11976
|
+
});
|
|
11977
|
+
waterConnection = (resData === null || resData === void 0 ? void 0 : resData.map(item => ({
|
|
11978
|
+
connectionNo: item === null || item === void 0 ? void 0 : item.consumerCode,
|
|
11979
|
+
isEdit: false,
|
|
11980
|
+
billData: {
|
|
11981
|
+
totalAmount: 0
|
|
11982
|
+
},
|
|
11983
|
+
isLoading: false
|
|
11984
|
+
}))) || [];
|
|
11985
|
+
} else {
|
|
11986
|
+
waterConnection = (waterConnectionData === null || waterConnectionData === void 0 ? void 0 : waterConnectionData.map(item => ({
|
|
11987
|
+
connectionNo: item === null || item === void 0 ? void 0 : item.connectionNo,
|
|
11988
|
+
isEdit: false,
|
|
11989
|
+
billData: {},
|
|
11990
|
+
isLoading: false
|
|
11991
|
+
}))) || [];
|
|
11960
11992
|
}
|
|
11961
|
-
|
|
11993
|
+
setPropertyDetails(prev => ({
|
|
11994
|
+
...prev,
|
|
11995
|
+
waterConnection
|
|
11996
|
+
}));
|
|
11997
|
+
}, [waterConnectionData, apiDataCheck]);
|
|
11962
11998
|
useEffect(() => {
|
|
11963
|
-
var
|
|
11964
|
-
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
|
|
11968
|
-
|
|
11969
|
-
|
|
11970
|
-
|
|
11971
|
-
|
|
11972
|
-
|
|
11973
|
-
|
|
11974
|
-
|
|
11975
|
-
}
|
|
11976
|
-
|
|
11999
|
+
var _apiDataCheck$3;
|
|
12000
|
+
let sewerageConnection;
|
|
12001
|
+
if (apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$3 = apiDataCheck[0]) !== null && _apiDataCheck$3 !== void 0 && _apiDataCheck$3.NdcDetails) {
|
|
12002
|
+
var _apiDataCheck$4;
|
|
12003
|
+
const resData = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$4 = apiDataCheck[0]) === null || _apiDataCheck$4 === void 0 ? void 0 : _apiDataCheck$4.NdcDetails.filter(item => {
|
|
12004
|
+
return item.businessService == "SW";
|
|
12005
|
+
});
|
|
12006
|
+
sewerageConnection = (resData === null || resData === void 0 ? void 0 : resData.map(item => ({
|
|
12007
|
+
connectionNo: item === null || item === void 0 ? void 0 : item.consumerCode,
|
|
12008
|
+
isEdit: false,
|
|
12009
|
+
billData: {
|
|
12010
|
+
totalAmount: 0
|
|
12011
|
+
},
|
|
12012
|
+
isLoading: false
|
|
12013
|
+
}))) || [];
|
|
12014
|
+
} else {
|
|
12015
|
+
sewerageConnection = (sewerageConnectionData === null || sewerageConnectionData === void 0 ? void 0 : sewerageConnectionData.map(item => ({
|
|
12016
|
+
connectionNo: item === null || item === void 0 ? void 0 : item.connectionNo,
|
|
12017
|
+
isEdit: false,
|
|
12018
|
+
billData: {},
|
|
12019
|
+
isLoading: false
|
|
12020
|
+
}))) || [];
|
|
11977
12021
|
}
|
|
11978
|
-
|
|
12022
|
+
setPropertyDetails(prev => ({
|
|
12023
|
+
...prev,
|
|
12024
|
+
sewerageConnection
|
|
12025
|
+
}));
|
|
12026
|
+
}, [sewerageConnectionData, apiDataCheck]);
|
|
11979
12027
|
useEffect(() => {
|
|
11980
12028
|
onSelect("PropertyDetails", propertyDetails, config);
|
|
11981
12029
|
}, [propertyDetails]);
|
|
@@ -12030,7 +12078,6 @@ const PropertyDetailsForm$1 = ({
|
|
|
12030
12078
|
consumerCode: consumercodes
|
|
12031
12079
|
});
|
|
12032
12080
|
setPropertyLoader(false);
|
|
12033
|
-
console.log("result======???????", result);
|
|
12034
12081
|
if ((result === null || result === void 0 ? void 0 : (_result$Bill = result.Bill) === null || _result$Bill === void 0 ? void 0 : _result$Bill.length) > 0) {
|
|
12035
12082
|
var _result$Bill$;
|
|
12036
12083
|
if ((result === null || result === void 0 ? void 0 : (_result$Bill$ = result.Bill[0]) === null || _result$Bill$ === void 0 ? void 0 : _result$Bill$.totalAmount) > 0) {
|
|
@@ -12072,10 +12119,6 @@ const PropertyDetailsForm$1 = ({
|
|
|
12072
12119
|
}));
|
|
12073
12120
|
}
|
|
12074
12121
|
} else if (result !== null && result !== void 0 && result.Bill) {
|
|
12075
|
-
setShowToast({
|
|
12076
|
-
error: false,
|
|
12077
|
-
label: t("NDC_MESSAGE_NO_BILLS_FOUND_FOR_THIS_CONSUMER_NUMBER")
|
|
12078
|
-
});
|
|
12079
12122
|
if (bussinessService === "WS") {
|
|
12080
12123
|
const updated = [...propertyDetails.waterConnection];
|
|
12081
12124
|
updated[index].billData = {
|
|
@@ -12086,6 +12129,10 @@ const PropertyDetailsForm$1 = ({
|
|
|
12086
12129
|
...prev,
|
|
12087
12130
|
waterConnection: updated
|
|
12088
12131
|
}));
|
|
12132
|
+
setShowToast({
|
|
12133
|
+
error: false,
|
|
12134
|
+
label: t("NDC_NO_BILLS_FOUND_WS")
|
|
12135
|
+
});
|
|
12089
12136
|
} else if (bussinessService === "SW") {
|
|
12090
12137
|
const updated = [...propertyDetails.sewerageConnection];
|
|
12091
12138
|
updated[index].billData = {
|
|
@@ -12096,6 +12143,10 @@ const PropertyDetailsForm$1 = ({
|
|
|
12096
12143
|
...prev,
|
|
12097
12144
|
sewerageConnection: updated
|
|
12098
12145
|
}));
|
|
12146
|
+
setShowToast({
|
|
12147
|
+
error: false,
|
|
12148
|
+
label: t("NDC_NO_BILLS_FOUND_SW")
|
|
12149
|
+
});
|
|
12099
12150
|
} else if (bussinessService === "PT") {
|
|
12100
12151
|
let updated = {
|
|
12101
12152
|
...propertyDetails.propertyBillData
|
|
@@ -12105,12 +12156,12 @@ const PropertyDetailsForm$1 = ({
|
|
|
12105
12156
|
...prev,
|
|
12106
12157
|
propertyBillData: updated
|
|
12107
12158
|
}));
|
|
12159
|
+
setShowToast({
|
|
12160
|
+
error: false,
|
|
12161
|
+
label: t("NDC_NO_BILLS_FOUND_PROPERTY")
|
|
12162
|
+
});
|
|
12108
12163
|
}
|
|
12109
12164
|
} else {
|
|
12110
|
-
setShowToast({
|
|
12111
|
-
error: false,
|
|
12112
|
-
label: t("NDC_MESSAGE_NO_BILLS_FOUND_FOR_THIS_CONSUMER_NUMBER")
|
|
12113
|
-
});
|
|
12114
12165
|
if (bussinessService === "WS") {
|
|
12115
12166
|
const updated = [...propertyDetails.waterConnection];
|
|
12116
12167
|
updated[index].isLoading = false;
|
|
@@ -12121,6 +12172,10 @@ const PropertyDetailsForm$1 = ({
|
|
|
12121
12172
|
...prev,
|
|
12122
12173
|
waterConnection: updated
|
|
12123
12174
|
}));
|
|
12175
|
+
setShowToast({
|
|
12176
|
+
error: false,
|
|
12177
|
+
label: t("NDC_NO_BILLS_FOUND_WS")
|
|
12178
|
+
});
|
|
12124
12179
|
} else if (bussinessService === "SW") {
|
|
12125
12180
|
const updated = [...propertyDetails.sewerageConnection];
|
|
12126
12181
|
updated[index].isLoading = false;
|
|
@@ -12131,6 +12186,10 @@ const PropertyDetailsForm$1 = ({
|
|
|
12131
12186
|
...prev,
|
|
12132
12187
|
sewerageConnection: updated
|
|
12133
12188
|
}));
|
|
12189
|
+
setShowToast({
|
|
12190
|
+
error: false,
|
|
12191
|
+
label: t("NDC_NO_BILLS_FOUND_SW")
|
|
12192
|
+
});
|
|
12134
12193
|
} else if (bussinessService === "PT") {
|
|
12135
12194
|
let updated = {
|
|
12136
12195
|
...propertyDetails.propertyBillData
|
|
@@ -12140,6 +12199,10 @@ const PropertyDetailsForm$1 = ({
|
|
|
12140
12199
|
...prev,
|
|
12141
12200
|
propertyBillData: updated
|
|
12142
12201
|
}));
|
|
12202
|
+
setShowToast({
|
|
12203
|
+
error: false,
|
|
12204
|
+
label: t("NDC_NO_BILLS_FOUND_PROPERTY")
|
|
12205
|
+
});
|
|
12143
12206
|
}
|
|
12144
12207
|
}
|
|
12145
12208
|
} catch (error) {
|
|
@@ -12211,16 +12274,35 @@ const PropertyDetailsForm$1 = ({
|
|
|
12211
12274
|
}
|
|
12212
12275
|
}
|
|
12213
12276
|
const PayWSBillModal = (_Digit = Digit) === null || _Digit === void 0 ? void 0 : (_Digit$ComponentRegis = _Digit.ComponentRegistryService) === null || _Digit$ComponentRegis === void 0 ? void 0 : _Digit$ComponentRegis.getComponent("PayWSBillModal");
|
|
12277
|
+
useEffect(() => {
|
|
12278
|
+
if (showToast) {
|
|
12279
|
+
const timer = setTimeout(() => {
|
|
12280
|
+
setShowToast(null);
|
|
12281
|
+
}, 3000);
|
|
12282
|
+
return () => clearTimeout(timer);
|
|
12283
|
+
}
|
|
12284
|
+
}, [showToast]);
|
|
12285
|
+
useEffect(() => {
|
|
12286
|
+
if (apiDataCheck) {
|
|
12287
|
+
var _apiDataCheck$5, _apiDataCheck$5$owner, _apiDataCheck$5$owner2;
|
|
12288
|
+
const apiEmail = (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$5 = apiDataCheck[0]) === null || _apiDataCheck$5 === void 0 ? void 0 : (_apiDataCheck$5$owner = _apiDataCheck$5.owners) === null || _apiDataCheck$5$owner === void 0 ? void 0 : (_apiDataCheck$5$owner2 = _apiDataCheck$5$owner[0]) === null || _apiDataCheck$5$owner2 === void 0 ? void 0 : _apiDataCheck$5$owner2.emailId) || "";
|
|
12289
|
+
setValue("email", apiEmail);
|
|
12290
|
+
setPropertyDetails(prev => ({
|
|
12291
|
+
...prev,
|
|
12292
|
+
email: apiEmail
|
|
12293
|
+
}));
|
|
12294
|
+
}
|
|
12295
|
+
}, [apiDataCheck]);
|
|
12214
12296
|
return /*#__PURE__*/React.createElement("div", {
|
|
12215
12297
|
style: {
|
|
12216
12298
|
marginBottom: "16px"
|
|
12217
12299
|
}
|
|
12218
|
-
}, (formData === null || formData === void 0 ? void 0 : (_formData$cpt4 = formData.cpt) === null || _formData$cpt4 === void 0 ? void 0 : _formData$cpt4.details) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
12300
|
+
}, ((formData === null || formData === void 0 ? void 0 : (_formData$cpt4 = formData.cpt) === null || _formData$cpt4 === void 0 ? void 0 : _formData$cpt4.details) || (apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$6 = apiDataCheck[0]) === null || _apiDataCheck$6 === void 0 ? void 0 : _apiDataCheck$6.NdcDetails)) && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(LabelFieldPair, {
|
|
12219
12301
|
style: {
|
|
12220
12302
|
marginTop: "40px"
|
|
12221
12303
|
}
|
|
12222
12304
|
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12223
|
-
className: "card-label-smaller"
|
|
12305
|
+
className: "card-label-smaller ndc_card_labels"
|
|
12224
12306
|
}, `${t("NDC_WATER_CONNECTION")}`), waterConnectionLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", {
|
|
12225
12307
|
className: "field",
|
|
12226
12308
|
style: {
|
|
@@ -12230,7 +12312,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12230
12312
|
width: "100%"
|
|
12231
12313
|
}
|
|
12232
12314
|
}, propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$wate = propertyDetails.waterConnection) === null || _propertyDetails$wate === void 0 ? void 0 : _propertyDetails$wate.map((item, index) => {
|
|
12233
|
-
var _item$billData, _item$billData2, _item$billData3, _item$billData4;
|
|
12315
|
+
var _apiDataCheck$7, _item$billData, _item$billData2, _item$billData3, _item$billData4;
|
|
12234
12316
|
return /*#__PURE__*/React.createElement("div", {
|
|
12235
12317
|
className: "ndc_property_search",
|
|
12236
12318
|
key: index,
|
|
@@ -12271,7 +12353,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12271
12353
|
alignItems: "center",
|
|
12272
12354
|
gap: "12px"
|
|
12273
12355
|
}
|
|
12274
|
-
}, (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", {
|
|
12356
|
+
}, !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$7 = apiDataCheck[0]) !== null && _apiDataCheck$7 !== void 0 && _apiDataCheck$7.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", {
|
|
12275
12357
|
className: "submit-bar",
|
|
12276
12358
|
type: "button",
|
|
12277
12359
|
style: {
|
|
@@ -12328,7 +12410,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12328
12410
|
marginTop: "40px"
|
|
12329
12411
|
}
|
|
12330
12412
|
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12331
|
-
className: "card-label-smaller"
|
|
12413
|
+
className: "card-label-smaller ndc_card_labels"
|
|
12332
12414
|
}, `${t("NDC_SEWERAGE_CONNECTION")} `), sewerageConnectionLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement("div", {
|
|
12333
12415
|
className: "field",
|
|
12334
12416
|
style: {
|
|
@@ -12338,7 +12420,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12338
12420
|
width: "100%"
|
|
12339
12421
|
}
|
|
12340
12422
|
}, propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$sewe = propertyDetails.sewerageConnection) === null || _propertyDetails$sewe === void 0 ? void 0 : _propertyDetails$sewe.map((item, index) => {
|
|
12341
|
-
var _item$billData5, _item$billData6, _item$billData7, _item$billData8;
|
|
12423
|
+
var _apiDataCheck$8, _item$billData5, _item$billData6, _item$billData7, _item$billData8;
|
|
12342
12424
|
return /*#__PURE__*/React.createElement("div", {
|
|
12343
12425
|
className: "ndc_property_search",
|
|
12344
12426
|
key: index,
|
|
@@ -12379,7 +12461,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12379
12461
|
alignItems: "center",
|
|
12380
12462
|
gap: "12px"
|
|
12381
12463
|
}
|
|
12382
|
-
}, (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", {
|
|
12464
|
+
}, !(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$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", {
|
|
12383
12465
|
className: "submit-bar",
|
|
12384
12466
|
type: "button",
|
|
12385
12467
|
style: {
|
|
@@ -12436,7 +12518,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12436
12518
|
marginTop: "40px"
|
|
12437
12519
|
}
|
|
12438
12520
|
}, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12439
|
-
className: "card-label-smaller"
|
|
12521
|
+
className: "card-label-smaller ndc_card_labels"
|
|
12440
12522
|
}, `${t("NDC_FIRST_NAME")} * `), /*#__PURE__*/React.createElement("div", {
|
|
12441
12523
|
className: "field"
|
|
12442
12524
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
@@ -12467,7 +12549,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12467
12549
|
});
|
|
12468
12550
|
}
|
|
12469
12551
|
}))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12470
|
-
className: "card-label-smaller"
|
|
12552
|
+
className: "card-label-smaller ndc_card_labels"
|
|
12471
12553
|
}, `${t("NDC_LAST_NAME")} * `), /*#__PURE__*/React.createElement("div", {
|
|
12472
12554
|
className: "field"
|
|
12473
12555
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
@@ -12498,23 +12580,23 @@ const PropertyDetailsForm$1 = ({
|
|
|
12498
12580
|
});
|
|
12499
12581
|
}
|
|
12500
12582
|
}))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12501
|
-
className: "card-label-smaller"
|
|
12583
|
+
className: "card-label-smaller ndc_card_labels"
|
|
12502
12584
|
}, `${t("NDC_EMAIL")} * `), /*#__PURE__*/React.createElement("div", {
|
|
12503
12585
|
className: "field"
|
|
12504
12586
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
12505
12587
|
control: control,
|
|
12506
12588
|
name: "email",
|
|
12507
|
-
defaultValue:
|
|
12589
|
+
defaultValue: "",
|
|
12508
12590
|
render: props => {
|
|
12509
12591
|
var _formData$cpt7, _formData$cpt7$detail, _formData$cpt7$detail2, _formData$cpt7$detail3, _formData$cpt7$detail4;
|
|
12510
12592
|
return /*#__PURE__*/React.createElement(TextInput, {
|
|
12511
|
-
value:
|
|
12593
|
+
value: props === null || props === void 0 ? void 0 : props.value,
|
|
12512
12594
|
onChange: e => {
|
|
12595
|
+
props.onChange(e.target.value);
|
|
12513
12596
|
setPropertyDetails(prev => ({
|
|
12514
12597
|
...prev,
|
|
12515
12598
|
email: e.target.value
|
|
12516
12599
|
}));
|
|
12517
|
-
props.onChange(e.target.value);
|
|
12518
12600
|
},
|
|
12519
12601
|
onBlur: e => {
|
|
12520
12602
|
props.onBlur(e);
|
|
@@ -12523,7 +12605,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12523
12605
|
});
|
|
12524
12606
|
}
|
|
12525
12607
|
}))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12526
|
-
className: "card-label-smaller"
|
|
12608
|
+
className: "card-label-smaller ndc_card_labels"
|
|
12527
12609
|
}, `${t("NDC_MOBILE_NUMBER")} * `), /*#__PURE__*/React.createElement("div", {
|
|
12528
12610
|
className: "field"
|
|
12529
12611
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
@@ -12544,7 +12626,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12544
12626
|
}
|
|
12545
12627
|
})
|
|
12546
12628
|
}))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12547
|
-
className: "card-label-smaller"
|
|
12629
|
+
className: "card-label-smaller ndc_card_labels"
|
|
12548
12630
|
}, `${t("NDC_ADDRESS")} * `), /*#__PURE__*/React.createElement("div", {
|
|
12549
12631
|
className: "field"
|
|
12550
12632
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
@@ -12569,7 +12651,7 @@ const PropertyDetailsForm$1 = ({
|
|
|
12569
12651
|
});
|
|
12570
12652
|
}
|
|
12571
12653
|
})))), /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12572
|
-
className: "card-label-smaller"
|
|
12654
|
+
className: "card-label-smaller ndc_card_labels"
|
|
12573
12655
|
}, `${t("NDC_TL_NUMBER")}`), /*#__PURE__*/React.createElement("div", {
|
|
12574
12656
|
className: "field"
|
|
12575
12657
|
}, /*#__PURE__*/React.createElement(Controller, {
|
|
@@ -12611,23 +12693,30 @@ const PropertySearchNSummary = ({
|
|
|
12611
12693
|
onSelect,
|
|
12612
12694
|
formData
|
|
12613
12695
|
}) => {
|
|
12614
|
-
var _formData$cpt, _formData$cpt2, _propertyDetails$Prop3,
|
|
12696
|
+
var _apiDataCheck$, _apiDataCheck$$NdcDet, _formData$cpt, _formData$cpt2, _propertyDetails$Prop3, _apiDataCheck$2, _formData$cpt12, _formData$cpt13, _formData$cpt13$dues;
|
|
12615
12697
|
const {
|
|
12616
12698
|
t
|
|
12617
12699
|
} = useTranslation();
|
|
12618
12700
|
const myElementRef = useRef(null);
|
|
12701
|
+
const dispatch = useDispatch();
|
|
12619
12702
|
let {
|
|
12620
12703
|
pathname,
|
|
12621
12704
|
state
|
|
12622
12705
|
} = useLocation();
|
|
12623
12706
|
state = state && (typeof state === "string" || state instanceof String) ? JSON.parse(state) : state;
|
|
12707
|
+
const apiDataCheck = useSelector(state => {
|
|
12708
|
+
var _state$ndc$NDCForm, _state$ndc$NDCForm$fo;
|
|
12709
|
+
return (_state$ndc$NDCForm = state.ndc.NDCForm) === null || _state$ndc$NDCForm === void 0 ? void 0 : (_state$ndc$NDCForm$fo = _state$ndc$NDCForm.formData) === null || _state$ndc$NDCForm$fo === void 0 ? void 0 : _state$ndc$NDCForm$fo.responseData;
|
|
12710
|
+
});
|
|
12624
12711
|
const isEditScreen = pathname.includes("/modify-application/");
|
|
12625
12712
|
const tenantId = window.location.href.includes("employee") ? Digit.ULBService.getCurrentPermanentCity() : localStorage.getItem("CITIZEN.CITY");
|
|
12626
12713
|
const search = useLocation().search;
|
|
12627
12714
|
const urlPropertyId = new URLSearchParams(search).get("propertyId");
|
|
12628
12715
|
const isfirstRender = useRef(true);
|
|
12629
|
-
const
|
|
12630
|
-
|
|
12716
|
+
const ptFromApi = apiDataCheck === null || apiDataCheck === void 0 ? void 0 : (_apiDataCheck$ = apiDataCheck[0]) === null || _apiDataCheck$ === void 0 ? void 0 : (_apiDataCheck$$NdcDet = _apiDataCheck$.NdcDetails) === null || _apiDataCheck$$NdcDet === void 0 ? void 0 : _apiDataCheck$$NdcDet.find(item => item.businessService == "PT");
|
|
12717
|
+
console.log("ptFromApi", ptFromApi);
|
|
12718
|
+
const [propertyId, setPropertyId] = useState((formData === null || formData === void 0 ? void 0 : (_formData$cpt = formData.cpt) === null || _formData$cpt === void 0 ? void 0 : _formData$cpt.id) || (urlPropertyId !== "null" ? urlPropertyId : "") || (ptFromApi === null || ptFromApi === void 0 ? void 0 : ptFromApi.consumerCode) || "");
|
|
12719
|
+
const [searchPropertyId, setSearchPropertyId] = useState((formData === null || formData === void 0 ? void 0 : (_formData$cpt2 = formData.cpt) === null || _formData$cpt2 === void 0 ? void 0 : _formData$cpt2.id) || (urlPropertyId !== "null" ? urlPropertyId : "") || (ptFromApi === null || ptFromApi === void 0 ? void 0 : ptFromApi.consumerCode) || "");
|
|
12631
12720
|
const [showToast, setShowToast] = useState(null);
|
|
12632
12721
|
const [propertyDetails, setPropertyDetails] = useState(() => {
|
|
12633
12722
|
var _formData$cpt3, _formData$cpt4;
|
|
@@ -12660,6 +12749,8 @@ const PropertySearchNSummary = ({
|
|
|
12660
12749
|
}
|
|
12661
12750
|
});
|
|
12662
12751
|
const [isSearchClicked, setIsSearchClicked] = useState(false);
|
|
12752
|
+
const [getNoDue, setNoDue] = useState(false);
|
|
12753
|
+
const [getCheckStatus, setCheckStats] = useState(false);
|
|
12663
12754
|
const {
|
|
12664
12755
|
isLoading,
|
|
12665
12756
|
isError,
|
|
@@ -12678,11 +12769,25 @@ const PropertySearchNSummary = ({
|
|
|
12678
12769
|
enabled: searchPropertyId ? true : false,
|
|
12679
12770
|
privacy: Digit.Utils.getPrivacyObject()
|
|
12680
12771
|
});
|
|
12772
|
+
console.log("apiDataCheck", apiDataCheck);
|
|
12773
|
+
useEffect(() => {
|
|
12774
|
+
if (ptFromApi !== null && ptFromApi !== void 0 && ptFromApi.consumerCode) {
|
|
12775
|
+
setIsSearchClicked(true);
|
|
12776
|
+
setPropertyId(ptFromApi.consumerCode);
|
|
12777
|
+
setSearchPropertyId(ptFromApi.consumerCode);
|
|
12778
|
+
setNoDue(true);
|
|
12779
|
+
onSelect(config.key, {
|
|
12780
|
+
...formData[config.key],
|
|
12781
|
+
id: ptFromApi.consumerCode
|
|
12782
|
+
});
|
|
12783
|
+
}
|
|
12784
|
+
}, [ptFromApi]);
|
|
12681
12785
|
useEffect(() => {
|
|
12682
12786
|
var _propertyDetailsFetch;
|
|
12683
12787
|
if (propertyDetailsFetch && propertyDetailsFetch !== null && propertyDetailsFetch !== void 0 && propertyDetailsFetch.Properties && (propertyDetailsFetch === null || propertyDetailsFetch === void 0 ? void 0 : (_propertyDetailsFetch = propertyDetailsFetch.Properties) === null || _propertyDetailsFetch === void 0 ? void 0 : _propertyDetailsFetch.length) > 0) {
|
|
12684
12788
|
setPropertyDetails(propertyDetailsFetch);
|
|
12685
12789
|
setShowToast(null);
|
|
12790
|
+
setCheckStats(true);
|
|
12686
12791
|
} else {
|
|
12687
12792
|
var _formData$cpt9;
|
|
12688
12793
|
if (isfirstRender.current) {
|
|
@@ -12690,7 +12795,6 @@ const PropertySearchNSummary = ({
|
|
|
12690
12795
|
return;
|
|
12691
12796
|
}
|
|
12692
12797
|
if (!(formData !== null && formData !== void 0 && (_formData$cpt9 = formData.cpt) !== null && _formData$cpt9 !== void 0 && _formData$cpt9.details)) {
|
|
12693
|
-
console.log("Property Id not found in response", propertyId);
|
|
12694
12798
|
setPropertyDetails({});
|
|
12695
12799
|
setShowToast({
|
|
12696
12800
|
error: true,
|
|
@@ -12705,7 +12809,6 @@ const PropertySearchNSummary = ({
|
|
|
12705
12809
|
useEffect(() => {
|
|
12706
12810
|
var _propertyDetails$Prop;
|
|
12707
12811
|
if (isLoading == false && error && error == true && (propertyDetails === null || propertyDetails === void 0 ? void 0 : (_propertyDetails$Prop = propertyDetails.Properties) === null || _propertyDetails$Prop === void 0 ? void 0 : _propertyDetails$Prop.length) == 0) {
|
|
12708
|
-
console.log("Error Caught", error, propertyDetails);
|
|
12709
12812
|
setShowToast({
|
|
12710
12813
|
error: true,
|
|
12711
12814
|
label: "PT_ENTER_VALID_PROPERTY_ID"
|
|
@@ -12745,6 +12848,8 @@ const PropertySearchNSummary = ({
|
|
|
12745
12848
|
setPropertyId(e.target.value);
|
|
12746
12849
|
setValue(e.target.value, propertyIdInput.name);
|
|
12747
12850
|
setIsSearchClicked(false);
|
|
12851
|
+
setNoDue(false);
|
|
12852
|
+
setCheckStats(false);
|
|
12748
12853
|
};
|
|
12749
12854
|
if (isEditScreen) {
|
|
12750
12855
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
@@ -12773,9 +12878,6 @@ const PropertySearchNSummary = ({
|
|
|
12773
12878
|
[input]: value
|
|
12774
12879
|
});
|
|
12775
12880
|
}
|
|
12776
|
-
function getValue(input) {
|
|
12777
|
-
return formData && formData[config.key] ? formData[config.key][input] : undefined;
|
|
12778
|
-
}
|
|
12779
12881
|
async function fetchBill() {
|
|
12780
12882
|
try {
|
|
12781
12883
|
var _formData$cpt0, _result$Bill;
|
|
@@ -12793,8 +12895,10 @@ const PropertySearchNSummary = ({
|
|
|
12793
12895
|
} else {
|
|
12794
12896
|
setShowToast({
|
|
12795
12897
|
error: false,
|
|
12796
|
-
label: t("
|
|
12898
|
+
label: t("NDC_NO_BILLS_FOUND_PROPERTY")
|
|
12797
12899
|
});
|
|
12900
|
+
setNoDue(true);
|
|
12901
|
+
setCheckStats(false);
|
|
12798
12902
|
}
|
|
12799
12903
|
setPropertyDues({
|
|
12800
12904
|
dues: result === null || result === void 0 ? void 0 : result.Bill[0]
|
|
@@ -12802,23 +12906,27 @@ const PropertySearchNSummary = ({
|
|
|
12802
12906
|
} else if (result !== null && result !== void 0 && result.Bill) {
|
|
12803
12907
|
setShowToast({
|
|
12804
12908
|
error: false,
|
|
12805
|
-
label: t("
|
|
12909
|
+
label: t("NDC_NO_BILLS_FOUND_PROPERTY")
|
|
12806
12910
|
});
|
|
12807
12911
|
setPropertyDues({
|
|
12808
12912
|
dues: {
|
|
12809
12913
|
totalAmount: 0
|
|
12810
12914
|
}
|
|
12811
12915
|
});
|
|
12916
|
+
setNoDue(true);
|
|
12917
|
+
setCheckStats(false);
|
|
12812
12918
|
} else {
|
|
12813
12919
|
setShowToast({
|
|
12814
12920
|
error: false,
|
|
12815
|
-
label: t("
|
|
12921
|
+
label: t("NDC_NO_BILLS_FOUND_PROPERTY")
|
|
12816
12922
|
});
|
|
12817
12923
|
setPropertyDues({
|
|
12818
12924
|
dues: {
|
|
12819
12925
|
totalAmount: 0
|
|
12820
12926
|
}
|
|
12821
12927
|
});
|
|
12928
|
+
setNoDue(true);
|
|
12929
|
+
setCheckStats(false);
|
|
12822
12930
|
}
|
|
12823
12931
|
} catch (error) {
|
|
12824
12932
|
setShowToast({
|
|
@@ -12834,12 +12942,20 @@ const PropertySearchNSummary = ({
|
|
|
12834
12942
|
window.open(payUrl, "_blank");
|
|
12835
12943
|
setPropertyDues({});
|
|
12836
12944
|
}
|
|
12945
|
+
useEffect(() => {
|
|
12946
|
+
if (showToast) {
|
|
12947
|
+
const timer = setTimeout(() => {
|
|
12948
|
+
setShowToast(null);
|
|
12949
|
+
}, 3000);
|
|
12950
|
+
return () => clearTimeout(timer);
|
|
12951
|
+
}
|
|
12952
|
+
}, [showToast]);
|
|
12837
12953
|
return /*#__PURE__*/React.createElement(React.Fragment, null, isLoading && /*#__PURE__*/React.createElement(Loader, null), /*#__PURE__*/React.createElement("div", {
|
|
12838
12954
|
style: {
|
|
12839
12955
|
marginBottom: "16px"
|
|
12840
12956
|
}
|
|
12841
12957
|
}, /*#__PURE__*/React.createElement(LabelFieldPair, null, /*#__PURE__*/React.createElement(CardLabel, {
|
|
12842
|
-
className: "card-label-smaller",
|
|
12958
|
+
className: "card-label-smaller ndc_card_labels",
|
|
12843
12959
|
style: getInputStyles()
|
|
12844
12960
|
}, `${t(propertyIdInput.label)}`, null), /*#__PURE__*/React.createElement("div", {
|
|
12845
12961
|
className: "field ndc_property_search",
|
|
@@ -12854,7 +12970,7 @@ const PropertySearchNSummary = ({
|
|
|
12854
12970
|
id: "search-property-field"
|
|
12855
12971
|
}, /*#__PURE__*/React.createElement(TextInput, Object.assign({
|
|
12856
12972
|
key: propertyIdInput.name,
|
|
12857
|
-
value:
|
|
12973
|
+
value: propertyId,
|
|
12858
12974
|
onChange: handlePropertyChange,
|
|
12859
12975
|
disable: false,
|
|
12860
12976
|
maxlength: 16,
|
|
@@ -12868,7 +12984,7 @@ const PropertySearchNSummary = ({
|
|
|
12868
12984
|
maxWidth: "100px"
|
|
12869
12985
|
},
|
|
12870
12986
|
onClick: searchProperty
|
|
12871
|
-
}, `${t("PT_SEARCH")}`),
|
|
12987
|
+
}, `${t("PT_SEARCH")}`), !(apiDataCheck !== null && apiDataCheck !== void 0 && (_apiDataCheck$2 = apiDataCheck[0]) !== null && _apiDataCheck$2 !== void 0 && _apiDataCheck$2.NdcDetails) && getCheckStatus && /*#__PURE__*/React.createElement("button", {
|
|
12872
12988
|
className: "submit-bar",
|
|
12873
12989
|
type: "button",
|
|
12874
12990
|
style: {
|
|
@@ -12880,7 +12996,7 @@ const PropertySearchNSummary = ({
|
|
|
12880
12996
|
onClick: () => {
|
|
12881
12997
|
fetchBill();
|
|
12882
12998
|
}
|
|
12883
|
-
}, `${t("CHECK_STATUS_PROPERTY")}`), (formData === null || formData === void 0 ? void 0 : (_formData$
|
|
12999
|
+
}, `${t("CHECK_STATUS_PROPERTY")}`), (formData === null || formData === void 0 ? void 0 : (_formData$cpt12 = formData.cpt) === null || _formData$cpt12 === void 0 ? void 0 : _formData$cpt12.id) && (formData === null || formData === void 0 ? void 0 : (_formData$cpt13 = formData.cpt) === null || _formData$cpt13 === void 0 ? void 0 : (_formData$cpt13$dues = _formData$cpt13.dues) === null || _formData$cpt13$dues === void 0 ? void 0 : _formData$cpt13$dues.totalAmount) > 0 && !isSearchClicked && /*#__PURE__*/React.createElement("button", {
|
|
12884
13000
|
className: "submit-bar",
|
|
12885
13001
|
type: "button",
|
|
12886
13002
|
style: {
|
|
@@ -12891,7 +13007,7 @@ const PropertySearchNSummary = ({
|
|
|
12891
13007
|
onClick: () => {
|
|
12892
13008
|
redirectToPayBill();
|
|
12893
13009
|
}
|
|
12894
|
-
}, `${t("PAY_DUES")}`),
|
|
13010
|
+
}, `${t("PAY_DUES")}`), getNoDue && /*#__PURE__*/React.createElement("div", {
|
|
12895
13011
|
style: {
|
|
12896
13012
|
color: "green",
|
|
12897
13013
|
width: "100%",
|
|
@@ -12963,6 +13079,7 @@ const SelectNDCDocuments = ({
|
|
|
12963
13079
|
formState: formState
|
|
12964
13080
|
});
|
|
12965
13081
|
}), error && /*#__PURE__*/React.createElement(Toast, {
|
|
13082
|
+
isDleteBtn: true,
|
|
12966
13083
|
label: error,
|
|
12967
13084
|
onClose: () => setError(null),
|
|
12968
13085
|
error: true
|
|
@@ -13659,6 +13776,18 @@ const NewNDCStepForm$1 = () => {
|
|
|
13659
13776
|
const formState = useSelector(state => state.ndc.NDCForm);
|
|
13660
13777
|
const step = formState.step;
|
|
13661
13778
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
13779
|
+
const id = window.location.pathname.split("/").pop();
|
|
13780
|
+
const {
|
|
13781
|
+
isLoading,
|
|
13782
|
+
data: applicationDetails
|
|
13783
|
+
} = Digit.Hooks.ndc.useSearchEmployeeApplication({
|
|
13784
|
+
uuid: id
|
|
13785
|
+
}, tenantId);
|
|
13786
|
+
useEffect(() => {
|
|
13787
|
+
if (applicationDetails !== null && applicationDetails !== void 0 && applicationDetails.Applications.length) {
|
|
13788
|
+
dispatch(updateNDCForm("responseData", applicationDetails === null || applicationDetails === void 0 ? void 0 : applicationDetails.Applications));
|
|
13789
|
+
}
|
|
13790
|
+
}, [applicationDetails]);
|
|
13662
13791
|
const setStep = updatedStepNumber => {
|
|
13663
13792
|
dispatch(setNDCStep(updatedStepNumber));
|
|
13664
13793
|
};
|
|
@@ -13813,6 +13942,7 @@ const NewNDCStepFormOne$1 = ({
|
|
|
13813
13942
|
};
|
|
13814
13943
|
function validateStepData(data) {
|
|
13815
13944
|
var _data$cpt6, _data$cpt6$dues, _data$cpt7, _data$cpt7$dues, _data$dues, _propertyDetails$wate, _propertyDetails$sewe;
|
|
13945
|
+
console.log("data", data);
|
|
13816
13946
|
const missingFields = [];
|
|
13817
13947
|
const invalidFields = [];
|
|
13818
13948
|
const cpt = (data === null || data === void 0 ? void 0 : data.cpt) || {};
|