@djb25/digit-ui-module-fsm 1.0.14 → 1.0.16
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 +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +248 -99
- 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 { AddNewIcon, ShippingTruck, EmployeeModuleCard, TickMark, FormStep as FormStep$1, RadioOrSelect, LabelFieldPair, CardLabel as CardLabel$1, Dropdown as Dropdown$2, TextInput as TextInput$1, RadioButtons, Loader, LocationSearchCard, TextArea as TextArea$1, CardLabelError as CardLabelError$1, CitizenInfoLabel, CardText as CardText$1, WrapUnMaskComponent, PitDimension, ImageUploadHandler, KeyNote, BackButton, PrivateRoute, LayoutWrapper, TelePhone, CardSectionHeader, CheckPoint, ConnectingCheckPoints, LinkButton as LinkButton$1, ActionLinks, Rating, SubmitBar as SubmitBar$1, Header, Card
|
|
1
|
+
import { AddNewIcon, ShippingTruck, EmployeeModuleCard, TickMark, FormStep as FormStep$1, RadioOrSelect, LabelFieldPair, CardLabel as CardLabel$1, Dropdown as Dropdown$2, TextInput as TextInput$1, RadioButtons, Loader, LocationSearchCard, TextArea as TextArea$1, CardLabelError as CardLabelError$1, CitizenInfoLabel, CardText as CardText$1, WrapUnMaskComponent, PitDimension, ImageUploadHandler, KeyNote, BackButton, PrivateRoute, LayoutWrapper, TelePhone, CardSectionHeader, CheckPoint, ConnectingCheckPoints, LinkButton as LinkButton$1, ActionLinks, Rating, SubmitBar as SubmitBar$1, Header, Card, CardHeader as CardHeader$1, CardSubHeader, StatusTable, Row, Banner, RatingCard, ULBHomeCard, ViewReportIcon, InboxIcon, Table, CheckBox, CloseSvg, Localities, RemoveableTag, ActionBar, ApplyFilterBar, Label, LinkLabel, DatePicker as DatePicker$3, DetailsCard, SearchAction, FilterAction, PopUp, BreadCrumb, ModuleHeader, ArrowLeft, HomeIcon, Modal, FormComposer, UploadPitPhoto, ImageViewer, BreakLine, Toast, Menu, MultiUploadWrapper, AddIcon, ToggleSwitch, InfoIcon, EditIcon, DeleteIcon, VerticalTimeline, CustomTooltip, MobileNumber, CitizenHomeCard, CitizenTruck } from '@djb25/digit-ui-react-components';
|
|
2
2
|
import React, { useState, useEffect, Fragment as Fragment$1, forwardRef, useCallback, useMemo, useRef } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { useLocation, useParams, Switch, Redirect, Link, useHistory, useRouteMatch, Route } from 'react-router-dom';
|
|
@@ -2147,24 +2147,6 @@ function getDDMMYYYY(date) {
|
|
|
2147
2147
|
return new Date(date).toLocaleString("en-In").split(",")[0];
|
|
2148
2148
|
}
|
|
2149
2149
|
|
|
2150
|
-
const Card = ({
|
|
2151
|
-
onClick,
|
|
2152
|
-
style,
|
|
2153
|
-
children,
|
|
2154
|
-
className,
|
|
2155
|
-
ReactRef,
|
|
2156
|
-
...props
|
|
2157
|
-
}) => {
|
|
2158
|
-
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
2159
|
-
key: props.key,
|
|
2160
|
-
className: `employeeCard ${className ? className : ""}`,
|
|
2161
|
-
onClick: onClick,
|
|
2162
|
-
style: style
|
|
2163
|
-
}, props, {
|
|
2164
|
-
ref: ReactRef
|
|
2165
|
-
}), children);
|
|
2166
|
-
};
|
|
2167
|
-
|
|
2168
2150
|
const CardHeader = props => {
|
|
2169
2151
|
return /*#__PURE__*/React.createElement("header", {
|
|
2170
2152
|
className: "card-header",
|
|
@@ -2237,7 +2219,7 @@ const InputCard = ({
|
|
|
2237
2219
|
className
|
|
2238
2220
|
}) => {
|
|
2239
2221
|
const isMobile = window.Digit.Utils.browser.isMobile();
|
|
2240
|
-
return /*#__PURE__*/React.createElement(
|
|
2222
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
2241
2223
|
className: className || "",
|
|
2242
2224
|
style: _cardStyle
|
|
2243
2225
|
}, _texts.headerCaption && /*#__PURE__*/React.createElement(CardCaption, null, t(_texts.headerCaption)), (_texts === null || _texts === void 0 ? void 0 : _texts.header) && /*#__PURE__*/React.createElement(CardHeader, null, t(_texts.header)), (_texts === null || _texts === void 0 ? void 0 : _texts.cardText) && /*#__PURE__*/React.createElement(CardText, null, t(_texts.cardText)), /*#__PURE__*/React.createElement("div", {
|
|
@@ -10055,7 +10037,7 @@ const ApplicationDetails = () => {
|
|
|
10055
10037
|
color: "#A52A2A"
|
|
10056
10038
|
},
|
|
10057
10039
|
onClick: handleViewTimeline
|
|
10058
|
-
}))), /*#__PURE__*/React.createElement(Card
|
|
10040
|
+
}))), /*#__PURE__*/React.createElement(Card, {
|
|
10059
10041
|
style: {
|
|
10060
10042
|
position: "relative"
|
|
10061
10043
|
}
|
|
@@ -10088,7 +10070,7 @@ const MyApplication = ({
|
|
|
10088
10070
|
const {
|
|
10089
10071
|
t
|
|
10090
10072
|
} = useTranslation();
|
|
10091
|
-
return /*#__PURE__*/React.createElement(Card
|
|
10073
|
+
return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(KeyNote, {
|
|
10092
10074
|
keyValue: t("CS_FSM_APPLICATION_APPLICATION_NO"),
|
|
10093
10075
|
note: application.applicationNo
|
|
10094
10076
|
}), /*#__PURE__*/React.createElement(KeyNote, {
|
|
@@ -10137,7 +10119,7 @@ const MyApplications = () => {
|
|
|
10137
10119
|
key: index
|
|
10138
10120
|
}, /*#__PURE__*/React.createElement(MyApplication, {
|
|
10139
10121
|
application: application
|
|
10140
|
-
}))), applicationsList.length === 0 && /*#__PURE__*/React.createElement(Card
|
|
10122
|
+
}))), applicationsList.length === 0 && /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement("p", {
|
|
10141
10123
|
style: {
|
|
10142
10124
|
textAlign: "center"
|
|
10143
10125
|
}
|
|
@@ -10205,7 +10187,7 @@ const CheckPage = ({
|
|
|
10205
10187
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Timeline, {
|
|
10206
10188
|
currentStep: 4,
|
|
10207
10189
|
flow: "APPLY"
|
|
10208
|
-
}), /*#__PURE__*/React.createElement(Card
|
|
10190
|
+
}), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardHeader$1, null, t("CS_CHECK_CHECK_YOUR_ANSWERS")), /*#__PURE__*/React.createElement(CardText$1, null, t("CS_CHECK_CHECK_YOUR_ANSWERS_TEXT")), /*#__PURE__*/React.createElement(CardSubHeader, null, t("CS_CHECK_PROPERTY_DETAILS")), /*#__PURE__*/React.createElement(StatusTable, null, selectTripNo && (selectTripNo === null || selectTripNo === void 0 ? void 0 : selectTripNo.tripNo) && /*#__PURE__*/React.createElement(Row, {
|
|
10209
10191
|
label: t("ES_FSM_ACTION_NUMBER_OF_TRIPS"),
|
|
10210
10192
|
text: t(selectTripNo === null || selectTripNo === void 0 ? void 0 : (_selectTripNo$tripNo = selectTripNo.tripNo) === null || _selectTripNo$tripNo === void 0 ? void 0 : _selectTripNo$tripNo.i18nKey),
|
|
10211
10193
|
actionButton: /*#__PURE__*/React.createElement(ActionButton, {
|
|
@@ -10628,7 +10610,7 @@ const Response = ({
|
|
|
10628
10610
|
Digit.Utils.pdf.generate(data);
|
|
10629
10611
|
};
|
|
10630
10612
|
const isSuccess = !successData ? mutation === null || mutation === void 0 ? void 0 : mutation.isSuccess : true;
|
|
10631
|
-
return mutation.isLoading || mutation.isIdle && !mutationHappened ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(Card
|
|
10613
|
+
return mutation.isLoading || mutation.isIdle && !mutationHappened ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(BannerPicker, {
|
|
10632
10614
|
t: t,
|
|
10633
10615
|
data: Data,
|
|
10634
10616
|
isSuccess: isSuccess,
|
|
@@ -11091,7 +11073,7 @@ const RateView = props => {
|
|
|
11091
11073
|
if (isLoading || isWorkflowLoading) {
|
|
11092
11074
|
return /*#__PURE__*/React.createElement(Loader, null);
|
|
11093
11075
|
}
|
|
11094
|
-
return /*#__PURE__*/React.createElement(Card
|
|
11076
|
+
return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(CardHeader$1, null, t("CS_RATE_HELP_US")), /*#__PURE__*/React.createElement(KeyNote, {
|
|
11095
11077
|
keyValue: t("CS_FSM_YOU_RATED")
|
|
11096
11078
|
}, /*#__PURE__*/React.createElement(Rating, {
|
|
11097
11079
|
currentRating: data === null || data === void 0 ? void 0 : (_data$timeline$ = data.timeline[0]) === null || _data$timeline$ === void 0 ? void 0 : _data$timeline$.rating
|
|
@@ -11391,7 +11373,7 @@ const FSMLink = ({
|
|
|
11391
11373
|
}, /*#__PURE__*/React.createElement(ShippingTruck, null)), " ", /*#__PURE__*/React.createElement("span", {
|
|
11392
11374
|
className: "text"
|
|
11393
11375
|
}, t("ES_TITLE_FAECAL_SLUDGE_MGMT")));
|
|
11394
|
-
return /*#__PURE__*/React.createElement(Card
|
|
11376
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
11395
11377
|
className: "employeeCard inboxLinksFSM"
|
|
11396
11378
|
}, /*#__PURE__*/React.createElement("div", {
|
|
11397
11379
|
className: "complaint-links-container"
|
|
@@ -12070,7 +12052,7 @@ const DesktopInbox = props => {
|
|
|
12070
12052
|
if (props.isLoading) {
|
|
12071
12053
|
result = /*#__PURE__*/React.createElement(Loader, null);
|
|
12072
12054
|
} else if (props.isSearch && !props.shouldSearch || (props === null || props === void 0 ? void 0 : (_props$data = props.data) === null || _props$data === void 0 ? void 0 : (_props$data$table = _props$data.table) === null || _props$data$table === void 0 ? void 0 : _props$data$table.length) === 0) {
|
|
12073
|
-
result = /*#__PURE__*/React.createElement(Card
|
|
12055
|
+
result = /*#__PURE__*/React.createElement(Card, {
|
|
12074
12056
|
style: {
|
|
12075
12057
|
marginTop: 20
|
|
12076
12058
|
}
|
|
@@ -12261,7 +12243,7 @@ const ApplicationCard = ({
|
|
|
12261
12243
|
}
|
|
12262
12244
|
let result;
|
|
12263
12245
|
if (!data || (data === null || data === void 0 ? void 0 : data.length) === 0) {
|
|
12264
|
-
result = /*#__PURE__*/React.createElement(Card
|
|
12246
|
+
result = /*#__PURE__*/React.createElement(Card, {
|
|
12265
12247
|
style: {
|
|
12266
12248
|
marginTop: 20
|
|
12267
12249
|
}
|
|
@@ -14443,7 +14425,7 @@ const ApplicationDetails$1 = props => {
|
|
|
14443
14425
|
color: "#A52A2A"
|
|
14444
14426
|
},
|
|
14445
14427
|
onClick: handleViewTimeline
|
|
14446
|
-
})), /*#__PURE__*/React.createElement(Card
|
|
14428
|
+
})), /*#__PURE__*/React.createElement(Card, {
|
|
14447
14429
|
className: "fsm",
|
|
14448
14430
|
style: {
|
|
14449
14431
|
position: "relative"
|
|
@@ -15974,7 +15956,7 @@ const FstpOperatorDetails = () => {
|
|
|
15974
15956
|
styles: {
|
|
15975
15957
|
marginLeft: "16px"
|
|
15976
15958
|
}
|
|
15977
|
-
}, t("ES_INBOX_VEHICLE_LOG")), /*#__PURE__*/React.createElement(Card
|
|
15959
|
+
}, t("ES_INBOX_VEHICLE_LOG")), /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(StatusTable, null, vehicleData === null || vehicleData === void 0 ? void 0 : vehicleData.map((row, index) => /*#__PURE__*/React.createElement(Row, {
|
|
15978
15960
|
rowContainerStyle: isMobile && history.location.pathname.includes("new-vehicle-entry") ? {
|
|
15979
15961
|
display: "block"
|
|
15980
15962
|
} : {
|
|
@@ -17268,7 +17250,7 @@ const Response$1 = props => {
|
|
|
17268
17250
|
ACTIONS = [...ACTIONS, "ASSIGN_TO_DSO"];
|
|
17269
17251
|
}
|
|
17270
17252
|
const isSuccess = !successData ? mutation === null || mutation === void 0 ? void 0 : mutation.isSuccess : true;
|
|
17271
|
-
return /*#__PURE__*/React.createElement(Card
|
|
17253
|
+
return /*#__PURE__*/React.createElement(Card, null, /*#__PURE__*/React.createElement(BannerPicker$1, {
|
|
17272
17254
|
t: t,
|
|
17273
17255
|
data: Data,
|
|
17274
17256
|
action: state.action,
|
|
@@ -18032,7 +18014,7 @@ const RegisryInbox = props => {
|
|
|
18032
18014
|
emptyCardText = "ES_FSM_REGISTRY_EMPTY_CARD_DRIVER";
|
|
18033
18015
|
emptyButtonText = "ES_FSM_REGISTRY_EMPTY_BUTTON_DRIVER";
|
|
18034
18016
|
}
|
|
18035
|
-
result = /*#__PURE__*/React.createElement(Card
|
|
18017
|
+
result = /*#__PURE__*/React.createElement(Card, {
|
|
18036
18018
|
style: {
|
|
18037
18019
|
display: "flex",
|
|
18038
18020
|
justifyContent: "center",
|
|
@@ -18680,7 +18662,7 @@ const VehicleDetails = props => {
|
|
|
18680
18662
|
}
|
|
18681
18663
|
return !isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
18682
18664
|
className: "employee-form-content"
|
|
18683
|
-
}, /*#__PURE__*/React.createElement(Card
|
|
18665
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
18684
18666
|
style: {
|
|
18685
18667
|
position: "relative",
|
|
18686
18668
|
backgroundColor: "#fff"
|
|
@@ -18694,7 +18676,7 @@ const VehicleDetails = props => {
|
|
|
18694
18676
|
marginBottom: "16px",
|
|
18695
18677
|
marginTop: "32px"
|
|
18696
18678
|
}
|
|
18697
|
-
}, t(detail.title)), /*#__PURE__*/React.createElement(Card
|
|
18679
|
+
}, t(detail.title)), /*#__PURE__*/React.createElement(Card, {
|
|
18698
18680
|
className: "card-with-background",
|
|
18699
18681
|
style: {
|
|
18700
18682
|
margin: "10px 16px",
|
|
@@ -18759,7 +18741,7 @@ const VehicleDetails = props => {
|
|
|
18759
18741
|
actionSaveLabel: t(selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? "ES_EVENT_DELETE" : "CS_COMMON_SUBMIT"),
|
|
18760
18742
|
actionSaveOnSubmit: handleModalAction,
|
|
18761
18743
|
formId: "modal-action"
|
|
18762
|
-
}, selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? renderModalContent() : /*#__PURE__*/React.createElement(Card
|
|
18744
|
+
}, selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? renderModalContent() : /*#__PURE__*/React.createElement(Card, {
|
|
18763
18745
|
style: {
|
|
18764
18746
|
boxShadow: "none"
|
|
18765
18747
|
}
|
|
@@ -19650,7 +19632,7 @@ const DriverDetails = props => {
|
|
|
19650
19632
|
}
|
|
19651
19633
|
return !isLoading ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
19652
19634
|
className: "employee-form-content"
|
|
19653
|
-
}, /*#__PURE__*/React.createElement(Card
|
|
19635
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
19654
19636
|
style: {
|
|
19655
19637
|
position: "relative",
|
|
19656
19638
|
backgroundColor: "#fff"
|
|
@@ -19664,7 +19646,7 @@ const DriverDetails = props => {
|
|
|
19664
19646
|
marginBottom: "16px",
|
|
19665
19647
|
marginTop: "32px"
|
|
19666
19648
|
}
|
|
19667
|
-
}, t(detail.title)), /*#__PURE__*/React.createElement(Card
|
|
19649
|
+
}, t(detail.title)), /*#__PURE__*/React.createElement(Card, {
|
|
19668
19650
|
className: "card-with-background",
|
|
19669
19651
|
style: {
|
|
19670
19652
|
margin: "10px 16px",
|
|
@@ -19729,7 +19711,7 @@ const DriverDetails = props => {
|
|
|
19729
19711
|
actionSaveLabel: t(selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? "ES_EVENT_DELETE" : "CS_COMMON_SUBMIT"),
|
|
19730
19712
|
actionSaveOnSubmit: handleModalAction,
|
|
19731
19713
|
formId: "modal-action"
|
|
19732
|
-
}, selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? renderModalContent() : /*#__PURE__*/React.createElement(Card
|
|
19714
|
+
}, selectedAction === "DELETE" || selectedAction === "DELETE_VENDOR" ? renderModalContent() : /*#__PURE__*/React.createElement(Card, {
|
|
19733
19715
|
style: {
|
|
19734
19716
|
boxShadow: "none"
|
|
19735
19717
|
}
|
|
@@ -20836,11 +20818,27 @@ const SelectLocalityOrGramPanchayat = ({
|
|
|
20836
20818
|
})))));
|
|
20837
20819
|
};
|
|
20838
20820
|
|
|
20821
|
+
const convertEpochToDate$1 = (dateEpoch, businessService) => {
|
|
20822
|
+
const dateFromApi = new Date(dateEpoch);
|
|
20823
|
+
if (dateEpoch) {
|
|
20824
|
+
let month = dateFromApi.getMonth() + 1;
|
|
20825
|
+
let day = dateFromApi.getDate();
|
|
20826
|
+
let year = dateFromApi.getFullYear();
|
|
20827
|
+
month = (month > 9 ? "" : "0") + month;
|
|
20828
|
+
day = (day > 9 ? "" : "0") + day;
|
|
20829
|
+
if (businessService === "asset-create") return `${day}-${month}-${year}`;else return `${day}/${month}/${year}`;
|
|
20830
|
+
} else {
|
|
20831
|
+
return null;
|
|
20832
|
+
}
|
|
20833
|
+
};
|
|
20834
|
+
|
|
20839
20835
|
const {
|
|
20840
20836
|
DatePicker: DatePicker$2,
|
|
20841
20837
|
Dropdown: Dropdown$1
|
|
20842
20838
|
} = require("@djb25/digit-ui-react-components");
|
|
20843
|
-
const VendorConfig = (t, disabled = false) => {
|
|
20839
|
+
const VendorConfig = (t, disabled = false, formData = {}) => {
|
|
20840
|
+
var _formData$serviceType;
|
|
20841
|
+
const isEkyc = (formData === null || formData === void 0 ? void 0 : (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code) === "EKYC";
|
|
20844
20842
|
return [{
|
|
20845
20843
|
head: "ES_VRNDOR_NEW_VENDOR_DETAILS",
|
|
20846
20844
|
body: [{
|
|
@@ -20912,7 +20910,130 @@ const VendorConfig = (t, disabled = false) => {
|
|
|
20912
20910
|
header: "CS_COMMON_CHOOSE_SERVICE_TYPE",
|
|
20913
20911
|
submitBarLabel: "CS_COMMON_NEXT"
|
|
20914
20912
|
}
|
|
20915
|
-
}
|
|
20913
|
+
}, ...(isEkyc ? [{
|
|
20914
|
+
label: "ES_VENDOR_CONTRACT_START_DATE",
|
|
20915
|
+
isMandatory: true,
|
|
20916
|
+
type: "custom",
|
|
20917
|
+
key: "contractStartDate",
|
|
20918
|
+
populators: {
|
|
20919
|
+
name: "contractStartDate",
|
|
20920
|
+
validation: {
|
|
20921
|
+
required: true
|
|
20922
|
+
},
|
|
20923
|
+
component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
|
|
20924
|
+
onChange: props.onChange,
|
|
20925
|
+
date: props.value
|
|
20926
|
+
}, customProps))
|
|
20927
|
+
}
|
|
20928
|
+
}, {
|
|
20929
|
+
label: "ES_VENDOR_CONTRACT_END_DATE",
|
|
20930
|
+
isMandatory: true,
|
|
20931
|
+
type: "custom",
|
|
20932
|
+
key: "contractEndDate",
|
|
20933
|
+
populators: {
|
|
20934
|
+
name: "contractEndDate",
|
|
20935
|
+
validation: {
|
|
20936
|
+
required: true
|
|
20937
|
+
},
|
|
20938
|
+
component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
|
|
20939
|
+
onChange: props.onChange,
|
|
20940
|
+
date: props.value
|
|
20941
|
+
}, customProps))
|
|
20942
|
+
}
|
|
20943
|
+
}, {
|
|
20944
|
+
label: "ES_VENDOR_ZONE",
|
|
20945
|
+
isMandatory: true,
|
|
20946
|
+
type: "component",
|
|
20947
|
+
key: "zoneIds",
|
|
20948
|
+
component: "SelectEkycZones"
|
|
20949
|
+
}, {
|
|
20950
|
+
label: "ES_VENDOR_CLUSTER",
|
|
20951
|
+
isMandatory: true,
|
|
20952
|
+
type: "component",
|
|
20953
|
+
key: "clusterIds",
|
|
20954
|
+
component: "SelectEkycClusters"
|
|
20955
|
+
}, {
|
|
20956
|
+
label: "ES_FSM_REGISTRY_NEW_OWNER_NAME",
|
|
20957
|
+
isMandatory: true,
|
|
20958
|
+
type: "text",
|
|
20959
|
+
populators: {
|
|
20960
|
+
name: "ownerName",
|
|
20961
|
+
validation: {
|
|
20962
|
+
required: true,
|
|
20963
|
+
pattern: /^[A-Za-z\s.,/]+$/
|
|
20964
|
+
},
|
|
20965
|
+
error: t("FSM_REGISTRY_INVALID_NAME"),
|
|
20966
|
+
className: "payment-form-text-input-correction"
|
|
20967
|
+
}
|
|
20968
|
+
}, {
|
|
20969
|
+
label: "ES_FSM_REGISTRY_NEW_FATHER_NAME",
|
|
20970
|
+
isMandatory: true,
|
|
20971
|
+
type: "text",
|
|
20972
|
+
populators: {
|
|
20973
|
+
name: "fatherOrHusbandName",
|
|
20974
|
+
validation: {
|
|
20975
|
+
required: true
|
|
20976
|
+
},
|
|
20977
|
+
className: "payment-form-text-input-correction"
|
|
20978
|
+
}
|
|
20979
|
+
}, {
|
|
20980
|
+
label: "ES_FSM_REGISTRY_NEW_GENDER",
|
|
20981
|
+
isMandatory: true,
|
|
20982
|
+
type: "component",
|
|
20983
|
+
key: "gender",
|
|
20984
|
+
component: "SelectEkycDropdown",
|
|
20985
|
+
populators: {
|
|
20986
|
+
name: "gender",
|
|
20987
|
+
options: [{
|
|
20988
|
+
code: "MALE",
|
|
20989
|
+
name: "ES_COMMON_GENDER_MALE"
|
|
20990
|
+
}, {
|
|
20991
|
+
code: "FEMALE",
|
|
20992
|
+
name: "ES_COMMON_GENDER_FEMALE"
|
|
20993
|
+
}, {
|
|
20994
|
+
code: "OTHER",
|
|
20995
|
+
name: "ES_COMMON_GENDER_OTHER"
|
|
20996
|
+
}],
|
|
20997
|
+
optionsKey: "name"
|
|
20998
|
+
}
|
|
20999
|
+
}, {
|
|
21000
|
+
label: "ES_FSM_REGISTRY_NEW_DOB",
|
|
21001
|
+
isMandatory: true,
|
|
21002
|
+
type: "custom",
|
|
21003
|
+
key: "dob",
|
|
21004
|
+
populators: {
|
|
21005
|
+
name: "dob",
|
|
21006
|
+
validation: {
|
|
21007
|
+
required: true
|
|
21008
|
+
},
|
|
21009
|
+
component: (props, customProps) => /*#__PURE__*/React.createElement(DatePicker$2, Object.assign({
|
|
21010
|
+
onChange: props.onChange,
|
|
21011
|
+
date: props.value
|
|
21012
|
+
}, customProps, {
|
|
21013
|
+
max: convertEpochToDate$1(new Date().setFullYear(new Date().getFullYear()))
|
|
21014
|
+
}))
|
|
21015
|
+
}
|
|
21016
|
+
}, {
|
|
21017
|
+
label: "ES_FSM_REGISTRY_NEW_RELATIONSHIP",
|
|
21018
|
+
isMandatory: true,
|
|
21019
|
+
type: "component",
|
|
21020
|
+
key: "relationship",
|
|
21021
|
+
component: "SelectEkycDropdown",
|
|
21022
|
+
populators: {
|
|
21023
|
+
name: "relationship",
|
|
21024
|
+
options: [{
|
|
21025
|
+
code: "FATHER",
|
|
21026
|
+
name: "ES_COMMON_RELATION_FATHER"
|
|
21027
|
+
}, {
|
|
21028
|
+
code: "HUSBAND",
|
|
21029
|
+
name: "ES_COMMON_RELATION_HUSBAND"
|
|
21030
|
+
}, {
|
|
21031
|
+
code: "OTHER",
|
|
21032
|
+
name: "ES_COMMON_RELATION_OTHER"
|
|
21033
|
+
}],
|
|
21034
|
+
optionsKey: "name"
|
|
21035
|
+
}
|
|
21036
|
+
}] : [])]
|
|
20916
21037
|
}, {
|
|
20917
21038
|
head: "ES_FSM_REGISTRY_NEW_ADDRESS_DETAILS",
|
|
20918
21039
|
body: [{
|
|
@@ -21753,7 +21874,6 @@ const AddVendor = ({
|
|
|
21753
21874
|
clearSuccessData();
|
|
21754
21875
|
clearError();
|
|
21755
21876
|
}, []);
|
|
21756
|
-
const Config = VendorConfig(t);
|
|
21757
21877
|
const defaultValues = {
|
|
21758
21878
|
serviceType: {
|
|
21759
21879
|
code: "WT",
|
|
@@ -21766,11 +21886,22 @@ const AddVendor = ({
|
|
|
21766
21886
|
amount: null
|
|
21767
21887
|
}
|
|
21768
21888
|
};
|
|
21769
|
-
const
|
|
21770
|
-
|
|
21771
|
-
|
|
21772
|
-
|
|
21773
|
-
if (
|
|
21889
|
+
const [formData, setFormData] = useState(defaultValues);
|
|
21890
|
+
const Config = VendorConfig(t, false, formData);
|
|
21891
|
+
const onFormValueChange = (setValue, data) => {
|
|
21892
|
+
var _data$serviceType, _formData$serviceType, _data$serviceType2, _data$serviceType3, _data$address, _data$address2;
|
|
21893
|
+
if ((data === null || data === void 0 ? void 0 : (_data$serviceType = data.serviceType) === null || _data$serviceType === void 0 ? void 0 : _data$serviceType.code) !== (formData === null || formData === void 0 ? void 0 : (_formData$serviceType = formData.serviceType) === null || _formData$serviceType === void 0 ? void 0 : _formData$serviceType.code) || JSON.stringify(data === null || data === void 0 ? void 0 : data.zoneIds) !== JSON.stringify(formData === null || formData === void 0 ? void 0 : formData.zoneIds)) {
|
|
21894
|
+
setFormData(data);
|
|
21895
|
+
}
|
|
21896
|
+
const isEkyc = (data === null || data === void 0 ? void 0 : (_data$serviceType2 = data.serviceType) === null || _data$serviceType2 === void 0 ? void 0 : _data$serviceType2.code) === "EKYC";
|
|
21897
|
+
const isVendorDetailsFilled = (data === null || data === void 0 ? void 0 : data.vendorName) && (data === null || data === void 0 ? void 0 : data.phone) && (data === null || data === void 0 ? void 0 : (_data$serviceType3 = data.serviceType) === null || _data$serviceType3 === void 0 ? void 0 : _data$serviceType3.code);
|
|
21898
|
+
const isAddressFilled = (data === null || data === void 0 ? void 0 : (_data$address = data.address) === null || _data$address === void 0 ? void 0 : _data$address.city) && (data === null || data === void 0 ? void 0 : (_data$address2 = data.address) === null || _data$address2 === void 0 ? void 0 : _data$address2.locality);
|
|
21899
|
+
let isEkycFieldsFilled = true;
|
|
21900
|
+
if (isEkyc) {
|
|
21901
|
+
var _data$zoneIds, _data$clusterIds;
|
|
21902
|
+
isEkycFieldsFilled = (data === null || data === void 0 ? void 0 : data.ownerName) && (data === null || data === void 0 ? void 0 : data.contractStartDate) && (data === null || data === void 0 ? void 0 : data.contractEndDate) && (data === null || data === void 0 ? void 0 : (_data$zoneIds = data.zoneIds) === null || _data$zoneIds === void 0 ? void 0 : _data$zoneIds.length) > 0 && (data === null || data === void 0 ? void 0 : (_data$clusterIds = data.clusterIds) === null || _data$clusterIds === void 0 ? void 0 : _data$clusterIds.length) > 0 && (data === null || data === void 0 ? void 0 : data.fatherOrHusbandName) && (data === null || data === void 0 ? void 0 : data.gender) && (data === null || data === void 0 ? void 0 : data.dob) && (data === null || data === void 0 ? void 0 : data.relationship);
|
|
21903
|
+
}
|
|
21904
|
+
if (isVendorDetailsFilled && isAddressFilled && isEkycFieldsFilled) {
|
|
21774
21905
|
setCanSubmit(true);
|
|
21775
21906
|
} else {
|
|
21776
21907
|
setCanSubmit(false);
|
|
@@ -21809,7 +21940,7 @@ const AddVendor = ({
|
|
|
21809
21940
|
setShowToast(null);
|
|
21810
21941
|
};
|
|
21811
21942
|
const onSubmit = data => {
|
|
21812
|
-
var _mergedData$street, _mergedData$doorNo, _mergedData$plotNo, _mergedData$landmark, _mergedData$address, _mergedData$address$c, _mergedData$address2, _mergedData$address2$, _mergedData$address3, _mergedData$address3$, _mergedData$address4, _mergedData$address4$, _mergedData$buildingN, _mergedData$address5, _mergedData$address5$, _mergedData$address6, _mergedData$address6$, _mergedData$address7, _mergedData$address7$, _mergedData$serviceTy, _mergedData$address8, _mergedData$address9;
|
|
21943
|
+
var _mergedData$street, _mergedData$doorNo, _mergedData$plotNo, _mergedData$landmark, _mergedData$address, _mergedData$address$c, _mergedData$address2, _mergedData$address2$, _mergedData$address3, _mergedData$address3$, _mergedData$address4, _mergedData$address4$, _mergedData$buildingN, _mergedData$address5, _mergedData$address5$, _mergedData$address6, _mergedData$address6$, _mergedData$address7, _mergedData$address7$, _mergedData$serviceTy, _mergedData$address8, _mergedData$address9, _mergedData$relations, _mergedData$gender, _mergedData$serviceTy2;
|
|
21813
21944
|
const mergedData = data;
|
|
21814
21945
|
const name = mergedData === null || mergedData === void 0 ? void 0 : mergedData.vendorName;
|
|
21815
21946
|
const pincode = mergedData === null || mergedData === void 0 ? void 0 : mergedData.pincode;
|
|
@@ -21825,59 +21956,75 @@ const AddVendor = ({
|
|
|
21825
21956
|
const localityCode = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address5 = mergedData.address) === null || _mergedData$address5 === void 0 ? void 0 : (_mergedData$address5$ = _mergedData$address5.locality) === null || _mergedData$address5$ === void 0 ? void 0 : _mergedData$address5$.code;
|
|
21826
21957
|
const localityName = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address6 = mergedData.address) === null || _mergedData$address6 === void 0 ? void 0 : (_mergedData$address6$ = _mergedData$address6.locality) === null || _mergedData$address6$ === void 0 ? void 0 : _mergedData$address6$.name;
|
|
21827
21958
|
const localityArea = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address7 = mergedData.address) === null || _mergedData$address7 === void 0 ? void 0 : (_mergedData$address7$ = _mergedData$address7.locality) === null || _mergedData$address7$ === void 0 ? void 0 : _mergedData$address7$.area;
|
|
21828
|
-
const gender = "MALE";
|
|
21829
21959
|
const emailId = mergedData === null || mergedData === void 0 ? void 0 : mergedData.emailId;
|
|
21830
21960
|
const phone = mergedData === null || mergedData === void 0 ? void 0 : mergedData.phone;
|
|
21831
|
-
const
|
|
21832
|
-
|
|
21833
|
-
|
|
21961
|
+
const isEkyc = (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$serviceTy = mergedData.serviceType) === null || _mergedData$serviceTy === void 0 ? void 0 : _mergedData$serviceTy.code) === "EKYC";
|
|
21962
|
+
let vendorData = {
|
|
21963
|
+
tenantId: tenantId,
|
|
21964
|
+
name,
|
|
21965
|
+
agencyType: "ULB",
|
|
21966
|
+
paymentPreference: "post-service",
|
|
21967
|
+
address: {
|
|
21834
21968
|
tenantId: tenantId,
|
|
21835
|
-
|
|
21836
|
-
|
|
21837
|
-
|
|
21838
|
-
|
|
21839
|
-
|
|
21840
|
-
|
|
21841
|
-
|
|
21842
|
-
|
|
21843
|
-
|
|
21844
|
-
|
|
21845
|
-
|
|
21846
|
-
|
|
21847
|
-
|
|
21848
|
-
|
|
21849
|
-
|
|
21850
|
-
|
|
21851
|
-
locality: {
|
|
21852
|
-
code: localityCode || "",
|
|
21853
|
-
name: localityName || "",
|
|
21854
|
-
label: "Locality",
|
|
21855
|
-
area: localityArea || ""
|
|
21856
|
-
},
|
|
21857
|
-
geoLocation: {
|
|
21858
|
-
latitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address8 = mergedData.address) === null || _mergedData$address8 === void 0 ? void 0 : _mergedData$address8.latitude) || 0,
|
|
21859
|
-
longitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address9 = mergedData.address) === null || _mergedData$address9 === void 0 ? void 0 : _mergedData$address9.longitude) || 0
|
|
21860
|
-
}
|
|
21861
|
-
},
|
|
21862
|
-
owner: {
|
|
21863
|
-
tenantId: stateId,
|
|
21864
|
-
name: name,
|
|
21865
|
-
fatherOrHusbandName: name,
|
|
21866
|
-
relationship: "OTHER",
|
|
21867
|
-
gender: gender,
|
|
21868
|
-
dob: "915148800",
|
|
21869
|
-
emailId: emailId || "abc@egov.com",
|
|
21870
|
-
mobileNumber: phone
|
|
21871
|
-
},
|
|
21872
|
-
additionalDetails: {
|
|
21873
|
-
serviceType: additionalDetails
|
|
21969
|
+
landmark,
|
|
21970
|
+
doorNo,
|
|
21971
|
+
plotNo,
|
|
21972
|
+
street,
|
|
21973
|
+
city,
|
|
21974
|
+
district,
|
|
21975
|
+
region,
|
|
21976
|
+
state,
|
|
21977
|
+
country: "india",
|
|
21978
|
+
pincode,
|
|
21979
|
+
buildingName,
|
|
21980
|
+
locality: {
|
|
21981
|
+
code: localityCode || "",
|
|
21982
|
+
name: localityName || "",
|
|
21983
|
+
label: "Locality",
|
|
21984
|
+
area: localityArea || ""
|
|
21874
21985
|
},
|
|
21875
|
-
|
|
21876
|
-
|
|
21877
|
-
|
|
21878
|
-
|
|
21986
|
+
geoLocation: {
|
|
21987
|
+
latitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address8 = mergedData.address) === null || _mergedData$address8 === void 0 ? void 0 : _mergedData$address8.latitude) || 28.6139,
|
|
21988
|
+
longitude: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$address9 = mergedData.address) === null || _mergedData$address9 === void 0 ? void 0 : _mergedData$address9.longitude) || 77.2090
|
|
21989
|
+
}
|
|
21990
|
+
},
|
|
21991
|
+
owner: {
|
|
21992
|
+
tenantId: "dl",
|
|
21993
|
+
name: (mergedData === null || mergedData === void 0 ? void 0 : mergedData.ownerName) || name,
|
|
21994
|
+
fatherOrHusbandName: (mergedData === null || mergedData === void 0 ? void 0 : mergedData.fatherOrHusbandName) || name,
|
|
21995
|
+
relationship: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$relations = mergedData.relationship) === null || _mergedData$relations === void 0 ? void 0 : _mergedData$relations.code) || "OTHER",
|
|
21996
|
+
gender: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$gender = mergedData.gender) === null || _mergedData$gender === void 0 ? void 0 : _mergedData$gender.code) || "MALE",
|
|
21997
|
+
dob: mergedData !== null && mergedData !== void 0 && mergedData.dob ? (new Date(mergedData.dob).getTime() / 1000).toString() : "915148800",
|
|
21998
|
+
emailId: emailId || "",
|
|
21999
|
+
mobileNumber: phone
|
|
22000
|
+
},
|
|
22001
|
+
additionalDetails: {
|
|
22002
|
+
serviceType: isEkyc ? "ekyc" : mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$serviceTy2 = mergedData.serviceType) === null || _mergedData$serviceTy2 === void 0 ? void 0 : _mergedData$serviceTy2.code
|
|
22003
|
+
},
|
|
22004
|
+
vehicles: [],
|
|
22005
|
+
drivers: [],
|
|
22006
|
+
source: isEkyc ? "eKYC Portal" : "WhatsApp"
|
|
21879
22007
|
};
|
|
21880
|
-
|
|
22008
|
+
if (isEkyc) {
|
|
22009
|
+
var _mergedData$zoneIds, _mergedData$clusterId;
|
|
22010
|
+
vendorData = {
|
|
22011
|
+
...vendorData,
|
|
22012
|
+
zoneIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$zoneIds = mergedData.zoneIds) === null || _mergedData$zoneIds === void 0 ? void 0 : _mergedData$zoneIds.map(z => z.code)) || [],
|
|
22013
|
+
clusterIds: (mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$clusterId = mergedData.clusterIds) === null || _mergedData$clusterId === void 0 ? void 0 : _mergedData$clusterId.map(c => c.code)) || [],
|
|
22014
|
+
contractStartDate: mergedData.contractStartDate ? new Date(mergedData.contractStartDate).getTime() : null,
|
|
22015
|
+
contractEndDate: mergedData.contractEndDate ? new Date(mergedData.contractEndDate).getTime() : null
|
|
22016
|
+
};
|
|
22017
|
+
}
|
|
22018
|
+
const payload = {
|
|
22019
|
+
vendor: vendorData
|
|
22020
|
+
};
|
|
22021
|
+
if (isEkyc) {
|
|
22022
|
+
payload.RequestInfo = {
|
|
22023
|
+
apiId: "Rainmaker",
|
|
22024
|
+
msgId: "ekyc-vendor-create"
|
|
22025
|
+
};
|
|
22026
|
+
}
|
|
22027
|
+
mutate(payload, {
|
|
21881
22028
|
onError: error => {
|
|
21882
22029
|
setShowToast({
|
|
21883
22030
|
key: "error",
|
|
@@ -21981,9 +22128,11 @@ const FSMLinks = ({
|
|
|
21981
22128
|
t
|
|
21982
22129
|
} = useTranslation();
|
|
21983
22130
|
const [clearParams] = Digit.Hooks.useSessionStorage("FSM_CITIZEN_FILE_PROPERTY", {});
|
|
21984
|
-
useEffect(() => {
|
|
21985
|
-
|
|
21986
|
-
|
|
22131
|
+
useEffect(() => userType === "employee" && Digit.LocalizationService.getLocale({
|
|
22132
|
+
modules: [`rainmaker-${Digit.ULBService.getCurrentTenantId()}`],
|
|
22133
|
+
locale: Digit.StoreData.getCurrentLanguage(),
|
|
22134
|
+
tenantId: Digit.ULBService.getCurrentTenantId()
|
|
22135
|
+
}), []);
|
|
21987
22136
|
const roleBasedLoginRoutes = [{
|
|
21988
22137
|
role: "FSM_DSO",
|
|
21989
22138
|
from: "/digit-ui/citizen/fsm/dso-dashboard",
|