@djb25/digit-ui-module-vendor 1.0.19 → 1.0.20
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 +166 -104
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -699,7 +699,6 @@ const AddVendor = ({
|
|
|
699
699
|
const [currentStep, setCurrentStep] = useState(1);
|
|
700
700
|
const [showToast, setShowToast] = useState(null);
|
|
701
701
|
const [canSubmit, setCanSubmit] = useState(false);
|
|
702
|
-
const [step1Data, setStep1Data] = useState({});
|
|
703
702
|
const [mutationHappened, setMutationHappened, clear] = Digit.Hooks.useSessionStorage("FSM_MUTATION_HAPPENED", false);
|
|
704
703
|
const [errorInfo, setErrorInfo, clearError] = Digit.Hooks.useSessionStorage("FSM_ERROR_DATA", false);
|
|
705
704
|
const [successData, setsuccessData, clearSuccessData] = Digit.Hooks.useSessionStorage("FSM_MUTATION_SUCCESS_DATA", false);
|
|
@@ -728,8 +727,6 @@ const AddVendor = ({
|
|
|
728
727
|
amount: null
|
|
729
728
|
}
|
|
730
729
|
};
|
|
731
|
-
const vendorStepConfig = Config.filter(config => config.head === "ES_VRNDOR_NEW_VENDOR_DETAILS");
|
|
732
|
-
const addressStepConfig = Config.filter(config => config.head === "ES_FSM_REGISTRY_NEW_ADDRESS_DETAILS");
|
|
733
730
|
const onFormValueChange = (setValue, formData) => {
|
|
734
731
|
var _formData$serviceType;
|
|
735
732
|
if (formData !== null && formData !== void 0 && formData.vendorName && formData !== null && formData !== void 0 && formData.phone && formData !== null && formData !== void 0 && (_formData$serviceType = formData.serviceType) !== null && _formData$serviceType !== void 0 && _formData$serviceType.code) {
|
|
@@ -743,15 +740,7 @@ const AddVendor = ({
|
|
|
743
740
|
};
|
|
744
741
|
const onSubmit = data => {
|
|
745
742
|
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;
|
|
746
|
-
|
|
747
|
-
setStep1Data(data);
|
|
748
|
-
setCurrentStep(2);
|
|
749
|
-
return;
|
|
750
|
-
}
|
|
751
|
-
const mergedData = {
|
|
752
|
-
...step1Data,
|
|
753
|
-
...data
|
|
754
|
-
};
|
|
743
|
+
const mergedData = data;
|
|
755
744
|
const name = mergedData === null || mergedData === void 0 ? void 0 : mergedData.vendorName;
|
|
756
745
|
const pincode = mergedData === null || mergedData === void 0 ? void 0 : mergedData.pincode;
|
|
757
746
|
const street = mergedData === null || mergedData === void 0 ? void 0 : (_mergedData$street = mergedData.street) === null || _mergedData$street === void 0 ? void 0 : _mergedData$street.trim();
|
|
@@ -857,34 +846,19 @@ const AddVendor = ({
|
|
|
857
846
|
flex: "1",
|
|
858
847
|
overflowY: "auto"
|
|
859
848
|
}
|
|
860
|
-
},
|
|
861
|
-
key: "step1",
|
|
862
|
-
isDisabled: !canSubmit,
|
|
863
|
-
label: t("CS_COMMON_NEXT"),
|
|
864
|
-
config: vendorStepConfig.filter(i => !i.hideInEmployee).map(config => ({
|
|
865
|
-
...config,
|
|
866
|
-
body: config.body.filter(a => !a.hideInEmployee)
|
|
867
|
-
})),
|
|
868
|
-
onSubmit: onSubmit,
|
|
869
|
-
defaultValues: {
|
|
870
|
-
...defaultValues,
|
|
871
|
-
...step1Data
|
|
872
|
-
},
|
|
873
|
-
onFormValueChange: onFormValueChange,
|
|
874
|
-
noBreakLine: true
|
|
875
|
-
}), currentStep === 2 && /*#__PURE__*/React.createElement(FormComposer, {
|
|
876
|
-
key: "step2",
|
|
849
|
+
}, /*#__PURE__*/React.createElement(FormComposer, {
|
|
877
850
|
label: t("ES_COMMON_APPLICATION_SUBMIT"),
|
|
878
|
-
config:
|
|
851
|
+
config: Config.filter(i => !i.hideInEmployee).map(config => ({
|
|
879
852
|
...config,
|
|
853
|
+
isCollapsible: true,
|
|
854
|
+
isDefaultOpen: true,
|
|
880
855
|
body: config.body.filter(a => !a.hideInEmployee)
|
|
881
856
|
})),
|
|
882
857
|
onSubmit: onSubmit,
|
|
883
|
-
defaultValues:
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
noBreakLine: true
|
|
858
|
+
defaultValues: defaultValues,
|
|
859
|
+
onFormValueChange: onFormValueChange,
|
|
860
|
+
noBreakLine: true,
|
|
861
|
+
noCard: true
|
|
888
862
|
}), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
889
863
|
error: showToast.key === "error",
|
|
890
864
|
label: t(showToast.key === "success" ? `ES_FSM_REGISTRY_${showToast.action}_SUCCESS` : showToast.action),
|
|
@@ -8134,7 +8108,7 @@ const SearchApplication = ({
|
|
|
8134
8108
|
}
|
|
8135
8109
|
}, searchFields === null || searchFields === void 0 ? void 0 : searchFields.map((input, index) => /*#__PURE__*/React.createElement("span", {
|
|
8136
8110
|
key: index,
|
|
8137
|
-
className: index === 0 ? "finance-mainlayout-
|
|
8111
|
+
className: index === 0 ? "finance-mainlayout-col1 complaint-input" : "finance-mainlayout-col1 mobile-input"
|
|
8138
8112
|
}, getFields(input))), /*#__PURE__*/React.createElement("div", {
|
|
8139
8113
|
style: {
|
|
8140
8114
|
display: "flex",
|
|
@@ -8163,6 +8137,36 @@ const parseAdditionalDetails = additionalDetails => {
|
|
|
8163
8137
|
return {};
|
|
8164
8138
|
}
|
|
8165
8139
|
};
|
|
8140
|
+
const getFillingPointIdentifiers = fillingPoint => {
|
|
8141
|
+
var _fillingPoint$filling;
|
|
8142
|
+
if (!fillingPoint) return [];
|
|
8143
|
+
if (typeof fillingPoint === "string" || typeof fillingPoint === "number") return [String(fillingPoint)];
|
|
8144
|
+
return [fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.id, fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.fillingStationId, fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.bookingId, fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.fillingPointId, fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.uuid, fillingPoint === null || fillingPoint === void 0 ? void 0 : (_fillingPoint$filling = fillingPoint.fillingpointmetadata) === null || _fillingPoint$filling === void 0 ? void 0 : _fillingPoint$filling.fillingPointId].filter(value => value !== undefined && value !== null && value !== "").map(String);
|
|
8145
|
+
};
|
|
8146
|
+
const getRowFillingPointIdentifiers = (row = {}) => {
|
|
8147
|
+
var _row$dsoDetails, _row$fillingpointmeta, _row$dsoDetails2;
|
|
8148
|
+
return Array.from(new Set([...[row === null || row === void 0 ? void 0 : row.fillingPointId, row === null || row === void 0 ? void 0 : (_row$dsoDetails = row.dsoDetails) === null || _row$dsoDetails === void 0 ? void 0 : _row$dsoDetails.fillingPointId, row === null || row === void 0 ? void 0 : (_row$fillingpointmeta = row.fillingpointmetadata) === null || _row$fillingpointmeta === void 0 ? void 0 : _row$fillingpointmeta.fillingPointId, row === null || row === void 0 ? void 0 : row.fillingPtName, row === null || row === void 0 ? void 0 : row.filling_pt_name].filter(value => value !== undefined && value !== null && value !== "").map(String), ...getFillingPointIdentifiers(row === null || row === void 0 ? void 0 : row.fillingPoint), ...getFillingPointIdentifiers(row === null || row === void 0 ? void 0 : (_row$dsoDetails2 = row.dsoDetails) === null || _row$dsoDetails2 === void 0 ? void 0 : _row$dsoDetails2.fillingPoint), ...getFillingPointIdentifiers(row === null || row === void 0 ? void 0 : row.fillingPointDetail)]));
|
|
8149
|
+
};
|
|
8150
|
+
const getSelectedFillingPointOption = (row, fillingPoints = []) => {
|
|
8151
|
+
const rowFillingPointIdentifiers = getRowFillingPointIdentifiers(row);
|
|
8152
|
+
if (!rowFillingPointIdentifiers.length) return null;
|
|
8153
|
+
return fillingPoints.find(fillingPoint => getFillingPointIdentifiers(fillingPoint).some(identifier => rowFillingPointIdentifiers.includes(identifier))) || null;
|
|
8154
|
+
};
|
|
8155
|
+
const getFillingPointDisplayValue = (row = {}) => {
|
|
8156
|
+
var _row$fillingPoint, _row$dsoDetails3, _row$dsoDetails3$fill, _row$dsoDetails4, _row$dsoDetails5, _row$dsoDetails6, _row$dsoDetails7, _row$fillingpointmeta2;
|
|
8157
|
+
return (row === null || row === void 0 ? void 0 : (_row$fillingPoint = row.fillingPoint) === null || _row$fillingPoint === void 0 ? void 0 : _row$fillingPoint.fillingPointName) || (row === null || row === void 0 ? void 0 : (_row$dsoDetails3 = row.dsoDetails) === null || _row$dsoDetails3 === void 0 ? void 0 : (_row$dsoDetails3$fill = _row$dsoDetails3.fillingPoint) === null || _row$dsoDetails3$fill === void 0 ? void 0 : _row$dsoDetails3$fill.fillingPointName) || (row === null || row === void 0 ? void 0 : row.fillingPointName) || (row === null || row === void 0 ? void 0 : (_row$dsoDetails4 = row.dsoDetails) === null || _row$dsoDetails4 === void 0 ? void 0 : _row$dsoDetails4.fillingPointName) || (row === null || row === void 0 ? void 0 : row.fillingPointId) || (row === null || row === void 0 ? void 0 : (_row$dsoDetails5 = row.dsoDetails) === null || _row$dsoDetails5 === void 0 ? void 0 : _row$dsoDetails5.fillingPointId) || (typeof (row === null || row === void 0 ? void 0 : row.fillingPoint) === "string" ? row === null || row === void 0 ? void 0 : row.fillingPoint : null) || (typeof (row === null || row === void 0 ? void 0 : (_row$dsoDetails6 = row.dsoDetails) === null || _row$dsoDetails6 === void 0 ? void 0 : _row$dsoDetails6.fillingPoint) === "string" ? row === null || row === void 0 ? void 0 : (_row$dsoDetails7 = row.dsoDetails) === null || _row$dsoDetails7 === void 0 ? void 0 : _row$dsoDetails7.fillingPoint : null) || (row === null || row === void 0 ? void 0 : (_row$fillingpointmeta2 = row.fillingpointmetadata) === null || _row$fillingpointmeta2 === void 0 ? void 0 : _row$fillingpointmeta2.fillingPointId) || (row === null || row === void 0 ? void 0 : row.filling_pt_name) || (row === null || row === void 0 ? void 0 : row.fillingPtName) || "NA";
|
|
8158
|
+
};
|
|
8159
|
+
const normalizeFillingPointForVehicleUpdate = fillingPoint => {
|
|
8160
|
+
if (!fillingPoint || typeof fillingPoint !== "object") return fillingPoint;
|
|
8161
|
+
const {
|
|
8162
|
+
id,
|
|
8163
|
+
...rest
|
|
8164
|
+
} = fillingPoint;
|
|
8165
|
+
return {
|
|
8166
|
+
...rest,
|
|
8167
|
+
fillingStationId: (fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.fillingStationId) || id || (fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.bookingId) || (fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.uuid) || (fillingPoint === null || fillingPoint === void 0 ? void 0 : fillingPoint.fillingPointId)
|
|
8168
|
+
};
|
|
8169
|
+
};
|
|
8166
8170
|
const VendorInbox = props => {
|
|
8167
8171
|
const tenantId = Digit.ULBService.getCurrentTenantId();
|
|
8168
8172
|
const {
|
|
@@ -8179,7 +8183,6 @@ const VendorInbox = props => {
|
|
|
8179
8183
|
const [vendors, setVendors] = useState([]);
|
|
8180
8184
|
const [drivers, setDrivers] = useState([]);
|
|
8181
8185
|
const queryClient = useQueryClient();
|
|
8182
|
-
const [toast, setToast] = useState(null);
|
|
8183
8186
|
const {
|
|
8184
8187
|
data: vendorData,
|
|
8185
8188
|
isLoading: isVendorLoading,
|
|
@@ -8249,6 +8252,20 @@ const VendorInbox = props => {
|
|
|
8249
8252
|
const closeToast = () => {
|
|
8250
8253
|
setShowToast(null);
|
|
8251
8254
|
};
|
|
8255
|
+
const getVehicleUpdatePayload = (vehicle, overrides = {}) => {
|
|
8256
|
+
const normalizedVehicle = {
|
|
8257
|
+
...vehicle,
|
|
8258
|
+
...overrides,
|
|
8259
|
+
driverData: (overrides === null || overrides === void 0 ? void 0 : overrides.driverData) || (vehicle === null || vehicle === void 0 ? void 0 : vehicle.driverData) || (vehicle === null || vehicle === void 0 ? void 0 : vehicle.driver),
|
|
8260
|
+
fillingPoint: normalizeFillingPointForVehicleUpdate(Object.prototype.hasOwnProperty.call(overrides, "fillingPoint") ? overrides.fillingPoint : vehicle === null || vehicle === void 0 ? void 0 : vehicle.fillingPoint)
|
|
8261
|
+
};
|
|
8262
|
+
delete normalizedVehicle.vendor;
|
|
8263
|
+
delete normalizedVehicle.popup;
|
|
8264
|
+
delete normalizedVehicle.driver;
|
|
8265
|
+
return {
|
|
8266
|
+
vehicle: normalizedVehicle
|
|
8267
|
+
};
|
|
8268
|
+
};
|
|
8252
8269
|
const onVendorUpdate = row => {
|
|
8253
8270
|
var _formDetails$owner, _formDetails$owner2, _formDetails$owner3, _formDetails$owner4;
|
|
8254
8271
|
let formDetails = row.original.dsoDetails;
|
|
@@ -8285,14 +8302,10 @@ const VendorInbox = props => {
|
|
|
8285
8302
|
});
|
|
8286
8303
|
};
|
|
8287
8304
|
const onVehicleUpdate = row => {
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
...formDetails,
|
|
8293
|
-
status: (formDetails === null || formDetails === void 0 ? void 0 : formDetails.status) === "ACTIVE" ? "DISABLED" : "ACTIVE"
|
|
8294
|
-
}
|
|
8295
|
-
};
|
|
8305
|
+
var _row$original;
|
|
8306
|
+
const formData = getVehicleUpdatePayload(row.original, {
|
|
8307
|
+
status: ((_row$original = row.original) === null || _row$original === void 0 ? void 0 : _row$original.status) === "ACTIVE" ? "DISABLED" : "ACTIVE"
|
|
8308
|
+
});
|
|
8296
8309
|
mutateVehicle(formData, {
|
|
8297
8310
|
onError: (error, variables) => {
|
|
8298
8311
|
setShowToast({
|
|
@@ -8386,14 +8399,9 @@ const VendorInbox = props => {
|
|
|
8386
8399
|
});
|
|
8387
8400
|
};
|
|
8388
8401
|
const onDriverSelect = (row, selectedOption) => {
|
|
8389
|
-
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
vehicle: {
|
|
8393
|
-
...vehicleData,
|
|
8394
|
-
driverData: selectedDriver
|
|
8395
|
-
}
|
|
8396
|
-
};
|
|
8402
|
+
const formData = getVehicleUpdatePayload(row.original, {
|
|
8403
|
+
driverData: selectedOption
|
|
8404
|
+
});
|
|
8397
8405
|
mutateVehicle(formData, {
|
|
8398
8406
|
onError: (error, variables) => {
|
|
8399
8407
|
setShowToast({
|
|
@@ -8415,6 +8423,42 @@ const VendorInbox = props => {
|
|
|
8415
8423
|
}
|
|
8416
8424
|
});
|
|
8417
8425
|
};
|
|
8426
|
+
const onVehicleFillingPointSelect = (row, selectedOption) => {
|
|
8427
|
+
const formData = getVehicleUpdatePayload(row.original, {
|
|
8428
|
+
fillingPoint: selectedOption
|
|
8429
|
+
});
|
|
8430
|
+
mutateVehicle(formData, {
|
|
8431
|
+
onError: error => {
|
|
8432
|
+
var _error$response, _error$response$data, _error$response$data$, _error$response$data$2;
|
|
8433
|
+
setShowToast({
|
|
8434
|
+
key: "error",
|
|
8435
|
+
label: (error === null || error === void 0 ? void 0 : error.message) || (error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : (_error$response$data$ = _error$response$data.Errors) === null || _error$response$data$ === void 0 ? void 0 : (_error$response$data$2 = _error$response$data$[0]) === null || _error$response$data$2 === void 0 ? void 0 : _error$response$data$2.message) || "Failed to map filling point"
|
|
8436
|
+
});
|
|
8437
|
+
setTimeout(closeToast, 5000);
|
|
8438
|
+
},
|
|
8439
|
+
onSuccess: () => {
|
|
8440
|
+
setTableData(currentTableData => currentTableData.map(vehicle => {
|
|
8441
|
+
var _row$original2;
|
|
8442
|
+
return (vehicle === null || vehicle === void 0 ? void 0 : vehicle.id) === ((_row$original2 = row.original) === null || _row$original2 === void 0 ? void 0 : _row$original2.id) ? {
|
|
8443
|
+
...vehicle,
|
|
8444
|
+
fillingPoint: {
|
|
8445
|
+
...selectedOption,
|
|
8446
|
+
fillingStationId: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.fillingStationId) || (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.id) || (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.bookingId) || (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.uuid) || (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.fillingPointId)
|
|
8447
|
+
}
|
|
8448
|
+
} : vehicle;
|
|
8449
|
+
}));
|
|
8450
|
+
setShowToast({
|
|
8451
|
+
key: "success",
|
|
8452
|
+
label: "Filling point mapped successfully"
|
|
8453
|
+
});
|
|
8454
|
+
queryClient.invalidateQueries("FSM_VEICLES_SEARCH");
|
|
8455
|
+
queryClient.invalidateQueries("DSO_SEARCH");
|
|
8456
|
+
props.refetchData();
|
|
8457
|
+
props.refetchVendor && props.refetchVendor();
|
|
8458
|
+
setTimeout(closeToast, 3000);
|
|
8459
|
+
}
|
|
8460
|
+
});
|
|
8461
|
+
};
|
|
8418
8462
|
const onSelectAdd = () => {
|
|
8419
8463
|
switch (props.selectedTab) {
|
|
8420
8464
|
case "VENDOR":
|
|
@@ -8470,8 +8514,9 @@ const VendorInbox = props => {
|
|
|
8470
8514
|
};
|
|
8471
8515
|
mapFixedFilling(payload, {
|
|
8472
8516
|
onSuccess: () => {
|
|
8473
|
-
|
|
8474
|
-
|
|
8517
|
+
setShowToast({
|
|
8518
|
+
key: "success",
|
|
8519
|
+
label: "WT_FIXED_FILLING_MAPPING_SUCCESS"
|
|
8475
8520
|
});
|
|
8476
8521
|
props.refetchData();
|
|
8477
8522
|
props.refetchVendor && props.refetchVendor();
|
|
@@ -8479,9 +8524,9 @@ const VendorInbox = props => {
|
|
|
8479
8524
|
},
|
|
8480
8525
|
onError: err => {
|
|
8481
8526
|
var _err$response, _err$response$data, _err$response$data$Er, _err$response$data$Er2;
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
|
|
8527
|
+
setShowToast({
|
|
8528
|
+
key: "error",
|
|
8529
|
+
label: (err === null || err === void 0 ? void 0 : (_err$response = err.response) === null || _err$response === void 0 ? void 0 : (_err$response$data = _err$response.data) === null || _err$response$data === void 0 ? void 0 : (_err$response$data$Er = _err$response$data.Errors) === null || _err$response$data$Er === void 0 ? void 0 : (_err$response$data$Er2 = _err$response$data$Er[0]) === null || _err$response$data$Er2 === void 0 ? void 0 : _err$response$data$Er2.message) || "WT_FIXED_FILLING_MAPPING_FAIL"
|
|
8485
8530
|
});
|
|
8486
8531
|
setTimeout(closeToast, 5000);
|
|
8487
8532
|
}
|
|
@@ -8508,27 +8553,19 @@ const VendorInbox = props => {
|
|
|
8508
8553
|
Cell: ({
|
|
8509
8554
|
row
|
|
8510
8555
|
}) => {
|
|
8511
|
-
var _row$
|
|
8512
|
-
return GetCell((_row$
|
|
8556
|
+
var _row$original3, _row$original3$auditD, _row$original4, _row$original4$auditD;
|
|
8557
|
+
return GetCell((_row$original3 = row.original) !== null && _row$original3 !== void 0 && (_row$original3$auditD = _row$original3.auditDetails) !== null && _row$original3$auditD !== void 0 && _row$original3$auditD.createdTime ? Digit.DateUtils.ConvertEpochToDate((_row$original4 = row.original) === null || _row$original4 === void 0 ? void 0 : (_row$original4$auditD = _row$original4.auditDetails) === null || _row$original4$auditD === void 0 ? void 0 : _row$original4$auditD.createdTime) : "");
|
|
8513
8558
|
}
|
|
8514
8559
|
}, {
|
|
8515
8560
|
Header: t("WT_FILLING_POINT"),
|
|
8516
|
-
accessor: row =>
|
|
8517
|
-
var _row$dsoDetails, _row$dsoDetails2, _row$dsoDetails$filli, _row$dsoDetails3, _row$fillingpointmeta;
|
|
8518
|
-
return (row === null || row === void 0 ? void 0 : row.fillingPointId) || ((_row$dsoDetails = row.dsoDetails) === null || _row$dsoDetails === void 0 ? void 0 : _row$dsoDetails.fillingPointId) || ((_row$dsoDetails2 = row.dsoDetails) !== null && _row$dsoDetails2 !== void 0 && _row$dsoDetails2.fillingPoint && typeof row.dsoDetails.fillingPoint === "object" ? (_row$dsoDetails$filli = row.dsoDetails.fillingPoint) === null || _row$dsoDetails$filli === void 0 ? void 0 : _row$dsoDetails$filli.fillingPointName : (_row$dsoDetails3 = row.dsoDetails) === null || _row$dsoDetails3 === void 0 ? void 0 : _row$dsoDetails3.fillingPoint) || (row === null || row === void 0 ? void 0 : (_row$fillingpointmeta = row.fillingpointmetadata) === null || _row$fillingpointmeta === void 0 ? void 0 : _row$fillingpointmeta.fillingPointId) || (row === null || row === void 0 ? void 0 : row.filling_pt_name) || (row === null || row === void 0 ? void 0 : row.fillingPoint) || "NA";
|
|
8519
|
-
},
|
|
8561
|
+
accessor: row => getFillingPointDisplayValue(row),
|
|
8520
8562
|
id: "fillingPoint",
|
|
8521
8563
|
Cell: ({
|
|
8522
8564
|
row
|
|
8523
8565
|
}) => {
|
|
8524
8566
|
return /*#__PURE__*/React.createElement(Dropdown$2, {
|
|
8525
8567
|
className: "fsm-registry-dropdown",
|
|
8526
|
-
selected:
|
|
8527
|
-
var _fp$fillingpointmetad, _row$original$dsoDeta, _row$original$dsoDeta2, _row$original$dsoDeta3, _row$original$filling, _row$original$filling2, _row$original$filling3, _row$original$filling4;
|
|
8528
|
-
const fpId = String(fp.id || fp.bookingId || fp.fillingPointId || fp.uuid || ((_fp$fillingpointmetad = fp.fillingpointmetadata) === null || _fp$fillingpointmetad === void 0 ? void 0 : _fp$fillingpointmetad.fillingPointId));
|
|
8529
|
-
const rowFpId = String(row.original.fillingPointId || ((_row$original$dsoDeta = row.original.dsoDetails) === null || _row$original$dsoDeta === void 0 ? void 0 : _row$original$dsoDeta.fillingPointId) || ((_row$original$dsoDeta2 = row.original.dsoDetails) === null || _row$original$dsoDeta2 === void 0 ? void 0 : (_row$original$dsoDeta3 = _row$original$dsoDeta2.fillingPoint) === null || _row$original$dsoDeta3 === void 0 ? void 0 : _row$original$dsoDeta3.id) || ((_row$original$filling = row.original.fillingpointmetadata) === null || _row$original$filling === void 0 ? void 0 : _row$original$filling.fillingPointId) || row.original.filling_pt_name || (row.original.fillingPoint && typeof row.original.fillingPoint === "object" ? (_row$original$filling2 = row.original.fillingPoint) === null || _row$original$filling2 === void 0 ? void 0 : _row$original$filling2.id : row.original.fillingPoint) || ((_row$original$filling3 = row.original.fillingPointDetail) === null || _row$original$filling3 === void 0 ? void 0 : _row$original$filling3.id) || ((_row$original$filling4 = row.original.fillingPointDetail) === null || _row$original$filling4 === void 0 ? void 0 : _row$original$filling4.bookingId) || "");
|
|
8530
|
-
return fpId === rowFpId && rowFpId !== "undefined" && rowFpId !== "null" && rowFpId !== "";
|
|
8531
|
-
}),
|
|
8568
|
+
selected: getSelectedFillingPointOption(row.original, allFillingPoints),
|
|
8532
8569
|
option: allFillingPoints,
|
|
8533
8570
|
select: value => onFillingPointSelect(row, value),
|
|
8534
8571
|
style: {
|
|
@@ -8542,8 +8579,8 @@ const VendorInbox = props => {
|
|
|
8542
8579
|
Header: t("ES_VENDOR_INBOX_SERVICE_TYPE"),
|
|
8543
8580
|
id: "serviceType",
|
|
8544
8581
|
accessor: row => {
|
|
8545
|
-
var _row$
|
|
8546
|
-
let additionalDetails = (_row$
|
|
8582
|
+
var _row$dsoDetails8, _additionalDetails;
|
|
8583
|
+
let additionalDetails = (_row$dsoDetails8 = row.dsoDetails) === null || _row$dsoDetails8 === void 0 ? void 0 : _row$dsoDetails8.additionalDetails;
|
|
8547
8584
|
if (typeof additionalDetails === "string") {
|
|
8548
8585
|
try {
|
|
8549
8586
|
additionalDetails = JSON.parse(additionalDetails);
|
|
@@ -8556,8 +8593,8 @@ const VendorInbox = props => {
|
|
|
8556
8593
|
Cell: ({
|
|
8557
8594
|
row
|
|
8558
8595
|
}) => {
|
|
8559
|
-
var _row$original$
|
|
8560
|
-
let additionalDetails = (_row$original$
|
|
8596
|
+
var _row$original$dsoDeta, _additionalDetails2;
|
|
8597
|
+
let additionalDetails = (_row$original$dsoDeta = row.original.dsoDetails) === null || _row$original$dsoDeta === void 0 ? void 0 : _row$original$dsoDeta.additionalDetails;
|
|
8561
8598
|
if (typeof additionalDetails === "string") {
|
|
8562
8599
|
try {
|
|
8563
8600
|
additionalDetails = JSON.parse(additionalDetails);
|
|
@@ -8573,19 +8610,19 @@ const VendorInbox = props => {
|
|
|
8573
8610
|
Header: t("ES_VENDOR_REGISTRY_INBOX_ENABLED"),
|
|
8574
8611
|
id: "status",
|
|
8575
8612
|
accessor: row => {
|
|
8576
|
-
var _row$
|
|
8577
|
-
return ((_row$
|
|
8613
|
+
var _row$dsoDetails9;
|
|
8614
|
+
return ((_row$dsoDetails9 = row.dsoDetails) === null || _row$dsoDetails9 === void 0 ? void 0 : _row$dsoDetails9.status) || "";
|
|
8578
8615
|
},
|
|
8579
8616
|
Cell: ({
|
|
8580
8617
|
row
|
|
8581
8618
|
}) => {
|
|
8582
|
-
var _row$
|
|
8619
|
+
var _row$original5, _row$original5$dsoDet;
|
|
8583
8620
|
return /*#__PURE__*/React.createElement(ToggleSwitch, {
|
|
8584
8621
|
style: {
|
|
8585
8622
|
display: "flex",
|
|
8586
8623
|
justifyContent: "left"
|
|
8587
8624
|
},
|
|
8588
|
-
value: ((_row$
|
|
8625
|
+
value: ((_row$original5 = row.original) === null || _row$original5 === void 0 ? void 0 : (_row$original5$dsoDet = _row$original5.dsoDetails) === null || _row$original5$dsoDet === void 0 ? void 0 : _row$original5$dsoDet.status) === "DISABLED" ? false : true,
|
|
8589
8626
|
onChange: () => onVendorUpdate(row),
|
|
8590
8627
|
name: `switch-${row.id}`
|
|
8591
8628
|
});
|
|
@@ -8596,8 +8633,8 @@ const VendorInbox = props => {
|
|
|
8596
8633
|
Cell: ({
|
|
8597
8634
|
row
|
|
8598
8635
|
}) => {
|
|
8599
|
-
var _row$
|
|
8600
|
-
const vendorId = (_row$
|
|
8636
|
+
var _row$original6, _additionalVendorData;
|
|
8637
|
+
const vendorId = (_row$original6 = row.original) === null || _row$original6 === void 0 ? void 0 : _row$original6.id;
|
|
8601
8638
|
if (!additionalVendorData) {
|
|
8602
8639
|
return /*#__PURE__*/React.createElement("span", null, "Loading...");
|
|
8603
8640
|
}
|
|
@@ -8610,7 +8647,7 @@ const VendorInbox = props => {
|
|
|
8610
8647
|
}, /*#__PURE__*/React.createElement("button", {
|
|
8611
8648
|
className: "submit-bar",
|
|
8612
8649
|
style: {
|
|
8613
|
-
backgroundColor: hasDetails ? "#417505" : "#
|
|
8650
|
+
backgroundColor: hasDetails ? "#417505" : "#3A8DCC",
|
|
8614
8651
|
color: "white"
|
|
8615
8652
|
}
|
|
8616
8653
|
}, hasDetails ? "View Details" : "Add Details"));
|
|
@@ -8635,8 +8672,8 @@ const VendorInbox = props => {
|
|
|
8635
8672
|
Cell: ({
|
|
8636
8673
|
row
|
|
8637
8674
|
}) => {
|
|
8638
|
-
var _row$
|
|
8639
|
-
return GetCell((_row$
|
|
8675
|
+
var _row$original7, _row$original7$auditD, _row$original8, _row$original8$auditD;
|
|
8676
|
+
return GetCell((_row$original7 = row.original) !== null && _row$original7 !== void 0 && (_row$original7$auditD = _row$original7.auditDetails) !== null && _row$original7$auditD !== void 0 && _row$original7$auditD.createdTime ? Digit.DateUtils.ConvertEpochToDate((_row$original8 = row.original) === null || _row$original8 === void 0 ? void 0 : (_row$original8$auditD = _row$original8.auditDetails) === null || _row$original8$auditD === void 0 ? void 0 : _row$original8$auditD.createdTime) : "");
|
|
8640
8677
|
}
|
|
8641
8678
|
}, {
|
|
8642
8679
|
Header: t("ES_FSM_REGISTRY_INBOX_VENDOR_NAME"),
|
|
@@ -8648,8 +8685,8 @@ const VendorInbox = props => {
|
|
|
8648
8685
|
Cell: ({
|
|
8649
8686
|
row
|
|
8650
8687
|
}) => {
|
|
8651
|
-
var _row$
|
|
8652
|
-
return GetCell(((_row$
|
|
8688
|
+
var _row$original9, _row$original9$vendor;
|
|
8689
|
+
return GetCell(((_row$original9 = row.original) === null || _row$original9 === void 0 ? void 0 : (_row$original9$vendor = _row$original9.vendor) === null || _row$original9$vendor === void 0 ? void 0 : _row$original9$vendor.name) || "NA");
|
|
8653
8690
|
}
|
|
8654
8691
|
}, {
|
|
8655
8692
|
Header: t("ES_VENDOR_INBOX_SERVICE_TYPE"),
|
|
@@ -8682,6 +8719,25 @@ const VendorInbox = props => {
|
|
|
8682
8719
|
const serviceType = ((_additionalDetail2 = additionalDetail) === null || _additionalDetail2 === void 0 ? void 0 : _additionalDetail2.serviceType) || "N/A";
|
|
8683
8720
|
return /*#__PURE__*/React.createElement("div", null, serviceType);
|
|
8684
8721
|
}
|
|
8722
|
+
}, {
|
|
8723
|
+
Header: t("WT_FILLING_POINT"),
|
|
8724
|
+
accessor: row => getFillingPointDisplayValue(row),
|
|
8725
|
+
id: "fillingPoint",
|
|
8726
|
+
Cell: ({
|
|
8727
|
+
row
|
|
8728
|
+
}) => {
|
|
8729
|
+
return /*#__PURE__*/React.createElement(Dropdown$2, {
|
|
8730
|
+
className: "fsm-registry-dropdown",
|
|
8731
|
+
selected: getSelectedFillingPointOption(row.original, allFillingPoints),
|
|
8732
|
+
option: allFillingPoints,
|
|
8733
|
+
select: value => onVehicleFillingPointSelect(row, value),
|
|
8734
|
+
style: {
|
|
8735
|
+
textAlign: "left"
|
|
8736
|
+
},
|
|
8737
|
+
optionKey: "fillingPointName",
|
|
8738
|
+
t: t
|
|
8739
|
+
});
|
|
8740
|
+
}
|
|
8685
8741
|
}, {
|
|
8686
8742
|
Header: t("ES_FSM_REGISTRY_SELECT_DRIVER"),
|
|
8687
8743
|
id: "driver",
|
|
@@ -8714,13 +8770,13 @@ const VendorInbox = props => {
|
|
|
8714
8770
|
Cell: ({
|
|
8715
8771
|
row
|
|
8716
8772
|
}) => {
|
|
8717
|
-
var _row$
|
|
8773
|
+
var _row$original0;
|
|
8718
8774
|
return /*#__PURE__*/React.createElement(ToggleSwitch, {
|
|
8719
8775
|
style: {
|
|
8720
8776
|
display: "flex",
|
|
8721
8777
|
justifyContent: "left"
|
|
8722
8778
|
},
|
|
8723
|
-
value: ((_row$
|
|
8779
|
+
value: ((_row$original0 = row.original) === null || _row$original0 === void 0 ? void 0 : _row$original0.status) === "DISABLED" ? false : true,
|
|
8724
8780
|
onChange: () => onVehicleUpdate(row),
|
|
8725
8781
|
name: `switch-${row.id}`
|
|
8726
8782
|
});
|
|
@@ -8762,8 +8818,8 @@ const VendorInbox = props => {
|
|
|
8762
8818
|
Cell: ({
|
|
8763
8819
|
row
|
|
8764
8820
|
}) => {
|
|
8765
|
-
var _row$
|
|
8766
|
-
return GetCell((_row$
|
|
8821
|
+
var _row$original1, _row$original1$auditD, _row$original10, _row$original10$audit;
|
|
8822
|
+
return GetCell((_row$original1 = row.original) !== null && _row$original1 !== void 0 && (_row$original1$auditD = _row$original1.auditDetails) !== null && _row$original1$auditD !== void 0 && _row$original1$auditD.createdTime ? Digit.DateUtils.ConvertEpochToDate((_row$original10 = row.original) === null || _row$original10 === void 0 ? void 0 : (_row$original10$audit = _row$original10.auditDetails) === null || _row$original10$audit === void 0 ? void 0 : _row$original10$audit.createdTime) : "");
|
|
8767
8823
|
}
|
|
8768
8824
|
}, {
|
|
8769
8825
|
Header: t("ES_FSM_REGISTRY_INBOX_VENDOR_NAME"),
|
|
@@ -8797,13 +8853,13 @@ const VendorInbox = props => {
|
|
|
8797
8853
|
Cell: ({
|
|
8798
8854
|
row
|
|
8799
8855
|
}) => {
|
|
8800
|
-
var _row$
|
|
8856
|
+
var _row$original11;
|
|
8801
8857
|
return /*#__PURE__*/React.createElement(ToggleSwitch, {
|
|
8802
8858
|
style: {
|
|
8803
8859
|
display: "flex",
|
|
8804
8860
|
justifyContent: "left"
|
|
8805
8861
|
},
|
|
8806
|
-
value: ((_row$
|
|
8862
|
+
value: ((_row$original11 = row.original) === null || _row$original11 === void 0 ? void 0 : _row$original11.status) === "DISABLED" ? false : true,
|
|
8807
8863
|
onChange: () => onDriverUpdate(row),
|
|
8808
8864
|
name: `switch-${row.id}`
|
|
8809
8865
|
});
|
|
@@ -8819,8 +8875,8 @@ const VendorInbox = props => {
|
|
|
8819
8875
|
return [{
|
|
8820
8876
|
Header: t("ES_VENDOR_INBOX_VENDOR_NAME"),
|
|
8821
8877
|
exportAccessor: row => {
|
|
8822
|
-
var _row$
|
|
8823
|
-
return (row === null || row === void 0 ? void 0 : row.name) || (row === null || row === void 0 ? void 0 : (_row$
|
|
8878
|
+
var _row$dsoDetails0;
|
|
8879
|
+
return (row === null || row === void 0 ? void 0 : row.name) || (row === null || row === void 0 ? void 0 : (_row$dsoDetails0 = row.dsoDetails) === null || _row$dsoDetails0 === void 0 ? void 0 : _row$dsoDetails0.name) || "NA";
|
|
8824
8880
|
}
|
|
8825
8881
|
}, {
|
|
8826
8882
|
Header: t("ES_VENDOR_INBOX_DATE_VENDOR_CREATION"),
|
|
@@ -8830,21 +8886,18 @@ const VendorInbox = props => {
|
|
|
8830
8886
|
}
|
|
8831
8887
|
}, {
|
|
8832
8888
|
Header: t("WT_FILLING_POINT"),
|
|
8833
|
-
exportAccessor: row =>
|
|
8834
|
-
var _row$dsoDetails7, _row$dsoDetails7$fill, _row$dsoDetails8, _row$dsoDetails9;
|
|
8835
|
-
return (row === null || row === void 0 ? void 0 : (_row$dsoDetails7 = row.dsoDetails) === null || _row$dsoDetails7 === void 0 ? void 0 : (_row$dsoDetails7$fill = _row$dsoDetails7.fillingPoint) === null || _row$dsoDetails7$fill === void 0 ? void 0 : _row$dsoDetails7$fill.fillingPointName) || (row === null || row === void 0 ? void 0 : (_row$dsoDetails8 = row.dsoDetails) === null || _row$dsoDetails8 === void 0 ? void 0 : _row$dsoDetails8.fillingPoint) || (row === null || row === void 0 ? void 0 : row.fillingPoint) || (row === null || row === void 0 ? void 0 : (_row$dsoDetails9 = row.dsoDetails) === null || _row$dsoDetails9 === void 0 ? void 0 : _row$dsoDetails9.fillingPointId) || (row === null || row === void 0 ? void 0 : row.fillingPointId) || "NA";
|
|
8836
|
-
}
|
|
8889
|
+
exportAccessor: row => getFillingPointDisplayValue(row)
|
|
8837
8890
|
}, {
|
|
8838
8891
|
Header: t("ES_VENDOR_INBOX_SERVICE_TYPE"),
|
|
8839
8892
|
exportAccessor: row => {
|
|
8840
|
-
var _parseAdditionalDetai, _row$
|
|
8841
|
-
return ((_parseAdditionalDetai = parseAdditionalDetails(row === null || row === void 0 ? void 0 : (_row$
|
|
8893
|
+
var _parseAdditionalDetai, _row$dsoDetails1;
|
|
8894
|
+
return ((_parseAdditionalDetai = parseAdditionalDetails(row === null || row === void 0 ? void 0 : (_row$dsoDetails1 = row.dsoDetails) === null || _row$dsoDetails1 === void 0 ? void 0 : _row$dsoDetails1.additionalDetails)) === null || _parseAdditionalDetai === void 0 ? void 0 : _parseAdditionalDetai.serviceType) || "N/A";
|
|
8842
8895
|
}
|
|
8843
8896
|
}, {
|
|
8844
8897
|
Header: t("ES_VENDOR_REGISTRY_INBOX_ENABLED"),
|
|
8845
8898
|
exportAccessor: row => {
|
|
8846
|
-
var _row$
|
|
8847
|
-
return (row === null || row === void 0 ? void 0 : (_row$
|
|
8899
|
+
var _row$dsoDetails10;
|
|
8900
|
+
return (row === null || row === void 0 ? void 0 : (_row$dsoDetails10 = row.dsoDetails) === null || _row$dsoDetails10 === void 0 ? void 0 : _row$dsoDetails10.status) || "NA";
|
|
8848
8901
|
}
|
|
8849
8902
|
}];
|
|
8850
8903
|
case "VEHICLE":
|
|
@@ -8869,6 +8922,9 @@ const VendorInbox = props => {
|
|
|
8869
8922
|
var _parseAdditionalDetai2;
|
|
8870
8923
|
return ((_parseAdditionalDetai2 = parseAdditionalDetails(row === null || row === void 0 ? void 0 : row.additionalDetails)) === null || _parseAdditionalDetai2 === void 0 ? void 0 : _parseAdditionalDetai2.serviceType) || "N/A";
|
|
8871
8924
|
}
|
|
8925
|
+
}, {
|
|
8926
|
+
Header: t("WT_FILLING_POINT"),
|
|
8927
|
+
exportAccessor: row => getFillingPointDisplayValue(row)
|
|
8872
8928
|
}, {
|
|
8873
8929
|
Header: t("ES_FSM_REGISTRY_SELECT_DRIVER"),
|
|
8874
8930
|
exportAccessor: row => {
|
|
@@ -9015,7 +9071,7 @@ const VendorInbox = props => {
|
|
|
9015
9071
|
}
|
|
9016
9072
|
}, result)), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
9017
9073
|
error: showToast.key === "error" ? true : false,
|
|
9018
|
-
label: t(showToast.key === "success" ? `ES_FSM_REGISTRY_${showToast.action}_DISABLE_SUCCESS` : showToast.action),
|
|
9074
|
+
label: showToast.label ? t(showToast.label) : t(showToast.key === "success" ? `ES_FSM_REGISTRY_${showToast.action}_DISABLE_SUCCESS` : showToast.action),
|
|
9019
9075
|
onClose: closeToast
|
|
9020
9076
|
}));
|
|
9021
9077
|
};
|
|
@@ -9598,6 +9654,8 @@ const AddDriver = ({
|
|
|
9598
9654
|
config: Config.filter(i => !i.hideInEmployee).map(config => {
|
|
9599
9655
|
return {
|
|
9600
9656
|
...config,
|
|
9657
|
+
isCollapsible: true,
|
|
9658
|
+
isDefaultOpen: true,
|
|
9601
9659
|
body: config.body.filter(a => !a.hideInEmployee)
|
|
9602
9660
|
};
|
|
9603
9661
|
}),
|
|
@@ -9608,7 +9666,8 @@ const AddDriver = ({
|
|
|
9608
9666
|
defaultValues: defaultValues,
|
|
9609
9667
|
onFormValueChange: onFormValueChange,
|
|
9610
9668
|
noBreakLine: true,
|
|
9611
|
-
mode: "onChange"
|
|
9669
|
+
mode: "onChange",
|
|
9670
|
+
noCard: true
|
|
9612
9671
|
}), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
9613
9672
|
error: showToast.key === "error" ? true : false,
|
|
9614
9673
|
label: t(showToast.key === "success" ? `ES_FSM_${showToast.action}_SUCCESS` : showToast.action),
|
|
@@ -10424,6 +10483,8 @@ const AddVehicle = ({
|
|
|
10424
10483
|
config: Config.filter(i => !i.hideInEmployee).map(config => {
|
|
10425
10484
|
return {
|
|
10426
10485
|
...config,
|
|
10486
|
+
isCollapsible: true,
|
|
10487
|
+
isDefaultOpen: true,
|
|
10427
10488
|
body: config.body.filter(a => !a.hideInEmployee)
|
|
10428
10489
|
};
|
|
10429
10490
|
}),
|
|
@@ -10434,7 +10495,8 @@ const AddVehicle = ({
|
|
|
10434
10495
|
defaultValues: defaultValues,
|
|
10435
10496
|
onFormValueChange: onFormValueChange,
|
|
10436
10497
|
noBreakLine: true,
|
|
10437
|
-
mode: "onChange"
|
|
10498
|
+
mode: "onChange",
|
|
10499
|
+
noCard: true
|
|
10438
10500
|
}), showToast && /*#__PURE__*/React.createElement(Toast, {
|
|
10439
10501
|
error: showToast.key === "error" ? true : false,
|
|
10440
10502
|
label: t(showToast.key === "success" ? `ES_FSM_REGISTRY_${showToast.action}_SUCCESS` : showToast.action),
|