oa-componentbook 1.0.1-stage.44 → 1.0.1-stage.440
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 +123 -43
- package/build/components/oa-component-accordion/styles.js +2 -2
- package/build/components/oa-component-button/CustomButton.js +24 -19
- package/build/components/oa-component-button/styles.js +1 -1
- package/build/components/oa-component-checkbox/CustomCheckBox.js +20 -17
- package/build/components/oa-component-checkbox/styles.js +1 -1
- package/build/components/oa-component-datepicker/CustomDatePicker.js +37 -26
- package/build/components/oa-component-drawer/CustomDrawer.js +2 -0
- package/build/components/oa-component-dropdown/CustomDropdown.js +16 -4
- package/build/components/oa-component-icons/MaterialIcon.js +1 -1
- package/build/components/oa-component-modal/CustomModal.js +59 -48
- package/build/components/oa-component-modal/styles.js +3 -2
- package/build/components/oa-component-pagination/CustomPagination.js +111 -0
- package/build/components/oa-component-pagination/styles.js +12 -0
- package/build/components/oa-component-progress-bar/CustomProgressBar.js +8 -4
- package/build/components/oa-component-select/CustomSelect.js +130 -56
- package/build/components/oa-component-steps/CustomSteps.js +117 -0
- package/build/components/oa-component-steps/styles.js +12 -0
- package/build/components/oa-component-table/CustomTable.js +28 -5
- package/build/components/oa-component-table/CustomTableV1.js +613 -0
- package/build/components/oa-component-table/styles.js +1 -1
- package/build/components/oa-component-table/stylesV1.js +19 -0
- package/build/components/oa-component-tabs/CustomTabs.js +1 -1
- package/build/components/oa-component-tag/CustomTag.js +29 -11
- package/build/components/oa-component-tag/styles.js +30 -3
- package/build/components/oa-component-textarea/CustomTextArea.js +161 -0
- package/build/components/oa-component-textarea/constants.js +39 -0
- package/build/components/oa-component-textarea/styles.js +12 -3
- package/build/components/oa-component-tooltip/CustomTooltip.js +8 -4
- package/build/components/oa-component-upload/CustomUpload.js +129 -42
- package/build/components/oa-component-viewer/CustomViewer.js +17 -11
- package/build/dev/oa-component-document-viewer/CustomDocumentViewer.js +367 -0
- package/build/dev/oa-component-document-viewer/styles.js +12 -0
- package/build/dev/oa-component-upload/CustomUpload.js +116 -29
- package/build/dev/oa-component-upload/styles.js +2 -2
- package/build/dev/oa-widget-document-modal/DocumentSideModal.js +166 -0
- package/build/dev/oa-widget-document-modal/styles.js +12 -0
- package/build/dev/oa-widget-document-side-drawer/DocumentSideDrawer.js +196 -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/Car.png +0 -0
- package/build/images/TwoWheeler.png +0 -0
- package/build/images/astronaut_emptystate.png +0 -0
- package/build/images/exportGrp01.png +0 -0
- package/build/images/exportGrp02.png +0 -0
- package/build/images/exportGrp03.png +0 -0
- package/build/images/outOfStock.png +0 -0
- package/build/index.js +114 -2
- package/build/layout/DetailDataLayout/DetailDataLayout.js +20 -0
- package/build/layout/DetailDataLayout/components/Form.js +22 -0
- package/build/layout/DetailDataLayout/components/Header.js +32 -0
- package/build/layout/DetailDataLayout/style.css +9 -0
- package/build/layout/DetailDataLayout/styles.js +12 -0
- package/build/layout/EntityOverviewLayout/EntityOverviewLayout.js +403 -0
- package/build/layout/EntityOverviewLayout/reducer/entityOverviewLayoutReducer.js +85 -0
- package/build/layout/EntityOverviewLayout/styles.js +13 -0
- package/build/layout/GenricLayOut/GenricLayOut.js +2421 -0
- package/build/layout/GenricLayOut/components/AppliedFilters.js +90 -0
- package/build/layout/GenricLayOut/components/CardList.js +34 -0
- package/build/layout/GenricLayOut/components/DropdownSearch.js +48 -0
- package/build/layout/GenricLayOut/components/Header.js +74 -0
- package/build/layout/GenricLayOut/components/Modal.js +96 -0
- package/build/layout/GenricLayOut/components/ProfileSection.js +219 -0
- package/build/layout/GenricLayOut/components/Search.js +51 -0
- package/build/layout/GenricLayOut/components/StaticFilter.css +73 -0
- package/build/layout/GenricLayOut/components/StaticFilter.js +37 -0
- package/build/layout/GenricLayOut/reducer/layoutReducer.js +310 -0
- package/build/layout/GenricLayOut/resolver/staticConfigResolver.js +98 -0
- package/build/layout/GenricLayOut/styles.js +42 -0
- package/build/utils/download-file.js +23 -0
- package/build/widgets/oa-form-widget/FormWidget.js +577 -0
- package/build/widgets/oa-form-widget/FormWidgetStyle.js +18 -0
- package/build/widgets/oa-widget-add-spare-part/AddSparePartCollapseWidget.js +80 -16
- package/build/widgets/oa-widget-add-spare-part/AddSparePartWidget.js +50 -7
- package/build/widgets/oa-widget-address/AddressWidget.js +12 -17
- package/build/widgets/oa-widget-approval/ApprovalWidget.js +19 -11
- package/build/widgets/oa-widget-approval/ApprovalWidgetNew.js +492 -0
- package/build/widgets/oa-widget-approval/styles.js +2 -2
- package/build/widgets/oa-widget-chat/ChatWidget.js +5 -5
- package/build/widgets/oa-widget-close-claim/CloseClaimWidget.js +17 -5
- package/build/widgets/oa-widget-collapsible-key-value/CollapsibleKeyValueWidget.js +396 -0
- package/build/widgets/oa-widget-collapsible-key-value/styles.js +16 -0
- package/build/widgets/oa-widget-content-panel/ContentPanel.js +82 -0
- package/build/widgets/oa-widget-content-panel/styles.js +12 -0
- package/build/widgets/oa-widget-customer-rating-card/CustomerRatingCard.js +5 -5
- package/build/widgets/oa-widget-detailcard/styles.js +1 -1
- package/build/widgets/oa-widget-document-upload/DocUploadWidget.js +6 -9
- package/build/widgets/oa-widget-dropdown-search-input/DropdownSearchInput.js +53 -19
- package/build/widgets/oa-widget-dropdown-search-input/styles.js +1 -1
- package/build/widgets/oa-widget-guide/GuideWidget.js +70 -0
- package/build/widgets/oa-widget-guide/GuideWidgetStyle.js +12 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationDeleteBiker.js +24 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModal.js +34 -0
- package/build/widgets/oa-widget-hub-automation-modal/HubAutomationModalStyle.js +13 -0
- package/build/widgets/oa-widget-image-carousel/ImageCarouselWidget.js +256 -0
- package/build/widgets/oa-widget-image-carousel/styles.js +23 -0
- package/build/widgets/oa-widget-image-gallery/FullscreenViewer.js +169 -0
- package/build/widgets/oa-widget-image-gallery/ImageGallery.js +87 -0
- package/build/widgets/oa-widget-image-gallery/ThumbnailGrid.js +146 -0
- package/build/widgets/oa-widget-image-gallery/imageCache.js +15 -0
- package/build/widgets/oa-widget-image-gallery/imageGalleryStyle.js +16 -0
- package/build/widgets/oa-widget-item-info-card/InfoCardListWidget.js +60 -0
- package/build/widgets/oa-widget-item-info-card/ItemInfoCardWidget.js +83 -0
- package/build/widgets/oa-widget-item-info-card/styles.css +50 -0
- package/build/widgets/oa-widget-item-info-card/styles.js +14 -0
- package/build/widgets/oa-widget-key-value/KeyValueWidget.js +46 -12
- package/build/widgets/oa-widget-key-value/styles.js +1 -1
- package/build/widgets/oa-widget-kpi/KPICardWidget.js +86 -0
- package/build/widgets/oa-widget-kpi/styles.js +12 -0
- package/build/widgets/oa-widget-map-base-location/AddressDetails.js +21 -7
- package/build/widgets/oa-widget-map-base-location/AddressForm.js +32 -5
- package/build/widgets/oa-widget-map-base-location/MapBaseLocation.js +9 -3
- package/build/widgets/oa-widget-map-base-location/MapComponent.js +17 -2
- package/build/widgets/oa-widget-membershipcard/MembershipCard.js +14 -3
- package/build/widgets/oa-widget-membershipcard/styles.js +1 -1
- package/build/widgets/oa-widget-notes/NotesWidget.js +32 -30
- package/build/widgets/oa-widget-notes/styles.js +4 -3
- package/build/widgets/oa-widget-profile-data/ProfileDataWidget.js +165 -0
- package/build/widgets/oa-widget-profile-data/styles.js +13 -0
- package/build/widgets/oa-widget-progressive-steps/ProgressiveStepsWidget.js +362 -0
- package/build/widgets/oa-widget-progressive-steps/styles.js +12 -0
- package/build/widgets/oa-widget-reimbursement-breakup/ReimbursementBreakupWidget.js +18 -9
- package/build/widgets/oa-widget-reimbursement-breakup/styles.js +1 -1
- package/build/widgets/oa-widget-reupload-drawer/ReUploadDrawer.js +164 -0
- package/build/widgets/oa-widget-select-list-item-modal/SelectListItemModal.js +91 -0
- package/build/widgets/oa-widget-sidebar/SidebarWidget.js +175 -0
- package/build/widgets/oa-widget-sidebar/components/Header.js +33 -0
- package/build/widgets/oa-widget-sidebar/styles.js +13 -0
- package/build/widgets/oa-widget-spare-part/SparePartsWidget.js +63 -35
- package/build/widgets/oa-widget-track-shipment-list/fn.js +16 -4
- package/build/widgets/oa-widget-user-management/UserManagementWidget.js +407 -0
- package/build/widgets/oa-widget-user-management/styles.js +15 -0
- package/package.json +4 -2
- package/build/components/oa-component-textarea/TextArea.js +0 -74
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.assign.js");
|
|
4
|
+
require("core-js/modules/es.weak-map.js");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
require("core-js/modules/es.symbol.description.js");
|
|
10
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
var _antd = require("antd");
|
|
14
|
+
var _CheckCircle = _interopRequireDefault(require("@material-ui/icons/CheckCircle"));
|
|
15
|
+
var _Check = _interopRequireDefault(require("@material-ui/icons/Check"));
|
|
16
|
+
var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
17
|
+
var _UploadDownloadWidget = _interopRequireDefault(require("../oa-widget-upload-download/UploadDownloadWidget"));
|
|
18
|
+
var _styles = require("./styles");
|
|
19
|
+
var _CustomRadio = _interopRequireDefault(require("../../components/oa-component-radio/CustomRadio"));
|
|
20
|
+
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
21
|
+
var _CustomButton = _interopRequireDefault(require("../../components/oa-component-button/CustomButton"));
|
|
22
|
+
var _MaterialIcon = _interopRequireDefault(require("../../components/oa-component-icons/MaterialIcon"));
|
|
23
|
+
var _CustomTag = _interopRequireDefault(require("../../components/oa-component-tag/CustomTag"));
|
|
24
|
+
var _CustomTooltip = _interopRequireDefault(require("../../components/oa-component-tooltip/CustomTooltip"));
|
|
25
|
+
const _excluded = ["children", "description", "docDetails", "multipleDocDetails", "approvalForm", "isMandatory", "hasDivider", "isQuestionStyleWidget", "questionId", "title", "viewOnClick", "actionRenderType", "actionContent", "systemStatus", "documentTitle", "descriptionTitle", "data-test", "form", "columnDynamicCssClass", "tooltipPlacement", "maxLength"];
|
|
26
|
+
/* eslint-disable */
|
|
27
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
|
+
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); }
|
|
29
|
+
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; }
|
|
30
|
+
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); }
|
|
31
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
32
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
33
|
+
/**
|
|
34
|
+
* @typedef {import('../../components/oa-component-upload/CustomUpload').DocumentDetails} DocumentDetails
|
|
35
|
+
*
|
|
36
|
+
* @typedef {Object} ApprovalForm
|
|
37
|
+
* @property {boolean} [disabled=false] Whether the approval form is disabled.
|
|
38
|
+
* @property {boolean} [hidden=false] Whether the approval form is hidden.
|
|
39
|
+
* @property {boolean} [invisible=false] Whether the approval form is invisible (preserving layout).
|
|
40
|
+
* @property {boolean} [isApproved] Initial value for the approval status.
|
|
41
|
+
* @property {string} [remarks] Initial value for the remarks.
|
|
42
|
+
*
|
|
43
|
+
* @typedef {Object} Props
|
|
44
|
+
* @property {React.ReactNode} [children] Content to be rendered inside the ApprovalWidget.
|
|
45
|
+
* @property {string} [description] Description for the widget.
|
|
46
|
+
* @property {DocumentDetails} [docDetails] Document details for the widget.
|
|
47
|
+
* @property {ApprovalForm} [approvalForm] Form data for approval.
|
|
48
|
+
* @property {boolean} [isMandatory=false] Whether the widget is mandatory.
|
|
49
|
+
* @property {boolean} [hasDivider=false] Display a divider line beneath the widget.
|
|
50
|
+
* @property {boolean} [isQuestionStyleWidget=false] Whether the widget has a question-style layout.
|
|
51
|
+
* @property {string|number} questionId Identifier for the question.
|
|
52
|
+
* @property {string} title Title of the widget.
|
|
53
|
+
* @property {Function} [viewOnClick] Callback function for the view action.
|
|
54
|
+
* @property {string} ['data-test'] Data test string to be applied to the outermost element.
|
|
55
|
+
*/
|
|
56
|
+
function ApprovalWidget(_ref) {
|
|
57
|
+
var _approvalForm$disable5, _actionContent$label, _approvalForm$disable6, _approvalForm$disable7, _approvalForm$disable8, _approvalForm$disable9, _approvalForm$remarks2, _approvalForm$disable10;
|
|
58
|
+
let {
|
|
59
|
+
children,
|
|
60
|
+
description,
|
|
61
|
+
docDetails,
|
|
62
|
+
multipleDocDetails,
|
|
63
|
+
approvalForm,
|
|
64
|
+
isMandatory,
|
|
65
|
+
hasDivider,
|
|
66
|
+
isQuestionStyleWidget,
|
|
67
|
+
questionId,
|
|
68
|
+
title,
|
|
69
|
+
viewOnClick,
|
|
70
|
+
actionRenderType,
|
|
71
|
+
actionContent,
|
|
72
|
+
systemStatus,
|
|
73
|
+
documentTitle,
|
|
74
|
+
descriptionTitle,
|
|
75
|
+
"data-test": dataTest,
|
|
76
|
+
form,
|
|
77
|
+
columnDynamicCssClass,
|
|
78
|
+
tooltipPlacement,
|
|
79
|
+
maxLength
|
|
80
|
+
} = _ref,
|
|
81
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
82
|
+
const getInitialValue = isApproved => {
|
|
83
|
+
switch (isApproved) {
|
|
84
|
+
case true:
|
|
85
|
+
return 1;
|
|
86
|
+
case false:
|
|
87
|
+
return 0;
|
|
88
|
+
default:
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const [isApproved, setIsApproved] = (0, _react.useState)(getInitialValue(approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.isApproved));
|
|
93
|
+
const [radioButtonValue, setRadioButtonValue] = (0, _react.useState)(approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.isApproved);
|
|
94
|
+
const getFieldDecorator = form === null || form === void 0 ? void 0 : form.getFieldDecorator;
|
|
95
|
+
const onRadioChange = event => setIsApproved(event.target.value);
|
|
96
|
+
const onChangeRadioWithForm = event => setRadioButtonValue(event.target.value);
|
|
97
|
+
const getApprovalText = (questionId, type) => {
|
|
98
|
+
const formValue = form.getFieldValue("validateDocumentButton#".concat(questionId));
|
|
99
|
+
let approvalStatus = "";
|
|
100
|
+
if (type === "buttonWithFormV4") {
|
|
101
|
+
approvalStatus = formValue === null || formValue === void 0 ? void 0 : formValue["isApproved-".concat(questionId)];
|
|
102
|
+
} else if (type === "buttonWithForm") {
|
|
103
|
+
approvalStatus = formValue === null || formValue === void 0 ? void 0 : formValue["srDoc#status#".concat(questionId)];
|
|
104
|
+
}
|
|
105
|
+
switch (approvalStatus) {
|
|
106
|
+
case 1:
|
|
107
|
+
case true:
|
|
108
|
+
case "Complete":
|
|
109
|
+
return "Marked as approved";
|
|
110
|
+
case 0:
|
|
111
|
+
case false:
|
|
112
|
+
case "Incomplete":
|
|
113
|
+
return "Marked as pending";
|
|
114
|
+
default:
|
|
115
|
+
return "";
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const getRemarksText = (questionId, type) => {
|
|
119
|
+
const formValue = form.getFieldValue("validateDocumentButton#".concat(questionId));
|
|
120
|
+
let approvalStatus = "";
|
|
121
|
+
let remarks = "";
|
|
122
|
+
if (type === "buttonWithFormV4") {
|
|
123
|
+
approvalStatus = formValue === null || formValue === void 0 ? void 0 : formValue["isApproved-".concat(questionId)];
|
|
124
|
+
remarks = formValue === null || formValue === void 0 ? void 0 : formValue["remarks-".concat(questionId)];
|
|
125
|
+
} else if (type === "buttonWithForm") {
|
|
126
|
+
approvalStatus = formValue === null || formValue === void 0 ? void 0 : formValue["srDoc#status#".concat(questionId)];
|
|
127
|
+
remarks = formValue === null || formValue === void 0 ? void 0 : formValue["srDoc#remarks#".concat(questionId)];
|
|
128
|
+
}
|
|
129
|
+
switch (approvalStatus) {
|
|
130
|
+
case 0:
|
|
131
|
+
case false:
|
|
132
|
+
case "Incomplete":
|
|
133
|
+
return "Remark: ".concat(remarks);
|
|
134
|
+
default:
|
|
135
|
+
return "";
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Renders the approval radio group with validation
|
|
141
|
+
* @param {boolean} isRequired - Whether the field is required
|
|
142
|
+
* @returns {React.ReactNode} Radio group component
|
|
143
|
+
*/
|
|
144
|
+
const renderApprovalRadioGroup = function renderApprovalRadioGroup() {
|
|
145
|
+
var _approvalForm$disable, _approvalForm$disable2;
|
|
146
|
+
let isRequired = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
147
|
+
return /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
148
|
+
name: "isApproved-".concat(questionId),
|
|
149
|
+
className: "custom-radio-group",
|
|
150
|
+
initialValue: isApproved,
|
|
151
|
+
rules: isRequired ? [{
|
|
152
|
+
required: true,
|
|
153
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
154
|
+
"data-test": "".concat(dataTest, "--is-approved-validation-message")
|
|
155
|
+
}, "Approval status needs to be selected.") : "Approval status needs to be selected."
|
|
156
|
+
}] : []
|
|
157
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomRadio.default.Group, {
|
|
158
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-group") : undefined,
|
|
159
|
+
onChange: onRadioChange,
|
|
160
|
+
value: isApproved
|
|
161
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
|
|
162
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-yes") : undefined,
|
|
163
|
+
disabled: (_approvalForm$disable = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable !== void 0 ? _approvalForm$disable : false,
|
|
164
|
+
label: "Mark as Approved",
|
|
165
|
+
value: 1
|
|
166
|
+
}), /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
|
|
167
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-no") : undefined,
|
|
168
|
+
disabled: (_approvalForm$disable2 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable2 !== void 0 ? _approvalForm$disable2 : false,
|
|
169
|
+
label: "Mark as Pending",
|
|
170
|
+
value: 0
|
|
171
|
+
})));
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Renders the remarks textarea with validation
|
|
176
|
+
* @param {boolean} isRequired - Whether the field is required
|
|
177
|
+
* @returns {React.ReactNode} Remarks section component
|
|
178
|
+
*/
|
|
179
|
+
const renderRemarksSection = function renderRemarksSection() {
|
|
180
|
+
var _approvalForm$remarks, _approvalForm$disable3;
|
|
181
|
+
let isRequired = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
182
|
+
return isApproved === 0 && /*#__PURE__*/_react.default.createElement("section", null, /*#__PURE__*/_react.default.createElement("h5", {
|
|
183
|
+
className: "type-b2-400"
|
|
184
|
+
}, "Remarks"), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
185
|
+
name: "remarks-".concat(questionId),
|
|
186
|
+
initialValue: (_approvalForm$remarks = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.remarks) !== null && _approvalForm$remarks !== void 0 ? _approvalForm$remarks : "",
|
|
187
|
+
rules: [isRequired && {
|
|
188
|
+
required: true,
|
|
189
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
190
|
+
"data-test": "".concat(dataTest, "--remarks-validation-message")
|
|
191
|
+
}, "Remarks cannot be empty.") : "Remarks cannot be empty."
|
|
192
|
+
}, maxLength && {
|
|
193
|
+
max: maxLength,
|
|
194
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
195
|
+
"data-test": "".concat(dataTest, "--remarks-maxlength-validation-message")
|
|
196
|
+
}, "Remarks cannot exceed ".concat(maxLength, " characters.")) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Remarks cannot exceed ".concat(maxLength, " characters."))
|
|
197
|
+
}]
|
|
198
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Input.TextArea, {
|
|
199
|
+
"data-test": dataTest ? "".concat(dataTest, "--remarks") : undefined,
|
|
200
|
+
disabled: (_approvalForm$disable3 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable3 !== void 0 ? _approvalForm$disable3 : false
|
|
201
|
+
})));
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* BUSINESS LOGIC: Two different radio implementations exist for different approval scenarios
|
|
206
|
+
*
|
|
207
|
+
* "radio" - MANDATORY APPROVAL: Always requires user to select approval status
|
|
208
|
+
* - Used when approval decision is compulsory (e.g., critical business processes)
|
|
209
|
+
* - Both approval status AND remarks (if pending) are mandatory
|
|
210
|
+
* - Cannot proceed without making a selection
|
|
211
|
+
*
|
|
212
|
+
* "radioOptional" - OPTIONAL APPROVAL: Approval status depends on isMandatory flag
|
|
213
|
+
* - Used when approval might be optional based on business rules
|
|
214
|
+
* - If isMandatory=true: Same behavior as "radio" (mandatory)
|
|
215
|
+
* - If isMandatory=false: User can skip approval selection
|
|
216
|
+
* - Provides flexibility for different approval workflows
|
|
217
|
+
*
|
|
218
|
+
* This separation allows the same component to handle both strict and flexible approval processes
|
|
219
|
+
*
|
|
220
|
+
* Renders the approval section based on action render type
|
|
221
|
+
* @returns {React.ReactNode} Approval section component
|
|
222
|
+
*/
|
|
223
|
+
const renderApprovalSection = () => {
|
|
224
|
+
const isRadioType = actionRenderType === "radio" || actionRenderType === "radioOptional";
|
|
225
|
+
if (!isRadioType) return null;
|
|
226
|
+
const isRequired = actionRenderType === "radio" || isMandatory;
|
|
227
|
+
return /*#__PURE__*/_react.default.createElement("div", null, renderApprovalRadioGroup(isRequired), renderRemarksSection(isRequired));
|
|
228
|
+
};
|
|
229
|
+
return /*#__PURE__*/_react.default.createElement(_styles.StyledContainer, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
230
|
+
className: "row"
|
|
231
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
232
|
+
className: columnDynamicCssClass === null || columnDynamicCssClass === void 0 ? void 0 : columnDynamicCssClass.firstColumn
|
|
233
|
+
}, title && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("h4", {
|
|
234
|
+
className: "type-button-500"
|
|
235
|
+
}, title, isMandatory && /*#__PURE__*/_react.default.createElement(_styles.RedText, null, "*"))), description && /*#__PURE__*/_react.default.createElement(_styles.Styledescription, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
236
|
+
typography: "type-b2-400",
|
|
237
|
+
color: "secondary-content"
|
|
238
|
+
}, descriptionTitle), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
239
|
+
typography: "type-b2-400",
|
|
240
|
+
color: "primary-content"
|
|
241
|
+
}, description)), !isQuestionStyleWidget && ((multipleDocDetails === null || multipleDocDetails === void 0 ? void 0 : multipleDocDetails.length) > 0 ? multipleDocDetails.map(docDetails => {
|
|
242
|
+
var _approvalForm$disable4;
|
|
243
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
244
|
+
className: "oaCustomerResponse"
|
|
245
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
246
|
+
typography: "type-b2-400",
|
|
247
|
+
color: "secondary-content"
|
|
248
|
+
}, docDetails.documentTitle, " \xA0"), /*#__PURE__*/_react.default.createElement(_UploadDownloadWidget.default, _extends({
|
|
249
|
+
disabled: (_approvalForm$disable4 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable4 !== void 0 ? _approvalForm$disable4 : false,
|
|
250
|
+
"data-test": dataTest ? "".concat(dataTest, "--upload-download-widget") : undefined
|
|
251
|
+
}, docDetails, {
|
|
252
|
+
formName: isMandatory ? "file-".concat(questionId) : undefined
|
|
253
|
+
})));
|
|
254
|
+
}) : /*#__PURE__*/_react.default.createElement("div", {
|
|
255
|
+
className: "oaCustomerResponse"
|
|
256
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
257
|
+
typography: "type-b2-400",
|
|
258
|
+
color: "secondary-content"
|
|
259
|
+
}, documentTitle, " \xA0"), /*#__PURE__*/_react.default.createElement(_UploadDownloadWidget.default, _extends({
|
|
260
|
+
disabled: (_approvalForm$disable5 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable5 !== void 0 ? _approvalForm$disable5 : false,
|
|
261
|
+
"data-test": dataTest ? "".concat(dataTest, "--upload-download-widget") : undefined
|
|
262
|
+
}, docDetails, {
|
|
263
|
+
formName: isMandatory ? "file-".concat(questionId) : undefined
|
|
264
|
+
})))), children && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children), viewOnClick && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
265
|
+
className: "view-button",
|
|
266
|
+
"data-test": dataTest ? "".concat(dataTest, "--view-button") : undefined,
|
|
267
|
+
onClick: () => viewOnClick(questionId),
|
|
268
|
+
type: "text-only",
|
|
269
|
+
label:
|
|
270
|
+
// isQuestionStyleWidget
|
|
271
|
+
// ? "View Previous Description"
|
|
272
|
+
// :
|
|
273
|
+
"View History"
|
|
274
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
275
|
+
className: columnDynamicCssClass === null || columnDynamicCssClass === void 0 ? void 0 : columnDynamicCssClass.secondColumn
|
|
276
|
+
}, systemStatus === null || systemStatus === void 0 ? void 0 : systemStatus.map(status => {
|
|
277
|
+
var _status$items;
|
|
278
|
+
return /*#__PURE__*/_react.default.createElement("div", null, status.renderType === "text" && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
279
|
+
typography: "type-b2-400",
|
|
280
|
+
color: "secondary-content"
|
|
281
|
+
}, status.label), status.renderType === "tag" && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_CustomTag.default, status)), status.renderType === "toolTip" && ((_status$items = status.items) === null || _status$items === void 0 ? void 0 : _status$items.length) > 0 && /*#__PURE__*/_react.default.createElement(_CustomTooltip.default, {
|
|
282
|
+
overlayClassName: "multipleDocumentTooltip",
|
|
283
|
+
isDisplayed: true,
|
|
284
|
+
placement: status.tooltipPlacement // Pass placement as a prop
|
|
285
|
+
,
|
|
286
|
+
title: (() => {
|
|
287
|
+
const totalItems = status.items.length;
|
|
288
|
+
const numColumns = totalItems === 1 ? 1 : 2; // 1 column if only 1 item, else 2 columns
|
|
289
|
+
|
|
290
|
+
const col1Size = Math.ceil(totalItems / numColumns); // First column gets extra if odd
|
|
291
|
+
const col2Size = totalItems - col1Size; // Remaining items go to second column
|
|
292
|
+
|
|
293
|
+
const columns = [status.items.slice(0, col1Size),
|
|
294
|
+
// First column
|
|
295
|
+
status.items.slice(col1Size) // Second column
|
|
296
|
+
];
|
|
297
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (status === null || status === void 0 ? void 0 : status.title) && /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
298
|
+
typography: "type-sl1-700",
|
|
299
|
+
color: "secondary-content"
|
|
300
|
+
}, status.title), /*#__PURE__*/_react.default.createElement("div", {
|
|
301
|
+
className: "tooltip-grid",
|
|
302
|
+
style: {
|
|
303
|
+
flexDirection: totalItems === 1 ? "column" : "row",
|
|
304
|
+
// Make it single column if only 1 item
|
|
305
|
+
width: totalItems === 1 ? "100%" : "auto" // Full width if only 1 item
|
|
306
|
+
}
|
|
307
|
+
}, columns.map((columnItems, colIndex) => /*#__PURE__*/_react.default.createElement("div", {
|
|
308
|
+
key: "col-".concat(colIndex),
|
|
309
|
+
className: "tooltip-column"
|
|
310
|
+
}, columnItems.map(item => /*#__PURE__*/_react.default.createElement("li", {
|
|
311
|
+
key: item.title,
|
|
312
|
+
className: "tooltip-item"
|
|
313
|
+
}, !(status !== null && status !== void 0 && status.hideIcon) && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
314
|
+
size: 20,
|
|
315
|
+
icon: item.type === "positive" ? _Check.default : _Close.default,
|
|
316
|
+
color: item.type === "positive" ? "positive" : "negative"
|
|
317
|
+
}), /*#__PURE__*/_react.default.createElement("p", null, item.title)))))));
|
|
318
|
+
})()
|
|
319
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
320
|
+
type: "text-only",
|
|
321
|
+
label: status.label
|
|
322
|
+
})));
|
|
323
|
+
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
324
|
+
className: columnDynamicCssClass === null || columnDynamicCssClass === void 0 ? void 0 : columnDynamicCssClass.thirdColumn
|
|
325
|
+
}, actionRenderType === "text" && /*#__PURE__*/_react.default.createElement("div", {
|
|
326
|
+
className: "oaActionText"
|
|
327
|
+
}, (actionContent === null || actionContent === void 0 ? void 0 : actionContent.icon) && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
328
|
+
icon: _CheckCircle.default,
|
|
329
|
+
size: 20,
|
|
330
|
+
color: "secondary-content"
|
|
331
|
+
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
332
|
+
typography: "type-b2-400",
|
|
333
|
+
color: "secondary-content"
|
|
334
|
+
}, (_actionContent$label = actionContent === null || actionContent === void 0 ? void 0 : actionContent.label) !== null && _actionContent$label !== void 0 ? _actionContent$label : "-")), actionRenderType === "button" && /*#__PURE__*/_react.default.createElement(_CustomButton.default, _extends({
|
|
335
|
+
disabled: (_approvalForm$disable6 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable6 !== void 0 ? _approvalForm$disable6 : false
|
|
336
|
+
}, actionContent)), renderApprovalSection(), actionRenderType === "buttonWithForm" && /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
337
|
+
validateStatus: form.getFieldError("validateDocumentButton#".concat(questionId)) ? "error" : "",
|
|
338
|
+
help: /*#__PURE__*/_react.default.createElement("div", {
|
|
339
|
+
className: "errorForRtv"
|
|
340
|
+
}, form.getFieldError("validateDocumentButton#".concat(questionId)) || "")
|
|
341
|
+
}, getFieldDecorator("validateDocumentButton#".concat(questionId), {
|
|
342
|
+
rules: isMandatory ? [{
|
|
343
|
+
required: true,
|
|
344
|
+
message: "This field is required"
|
|
345
|
+
}] : [],
|
|
346
|
+
initialValue: approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.isApproved
|
|
347
|
+
})( /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (actionContent === null || actionContent === void 0 ? void 0 : actionContent.showAgentFeedback) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
348
|
+
className: "type-b2-400",
|
|
349
|
+
color: "primary-content"
|
|
350
|
+
}, getApprovalText(questionId, "buttonWithForm")), /*#__PURE__*/_react.default.createElement("div", {
|
|
351
|
+
className: "padding-top-4"
|
|
352
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
353
|
+
className: "type-b2-400",
|
|
354
|
+
color: "secondary-content"
|
|
355
|
+
}, getRemarksText(questionId, "buttonWithForm")))), /*#__PURE__*/_react.default.createElement(_CustomButton.default, _extends({}, actionContent, {
|
|
356
|
+
disabled: (_approvalForm$disable7 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable7 !== void 0 ? _approvalForm$disable7 : false
|
|
357
|
+
}))))), actionRenderType === "radioWithForm" && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
358
|
+
className: "custom-radio-group",
|
|
359
|
+
validateStatus: form.getFieldError("icQues_status_".concat(questionId)) ? "error" : "",
|
|
360
|
+
help: form.getFieldError("icQues_status_".concat(questionId)) || ""
|
|
361
|
+
}, getFieldDecorator("icQues_status_".concat(questionId), {
|
|
362
|
+
initialValue: approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.isApproved,
|
|
363
|
+
rules: isMandatory ? [{
|
|
364
|
+
required: true,
|
|
365
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
366
|
+
"data-test": "".concat(dataTest, "--is-approved-validation-message")
|
|
367
|
+
}, "Approval status needs to be selected.") : "Approval status needs to be selected."
|
|
368
|
+
}] : []
|
|
369
|
+
})( /*#__PURE__*/_react.default.createElement(_CustomRadio.default.Group, {
|
|
370
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-group") : undefined,
|
|
371
|
+
onChange: onChangeRadioWithForm,
|
|
372
|
+
value: radioButtonValue
|
|
373
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
|
|
374
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-yes") : undefined,
|
|
375
|
+
label: "Mark as Approved",
|
|
376
|
+
value: "Complete",
|
|
377
|
+
disabled: (_approvalForm$disable8 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable8 !== void 0 ? _approvalForm$disable8 : false
|
|
378
|
+
}), /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
|
|
379
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-no") : undefined,
|
|
380
|
+
label: "Mark as Pending",
|
|
381
|
+
value: "Incomplete",
|
|
382
|
+
disabled: (_approvalForm$disable9 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable9 !== void 0 ? _approvalForm$disable9 : false
|
|
383
|
+
})))), form.getFieldValue("icQues_status_".concat(questionId)) == "Incomplete" && /*#__PURE__*/_react.default.createElement("section", null, /*#__PURE__*/_react.default.createElement("h5", {
|
|
384
|
+
className: "type-b2-400"
|
|
385
|
+
}, "Remarks"), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
386
|
+
validateStatus: form.getFieldError("icQues_remarks_".concat(questionId)) ? "error" : "",
|
|
387
|
+
help: form.getFieldError("icQues_remarks_".concat(questionId)) || ""
|
|
388
|
+
}, getFieldDecorator("icQues_remarks_".concat(questionId), {
|
|
389
|
+
rules: [isMandatory && {
|
|
390
|
+
required: true,
|
|
391
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
392
|
+
"data-test": "".concat(dataTest, "--remarks-validation-message")
|
|
393
|
+
}, "Remarks cannot be empty.") : "Remarks cannot be empty."
|
|
394
|
+
}, maxLength && {
|
|
395
|
+
max: maxLength,
|
|
396
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
397
|
+
"data-test": "".concat(dataTest, "--remarks-maxlength-validation-message")
|
|
398
|
+
}, "Remarks cannot exceed ".concat(maxLength, " characters.")) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Remarks cannot exceed ".concat(maxLength, " characters."))
|
|
399
|
+
}],
|
|
400
|
+
initialValue: (_approvalForm$remarks2 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.remarks) !== null && _approvalForm$remarks2 !== void 0 ? _approvalForm$remarks2 : ""
|
|
401
|
+
})( /*#__PURE__*/_react.default.createElement(_antd.Input.TextArea, {
|
|
402
|
+
"data-test": dataTest ? "".concat(dataTest, "--remarks") : undefined,
|
|
403
|
+
disabled: (_approvalForm$disable10 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable10 !== void 0 ? _approvalForm$disable10 : false
|
|
404
|
+
}))))), actionRenderType === "buttonWithFormV4" && /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
405
|
+
name: "validateDocumentButton#".concat(questionId),
|
|
406
|
+
initialValue: approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.isApproved,
|
|
407
|
+
rules: isMandatory ? [{
|
|
408
|
+
required: true,
|
|
409
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
410
|
+
"data-test": "".concat(dataTest, "--is-approved-validation-message")
|
|
411
|
+
}, "Approval status needs to be selected.") : "Approval status needs to be selected."
|
|
412
|
+
}] : []
|
|
413
|
+
}, (actionContent === null || actionContent === void 0 ? void 0 : actionContent.showAgentFeedback) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
414
|
+
className: "type-b2-400",
|
|
415
|
+
color: "primary-content"
|
|
416
|
+
}, getApprovalText(questionId, "buttonWithFormV4")), /*#__PURE__*/_react.default.createElement("div", {
|
|
417
|
+
className: "padding-top-4"
|
|
418
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
419
|
+
className: "type-b2-400",
|
|
420
|
+
color: "secondary-content"
|
|
421
|
+
}, getRemarksText(questionId, "buttonWithFormV4")))), /*#__PURE__*/_react.default.createElement(_CustomButton.default, actionContent)))), hasDivider && /*#__PURE__*/_react.default.createElement(_antd.Divider, null));
|
|
422
|
+
}
|
|
423
|
+
ApprovalWidget.propTypes = {
|
|
424
|
+
children: _propTypes.default.node,
|
|
425
|
+
"data-test": _propTypes.default.string,
|
|
426
|
+
description: _propTypes.default.string,
|
|
427
|
+
// Leave description optional
|
|
428
|
+
docDetails: _propTypes.default.shape({
|
|
429
|
+
multiple: _propTypes.default.bool,
|
|
430
|
+
onUpload: _propTypes.default.func,
|
|
431
|
+
uploadedDocuments: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
432
|
+
name: _propTypes.default.string,
|
|
433
|
+
onDelete: _propTypes.default.func,
|
|
434
|
+
onDownload: _propTypes.default.func
|
|
435
|
+
}))
|
|
436
|
+
}),
|
|
437
|
+
multipleDocDetails: _propTypes.default.array,
|
|
438
|
+
hasDivider: _propTypes.default.bool,
|
|
439
|
+
// Leave hasDivider optional,
|
|
440
|
+
approvalForm: _propTypes.default.shape({
|
|
441
|
+
disabled: _propTypes.default.bool,
|
|
442
|
+
hidden: _propTypes.default.bool,
|
|
443
|
+
invisible: _propTypes.default.bool,
|
|
444
|
+
isApproved: _propTypes.default.bool,
|
|
445
|
+
remarks: _propTypes.default.string
|
|
446
|
+
}),
|
|
447
|
+
isMandatory: _propTypes.default.bool,
|
|
448
|
+
isQuestionStyleWidget: _propTypes.default.bool,
|
|
449
|
+
questionId: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
|
|
450
|
+
title: _propTypes.default.string.isRequired,
|
|
451
|
+
// Make title required
|
|
452
|
+
viewOnClick: _propTypes.default.func,
|
|
453
|
+
actionRenderType: _propTypes.default.string,
|
|
454
|
+
actionContent: _propTypes.default.shape({
|
|
455
|
+
label: _propTypes.default.string
|
|
456
|
+
}),
|
|
457
|
+
systemStatus: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
458
|
+
renderType: _propTypes.default.string,
|
|
459
|
+
label: _propTypes.default.string,
|
|
460
|
+
title: _propTypes.default.string
|
|
461
|
+
})),
|
|
462
|
+
documentTitle: _propTypes.default.string,
|
|
463
|
+
descriptionTitle: _propTypes.default.string,
|
|
464
|
+
form: _propTypes.default.object,
|
|
465
|
+
tooltipPlacement: _propTypes.default.string,
|
|
466
|
+
columnDynamicCssClass: _propTypes.default.object
|
|
467
|
+
};
|
|
468
|
+
ApprovalWidget.defaultProps = {
|
|
469
|
+
children: null,
|
|
470
|
+
"data-test": undefined,
|
|
471
|
+
description: "",
|
|
472
|
+
docDetails: {},
|
|
473
|
+
approvalForm: {},
|
|
474
|
+
isMandatory: false,
|
|
475
|
+
hasDivider: false,
|
|
476
|
+
isQuestionStyleWidget: false,
|
|
477
|
+
viewOnClick: undefined,
|
|
478
|
+
actionRenderType: undefined,
|
|
479
|
+
actionContent: {},
|
|
480
|
+
systemStatus: [],
|
|
481
|
+
documentTitle: "",
|
|
482
|
+
descriptionTitle: "",
|
|
483
|
+
form: null,
|
|
484
|
+
tooltipPlacement: "bottom",
|
|
485
|
+
// Default placement
|
|
486
|
+
columnDynamicCssClass: {
|
|
487
|
+
firstColumn: "col-sm-12 col-md-5 col-lg-5",
|
|
488
|
+
secondColumn: "col-sm-12 col-md-4 col-lg-4 flexCol8",
|
|
489
|
+
thirdColumn: "col-sm-12 col-md-3 col-lg-3"
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
var _default = exports.default = ApprovalWidget;
|
|
@@ -8,6 +8,6 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
8
8
|
var _templateObject, _templateObject2, _templateObject3;
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
11
|
-
const Styledescription = exports.Styledescription = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 0 0 8px;\n"])));
|
|
12
|
-
const StyledContainer = exports.StyledContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 0 0 16px;\
|
|
11
|
+
const Styledescription = exports.Styledescription = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n // padding: 0 0 8px;\n"])));
|
|
12
|
+
const StyledContainer = exports.StyledContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 0 0 16px;\n label.ant-radio-wrapper:first-child {\n margin-inline-end: 16px;\n }\n .ant-radio-wrapper {\n white-space: nowrap;\n }\n .paddind-bottom-4 {\n padding: 0 0 4px;\n }\n .container {\n margin-bottom: 16px;\n }\n\n .view-button {\n justify-content: start;\n }\n .ant-form-item.custom-radio-group {\n margin-bottom: 12px;\n }\n\n .ant-divider-horizontal {\n margin: 16px 0px 0px;\n }\n\n .ant-form-item .ant-form-item-control-input {\n min-height: auto;\n }\n\n .ant-radio-group-outline {\n display: flex;\n justify-content: start;\n }\n\n textarea {\n padding: 16px;\n min-height: 88px;\n resize: none;\n border-radius: 4px;\n border: 1px solid var(--color-placeholder-text);\n }\n\n h5 {\n margin: 0 0 4px;\n color: var(--color-primary-content);\n }\n\n radiofield label {\n white-space: nowrap;\n }\n\n docdetailstag a {\n white-space: nowrap;\n }\n .oaCustomerResponse {\n display: flex;\n align-items: center;\n align-items: flex-start;\n }\n .oaCustomerResponse button{\n padding: 0;\n }\n .oaCustomerResponse section {\n padding: 0;\n }\n .oaActionText {\n display: flex;\n gap: 4px;\n align-items: center;\n height: fit-content;\n }\n .flexCol8 {\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n .flexCol12 {\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n .flexCol12 button{\n padding: 0;\n }\n"])));
|
|
13
13
|
const RedText = exports.RedText = _styledComponents.default.span(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: inline-block;\n color: red;\n margin-left: 4px;\n"])));
|
|
@@ -15,7 +15,7 @@ var _relativeTime = _interopRequireDefault(require("dayjs/plugin/relativeTime"))
|
|
|
15
15
|
var _react = _interopRequireWildcard(require("react"));
|
|
16
16
|
var _icons = require("@material-ui/icons");
|
|
17
17
|
var _system = require("@material-ui/system");
|
|
18
|
-
var
|
|
18
|
+
var _CustomTextArea = _interopRequireDefault(require("../../components/oa-component-textarea/CustomTextArea"));
|
|
19
19
|
var _CustomButton = _interopRequireDefault(require("../../components/oa-component-button/CustomButton"));
|
|
20
20
|
var _CustomDrawer = _interopRequireDefault(require("../../components/oa-component-drawer/CustomDrawer"));
|
|
21
21
|
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
@@ -31,7 +31,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typ
|
|
|
31
31
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
32
32
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
33
33
|
_dayjs.default.extend(_relativeTime.default);
|
|
34
|
-
const StyledCustomDrawer = exports.StyledCustomDrawer = (0, _styledComponents.default)(_CustomDrawer.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n h3{\n margin: 0 0 4px;\n }\n .ant-drawer-footer{\n padding: 24px;\n }\n .ant-drawer-footer span{\n margin: 0 0 4px;\n display: block;\n }\n .ant-drawer-footer aside{\n display: flex;\n justify-content: end;\n padding: 16px 0 0;\n }\n .ant-drawer-footer aside span{\n margin: 0;\n }\n"])));
|
|
34
|
+
const StyledCustomDrawer = exports.StyledCustomDrawer = (0, _styledComponents.default)(_CustomDrawer.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n h3 {\n margin: 0 0 4px;\n }\n .ant-drawer-footer {\n padding: 24px;\n }\n .ant-drawer-footer span {\n margin: 0 0 4px;\n display: block;\n }\n .ant-drawer-footer aside {\n display: flex;\n justify-content: end;\n padding: 16px 0 0;\n }\n .ant-drawer-footer aside span {\n margin: 0;\n }\n"])));
|
|
35
35
|
const stylesObj = {
|
|
36
36
|
chatUi: {
|
|
37
37
|
padding: '16px',
|
|
@@ -110,7 +110,7 @@ function ChatWidget(_ref) {
|
|
|
110
110
|
footer: /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
111
111
|
className: "type-b2-400",
|
|
112
112
|
color: "primary-content"
|
|
113
|
-
}, "Reply to Query"), /*#__PURE__*/_react.default.createElement(
|
|
113
|
+
}, "Reply to Query"), /*#__PURE__*/_react.default.createElement(_CustomTextArea.default, {
|
|
114
114
|
name: "message",
|
|
115
115
|
value: message,
|
|
116
116
|
placeholder: "Type here...",
|
|
@@ -192,8 +192,8 @@ function ChatWidget(_ref) {
|
|
|
192
192
|
}, msg.createdAt))) :
|
|
193
193
|
/*#__PURE__*/
|
|
194
194
|
/*
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
Info : This is the chat box of left side which will show messages from other user.
|
|
196
|
+
*/
|
|
197
197
|
_react.default.createElement("div", {
|
|
198
198
|
style: {
|
|
199
199
|
display: 'flex',
|
|
@@ -14,7 +14,7 @@ var _styles = require("./styles");
|
|
|
14
14
|
var _Typography = _interopRequireDefault(require("../../components/oa-component-typography/Typography"));
|
|
15
15
|
var _CustomDrawer = _interopRequireDefault(require("../../components/oa-component-drawer/CustomDrawer"));
|
|
16
16
|
var _CustomSelect = _interopRequireDefault(require("../../components/oa-component-select/CustomSelect"));
|
|
17
|
-
const _excluded = ["visible", "onCancel", "onConfirm", "fraudReasons", "isFraudRequired", "closingClaimReasons", "serviceRequestData", "remarkMaxlength", "data-test"];
|
|
17
|
+
const _excluded = ["visible", "onCancel", "onConfirm", "fraudReasons", "isFraudRequired", "closingClaimReasons", "serviceRequestData", "remarkMaxlength", "data-test", "selectModeForRejectionReason", "onSelectionChange", "maxSelectForMultiSelect"];
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
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); }
|
|
20
20
|
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; }
|
|
@@ -53,7 +53,10 @@ function CloseClaimWidget(_ref) {
|
|
|
53
53
|
serviceRequestData,
|
|
54
54
|
// Data for the service request
|
|
55
55
|
remarkMaxlength,
|
|
56
|
-
'data-test': dataTest
|
|
56
|
+
'data-test': dataTest,
|
|
57
|
+
selectModeForRejectionReason,
|
|
58
|
+
onSelectionChange,
|
|
59
|
+
maxSelectForMultiSelect
|
|
57
60
|
} = _ref,
|
|
58
61
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
59
62
|
const [form] = _antd.Form.useForm();
|
|
@@ -143,7 +146,10 @@ function CloseClaimWidget(_ref) {
|
|
|
143
146
|
options: closingClaimReasons === null || closingClaimReasons === void 0 ? void 0 : closingClaimReasons.map(row => ({
|
|
144
147
|
value: row.value,
|
|
145
148
|
label: row.value
|
|
146
|
-
}))
|
|
149
|
+
})),
|
|
150
|
+
mode: selectModeForRejectionReason,
|
|
151
|
+
onSelectionChange: onSelectionChange,
|
|
152
|
+
maxSelectForMultiSelect: maxSelectForMultiSelect
|
|
147
153
|
})), isFraudRequired && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("label", {
|
|
148
154
|
htmlFor: "labelremarks"
|
|
149
155
|
}, "Is this a fraud case?", /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
@@ -234,11 +240,17 @@ CloseClaimWidget.propTypes = {
|
|
|
234
240
|
// Can't define object type in this because the data is highly dynamic
|
|
235
241
|
serviceRequestData: _propTypes.default.object.isRequired,
|
|
236
242
|
isFraudRequired: _propTypes.default.bool,
|
|
237
|
-
remarkMaxlength: _propTypes.default.number
|
|
243
|
+
remarkMaxlength: _propTypes.default.number,
|
|
244
|
+
selectModeForRejectionReason: _propTypes.default.oneOf(['multiple', 'tags']),
|
|
245
|
+
onSelectionChange: _propTypes.default.func,
|
|
246
|
+
maxSelectForMultiSelect: _propTypes.default.number
|
|
238
247
|
};
|
|
239
248
|
CloseClaimWidget.defaultProps = {
|
|
240
249
|
'data-test': null,
|
|
241
250
|
isFraudRequired: false,
|
|
242
|
-
remarkMaxlength: 250
|
|
251
|
+
remarkMaxlength: 250,
|
|
252
|
+
selectModeForRejectionReason: null,
|
|
253
|
+
onSelectionChange: null,
|
|
254
|
+
maxSelectForMultiSelect: null
|
|
243
255
|
};
|
|
244
256
|
var _default = exports.default = CloseClaimWidget;
|