oa-componentbook 0.17.32 → 0.17.33
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.
|
@@ -31,29 +31,29 @@ function CloseClaim(_ref) {
|
|
|
31
31
|
serviceRequestData // Data for the service request
|
|
32
32
|
} = _ref;
|
|
33
33
|
const [form] = _antd.Form.useForm();
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}).then(() => setSubmittable(true), () => setSubmittable(false));
|
|
41
|
-
}, [watchValues]);
|
|
34
|
+
|
|
35
|
+
/*
|
|
36
|
+
Used 0 and 1, instead of booleans, since radio in antd throws warning in console,
|
|
37
|
+
if any type other than number or string are used in radio
|
|
38
|
+
*/
|
|
39
|
+
const [isFraud, setIsFraud] = (0, _react.useState)(0);
|
|
42
40
|
const handleConfirm = () => {
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
form.validateFields().then(values => {
|
|
42
|
+
// Passing the form data upto the parent.
|
|
43
|
+
onConfirm(values);
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
// This resets the form upon confirm.
|
|
46
|
+
form.resetFields();
|
|
47
|
+
setIsFraud(form.getFieldValue('isCustomerFraudCase'));
|
|
48
|
+
}).catch(error => console.log(error));
|
|
49
49
|
};
|
|
50
50
|
const hideOrShowFraudReasons = radioEvent => {
|
|
51
|
-
setIsFraud(radioEvent.target.value
|
|
51
|
+
setIsFraud(radioEvent.target.value);
|
|
52
52
|
};
|
|
53
53
|
const handleCancel = () => {
|
|
54
54
|
onCancel();
|
|
55
55
|
form.resetFields();
|
|
56
|
-
setIsFraud(
|
|
56
|
+
setIsFraud(0);
|
|
57
57
|
};
|
|
58
58
|
return /*#__PURE__*/_react.default.createElement(_CustomDrawer.default, {
|
|
59
59
|
title: "Close Claim",
|
|
@@ -62,7 +62,6 @@ function CloseClaim(_ref) {
|
|
|
62
62
|
label: 'Cancel',
|
|
63
63
|
type: 'secondary'
|
|
64
64
|
}, {
|
|
65
|
-
disabled: !submittable,
|
|
66
65
|
callback: handleConfirm,
|
|
67
66
|
label: 'Close Claim',
|
|
68
67
|
type: 'primary'
|
|
@@ -91,32 +90,31 @@ function CloseClaim(_ref) {
|
|
|
91
90
|
}, (closingClaimReasons === null || closingClaimReasons === void 0 ? void 0 : closingClaimReasons.length) > 0 && closingClaimReasons.map(row => /*#__PURE__*/_react.default.createElement(Option, {
|
|
92
91
|
key: row.key,
|
|
93
92
|
value: row.key
|
|
94
|
-
}, row.value)))), /*#__PURE__*/_react.default.createElement("div", {
|
|
95
|
-
className: ""
|
|
96
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
93
|
+
}, row.value)))), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
97
94
|
name: "isCustomerFraudCase",
|
|
98
95
|
rules: [{
|
|
99
96
|
required: true,
|
|
100
|
-
message: '
|
|
97
|
+
message: 'A seletion is required.'
|
|
101
98
|
}],
|
|
102
|
-
initialValue:
|
|
99
|
+
initialValue: 0,
|
|
103
100
|
label: "Is this a fraud case?",
|
|
104
101
|
labelCol: {
|
|
105
102
|
span: 24
|
|
106
103
|
}
|
|
107
104
|
}, /*#__PURE__*/_react.default.createElement(_CustomRadio.default.Group, {
|
|
108
|
-
onChange: hideOrShowFraudReasons
|
|
105
|
+
onChange: hideOrShowFraudReasons,
|
|
106
|
+
value: isFraud
|
|
109
107
|
}, /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
|
|
110
108
|
value: 1,
|
|
111
109
|
label: "Yes"
|
|
112
110
|
}), /*#__PURE__*/_react.default.createElement(_CustomRadio.default, {
|
|
113
111
|
value: 0,
|
|
114
112
|
label: "No"
|
|
115
|
-
})))), isFraud && /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
113
|
+
})))), isFraud === 1 && /*#__PURE__*/_react.default.createElement(_antd.Form.Item, {
|
|
116
114
|
name: "serviceFraudCaseReason",
|
|
117
115
|
rules: [{
|
|
118
116
|
required: true,
|
|
119
|
-
message: '
|
|
117
|
+
message: 'Please select atleast one reason.',
|
|
120
118
|
type: 'array'
|
|
121
119
|
}],
|
|
122
120
|
id: "serviceFraudCaseReason",
|
|
@@ -141,7 +139,7 @@ function CloseClaim(_ref) {
|
|
|
141
139
|
name: "remarks",
|
|
142
140
|
rules: [{
|
|
143
141
|
required: true,
|
|
144
|
-
message: '
|
|
142
|
+
message: 'Please enter remarks.'
|
|
145
143
|
}],
|
|
146
144
|
initialValue: "",
|
|
147
145
|
id: "remarks"
|