oa-componentbook 1.0.1-stage.9 → 1.0.1-stage.91
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 +9 -4
- 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 +281 -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 +130 -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 +373 -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 +5 -7
- package/build/widgets/oa-widget-notes/NotesWidget.js +2 -1
- package/build/widgets/oa-widget-reupload-drawer/ReUploadDrawer.js +164 -0
- package/build/widgets/oa-widget-track-shipment/TrackShipmentWidget.js +4 -2
- package/build/widgets/oa-widget-track-shipment-list/TrackShipmentWidgetList.js +71 -30
- package/build/widgets/oa-widget-track-shipment-list/fn.js +8 -8
- package/package.json +6 -3
|
@@ -11,52 +11,93 @@ var _TrackShipmentWidget = _interopRequireDefault(require("../oa-widget-track-sh
|
|
|
11
11
|
var _Accordion = _interopRequireDefault(require("../../components/oa-component-accordion/Accordion"));
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
13
|
function TrackShipmentWidgetList(_ref) {
|
|
14
|
-
var
|
|
14
|
+
var _assignments$map;
|
|
15
15
|
let {
|
|
16
16
|
shipmentData,
|
|
17
|
-
onChange
|
|
17
|
+
onChange
|
|
18
18
|
} = _ref;
|
|
19
|
-
|
|
20
|
-
|
|
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));
|
|
21
22
|
}
|
|
22
|
-
if (
|
|
23
|
-
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]));
|
|
24
25
|
}
|
|
25
|
-
|
|
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) => {
|
|
26
28
|
const {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
assignmentId,
|
|
30
|
+
assignmentDate,
|
|
31
|
+
assignmentClosedTime,
|
|
30
32
|
status
|
|
31
33
|
} = item !== null && item !== void 0 ? item : {};
|
|
32
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
33
|
-
|
|
34
|
-
key:
|
|
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,
|
|
35
40
|
body: /*#__PURE__*/_react.default.createElement(_TrackShipmentWidget.default, (0, _fn.getSingleShipmentHistory)(item)),
|
|
36
|
-
headerText: (0, _fn.headerText)(index,
|
|
37
|
-
});
|
|
41
|
+
headerText: (0, _fn.headerText)(index, assignmentDate, assignmentClosedTime, status)
|
|
42
|
+
}));
|
|
38
43
|
});
|
|
39
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
|
+
});
|
|
40
83
|
TrackShipmentWidgetList.propTypes = {
|
|
41
|
-
shipmentData: _propTypes.default.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
originPincode: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
48
|
-
originDistrict: _propTypes.default.string,
|
|
49
|
-
destAddressFullName: _propTypes.default.string,
|
|
50
|
-
destAddressLine1: _propTypes.default.string,
|
|
51
|
-
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,
|
|
52
90
|
destDistrict: _propTypes.default.string,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
+
}),
|
|
57
97
|
onChange: _propTypes.default.func
|
|
58
98
|
};
|
|
59
99
|
TrackShipmentWidgetList.defaultProps = {
|
|
100
|
+
shipmentData: {},
|
|
60
101
|
onChange: () => {}
|
|
61
102
|
};
|
|
62
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.91",
|
|
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"
|