oa-componentbook 1.0.1-stage.68 → 1.0.1-stage.69
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.
|
@@ -54,7 +54,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
54
54
|
* @property {string} ['data-test'] Data test string to be applied to the outermost element.
|
|
55
55
|
*/
|
|
56
56
|
function ApprovalWidget(_ref) {
|
|
57
|
-
var _approvalForm$disable, _actionContent$label, _approvalForm$disable2, _approvalForm$disable3, _approvalForm$remarks, _approvalForm$disable4;
|
|
57
|
+
var _approvalForm$disable, _actionContent$label, _approvalForm$disable2, _approvalForm$disable3, _approvalForm$remarks, _approvalForm$disable4, _approvalForm$disable5, _approvalForm$disable6, _approvalForm$disable7;
|
|
58
58
|
let {
|
|
59
59
|
children,
|
|
60
60
|
description,
|
|
@@ -145,14 +145,17 @@ function ApprovalWidget(_ref) {
|
|
|
145
145
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
146
146
|
className: "tooltip-grid"
|
|
147
147
|
}, columns.map(columnItems => {
|
|
148
|
-
var _columnItems
|
|
148
|
+
var _columnItems$, _columnItems$2;
|
|
149
149
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
150
150
|
key: "col-".concat((_columnItems$ = columnItems[0]) === null || _columnItems$ === void 0 ? void 0 : _columnItems$.title),
|
|
151
151
|
className: "tooltip-column"
|
|
152
|
-
},
|
|
152
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
153
|
+
typography: "type-sl1-700",
|
|
154
|
+
color: "secondary-content"
|
|
155
|
+
}, (_columnItems$2 = columnItems[0]) === null || _columnItems$2 === void 0 ? void 0 : _columnItems$2.title), columnItems.map(item => /*#__PURE__*/_react.default.createElement("li", {
|
|
153
156
|
key: item.title,
|
|
154
157
|
className: "tooltip-item"
|
|
155
|
-
}, /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
158
|
+
}, item.type && /*#__PURE__*/_react.default.createElement(_MaterialIcon.default, {
|
|
156
159
|
size: 20,
|
|
157
160
|
icon: item.type === "positive" ? _Check.default : _Close.default,
|
|
158
161
|
color: item.type === "positive" ? "positive" : "negative"
|
|
@@ -218,7 +221,40 @@ function ApprovalWidget(_ref) {
|
|
|
218
221
|
required: true,
|
|
219
222
|
message: "This field is required"
|
|
220
223
|
}] : []
|
|
221
|
-
})( /*#__PURE__*/_react.default.createElement(_CustomButton.default, actionContent)))
|
|
224
|
+
})( /*#__PURE__*/_react.default.createElement(_CustomButton.default, actionContent))), actionRenderType === "radioWithForm" && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
225
|
+
className: "custom-radio-group"
|
|
226
|
+
}, getFieldDecorator("icQues_status_".concat(questionId, "}"), {
|
|
227
|
+
rules: isMandatory ? [{
|
|
228
|
+
required: true,
|
|
229
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
230
|
+
"data-test": "".concat(dataTest, "--is-approved-validation-message")
|
|
231
|
+
}, "Approval status needs to be selected.") : "Approval status needs to be selected."
|
|
232
|
+
}] : []
|
|
233
|
+
})( /*#__PURE__*/_react.default.createElement(_CustomRadio.default.Group, {
|
|
234
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-group") : undefined
|
|
235
|
+
}, /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
|
|
236
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-yes") : undefined,
|
|
237
|
+
label: "Mark as Approved",
|
|
238
|
+
value: "Complete",
|
|
239
|
+
disabled: (_approvalForm$disable5 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable5 !== void 0 ? _approvalForm$disable5 : false
|
|
240
|
+
}), /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
|
|
241
|
+
"data-test": dataTest ? "".concat(dataTest, "--is-approved-radio-no") : undefined,
|
|
242
|
+
disabled: (_approvalForm$disable6 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable6 !== void 0 ? _approvalForm$disable6 : false,
|
|
243
|
+
label: "Mark as Pending",
|
|
244
|
+
value: "Incomplete"
|
|
245
|
+
})))), form.getFieldValue("icQues_status_".concat(questionId)) == "Incomplete" && /*#__PURE__*/_react.default.createElement("section", null, /*#__PURE__*/_react.default.createElement("h5", {
|
|
246
|
+
className: "type-b2-400"
|
|
247
|
+
}, "Remarks"), /*#__PURE__*/_react.default.createElement(_antd.Form.Item, null, getFieldDecorator("icQues_remarks_".concat(questionId), {
|
|
248
|
+
rules: isMandatory ? [{
|
|
249
|
+
required: true,
|
|
250
|
+
message: dataTest ? /*#__PURE__*/_react.default.createElement("span", {
|
|
251
|
+
"data-test": "".concat(dataTest, "--remarks-validation-message")
|
|
252
|
+
}, "Remarks cannot be empty.") : "Remarks cannot be empty."
|
|
253
|
+
}] : []
|
|
254
|
+
})( /*#__PURE__*/_react.default.createElement(_antd.Input.TextArea, {
|
|
255
|
+
"data-test": dataTest ? "".concat(dataTest, "--remarks") : undefined,
|
|
256
|
+
disabled: (_approvalForm$disable7 = approvalForm === null || approvalForm === void 0 ? void 0 : approvalForm.disabled) !== null && _approvalForm$disable7 !== void 0 ? _approvalForm$disable7 : false
|
|
257
|
+
})))))) || undefined), hasDivider && /*#__PURE__*/_react.default.createElement(_antd.Divider, null));
|
|
222
258
|
}
|
|
223
259
|
ApprovalWidget.propTypes = {
|
|
224
260
|
children: _propTypes.default.node,
|