oa-componentbook 1.0.1-stage.8 → 1.0.1-stage.80
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/build/components/oa-component-accordion/Accordion.js +16 -5
- package/build/components/oa-component-feedback-form/FeedbackForm.js +75 -0
- package/build/components/oa-component-feedback-tooltip/FeedbackTooltip.js +69 -0
- package/build/components/oa-component-modal/styles.js +1 -1
- package/build/dev/oa-component-document-viewer/CustomDocumentViewer.js +278 -0
- package/build/dev/oa-component-document-viewer/styles.js +12 -0
- package/build/dev/oa-component-upload/CustomUpload.js +3 -0
- package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +124 -0
- package/build/dev/oa-widget-document-side-drawer/styles.js +12 -0
- package/build/global-css/GlobalCss.js +2 -1
- package/build/global-css/GridLayout.js +1 -1
- package/build/global-css/commonStyles.js +11 -0
- package/build/images/oaChat.svg +5 -0
- package/build/index.js +56 -0
- package/build/layout/paymentAndConsent/CancelScreen.js +46 -0
- package/build/layout/paymentAndConsent/ConsentCard.js +68 -0
- package/build/layout/paymentAndConsent/DetailsCard.js +75 -0
- package/build/layout/paymentAndConsent/DetailsList.js +38 -0
- package/build/layout/paymentAndConsent/Header.js +33 -0
- package/build/layout/paymentAndConsent/InProgressScreen.js +46 -0
- package/build/layout/paymentAndConsent/Loader.js +21 -0
- package/build/layout/paymentAndConsent/Modal.js +28 -0
- package/build/layout/paymentAndConsent/PaymentAndConsent.js +22 -0
- package/build/layout/paymentAndConsent/PaymentCard.js +83 -0
- package/build/layout/paymentAndConsent/Section.js +34 -0
- package/build/layout/paymentAndConsent/SuccessScreen.js +46 -0
- package/build/layout/paymentAndConsent/TimeLineCard.js +28 -0
- package/build/layout/paymentAndConsent/TncList.js +32 -0
- package/build/layout/paymentAndConsent/style.js +12 -0
- package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +17 -11
- package/build/widgets/oa-widget-approval/ApprovalWidgetNew.js +370 -0
- package/build/widgets/oa-widget-approval/styles.js +2 -2
- package/build/widgets/oa-widget-document-upload/DocUploadWidget.js +6 -6
- package/build/widgets/oa-widget-feedback/FeedbackWidget.js +83 -0
- package/build/widgets/oa-widget-feedback/styles.js +13 -0
- package/build/widgets/oa-widget-image-carousel/ImageCarouselWidget.js +257 -0
- package/build/widgets/oa-widget-image-carousel/styles.js +23 -0
- package/build/widgets/oa-widget-map-base-location/AddressDetails.js +6 -4
- package/build/widgets/oa-widget-map-base-location/AddressForm.js +26 -3
- package/build/widgets/oa-widget-map-base-location/MapBaseLocation.js +5 -3
- package/build/widgets/oa-widget-membershipcard/MembershipCard.js +13 -15
- package/build/widgets/oa-widget-notes/NotesWidget.js +2 -1
- package/build/widgets/oa-widget-reupload-drawer/ReUploadDrawer.js +163 -0
- package/build/widgets/oa-widget-track-shipment/TrackShipmentWidget.js +4 -2
- package/build/widgets/oa-widget-track-shipment-list/TrackShipmentWidgetList.js +77 -38
- package/build/widgets/oa-widget-track-shipment-list/fn.js +8 -8
- package/package.json +6 -3
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.assign.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
require("core-js/modules/es.array.includes.js");
|
|
9
|
+
require("core-js/modules/es.string.includes.js");
|
|
10
|
+
require("core-js/modules/es.promise.js");
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _Info = _interopRequireDefault(require("@material-ui/icons/Info"));
|
|
13
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
14
|
+
var _antd = require("antd");
|
|
15
|
+
var _CustomDrawer = _interopRequireDefault(require("../../components/oa-component-drawer/CustomDrawer"));
|
|
16
|
+
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
17
|
+
var _CustomInfo = _interopRequireDefault(require("../../components/oa-component-info/CustomInfo"));
|
|
18
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
19
|
+
var _CustomUpload = _interopRequireDefault(require("../../dev/oa-component-upload/CustomUpload"));
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
22
|
+
function GenericUpload(_ref) {
|
|
23
|
+
var _config$documents;
|
|
24
|
+
let {
|
|
25
|
+
config,
|
|
26
|
+
uploadHandler,
|
|
27
|
+
deleteHandler: _deleteHandler,
|
|
28
|
+
downloadHandler,
|
|
29
|
+
previewHandler,
|
|
30
|
+
visible,
|
|
31
|
+
onClose,
|
|
32
|
+
validationConfig = {
|
|
33
|
+
maxSize: 5,
|
|
34
|
+
allowedTypes: ['image/jpeg', 'image/png', 'image/jpg', 'application/pdf'],
|
|
35
|
+
customValidation: null
|
|
36
|
+
},
|
|
37
|
+
uploadedDocuments,
|
|
38
|
+
showDelete = true,
|
|
39
|
+
showPreview = false,
|
|
40
|
+
form
|
|
41
|
+
} = _ref;
|
|
42
|
+
const validateFile = (file, docTypeId) => {
|
|
43
|
+
const isValidType = validationConfig.allowedTypes.includes(file.type);
|
|
44
|
+
if (!isValidType) {
|
|
45
|
+
form.setFields([{
|
|
46
|
+
name: docTypeId,
|
|
47
|
+
errors: ["Only ".concat(validationConfig.allowedTypes.map(type => type.split('/')[1].toUpperCase()).join('/'), " files are allowed!")]
|
|
48
|
+
}]);
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
const isValidSize = file.size / 1024 / 1024 < validationConfig.maxSize;
|
|
52
|
+
if (!isValidSize) {
|
|
53
|
+
form.setFields([{
|
|
54
|
+
name: docTypeId,
|
|
55
|
+
errors: ["File must be smaller than ".concat(validationConfig.maxSize, "MB!")]
|
|
56
|
+
}]);
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
if (validationConfig.customValidation) {
|
|
60
|
+
return validationConfig.customValidation(file, docTypeId);
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
};
|
|
64
|
+
const handleUpload = async (file, docTypeId, documentId) => {
|
|
65
|
+
if (!validateFile(file, docTypeId)) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
return uploadHandler(file, docTypeId, documentId);
|
|
69
|
+
};
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement(_CustomDrawer.default, {
|
|
71
|
+
title: config.title,
|
|
72
|
+
width: config.width,
|
|
73
|
+
open: visible,
|
|
74
|
+
onClose: onClose,
|
|
75
|
+
buttonConfig: config.buttonConfig
|
|
76
|
+
}, config.systemInfo && /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
+
className: "margin-bottom-32"
|
|
78
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomInfo.default, _extends({}, config.systemInfo, {
|
|
79
|
+
iconConfig: {
|
|
80
|
+
icon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
81
|
+
icon: _Info.default,
|
|
82
|
+
size: 24,
|
|
83
|
+
color: "negative"
|
|
84
|
+
}),
|
|
85
|
+
position: 'left'
|
|
86
|
+
}
|
|
87
|
+
}))), (config === null || config === void 0 ? void 0 : config.heading) && /*#__PURE__*/_react.default.createElement("div", {
|
|
88
|
+
className: "padding-bottom-32"
|
|
89
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
90
|
+
className: "type-t1-500",
|
|
91
|
+
color: "primary-content"
|
|
92
|
+
}, config.heading, ' ')), /*#__PURE__*/_react.default.createElement(_antd.Form, {
|
|
93
|
+
form: form
|
|
94
|
+
}, (_config$documents = config.documents) === null || _config$documents === void 0 ? void 0 : _config$documents.map(item => /*#__PURE__*/_react.default.createElement("div", {
|
|
95
|
+
key: item.docTypeId
|
|
96
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
97
|
+
className: "padding-bottom-4"
|
|
98
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
99
|
+
typography: "type-b2-500",
|
|
100
|
+
color: "primary-content"
|
|
101
|
+
}, item === null || item === void 0 ? void 0 : item.docName)), /*#__PURE__*/_react.default.createElement(_CustomUpload.default, {
|
|
102
|
+
isMandatory: true,
|
|
103
|
+
handleCustomOnChange: (file, status) => handleUpload(file, item.docTypeId, item.documentId),
|
|
104
|
+
formName: item.docTypeId,
|
|
105
|
+
uploadedDocuments: uploadedDocuments && uploadedDocuments[item.docTypeId] ? [uploadedDocuments[item.docTypeId]] : [],
|
|
106
|
+
deleteHandler: selectedFile => _deleteHandler(item.docTypeId),
|
|
107
|
+
downloadCallback: file => downloadHandler(item.docTypeId),
|
|
108
|
+
getPreview: previewHandler || (() => {}),
|
|
109
|
+
showDelete: showDelete,
|
|
110
|
+
showPreview: showPreview,
|
|
111
|
+
accept: validationConfig.allowedTypes.join(', '),
|
|
112
|
+
docName: item.docName
|
|
113
|
+
})))));
|
|
114
|
+
}
|
|
115
|
+
GenericUpload.propTypes = {
|
|
116
|
+
config: _propTypes.default.shape({
|
|
117
|
+
title: _propTypes.default.string.isRequired,
|
|
118
|
+
width: _propTypes.default.number,
|
|
119
|
+
buttonConfig: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
120
|
+
callback: _propTypes.default.func,
|
|
121
|
+
label: _propTypes.default.string,
|
|
122
|
+
type: _propTypes.default.string
|
|
123
|
+
})),
|
|
124
|
+
systemInfo: _propTypes.default.shape({
|
|
125
|
+
title: _propTypes.default.string,
|
|
126
|
+
color: _propTypes.default.string,
|
|
127
|
+
description: _propTypes.default.node
|
|
128
|
+
}),
|
|
129
|
+
heading: _propTypes.default.string,
|
|
130
|
+
documents: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
131
|
+
title: _propTypes.default.string,
|
|
132
|
+
docTypeId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
133
|
+
docName: _propTypes.default.string
|
|
134
|
+
}))
|
|
135
|
+
}).isRequired,
|
|
136
|
+
uploadHandler: _propTypes.default.func.isRequired,
|
|
137
|
+
deleteHandler: _propTypes.default.func.isRequired,
|
|
138
|
+
downloadHandler: _propTypes.default.func.isRequired,
|
|
139
|
+
previewHandler: _propTypes.default.func,
|
|
140
|
+
validationConfig: _propTypes.default.shape({
|
|
141
|
+
maxSize: _propTypes.default.number,
|
|
142
|
+
allowedTypes: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
143
|
+
customValidation: _propTypes.default.func
|
|
144
|
+
}),
|
|
145
|
+
uploadedDocuments: _propTypes.default.object,
|
|
146
|
+
showDelete: _propTypes.default.bool,
|
|
147
|
+
showPreview: _propTypes.default.bool,
|
|
148
|
+
form: _propTypes.default.object.isRequired,
|
|
149
|
+
visible: _propTypes.default.bool.isRequired,
|
|
150
|
+
onClose: _propTypes.default.func.isRequired
|
|
151
|
+
};
|
|
152
|
+
GenericUpload.defaultProps = {
|
|
153
|
+
previewHandler: () => {},
|
|
154
|
+
validationConfig: {
|
|
155
|
+
maxSize: 5,
|
|
156
|
+
allowedTypes: ['image/jpeg', 'image/png', 'image/jpg', 'application/pdf'],
|
|
157
|
+
customValidation: null
|
|
158
|
+
},
|
|
159
|
+
uploadedDocuments: {},
|
|
160
|
+
showDelete: true,
|
|
161
|
+
showPreview: false
|
|
162
|
+
};
|
|
163
|
+
var _default = exports.default = GenericUpload;
|
|
@@ -121,7 +121,9 @@ function TrackShipmentWidget(_ref) {
|
|
|
121
121
|
}, /*#__PURE__*/_react.default.createElement(_CustomTimeline.default, {
|
|
122
122
|
currentStep: isOnDeliveryStage ? stepsData.length : stepsData.length - 1,
|
|
123
123
|
stepsData: stepsData
|
|
124
|
-
})), errorReason && /*#__PURE__*/_react.default.createElement(
|
|
124
|
+
})), errorReason && /*#__PURE__*/_react.default.createElement("div", {
|
|
125
|
+
className: "margin-top-16 margin-bottom-16"
|
|
126
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomInfo.default, {
|
|
125
127
|
iconConfig: {
|
|
126
128
|
icon: /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
127
129
|
color: "warning",
|
|
@@ -131,7 +133,7 @@ function TrackShipmentWidget(_ref) {
|
|
|
131
133
|
position: 'left'
|
|
132
134
|
},
|
|
133
135
|
description: errorReason
|
|
134
|
-
}), (tableData === null || tableData === void 0 ? void 0 : tableData.length) > 0 && /*#__PURE__*/_react.default.createElement(_CustomTable.default, {
|
|
136
|
+
})), (tableData === null || tableData === void 0 ? void 0 : tableData.length) > 0 && /*#__PURE__*/_react.default.createElement(_CustomTable.default, {
|
|
135
137
|
bordered: true,
|
|
136
138
|
rowKey: "key",
|
|
137
139
|
columns: [{
|
|
@@ -1,64 +1,103 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
require("core-js/modules/es.weak-map.js");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
require("
|
|
9
|
-
require("core-js/modules/es.promise.js");
|
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
9
|
var _fn = require("./fn");
|
|
13
10
|
var _TrackShipmentWidget = _interopRequireDefault(require("../oa-widget-track-shipment/TrackShipmentWidget"));
|
|
14
11
|
var _Accordion = _interopRequireDefault(require("../../components/oa-component-accordion/Accordion"));
|
|
15
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
13
|
function TrackShipmentWidgetList(_ref) {
|
|
19
|
-
var
|
|
14
|
+
var _assignments$map;
|
|
20
15
|
let {
|
|
21
|
-
shipmentData
|
|
16
|
+
shipmentData,
|
|
17
|
+
onChange
|
|
22
18
|
} = _ref;
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
if (!shipmentData || shipmentData.length === 0) {
|
|
27
|
-
return /*#__PURE__*/_react.default.createElement("p", null, "No shipment data available.");
|
|
19
|
+
const assignments = (shipmentData === null || shipmentData === void 0 ? void 0 : shipmentData.assignments) || [];
|
|
20
|
+
if (assignments.length === 0) {
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(_TrackShipmentWidget.default, (0, _fn.getSingleShipmentHistory)(shipmentData));
|
|
28
22
|
}
|
|
29
|
-
if (
|
|
30
|
-
return /*#__PURE__*/_react.default.createElement(_TrackShipmentWidget.default, (0, _fn.getSingleShipmentHistory)(
|
|
23
|
+
if (assignments.length === 1) {
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement(_TrackShipmentWidget.default, (0, _fn.getSingleShipmentHistory)(assignments[0]));
|
|
31
25
|
}
|
|
32
|
-
|
|
26
|
+
const lastReassignmentId = assignments && assignments.length > 0 ? assignments[assignments.length - 1].assignmentId || 0 : 0;
|
|
27
|
+
return assignments === null || assignments === void 0 || (_assignments$map = assignments.map) === null || _assignments$map === void 0 ? void 0 : _assignments$map.call(assignments, (item, index) => {
|
|
33
28
|
const {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
assignmentId,
|
|
30
|
+
assignmentDate,
|
|
31
|
+
assignmentClosedTime,
|
|
37
32
|
status
|
|
38
33
|
} = item !== null && item !== void 0 ? item : {};
|
|
39
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
40
|
-
|
|
34
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
35
|
+
className: "margin-bottom-16",
|
|
36
|
+
key: assignmentId
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement(_Accordion.default, {
|
|
38
|
+
defaultActiveKey: lastReassignmentId,
|
|
39
|
+
activeKey: assignmentId,
|
|
41
40
|
body: /*#__PURE__*/_react.default.createElement(_TrackShipmentWidget.default, (0, _fn.getSingleShipmentHistory)(item)),
|
|
42
|
-
headerText: (0, _fn.headerText)(index,
|
|
43
|
-
});
|
|
41
|
+
headerText: (0, _fn.headerText)(index, assignmentDate, assignmentClosedTime, status)
|
|
42
|
+
}));
|
|
44
43
|
});
|
|
45
44
|
}
|
|
45
|
+
const HistoryPropType = _propTypes.default.shape({
|
|
46
|
+
shipmentStatus: _propTypes.default.string.isRequired,
|
|
47
|
+
fromDate: _propTypes.default.string.isRequired,
|
|
48
|
+
toDate: _propTypes.default.string.isRequired,
|
|
49
|
+
partnerStatus: _propTypes.default.string,
|
|
50
|
+
customerDisplayStatus: _propTypes.default.string.isRequired,
|
|
51
|
+
oneassistDisplayStatus: _propTypes.default.string.isRequired,
|
|
52
|
+
stageConsistent: _propTypes.default.bool.isRequired
|
|
53
|
+
});
|
|
54
|
+
const AssignmentPropType = _propTypes.default.shape({
|
|
55
|
+
assignmentDate: _propTypes.default.number.isRequired,
|
|
56
|
+
assignmentClosedTime: _propTypes.default.number.isRequired,
|
|
57
|
+
logisticPartnerName: _propTypes.default.string.isRequired,
|
|
58
|
+
assignmentId: _propTypes.default.number.isRequired,
|
|
59
|
+
logisticPartnerRefNum: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
60
|
+
originAddressLine1: _propTypes.default.string.isRequired,
|
|
61
|
+
originDistrict: _propTypes.default.string.isRequired,
|
|
62
|
+
originPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
63
|
+
destAddressLine1: _propTypes.default.string.isRequired,
|
|
64
|
+
destDistrict: _propTypes.default.string,
|
|
65
|
+
destPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
66
|
+
history: _propTypes.default.arrayOf(HistoryPropType).isRequired,
|
|
67
|
+
origAddressFullName: _propTypes.default.string.isRequired,
|
|
68
|
+
destAddressFullName: _propTypes.default.string.isRequired,
|
|
69
|
+
assignments: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
70
|
+
logisticPartnerRefNum: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
71
|
+
originAddressLine1: _propTypes.default.string.isRequired,
|
|
72
|
+
originDistrict: _propTypes.default.string.isRequired,
|
|
73
|
+
originPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
74
|
+
destAddressLine1: _propTypes.default.string.isRequired,
|
|
75
|
+
destDistrict: _propTypes.default.string,
|
|
76
|
+
destPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
77
|
+
history: _propTypes.default.arrayOf(HistoryPropType).isRequired,
|
|
78
|
+
origAddressFullName: _propTypes.default.string.isRequired,
|
|
79
|
+
destAddressFullName: _propTypes.default.string.isRequired,
|
|
80
|
+
assignments: _propTypes.default.array // Placeholder to break recursion
|
|
81
|
+
}))
|
|
82
|
+
});
|
|
46
83
|
TrackShipmentWidgetList.propTypes = {
|
|
47
|
-
shipmentData: _propTypes.default.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
originPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
54
|
-
originDistrict: _propTypes.default.string,
|
|
55
|
-
destAddressFullName: _propTypes.default.string,
|
|
56
|
-
destAddressLine1: _propTypes.default.string,
|
|
57
|
-
destPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
84
|
+
shipmentData: _propTypes.default.shape({
|
|
85
|
+
logisticPartnerRefNum: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
86
|
+
originAddressLine1: _propTypes.default.string.isRequired,
|
|
87
|
+
originDistrict: _propTypes.default.string.isRequired,
|
|
88
|
+
originPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
89
|
+
destAddressLine1: _propTypes.default.string.isRequired,
|
|
58
90
|
destDistrict: _propTypes.default.string,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
91
|
+
destPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
92
|
+
history: _propTypes.default.arrayOf(HistoryPropType).isRequired,
|
|
93
|
+
origAddressFullName: _propTypes.default.string.isRequired,
|
|
94
|
+
destAddressFullName: _propTypes.default.string.isRequired,
|
|
95
|
+
assignments: _propTypes.default.arrayOf(AssignmentPropType)
|
|
96
|
+
}),
|
|
97
|
+
onChange: _propTypes.default.func
|
|
98
|
+
};
|
|
99
|
+
TrackShipmentWidgetList.defaultProps = {
|
|
100
|
+
shipmentData: {},
|
|
101
|
+
onChange: () => {}
|
|
63
102
|
};
|
|
64
103
|
var _default = exports.default = TrackShipmentWidgetList;
|
|
@@ -15,7 +15,7 @@ const getDateFromEpoch = date => {
|
|
|
15
15
|
if (!date) {
|
|
16
16
|
return '';
|
|
17
17
|
}
|
|
18
|
-
const dateObj = new Date(date
|
|
18
|
+
const dateObj = new Date(date);
|
|
19
19
|
const day = dateObj.getDate();
|
|
20
20
|
const month = dateObj.getMonth();
|
|
21
21
|
const year = dateObj.getFullYear();
|
|
@@ -39,16 +39,16 @@ const getCurrentShipmentLabel = number => {
|
|
|
39
39
|
return "".concat(ordinalNumber, " Shipment");
|
|
40
40
|
};
|
|
41
41
|
exports.getCurrentShipmentLabel = getCurrentShipmentLabel;
|
|
42
|
-
const isActive =
|
|
42
|
+
const isActive = time => time === null;
|
|
43
43
|
exports.isActive = isActive;
|
|
44
|
-
const headerText = (index, reassignmentTime, modifiedTime, status) => "".concat(getCurrentShipmentLabel(index + 1), " | ").concat(getDateString(reassignmentTime, modifiedTime)).concat(isActive(
|
|
44
|
+
const headerText = (index, reassignmentTime, modifiedTime, status) => "".concat(getCurrentShipmentLabel(index + 1), " | ").concat(getDateString(reassignmentTime, modifiedTime)).concat(isActive(modifiedTime) ? ' - Present' : '');
|
|
45
45
|
exports.headerText = headerText;
|
|
46
46
|
const getSingleShipmentHistory = item => {
|
|
47
|
-
var _item$
|
|
47
|
+
var _item$history;
|
|
48
48
|
return {
|
|
49
|
-
partnerName: item === null || item === void 0 ? void 0 : item.
|
|
50
|
-
errorReason: item === null || item === void 0 ? void 0 : item.
|
|
51
|
-
awbNumber: item === null || item === void 0 ? void 0 : item.
|
|
49
|
+
partnerName: item === null || item === void 0 ? void 0 : item.logisticPartnerName,
|
|
50
|
+
errorReason: item === null || item === void 0 ? void 0 : item.failureReason,
|
|
51
|
+
awbNumber: item === null || item === void 0 ? void 0 : item.logisticPartnerRefNum,
|
|
52
52
|
fromAddress: {
|
|
53
53
|
heading: 'From Address:',
|
|
54
54
|
addressLine1: item === null || item === void 0 ? void 0 : item.origAddressFullName,
|
|
@@ -63,7 +63,7 @@ const getSingleShipmentHistory = item => {
|
|
|
63
63
|
pincode: item === null || item === void 0 ? void 0 : item.destPincode,
|
|
64
64
|
city: item === null || item === void 0 ? void 0 : item.destDistrict
|
|
65
65
|
},
|
|
66
|
-
tableData: (_item$
|
|
66
|
+
tableData: (_item$history = item === null || item === void 0 ? void 0 : item.history) !== null && _item$history !== void 0 ? _item$history : []
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
69
|
exports.getSingleShipmentHistory = getSingleShipmentHistory;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oa-componentbook",
|
|
3
|
-
"version": "1.0.1-stage.
|
|
3
|
+
"version": "1.0.1-stage.80",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Reusable components",
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"react-markdown": "^8.0.7",
|
|
28
28
|
"react-pattern-lock": "^12.0.12",
|
|
29
29
|
"react-pdf": "^5.3.0",
|
|
30
|
-
"react-zoom-pan-pinch": "^3.
|
|
30
|
+
"react-zoom-pan-pinch": "^3.7.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@babel/cli": "^7.22.9",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
"babel-plugin-named-exports-order": "^0.0.2",
|
|
48
48
|
"eslint-config-airbnb": "^19.0.4",
|
|
49
49
|
"eslint-plugin-storybook": "^0.6.15",
|
|
50
|
+
"onchange": "^6.1.0",
|
|
50
51
|
"pre-commit": "^1.2.2",
|
|
51
52
|
"react-scripts": "^5.0.1",
|
|
52
53
|
"storybook": "^7.6.3",
|
|
@@ -66,10 +67,12 @@
|
|
|
66
67
|
"scripts": {
|
|
67
68
|
"start": "react-scripts start",
|
|
68
69
|
"build": "rm -rf build && NODE_ENV=production babel src/lib --out-dir build --copy-files",
|
|
70
|
+
"publish:local": "npm run build && yalc push --force",
|
|
71
|
+
"watch:publish": "onchange 'src/lib/**/*' -- npm run publish:local",
|
|
69
72
|
"storybook": "storybook dev -p 6006",
|
|
70
73
|
"build-storybook": "storybook build",
|
|
71
74
|
"update-package-lock": "npm i --package-lock-only",
|
|
72
|
-
"lint": "eslint src
|
|
75
|
+
"lint": "eslint \"src/**/*.{js,jsx}\"",
|
|
73
76
|
"lint-fix": "npm run lint -- --fix",
|
|
74
77
|
"lint-fix-quiet": "npm run lint-fix -- --quiet",
|
|
75
78
|
"pre-commit": "./pre-commit.sh"
|