oa-componentbook 0.18.375 → 0.18.377
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 +4 -2
- package/build/components/oa-component-modal/CustomModal.js +4 -1
- package/build/components/oa-component-table/CustomTableV1.js +4 -1
- package/build/components/oa-component-upload/CustomUpload.js +13 -6
- package/build/components/oa-component-viewer/CustomViewer.js +14 -10
- package/build/dev/oa-component-upload/CustomUpload.js +113 -29
- package/build/dev/oa-component-upload/styles.js +2 -2
- package/build/layout/GenricLayOut/GenricLayOut.js +77 -37
- package/build/layout/GenricLayOut/reducer/layoutReducer.js +5 -1
- package/build/widgets/oa-widget-user-management/UserManagementWidget.js +13 -11
- package/package.json +1 -1
|
@@ -92,7 +92,8 @@ function Accordion(_ref2) {
|
|
|
92
92
|
componentConfig,
|
|
93
93
|
subtext,
|
|
94
94
|
customBody,
|
|
95
|
-
onActionClick
|
|
95
|
+
onActionClick,
|
|
96
|
+
collapsibleActiveKey
|
|
96
97
|
} = _ref2;
|
|
97
98
|
const themeConfig = {
|
|
98
99
|
components: {
|
|
@@ -108,7 +109,8 @@ function Accordion(_ref2) {
|
|
|
108
109
|
expandIcon: CollapseIcon,
|
|
109
110
|
expandIconPosition: "end",
|
|
110
111
|
defaultActiveKey: disabled ? "-1" : defaultActiveKey,
|
|
111
|
-
onChange: onChange
|
|
112
|
+
onChange: onChange,
|
|
113
|
+
activeKey: collapsibleActiveKey
|
|
112
114
|
}, /*#__PURE__*/_react.default.createElement(_antd.Collapse.Panel, {
|
|
113
115
|
"data-test": dataTest ? "".concat(dataTest, "--complete") : undefined,
|
|
114
116
|
collapsible: disabled ? "disabled" : undefined,
|
|
@@ -105,7 +105,10 @@ function CustomModal(_ref) {
|
|
|
105
105
|
open: open,
|
|
106
106
|
title: (title || imgSrc) && /*#__PURE__*/_react.default.createElement(_styles.TitleContainer, null, imgSrc && /*#__PURE__*/_react.default.createElement("img", {
|
|
107
107
|
src: imgSrc,
|
|
108
|
-
alt: ""
|
|
108
|
+
alt: "",
|
|
109
|
+
onError: e => {
|
|
110
|
+
e.target.style.display = "none";
|
|
111
|
+
}
|
|
109
112
|
}), /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
110
113
|
typography: typographies.title
|
|
111
114
|
}, title)),
|
|
@@ -245,12 +245,14 @@ function CustomTableV1(_ref2) {
|
|
|
245
245
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
246
246
|
key: idx
|
|
247
247
|
}, (option === null || option === void 0 ? void 0 : option.type) === "button" ? /*#__PURE__*/_react.default.createElement(_CustomButton.default, {
|
|
248
|
+
style: _objectSpread({}, typeof getByPath(record, option === null || option === void 0 ? void 0 : option.key) === "object" ? getByPath(record, option === null || option === void 0 ? void 0 : option.key) : {}),
|
|
249
|
+
disabled: (record === null || record === void 0 ? void 0 : record[option === null || option === void 0 ? void 0 : option.disabled]) || false,
|
|
248
250
|
type: (option === null || option === void 0 ? void 0 : option.subType) || "primary",
|
|
249
251
|
label: (option === null || option === void 0 ? void 0 : option.label) || (record === null || record === void 0 ? void 0 : record[option === null || option === void 0 ? void 0 : option.key]) || "",
|
|
250
252
|
onClick: () => customTableChange(record, config)
|
|
251
253
|
}) : (option === null || option === void 0 ? void 0 : option.type) === "tag" ? /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
|
|
252
254
|
label: getByPath(record, option === null || option === void 0 ? void 0 : option.key) || "",
|
|
253
|
-
type: (option === null || option === void 0 ? void 0 : option.tagType) || "primary",
|
|
255
|
+
type: getByPath(record, option === null || option === void 0 ? void 0 : option.tagType) || (option === null || option === void 0 ? void 0 : option.tagType) || "primary",
|
|
254
256
|
visible: true
|
|
255
257
|
}) : /*#__PURE__*/_react.default.createElement(_Typography.default, {
|
|
256
258
|
typography: (option === null || option === void 0 ? void 0 : option.typography) || (col === null || col === void 0 ? void 0 : col.customStyle) && (record === null || record === void 0 || (_record$option$styleK = record[option === null || option === void 0 ? void 0 : option.styleKey]) === null || _record$option$styleK === void 0 ? void 0 : _record$option$styleK.typography) || "type-b2-400",
|
|
@@ -260,6 +262,7 @@ function CustomTableV1(_ref2) {
|
|
|
260
262
|
case "tag":
|
|
261
263
|
const tagType = typeof subType === "function" ? subType(_, record) : subType;
|
|
262
264
|
const tagLabel = label || _;
|
|
265
|
+
console.log("tagLabel", tagLabel);
|
|
263
266
|
return tagLabel ? /*#__PURE__*/_react.default.createElement(_CustomTag.default, {
|
|
264
267
|
key: index,
|
|
265
268
|
label: tagLabel,
|
|
@@ -28,7 +28,7 @@ var _CustomModal = _interopRequireDefault(require("../oa-component-modal/CustomM
|
|
|
28
28
|
var _handIcon = _interopRequireDefault(require("../../images/hand-icon.svg"));
|
|
29
29
|
var _PdfSampleImage = _interopRequireDefault(require("../../images/PdfSampleImage.png"));
|
|
30
30
|
var _CustomNotification = _interopRequireDefault(require("../../components/oa-component-notification/CustomNotification"));
|
|
31
|
-
const _excluded = ["uploadedDocuments", "onChange", "multipleDoc", "showDelete", "formName", "getPreview", "isMandatory", "noOfUpload", "downloadCallback", "formRules", "allowLocalDelete", "deleteHandler", "s3ResponseReturn", "form", "beforeUploadFileValidations", "allowedMediaType", "maxAllowedSize", "generateS3Url", "uploadOnS3", "label"];
|
|
31
|
+
const _excluded = ["uploadedDocuments", "onChange", "multipleDoc", "showDelete", "formName", "getPreview", "isMandatory", "noOfUpload", "downloadCallback", "formRules", "allowLocalDelete", "deleteHandler", "s3ResponseReturn", "form", "beforeUploadFileValidations", "allowedMediaType", "maxAllowedSize", "generateS3Url", "uploadOnS3", "label", "showPreviewIcon", "showDownloadIcon"];
|
|
32
32
|
/* eslint-disable */
|
|
33
33
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
34
34
|
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); }
|
|
@@ -110,7 +110,9 @@ function DocumentUpload(_ref) {
|
|
|
110
110
|
maxAllowedSize,
|
|
111
111
|
generateS3Url,
|
|
112
112
|
uploadOnS3,
|
|
113
|
-
label
|
|
113
|
+
label,
|
|
114
|
+
showPreviewIcon,
|
|
115
|
+
showDownloadIcon
|
|
114
116
|
} = _ref,
|
|
115
117
|
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
116
118
|
const [previewOpen, setPreviewOpen] = (0, _react.useState)(false);
|
|
@@ -268,8 +270,9 @@ function DocumentUpload(_ref) {
|
|
|
268
270
|
onChange: handleChange,
|
|
269
271
|
onRemove: handleRemove,
|
|
270
272
|
showUploadList: {
|
|
271
|
-
showDownloadIcon:
|
|
273
|
+
showDownloadIcon: showDownloadIcon,
|
|
272
274
|
showRemoveIcon: showDelete,
|
|
275
|
+
showPreviewIcon: showPreviewIcon,
|
|
273
276
|
removeIcon: /*#__PURE__*/_react.default.createElement(_icons.DeleteFilled, null),
|
|
274
277
|
previewIcon: /*#__PURE__*/_react.default.createElement(_icons.EyeFilled, null)
|
|
275
278
|
}
|
|
@@ -279,7 +282,8 @@ function DocumentUpload(_ref) {
|
|
|
279
282
|
title: previewTitle,
|
|
280
283
|
onCancel: () => setPreviewOpen(false),
|
|
281
284
|
downloadCallback: downloadCallback,
|
|
282
|
-
selectedDocumentData: selectedDocumentData
|
|
285
|
+
selectedDocumentData: selectedDocumentData,
|
|
286
|
+
showDownloadIcon: showDownloadIcon
|
|
283
287
|
}), deleteConfirmation && /*#__PURE__*/_react.default.createElement(_CustomModal.default, {
|
|
284
288
|
buttonConfig: [{
|
|
285
289
|
callback: () => DeleteFile(previewImage),
|
|
@@ -311,7 +315,9 @@ DocumentUpload.propTypes = {
|
|
|
311
315
|
formRules: _propTypes.default.array,
|
|
312
316
|
beforeUploadFileValidations: _propTypes.default.bool,
|
|
313
317
|
allowedMediaType: _propTypes.default.array,
|
|
314
|
-
maxAllowedSize: _propTypes.default.string
|
|
318
|
+
maxAllowedSize: _propTypes.default.string,
|
|
319
|
+
showPreviewIcon: _propTypes.default.bool,
|
|
320
|
+
showDownloadIcon: _propTypes.default.bool
|
|
315
321
|
};
|
|
316
322
|
DocumentUpload.defaultProps = {
|
|
317
323
|
uploadedDocuments: [],
|
|
@@ -327,6 +333,7 @@ DocumentUpload.defaultProps = {
|
|
|
327
333
|
allowLocalDelete: true,
|
|
328
334
|
beforeUploadFileValidations: false,
|
|
329
335
|
allowedMediaType: [],
|
|
330
|
-
maxAllowedSize: ""
|
|
336
|
+
maxAllowedSize: "",
|
|
337
|
+
showPreviewIcon: true
|
|
331
338
|
};
|
|
332
339
|
var _default = exports.default = DocumentUpload;
|
|
@@ -26,7 +26,7 @@ var _common = _interopRequireDefault(require("../../utils/common"));
|
|
|
26
26
|
var _styles = require("./styles");
|
|
27
27
|
var _MaterialIcon = _interopRequireDefault(require("../oa-component-icons/MaterialIcon"));
|
|
28
28
|
var _Typography = _interopRequireDefault(require("../oa-component-typography/Typography"));
|
|
29
|
-
const _excluded = ["downloadCallback", "title", "selectedDocumentData", "previewFile", "fileName"],
|
|
29
|
+
const _excluded = ["downloadCallback", "title", "selectedDocumentData", "previewFile", "fileName", "showDownloadIcon"],
|
|
30
30
|
_excluded2 = ["zoomIn", "zoomOut"];
|
|
31
31
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
32
32
|
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); }
|
|
@@ -181,7 +181,8 @@ function CustomViewer(_ref2) {
|
|
|
181
181
|
title,
|
|
182
182
|
selectedDocumentData,
|
|
183
183
|
previewFile,
|
|
184
|
-
fileName = 'download'
|
|
184
|
+
fileName = 'download',
|
|
185
|
+
showDownloadIcon = true
|
|
185
186
|
} = _ref2,
|
|
186
187
|
antDesignProps = _objectWithoutProperties(_ref2, _excluded);
|
|
187
188
|
console.log(downloadCallback, title, selectedDocumentData, previewFile, fileName, antDesignProps, 'antDesignProps');
|
|
@@ -226,15 +227,16 @@ function CustomViewer(_ref2) {
|
|
|
226
227
|
return 'UNSUPPORTED';
|
|
227
228
|
}, [previewFile, title]);
|
|
228
229
|
console.log(getUrl, 'getUrl');
|
|
230
|
+
const buttonConfig = showDownloadIcon ? [{
|
|
231
|
+
callback: () => {
|
|
232
|
+
downloadCallback(selectedDocumentData);
|
|
233
|
+
},
|
|
234
|
+
label: 'Download'
|
|
235
|
+
}] : [];
|
|
229
236
|
return /*#__PURE__*/_react.default.createElement(_CustomModal.default, _extends({
|
|
230
237
|
width: 860,
|
|
231
238
|
className: "imageZoom",
|
|
232
|
-
buttonConfig:
|
|
233
|
-
callback: () => {
|
|
234
|
-
downloadCallback(selectedDocumentData);
|
|
235
|
-
},
|
|
236
|
-
label: 'Download'
|
|
237
|
-
}]
|
|
239
|
+
buttonConfig: buttonConfig
|
|
238
240
|
}, antDesignProps), /*#__PURE__*/_react.default.createElement(_reactZoomPanPinch.TransformWrapper, null, _ref4 => {
|
|
239
241
|
let {
|
|
240
242
|
zoomIn,
|
|
@@ -262,12 +264,14 @@ CustomViewer.propTypes = {
|
|
|
262
264
|
fileName: _propTypes.default.string,
|
|
263
265
|
antDesignProps: _propTypes.default.object,
|
|
264
266
|
downloadCallback: _propTypes.default.func,
|
|
265
|
-
selectedDocumentData: _propTypes.default.object
|
|
267
|
+
selectedDocumentData: _propTypes.default.object,
|
|
268
|
+
showDownloadIcon: _propTypes.default.bool
|
|
266
269
|
};
|
|
267
270
|
CustomViewer.defaultProps = {
|
|
268
271
|
fileName: 'download',
|
|
269
272
|
antDesignProps: {},
|
|
270
273
|
downloadCallback: () => {},
|
|
271
|
-
selectedDocumentData: {}
|
|
274
|
+
selectedDocumentData: {},
|
|
275
|
+
showDownloadIcon: true
|
|
272
276
|
};
|
|
273
277
|
var _default = exports.default = CustomViewer;
|
|
@@ -18,7 +18,10 @@ var _ColorVariablesMap = _interopRequireDefault(require("../../global-css/ColorV
|
|
|
18
18
|
var _handIcon = _interopRequireDefault(require("../../images/hand-icon.svg"));
|
|
19
19
|
var _PdfSampleImage = _interopRequireDefault(require("../../images/PdfSampleImage.png"));
|
|
20
20
|
var _styles = require("./styles");
|
|
21
|
-
const _excluded = ["uploadedDocuments", "handleCustomOnChange", "multipleDoc", "showDelete", "formName", "getPreview", "isMandatory", "noOfUpload", "downloadCallback", "showDownloadButton", "showDeleteButton", "deleteHandler", "showRoateButton", "showZoomInButton", "showZoomOutButton"];
|
|
21
|
+
const _excluded = ["uploadedDocuments", "handleCustomOnChange", "multipleDoc", "showDelete", "formName", "getPreview", "isMandatory", "noOfUpload", "downloadCallback", "showDownloadButton", "showDeleteButton", "deleteHandler", "showRoateButton", "showZoomInButton", "showZoomOutButton", "uploadButtonConfig", "notShowPreviewButton", "removeHandler", "listType", "deleteModalConfig"];
|
|
22
|
+
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
|
|
23
|
+
/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
|
|
24
|
+
/* eslint-disable */
|
|
22
25
|
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); }
|
|
23
26
|
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; }
|
|
24
27
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -94,7 +97,12 @@ function DocumentUpload(_ref) {
|
|
|
94
97
|
deleteHandler,
|
|
95
98
|
showRoateButton,
|
|
96
99
|
showZoomInButton,
|
|
97
|
-
showZoomOutButton
|
|
100
|
+
showZoomOutButton,
|
|
101
|
+
uploadButtonConfig,
|
|
102
|
+
notShowPreviewButton,
|
|
103
|
+
removeHandler = () => {},
|
|
104
|
+
listType,
|
|
105
|
+
deleteModalConfig
|
|
98
106
|
} = _ref,
|
|
99
107
|
antDesignProps = _objectWithoutProperties(_ref, _excluded);
|
|
100
108
|
const [previewOpen, setPreviewOpen] = (0, _react.useState)(false);
|
|
@@ -105,10 +113,16 @@ function DocumentUpload(_ref) {
|
|
|
105
113
|
const [deleteConfirmation, setDeleteConfirmation] = (0, _react.useState)(false);
|
|
106
114
|
const [selectedFile, setSelectedFile] = (0, _react.useState)(null);
|
|
107
115
|
const [selectedDocumentData, setSelectedDocumentData] = (0, _react.useState)({});
|
|
116
|
+
const [isError, setIsError] = (0, _react.useState)(false);
|
|
117
|
+
const uploadRef = _react.default.useRef(null);
|
|
108
118
|
(0, _react.useEffect)(() => {
|
|
109
119
|
setFileList(uploadedDocuments);
|
|
110
120
|
}, [uploadedDocuments === null || uploadedDocuments === void 0 ? void 0 : uploadedDocuments.length]);
|
|
111
121
|
const handlePreview = async file => {
|
|
122
|
+
// Don't show preview if notShowPreviewButton is true
|
|
123
|
+
if (notShowPreviewButton) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
112
126
|
if (file !== null && file !== void 0 && file.originFileObj) {
|
|
113
127
|
setPreviewImage(file);
|
|
114
128
|
} else if ((file === null || file === void 0 ? void 0 : file.fileType) === 'thumbnail') {
|
|
@@ -126,6 +140,22 @@ function DocumentUpload(_ref) {
|
|
|
126
140
|
fileList: newFileList,
|
|
127
141
|
file
|
|
128
142
|
} = _ref2;
|
|
143
|
+
if (antDesignProps !== null && antDesignProps !== void 0 && antDesignProps.customRequest) {
|
|
144
|
+
const isError = newFileList.some(f => (f === null || f === void 0 ? void 0 : f.status) === 'error');
|
|
145
|
+
if (isError) {
|
|
146
|
+
setFileList([]);
|
|
147
|
+
setIsError(true);
|
|
148
|
+
setLoading(false);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
setIsError(false);
|
|
152
|
+
setFileList(newFileList);
|
|
153
|
+
const isUploading = newFileList.some(f => f.status === 'uploading');
|
|
154
|
+
setLoading(isUploading);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Default behavior for non-custom uploads
|
|
129
159
|
const modifiedList = await Promise.all(newFileList.map(async files => {
|
|
130
160
|
let modifiedFile = files;
|
|
131
161
|
setLoading(true);
|
|
@@ -135,7 +165,6 @@ function DocumentUpload(_ref) {
|
|
|
135
165
|
modifiedFile.status = 'done';
|
|
136
166
|
if (!isImageFile(file === null || file === void 0 ? void 0 : file.name)) {
|
|
137
167
|
modifiedFile.url = _PdfSampleImage.default;
|
|
138
|
-
// delete modifiedFile?.type;
|
|
139
168
|
}
|
|
140
169
|
}
|
|
141
170
|
} catch (error) {
|
|
@@ -147,38 +176,83 @@ function DocumentUpload(_ref) {
|
|
|
147
176
|
const tempList = modifiedList === null || modifiedList === void 0 ? void 0 : modifiedList.filter(Boolean);
|
|
148
177
|
setFileList(tempList);
|
|
149
178
|
};
|
|
179
|
+
const getUploadButtonIcon = () => {
|
|
180
|
+
if ((uploadButtonConfig === null || uploadButtonConfig === void 0 ? void 0 : uploadButtonConfig.icon) === 'PlusOutlined') {
|
|
181
|
+
return /*#__PURE__*/_react.default.createElement(_icons.PlusOutlined, null);
|
|
182
|
+
}
|
|
183
|
+
return /*#__PURE__*/_react.default.createElement(_icons.UploadOutlined, null);
|
|
184
|
+
};
|
|
150
185
|
const uploadButton = /*#__PURE__*/_react.default.createElement("button", {
|
|
151
186
|
style: {
|
|
152
187
|
border: 0,
|
|
153
188
|
background: 'none'
|
|
154
189
|
},
|
|
155
190
|
type: "button"
|
|
156
|
-
}, loading ? /*#__PURE__*/_react.default.createElement(_icons.LoadingOutlined, null) :
|
|
157
|
-
/*#__PURE__*/
|
|
158
|
-
// <CustomIcon
|
|
159
|
-
// className="UploadImg"
|
|
160
|
-
// alt="phone img"
|
|
161
|
-
// src={offerImg}
|
|
162
|
-
// />
|
|
163
|
-
_react.default.createElement(_icons.UploadOutlined, null), /*#__PURE__*/_react.default.createElement("div", null, "Upload"));
|
|
191
|
+
}, loading ? /*#__PURE__*/_react.default.createElement(_icons.LoadingOutlined, null) : getUploadButtonIcon(), /*#__PURE__*/_react.default.createElement("div", null, uploadButtonConfig !== null && uploadButtonConfig !== void 0 && uploadButtonConfig.text ? uploadButtonConfig === null || uploadButtonConfig === void 0 ? void 0 : uploadButtonConfig.text : 'Upload'));
|
|
164
192
|
const DeleteFile = async () => {
|
|
165
|
-
await deleteHandler(selectedFile
|
|
193
|
+
await deleteHandler(selectedFile, isEmptyFileList => {
|
|
194
|
+
if (isEmptyFileList) {
|
|
195
|
+
setFileList([]);
|
|
196
|
+
}
|
|
197
|
+
});
|
|
166
198
|
setDeleteConfirmation(false);
|
|
167
199
|
if (showDeleteButton) {
|
|
168
200
|
setPreviewOpen(false);
|
|
169
201
|
}
|
|
170
202
|
};
|
|
171
203
|
const handleRemove = file => new Promise((resolve, reject) => {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
204
|
+
// If file is uploading, cancel immediately without confirmation
|
|
205
|
+
if ((file === null || file === void 0 ? void 0 : file.status) === 'uploading') {
|
|
206
|
+
// Remove file from list immediately to cancel upload
|
|
207
|
+
const newFileList = fileList.filter(f => f.uid !== file.uid);
|
|
208
|
+
setFileList(newFileList);
|
|
209
|
+
resolve(true); // Allow removal
|
|
210
|
+
if (removeHandler) removeHandler(file);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// If file is done or error, show confirmation modal
|
|
215
|
+
if ((file === null || file === void 0 ? void 0 : file.status) === 'done' || (file === null || file === void 0 ? void 0 : file.status) === 'error') {
|
|
216
|
+
setSelectedFile(file);
|
|
217
|
+
setDeleteConfirmation(true);
|
|
218
|
+
resolve(false); // Prevent removal until confirmed
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Default: allow removal
|
|
223
|
+
resolve(true);
|
|
175
224
|
});
|
|
176
225
|
const handleModalDeleteButton = file => {
|
|
177
226
|
setSelectedFile(file);
|
|
178
227
|
setDeleteConfirmation(true);
|
|
179
228
|
};
|
|
229
|
+
|
|
230
|
+
// Get the appropriate remove icon based on file status
|
|
231
|
+
const getRemoveIcon = file => {
|
|
232
|
+
// Show cross icon during upload (to cancel)
|
|
233
|
+
if ((file === null || file === void 0 ? void 0 : file.status) === 'uploading') {
|
|
234
|
+
return /*#__PURE__*/_react.default.createElement(_icons.CloseOutlined, null);
|
|
235
|
+
}
|
|
236
|
+
// Show delete icon after upload is done or if upload failed
|
|
237
|
+
if ((file === null || file === void 0 ? void 0 : file.status) === 'done' || (file === null || file === void 0 ? void 0 : file.status) === 'error') {
|
|
238
|
+
return /*#__PURE__*/_react.default.createElement(_icons.DeleteOutlined, null);
|
|
239
|
+
}
|
|
240
|
+
// Default to delete icon
|
|
241
|
+
return /*#__PURE__*/_react.default.createElement(_icons.DeleteOutlined, null);
|
|
242
|
+
};
|
|
180
243
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.MainStyleSec, null, /*#__PURE__*/_react.default.createElement(_styles.StyledSection, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
181
|
-
|
|
244
|
+
onClick: listType === 'picture' ? () => {
|
|
245
|
+
var _inst$upload, _inst$nativeElement, _inst$nativeElement$q, _inst$querySelector, _input$click;
|
|
246
|
+
if ((fileList === null || fileList === void 0 ? void 0 : fileList.length) >= noOfUpload) return;
|
|
247
|
+
const inst = uploadRef.current;
|
|
248
|
+
if (inst !== null && inst !== void 0 && inst.onClick) {
|
|
249
|
+
inst.onClick();
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const input = (inst === null || inst === void 0 || (_inst$upload = inst.upload) === null || _inst$upload === void 0 ? void 0 : _inst$upload.input) || (inst === null || inst === void 0 ? void 0 : inst.fileInput) || (inst === null || inst === void 0 || (_inst$nativeElement = inst.nativeElement) === null || _inst$nativeElement === void 0 || (_inst$nativeElement$q = _inst$nativeElement.querySelector) === null || _inst$nativeElement$q === void 0 ? void 0 : _inst$nativeElement$q.call(_inst$nativeElement, 'input[type="file"]')) || (inst === null || inst === void 0 || (_inst$querySelector = inst.querySelector) === null || _inst$querySelector === void 0 ? void 0 : _inst$querySelector.call(inst, 'input[type="file"]'));
|
|
253
|
+
input === null || input === void 0 || (_input$click = input.click) === null || _input$click === void 0 || _input$click.call(input);
|
|
254
|
+
} : null,
|
|
255
|
+
className: listType === 'picture' ? "uploadSecPad ".concat(isError && 'errorBorder') : 'uploadDiv'
|
|
182
256
|
}, multipleDoc > 0 && /*#__PURE__*/_react.default.createElement("em", null, multipleDoc), /*#__PURE__*/_react.default.createElement(_antd.ConfigProvider, {
|
|
183
257
|
theme: {
|
|
184
258
|
token: {
|
|
@@ -205,18 +279,21 @@ function DocumentUpload(_ref) {
|
|
|
205
279
|
}
|
|
206
280
|
}]
|
|
207
281
|
}, /*#__PURE__*/_react.default.createElement(_antd.Upload, _extends({
|
|
208
|
-
|
|
209
|
-
|
|
282
|
+
onClick: e => e.stopPropagation(),
|
|
283
|
+
ref: uploadRef,
|
|
284
|
+
listType: listType || 'picture-card',
|
|
210
285
|
fileList: fileList,
|
|
211
|
-
onPreview: handlePreview,
|
|
286
|
+
onPreview: notShowPreviewButton ? undefined : handlePreview,
|
|
212
287
|
onChange: handleChange,
|
|
213
288
|
onRemove: handleRemove,
|
|
214
289
|
showUploadList: {
|
|
215
290
|
showDownloadIcon: false,
|
|
216
|
-
showRemoveIcon: showDelete,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
291
|
+
showRemoveIcon: showDelete !== undefined ? showDelete : true,
|
|
292
|
+
showPreviewIcon: !notShowPreviewButton,
|
|
293
|
+
removeIcon: file => getRemoveIcon(file),
|
|
294
|
+
previewIcon: notShowPreviewButton ? false : /*#__PURE__*/_react.default.createElement(_icons.EyeFilled, null)
|
|
295
|
+
},
|
|
296
|
+
maxCount: noOfUpload
|
|
220
297
|
}, antDesignProps), (fileList === null || fileList === void 0 ? void 0 : fileList.length) >= noOfUpload ? null : uploadButton)))))), previewOpen && /*#__PURE__*/_react.default.createElement(_CustomViewer.default, {
|
|
221
298
|
open: previewOpen,
|
|
222
299
|
previewFile: previewImage,
|
|
@@ -236,12 +313,14 @@ function DocumentUpload(_ref) {
|
|
|
236
313
|
label: 'Yes, Delete',
|
|
237
314
|
type: 'danger-primary'
|
|
238
315
|
}],
|
|
239
|
-
imgSrc: _handIcon.default,
|
|
316
|
+
imgSrc: deleteModalConfig !== null && deleteModalConfig !== void 0 && deleteModalConfig.deleteImage ? deleteModalConfig.deleteImage : _handIcon.default,
|
|
240
317
|
open: deleteConfirmation,
|
|
241
|
-
onCancel: () =>
|
|
242
|
-
|
|
318
|
+
onCancel: () => {
|
|
319
|
+
setDeleteConfirmation(false);
|
|
320
|
+
},
|
|
321
|
+
title: deleteModalConfig !== null && deleteModalConfig !== void 0 && deleteModalConfig.title ? deleteModalConfig.title : 'Delete Item?',
|
|
243
322
|
className: "delete-modal-confirmation"
|
|
244
|
-
},
|
|
323
|
+
}, deleteModalConfig !== null && deleteModalConfig !== void 0 && deleteModalConfig.body ? deleteModalConfig.body : 'This action will permanently delete the selected item'));
|
|
245
324
|
}
|
|
246
325
|
DocumentUpload.propTypes = {
|
|
247
326
|
uploadedDocuments: _propTypes.default.array,
|
|
@@ -262,7 +341,10 @@ DocumentUpload.propTypes = {
|
|
|
262
341
|
showDeleteButton: _propTypes.default.bool,
|
|
263
342
|
showRoateButton: _propTypes.default.bool,
|
|
264
343
|
showZoomInButton: _propTypes.default.bool,
|
|
265
|
-
showZoomOutButton: _propTypes.default.bool
|
|
344
|
+
showZoomOutButton: _propTypes.default.bool,
|
|
345
|
+
uploadButtonConfig: _propTypes.default.object,
|
|
346
|
+
// Config for upload button text
|
|
347
|
+
notShowPreviewButton: _propTypes.default.bool // Hide preview button
|
|
266
348
|
};
|
|
267
349
|
DocumentUpload.defaultProps = {
|
|
268
350
|
uploadedDocuments: [],
|
|
@@ -280,6 +362,8 @@ DocumentUpload.defaultProps = {
|
|
|
280
362
|
showDownloadButton: true,
|
|
281
363
|
showRoateButton: true,
|
|
282
364
|
showZoomInButton: true,
|
|
283
|
-
showZoomOutButton: true
|
|
365
|
+
showZoomOutButton: true,
|
|
366
|
+
uploadButtonConfig: null,
|
|
367
|
+
notShowPreviewButton: false
|
|
284
368
|
};
|
|
285
369
|
var _default = exports.default = DocumentUpload;
|
|
@@ -9,5 +9,5 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
9
9
|
var _templateObject, _templateObject2;
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
12
|
-
const MainStyleSec = exports.MainStyleSec = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n.ant-upload-list{\n
|
|
13
|
-
const StyledSection = exports.StyledSection = _styledComponents.default.section(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: flex;\n gap: 16px;\n justify-content: space-between;\n h2{\n margin: 0;\n }\n \n @media only screen and (max-width: 600px) {\n
|
|
12
|
+
const MainStyleSec = exports.MainStyleSec = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .ant-upload-list {\n display: flex !important;\n gap: 16px !important;\n flex-wrap: wrap !important;\n }\n .ant-upload-wrapper .ant-upload-list::before {\n display: none;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload.ant-upload-select,\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload-list.ant-upload-list-picture-card\n .ant-upload-list-item-container {\n width: 96px;\n height: 96px;\n margin-block: 0;\n margin-inline: 0;\n }\n .ant-upload-select button > span.UploadImg {\n width: 24px !important;\n height: 24px;\n }\n .ant-upload-select button > span.UploadImg > img {\n width: 100% !important;\n }\n .ant-upload-list-item-container:last-child {\n margin: 0 !important;\n }\n .ant-form-item {\n margin-bottom: 0;\n }\n .ant-upload button {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 4px;\n }\n\n .uploadSecPad div {\n padding: 0 0 8px;\n }\n .anticon-upload {\n font-size: 24px;\n }\n .ant-upload-disabled .button {\n cursor: not-allowed;\n }\n .uploadSecPad {\n width: 100%;\n }\n .uploadSecPad div:last-child {\n padding: 0;\n }\n display: flex;\n flex-direction: column;\n gap: 24px;\n .ant-upload-list-item-done,\n .ant-upload-list-item-A {\n border: 1px solid var(--color-divider) !important;\n }\n\n .ant-upload-list-item-actions {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 16px;\n }\n\n .ant-upload-list-item-actions button {\n background: #212121;\n border-radius: 50px;\n height: 24px !important;\n display: flex;\n align-items: center;\n }\n .ant-btn-text:not(:disabled):not(.ant-btn-disabled):hover {\n background: #212121;\n }\n .ant-upload-list-item-actions a {\n background: #212121;\n border-radius: 50px;\n height: 24px;\n display: flex;\n }\n\n .ant-upload-wrapper\n .ant-upload-list.ant-upload-list-picture-card\n .ant-upload-list-item {\n opacity: 1 !important;\n }\n\n @media only screen and (max-width: 600px) {\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload-list.ant-upload-list-picture-card\n .ant-upload-list-item-container,\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload.ant-upload-select {\n width: 64px;\n height: 64px;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload-list.ant-upload-list-picture-card\n .ant-upload-list-item::before,\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload-list.ant-upload-list-picture-card\n .ant-upload-list-item-actions,\n .ant-upload-wrapper\n .ant-upload-list\n .ant-upload-list-item\n .ant-upload-list-item-actions\n .ant-upload-list-item-action {\n opacity: 1;\n }\n .ant-upload-list-item-actions a {\n height: 16px;\n align-items: center;\n justify-content: center;\n width: 16px !important;\n }\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload-list.ant-upload-list-picture-card\n .ant-upload-list-item-actions\n .anticon-eye,\n .ant-upload-wrapper.ant-upload-picture-card-wrapper\n .ant-upload-list.ant-upload-list-picture-card\n .ant-upload-list-item-actions\n .anticon-delete {\n font-size: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 0px !important;\n padding: 0px !important;\n color: #fff;\n }\n }\n"])));
|
|
13
|
+
const StyledSection = exports.StyledSection = _styledComponents.default.section(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .errorBorder {\n border: 1px dashed #de350b !important;\n }\n\n .uploadSecPad .ant-upload-list-picture {\n padding: 0 !important;\n gap: 0 !important;\n }\n\n .uploadSecPad\n .ant-upload-wrapper\n .ant-upload-list.ant-upload-list-picture\n .ant-upload-list-item\n .ant-upload-list-item-progress {\n bottom: -2px;\n width: calc(100% - 24px);\n margin-top: 0;\n padding-inline-start: 34px;\n }\n\n .uploadSecPad .ant-upload-list-item-thumbnail {\n line-height: normal !important;\n width: 24px !important;\n height: 24px !important;\n padding: 0;\n }\n\n .uploadSecPad .ant-upload-list-item-thumbnail .anticon-file,\n .uploadSecPad .ant-upload-list-item-thumbnail .anticon-loading {\n font-size: 24px !important;\n color: #014fc5 !important;\n }\n\n .uploadSecPad .ant-upload-list-picture .ant-upload-list-item-done {\n border: none !important;\n margin: 0;\n padding: 0;\n height: auto;\n }\n\n .uploadSecPad .ant-upload-list-item-actions button,\n .uploadSecPad .ant-upload-list-item-actions button:hover {\n background: transparent !important;\n }\n\n .uploadSecPad .ant-upload-list-item-actions button .anticon-delete svg {\n color: #de350b;\n font-size: 18px;\n }\n\n .uploadSecPad\n .ant-upload-wrapper\n .ant-upload-list.ant-upload-list-picture\n .ant-upload-list-item-uploading\n .ant-upload-list-item-name {\n color: #014fc5;\n }\n .uploadSecPad {\n width: 100%;\n border-radius: 4px;\n border: 1px dashed #014fc5;\n background: #f6f6f6;\n padding: 24px 16px;\n cursor: pointer;\n }\n\n .uploadSecPad .ant-upload-list-item-container {\n width: 100%;\n }\n\n .uploadSecPad button {\n display: flex;\n flex-direction: row;\n gap: 8px;\n padding: 0;\n margin: 0;\n color: #014fc5;\n cursor: pointer;\n }\n .uploadSecPad .ant-form-item-control-input {\n min-height: auto;\n }\n .uploadSecPad .ant-upload-select {\n padding: 0px;\n }\n display: flex;\n gap: 16px;\n justify-content: space-between;\n h2 {\n margin: 0;\n }\n\n .uploadSecPad\n .ant-upload-wrapper\n .ant-upload-list.ant-upload-list-picture\n .ant-upload-list-item {\n height: auto;\n padding: 0;\n border: none;\n border-radius: 0;\n border-style: none !important;\n margin: 0;\n }\n\n @media only screen and (max-width: 600px) {\n .ant-upload-list-item-actions button {\n height: 16px !important;\n width: 16px !important;\n justify-content: center;\n }\n .ant-upload-list-item-actions a {\n height: 16px;\n width: 16px !important;\n align-items: center;\n justify-content: center;\n }\n .ant-upload-list-item-actions {\n gap: 8px;\n }\n .ant-upload button span + div {\n display: none;\n }\n }\n"])));
|
|
@@ -53,7 +53,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
53
53
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
54
54
|
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); } /* eslint-disable */
|
|
55
55
|
function GenricLayOut(_ref) {
|
|
56
|
-
var _state$
|
|
56
|
+
var _state$misc30, _sidebar$mobileMenuIt, _imageViewer$content, _imageViewer$content2, _leftHeaderFirstButto, _leftHeaderFirstButto2, _infoPanel$data, _infoPanel$data2, _infoPanel$data3, _infoPanel$data4, _infoPanel$data5, _state$customDrawer3, _state$customDrawer4, _tabs$list, _tables$columns3, _tables$columns4, _tabs$active3, _state$tables5, _tables$selectionType, _tabs$active4, _tables$selectionType2, _tables$pagination17, _drawer$data, _tabs$active5, _drawer$data$drawer$a, _drawer$data2, _tabs$active6, _tabs$active7, _nestedDrawer$data, _nestedDrawer$data$ca, _nestedDrawer$data2, _customDrawer$data, _customDrawer$data2, _contentPanel$dataSou, _tables$tableFooter, _tables$selectedRowKe, _tables$tableFooter2, _tables$tableFooter3, _tables$tableFooter5;
|
|
57
57
|
let {
|
|
58
58
|
config,
|
|
59
59
|
getInitialData,
|
|
@@ -81,7 +81,9 @@ function GenricLayOut(_ref) {
|
|
|
81
81
|
handleCollapsibleKeyData,
|
|
82
82
|
handleProfileReroute,
|
|
83
83
|
handleTableFooterApi,
|
|
84
|
-
handleSwitchSelectItem
|
|
84
|
+
handleSwitchSelectItem,
|
|
85
|
+
handleTableColumnClickParent,
|
|
86
|
+
handleLeftHeaderFirstButton
|
|
85
87
|
} = {}
|
|
86
88
|
} = _ref;
|
|
87
89
|
const [state, dispatch] = (0, _react.useReducer)(_layoutReducer.genericLayoutReducer, config !== null && config !== void 0 ? config : _layoutReducer.initialState);
|
|
@@ -835,7 +837,11 @@ function GenricLayOut(_ref) {
|
|
|
835
837
|
if (error) {
|
|
836
838
|
showErrorNotification(error);
|
|
837
839
|
} else {
|
|
838
|
-
if ((
|
|
840
|
+
if ((data === null || data === void 0 ? void 0 : data.call) === "parent") {
|
|
841
|
+
handleTableColumnClickParent({
|
|
842
|
+
record
|
|
843
|
+
});
|
|
844
|
+
} else if ((configArgs === null || configArgs === void 0 ? void 0 : configArgs.type) === "openNestedDrawer") {
|
|
839
845
|
var _config$nestedDrawer;
|
|
840
846
|
const record = config === null || config === void 0 || (_config$nestedDrawer = config.nestedDrawer) === null || _config$nestedDrawer === void 0 || (_config$nestedDrawer = _config$nestedDrawer.data) === null || _config$nestedDrawer === void 0 ? void 0 : _config$nestedDrawer.cancelOrder;
|
|
841
847
|
const dynamicConfig = (0, _staticConfigResolver.default)(record, data !== null && data !== void 0 ? data : {});
|
|
@@ -952,6 +958,26 @@ function GenricLayOut(_ref) {
|
|
|
952
958
|
});
|
|
953
959
|
}
|
|
954
960
|
}
|
|
961
|
+
} else if ((configArgs === null || configArgs === void 0 ? void 0 : configArgs.action) === "CHANGE_ROW") {
|
|
962
|
+
if (handleTableColumnClick) {
|
|
963
|
+
var _state$tables2, _state$misc14;
|
|
964
|
+
const {
|
|
965
|
+
error,
|
|
966
|
+
data
|
|
967
|
+
} = await (handleTableColumnClick === null || handleTableColumnClick === void 0 ? void 0 : handleTableColumnClick(_objectSpread({
|
|
968
|
+
tables: (_state$tables2 = state === null || state === void 0 ? void 0 : state.tables) !== null && _state$tables2 !== void 0 ? _state$tables2 : {},
|
|
969
|
+
record: record,
|
|
970
|
+
type: configArgs === null || configArgs === void 0 ? void 0 : configArgs.call
|
|
971
|
+
}, (_state$misc14 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc14 !== void 0 ? _state$misc14 : {})));
|
|
972
|
+
if (error) {
|
|
973
|
+
showErrorNotification(error);
|
|
974
|
+
} else {
|
|
975
|
+
dispatch({
|
|
976
|
+
type: _layoutReducer.actionTypes.CHANGE_ROW,
|
|
977
|
+
payload: data
|
|
978
|
+
});
|
|
979
|
+
}
|
|
980
|
+
}
|
|
955
981
|
}
|
|
956
982
|
};
|
|
957
983
|
|
|
@@ -1017,11 +1043,11 @@ function GenricLayOut(_ref) {
|
|
|
1017
1043
|
}
|
|
1018
1044
|
} else if ((configData === null || configData === void 0 ? void 0 : configData.action) === "ACTION_ON_CTA") {
|
|
1019
1045
|
if (handleTableFooterApi) {
|
|
1020
|
-
var _state$
|
|
1046
|
+
var _state$tables3;
|
|
1021
1047
|
const {
|
|
1022
1048
|
error,
|
|
1023
1049
|
data
|
|
1024
|
-
} = await (handleTableFooterApi === null || handleTableFooterApi === void 0 ? void 0 : handleTableFooterApi(state === null || state === void 0 || (_state$
|
|
1050
|
+
} = await (handleTableFooterApi === null || handleTableFooterApi === void 0 ? void 0 : handleTableFooterApi(state === null || state === void 0 || (_state$tables3 = state.tables) === null || _state$tables3 === void 0 ? void 0 : _state$tables3.selectedRowKeys, state));
|
|
1025
1051
|
if (error) {
|
|
1026
1052
|
showErrorNotification(error);
|
|
1027
1053
|
} else {
|
|
@@ -1119,7 +1145,7 @@ function GenricLayOut(_ref) {
|
|
|
1119
1145
|
}
|
|
1120
1146
|
});
|
|
1121
1147
|
if (handleTableChange) {
|
|
1122
|
-
var _state$dropdownSearch3, _state$inputSearch4, _state$tabs8, _header$subHeading15, _header$subHeading16, _staticFilter$data6, _customDrawer$applied8, _state$
|
|
1148
|
+
var _state$dropdownSearch3, _state$inputSearch4, _state$tabs8, _header$subHeading15, _header$subHeading16, _staticFilter$data6, _customDrawer$applied8, _state$misc15, _state$staticFilter$m5, _state$staticFilter5;
|
|
1123
1149
|
dispatch({
|
|
1124
1150
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
1125
1151
|
payload: true
|
|
@@ -1144,7 +1170,7 @@ function GenricLayOut(_ref) {
|
|
|
1144
1170
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1145
1171
|
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied8 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied8 !== void 0 ? _customDrawer$applied8 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), {}, {
|
|
1146
1172
|
order: (sorter === null || sorter === void 0 ? void 0 : sorter.order) === "ascend" && "ASC" || (sorter === null || sorter === void 0 ? void 0 : sorter.order) === "descend" && "DESC" || ""
|
|
1147
|
-
}, (_state$
|
|
1173
|
+
}, (_state$misc15 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc15 !== void 0 ? _state$misc15 : {}), {}, {
|
|
1148
1174
|
multiSelectValue: (_state$staticFilter$m5 = state === null || state === void 0 || (_state$staticFilter5 = state.staticFilter) === null || _state$staticFilter5 === void 0 ? void 0 : _state$staticFilter5.multiSelectValue) !== null && _state$staticFilter$m5 !== void 0 ? _state$staticFilter$m5 : []
|
|
1149
1175
|
}));
|
|
1150
1176
|
if (error) {
|
|
@@ -1227,7 +1253,7 @@ function GenricLayOut(_ref) {
|
|
|
1227
1253
|
});
|
|
1228
1254
|
const selectedStaticFilterValue = tables !== null && tables !== void 0 && tables.staticFilterKey && (tables === null || tables === void 0 ? void 0 : tables.staticFilterKey) == key && Array.isArray(staticFilter.data) ? (_staticFilter$data$fi2 = staticFilter.data.find(item => item.selected)) === null || _staticFilter$data$fi2 === void 0 ? void 0 : _staticFilter$data$fi2.value : undefined;
|
|
1229
1255
|
if (handleTabClick) {
|
|
1230
|
-
var _state$
|
|
1256
|
+
var _state$misc16, _tables$pagination, _tables$pagination2, _tables$sorting13, _tables$sorting14, _state$dropdownSearch4, _header$subHeading17, _header$subHeading18, _customDrawer$applied9, _state$misc17, _state$staticFilter$m6, _state$staticFilter6;
|
|
1231
1257
|
dispatch({
|
|
1232
1258
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
1233
1259
|
payload: true
|
|
@@ -1235,7 +1261,7 @@ function GenricLayOut(_ref) {
|
|
|
1235
1261
|
const {
|
|
1236
1262
|
error,
|
|
1237
1263
|
data
|
|
1238
|
-
} = await handleTabClick(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (_state$
|
|
1264
|
+
} = await handleTabClick(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, (_state$misc16 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc16 !== void 0 ? _state$misc16 : {}), {}, {
|
|
1239
1265
|
selectedTab: key,
|
|
1240
1266
|
current: tables === null || tables === void 0 || (_tables$pagination = tables.pagination) === null || _tables$pagination === void 0 ? void 0 : _tables$pagination.current,
|
|
1241
1267
|
pageSize: tables === null || tables === void 0 || (_tables$pagination2 = tables.pagination) === null || _tables$pagination2 === void 0 ? void 0 : _tables$pagination2.pageSize,
|
|
@@ -1249,7 +1275,7 @@ function GenricLayOut(_ref) {
|
|
|
1249
1275
|
selectedOption: state.dropdownSearch.selectedOption
|
|
1250
1276
|
}), (header === null || header === void 0 || (_header$subHeading17 = header.subHeading) === null || _header$subHeading17 === void 0 || (_header$subHeading17 = _header$subHeading17.jsxConfig) === null || _header$subHeading17 === void 0 ? void 0 : _header$subHeading17.type) == "select" ? {
|
|
1251
1277
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading18 = header.subHeading) === null || _header$subHeading18 === void 0 || (_header$subHeading18 = _header$subHeading18.jsxConfig) === null || _header$subHeading18 === void 0 ? void 0 : _header$subHeading18.value
|
|
1252
|
-
} : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied9 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied9 !== void 0 ? _customDrawer$applied9 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$
|
|
1278
|
+
} : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied9 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied9 !== void 0 ? _customDrawer$applied9 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$misc17 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc17 !== void 0 ? _state$misc17 : {}), {}, {
|
|
1253
1279
|
multiSelectValue: (_state$staticFilter$m6 = state === null || state === void 0 || (_state$staticFilter6 = state.staticFilter) === null || _state$staticFilter6 === void 0 ? void 0 : _state$staticFilter6.multiSelectValue) !== null && _state$staticFilter$m6 !== void 0 ? _state$staticFilter$m6 : []
|
|
1254
1280
|
}));
|
|
1255
1281
|
if (error) {
|
|
@@ -1345,11 +1371,11 @@ function GenricLayOut(_ref) {
|
|
|
1345
1371
|
return;
|
|
1346
1372
|
}
|
|
1347
1373
|
if (handleDrawerFormOnFinish) {
|
|
1348
|
-
var _state$
|
|
1374
|
+
var _state$misc18;
|
|
1349
1375
|
const {
|
|
1350
1376
|
error,
|
|
1351
1377
|
data
|
|
1352
|
-
} = await (handleDrawerFormOnFinish === null || handleDrawerFormOnFinish === void 0 ? void 0 : handleDrawerFormOnFinish(_objectSpread(_objectSpread(_objectSpread({}, record), formData), (_state$
|
|
1378
|
+
} = await (handleDrawerFormOnFinish === null || handleDrawerFormOnFinish === void 0 ? void 0 : handleDrawerFormOnFinish(_objectSpread(_objectSpread(_objectSpread({}, record), formData), (_state$misc18 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc18 !== void 0 ? _state$misc18 : {})));
|
|
1353
1379
|
if (error) {
|
|
1354
1380
|
showErrorNotification(error);
|
|
1355
1381
|
} else {
|
|
@@ -1373,7 +1399,7 @@ function GenricLayOut(_ref) {
|
|
|
1373
1399
|
|
|
1374
1400
|
// If there are remaining filters, reapply them
|
|
1375
1401
|
if (Object.keys(currentFilters).length > 0) {
|
|
1376
|
-
var _state$dropdownSearch5, _state$inputSearch5, _state$tabs11, _tables$pagination3, _tables$pagination4, _tables$filter6, _tables$sorting15, _header$subHeading19, _header$subHeading20, _staticFilter$data7, _tables$sorting16, _state$
|
|
1402
|
+
var _state$dropdownSearch5, _state$inputSearch5, _state$tabs11, _tables$pagination3, _tables$pagination4, _tables$filter6, _tables$sorting15, _header$subHeading19, _header$subHeading20, _staticFilter$data7, _tables$sorting16, _state$misc19, _state$staticFilter$m7, _state$staticFilter7;
|
|
1377
1403
|
const {
|
|
1378
1404
|
error,
|
|
1379
1405
|
data
|
|
@@ -1399,7 +1425,7 @@ function GenricLayOut(_ref) {
|
|
|
1399
1425
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1400
1426
|
}), {}, {
|
|
1401
1427
|
order: tables === null || tables === void 0 || (_tables$sorting16 = tables.sorting) === null || _tables$sorting16 === void 0 ? void 0 : _tables$sorting16.sortDirection
|
|
1402
|
-
}, (_state$
|
|
1428
|
+
}, (_state$misc19 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc19 !== void 0 ? _state$misc19 : {}), {}, {
|
|
1403
1429
|
multiSelectValue: (_state$staticFilter$m7 = state === null || state === void 0 || (_state$staticFilter7 = state.staticFilter) === null || _state$staticFilter7 === void 0 ? void 0 : _state$staticFilter7.multiSelectValue) !== null && _state$staticFilter$m7 !== void 0 ? _state$staticFilter$m7 : []
|
|
1404
1430
|
}));
|
|
1405
1431
|
if (error) {
|
|
@@ -1433,7 +1459,7 @@ function GenricLayOut(_ref) {
|
|
|
1433
1459
|
const filterFormOnFinish = async formData => {
|
|
1434
1460
|
// Check if this is a cancel/clear action - check both buttonClickType and the actual button data
|
|
1435
1461
|
if (formData.type === "FILTER-CANCEL") {
|
|
1436
|
-
var _state$dropdownSearch6, _state$inputSearch6, _state$tabs12, _tables$pagination5, _tables$pagination6, _tables$filter7, _tables$sorting17, _header$subHeading21, _header$subHeading22, _staticFilter$data8, _tables$sorting18, _state$
|
|
1462
|
+
var _state$dropdownSearch6, _state$inputSearch6, _state$tabs12, _tables$pagination5, _tables$pagination6, _tables$filter7, _tables$sorting17, _header$subHeading21, _header$subHeading22, _staticFilter$data8, _tables$sorting18, _state$misc20, _state$staticFilter$m8, _state$staticFilter8;
|
|
1437
1463
|
if (isFiltersEmpty(customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)) {
|
|
1438
1464
|
dispatch({
|
|
1439
1465
|
type: _layoutReducer.actionTypes.CUSTOM_DRAWER_CLOSED
|
|
@@ -1462,7 +1488,7 @@ function GenricLayOut(_ref) {
|
|
|
1462
1488
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1463
1489
|
}), {}, {
|
|
1464
1490
|
order: tables === null || tables === void 0 || (_tables$sorting18 = tables.sorting) === null || _tables$sorting18 === void 0 ? void 0 : _tables$sorting18.sortDirection
|
|
1465
|
-
}, (_state$
|
|
1491
|
+
}, (_state$misc20 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc20 !== void 0 ? _state$misc20 : {}), {}, {
|
|
1466
1492
|
multiSelectValue: (_state$staticFilter$m8 = state === null || state === void 0 || (_state$staticFilter8 = state.staticFilter) === null || _state$staticFilter8 === void 0 ? void 0 : _state$staticFilter8.multiSelectValue) !== null && _state$staticFilter$m8 !== void 0 ? _state$staticFilter$m8 : []
|
|
1467
1493
|
}));
|
|
1468
1494
|
if (error) {
|
|
@@ -1512,7 +1538,7 @@ function GenricLayOut(_ref) {
|
|
|
1512
1538
|
|
|
1513
1539
|
// Only process filter data if this is actually a filter drawer
|
|
1514
1540
|
if (formData.type === "FILTER-SUBMIT") {
|
|
1515
|
-
var _state$dropdownSearch7, _state$inputSearch7, _ref4, _appliedFilters$filte, _state$tabs13, _config$tables29, _config$tables30, _tables$filter8, _tables$sorting19, _header$subHeading23, _header$subHeading24, _staticFilter$data9, _tables$sorting20, _state$
|
|
1541
|
+
var _state$dropdownSearch7, _state$inputSearch7, _ref4, _appliedFilters$filte, _state$tabs13, _config$tables29, _config$tables30, _tables$filter8, _tables$sorting19, _header$subHeading23, _header$subHeading24, _staticFilter$data9, _tables$sorting20, _state$misc21, _state$staticFilter$m9, _state$staticFilter9;
|
|
1516
1542
|
const appliedFilters = {};
|
|
1517
1543
|
Object.keys(formData).forEach(key => {
|
|
1518
1544
|
const value = formData[key];
|
|
@@ -1551,7 +1577,7 @@ function GenricLayOut(_ref) {
|
|
|
1551
1577
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1552
1578
|
}), {}, {
|
|
1553
1579
|
order: tables === null || tables === void 0 || (_tables$sorting20 = tables.sorting) === null || _tables$sorting20 === void 0 ? void 0 : _tables$sorting20.sortDirection
|
|
1554
|
-
}, (_state$
|
|
1580
|
+
}, (_state$misc21 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc21 !== void 0 ? _state$misc21 : {}), {}, {
|
|
1555
1581
|
multiSelectValue: (_state$staticFilter$m9 = state === null || state === void 0 || (_state$staticFilter9 = state.staticFilter) === null || _state$staticFilter9 === void 0 ? void 0 : _state$staticFilter9.multiSelectValue) !== null && _state$staticFilter$m9 !== void 0 ? _state$staticFilter$m9 : []
|
|
1556
1582
|
}));
|
|
1557
1583
|
if (error) {
|
|
@@ -1606,7 +1632,7 @@ function GenricLayOut(_ref) {
|
|
|
1606
1632
|
}
|
|
1607
1633
|
});
|
|
1608
1634
|
if (handleSecondaryTableCTAClick) {
|
|
1609
|
-
var _state$dropdownSearch8, _state$inputSearch8, _state$tabs14, _tables$pagination7, _tables$pagination8, _tables$filter9, _tables$sorting21, _tables$sorting22, _header$subHeading25, _header$subHeading26, _staticFilter$data10, _state$
|
|
1635
|
+
var _state$dropdownSearch8, _state$inputSearch8, _state$tabs14, _tables$pagination7, _tables$pagination8, _tables$filter9, _tables$sorting21, _tables$sorting22, _header$subHeading25, _header$subHeading26, _staticFilter$data10, _state$misc22, _state$staticFilter$m10, _state$staticFilter10;
|
|
1610
1636
|
const {
|
|
1611
1637
|
error,
|
|
1612
1638
|
data
|
|
@@ -1631,7 +1657,7 @@ function GenricLayOut(_ref) {
|
|
|
1631
1657
|
toDate: formData === null || formData === void 0 ? void 0 : formData.toDate
|
|
1632
1658
|
}, appliedFilters), (formData === null || formData === void 0 ? void 0 : formData.exportType) && {
|
|
1633
1659
|
exportType: formData === null || formData === void 0 ? void 0 : formData.exportType
|
|
1634
|
-
}), (_state$
|
|
1660
|
+
}), (_state$misc22 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc22 !== void 0 ? _state$misc22 : {}), {}, {
|
|
1635
1661
|
multiSelectValue: (_state$staticFilter$m10 = state === null || state === void 0 || (_state$staticFilter10 = state.staticFilter) === null || _state$staticFilter10 === void 0 ? void 0 : _state$staticFilter10.multiSelectValue) !== null && _state$staticFilter$m10 !== void 0 ? _state$staticFilter$m10 : []
|
|
1636
1662
|
})));
|
|
1637
1663
|
if (error) {
|
|
@@ -1647,7 +1673,7 @@ function GenricLayOut(_ref) {
|
|
|
1647
1673
|
}
|
|
1648
1674
|
};
|
|
1649
1675
|
const onClearAllAppliedFilters = async () => {
|
|
1650
|
-
var _state$dropdownSearch9, _state$inputSearch9, _state$tabs15, _tables$pagination9, _tables$pagination10, _tables$filter10, _tables$sorting23, _header$subHeading27, _header$subHeading28, _staticFilter$data11, _tables$sorting24, _state$
|
|
1676
|
+
var _state$dropdownSearch9, _state$inputSearch9, _state$tabs15, _tables$pagination9, _tables$pagination10, _tables$filter10, _tables$sorting23, _header$subHeading27, _header$subHeading28, _staticFilter$data11, _tables$sorting24, _state$misc23, _state$staticFilter$m11, _state$staticFilter11;
|
|
1651
1677
|
const {
|
|
1652
1678
|
error,
|
|
1653
1679
|
data
|
|
@@ -1670,7 +1696,7 @@ function GenricLayOut(_ref) {
|
|
|
1670
1696
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1671
1697
|
}), {}, {
|
|
1672
1698
|
order: tables === null || tables === void 0 || (_tables$sorting24 = tables.sorting) === null || _tables$sorting24 === void 0 ? void 0 : _tables$sorting24.sortDirection
|
|
1673
|
-
}, (_state$
|
|
1699
|
+
}, (_state$misc23 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc23 !== void 0 ? _state$misc23 : {}), {}, {
|
|
1674
1700
|
multiSelectValue: (_state$staticFilter$m11 = state === null || state === void 0 || (_state$staticFilter11 = state.staticFilter) === null || _state$staticFilter11 === void 0 ? void 0 : _state$staticFilter11.multiSelectValue) !== null && _state$staticFilter$m11 !== void 0 ? _state$staticFilter$m11 : []
|
|
1675
1701
|
}));
|
|
1676
1702
|
if (error) {
|
|
@@ -1729,14 +1755,14 @@ function GenricLayOut(_ref) {
|
|
|
1729
1755
|
return;
|
|
1730
1756
|
} else if (action === "CLOSE_MODAL_AND_FETCH") {
|
|
1731
1757
|
if (handleModalCloseSuccess) {
|
|
1732
|
-
var _stateRef$current, _state$
|
|
1758
|
+
var _stateRef$current, _state$misc24;
|
|
1733
1759
|
const {
|
|
1734
1760
|
error,
|
|
1735
1761
|
data
|
|
1736
1762
|
} = await (handleModalCloseSuccess === null || handleModalCloseSuccess === void 0 ? void 0 : handleModalCloseSuccess(_objectSpread({
|
|
1737
1763
|
modalValue: stateRef === null || stateRef === void 0 || (_stateRef$current = stateRef.current) === null || _stateRef$current === void 0 || (_stateRef$current = _stateRef$current.modal) === null || _stateRef$current === void 0 ? void 0 : _stateRef$current.value,
|
|
1738
1764
|
call: buttonConfig === null || buttonConfig === void 0 ? void 0 : buttonConfig.call
|
|
1739
|
-
}, (_state$
|
|
1765
|
+
}, (_state$misc24 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc24 !== void 0 ? _state$misc24 : {})));
|
|
1740
1766
|
if (error) {
|
|
1741
1767
|
showErrorNotification(error);
|
|
1742
1768
|
} else {
|
|
@@ -1750,11 +1776,11 @@ function GenricLayOut(_ref) {
|
|
|
1750
1776
|
}
|
|
1751
1777
|
} else {
|
|
1752
1778
|
if (handleDrawerFormOnFinish) {
|
|
1753
|
-
var _state$tables$selecte, _state$
|
|
1779
|
+
var _state$tables$selecte, _state$tables4, _state$misc25;
|
|
1754
1780
|
let req = {};
|
|
1755
1781
|
req.type = "APPROVE";
|
|
1756
|
-
req.orderUUID = (_state$tables$selecte = state === null || state === void 0 || (_state$
|
|
1757
|
-
req.misc = (_state$
|
|
1782
|
+
req.orderUUID = (_state$tables$selecte = state === null || state === void 0 || (_state$tables4 = state.tables) === null || _state$tables4 === void 0 || (_state$tables4 = _state$tables4.selectedRowKeys) === null || _state$tables4 === void 0 ? void 0 : _state$tables4.map(item => item.orderUUID)) !== null && _state$tables$selecte !== void 0 ? _state$tables$selecte : [];
|
|
1783
|
+
req.misc = (_state$misc25 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc25 !== void 0 ? _state$misc25 : {};
|
|
1758
1784
|
const {
|
|
1759
1785
|
error,
|
|
1760
1786
|
data
|
|
@@ -1814,6 +1840,20 @@ function GenricLayOut(_ref) {
|
|
|
1814
1840
|
dispatch({
|
|
1815
1841
|
type: _layoutReducer.actionTypes.CUSTOM_DRAWER_OPEN
|
|
1816
1842
|
});
|
|
1843
|
+
} else if ((leftHeaderFirstButton === null || leftHeaderFirstButton === void 0 ? void 0 : leftHeaderFirstButton.action) === "EXPORT_DATA") {
|
|
1844
|
+
handleLeftHeaderFirstButton(state).then(res => {
|
|
1845
|
+
const {
|
|
1846
|
+
error,
|
|
1847
|
+
data
|
|
1848
|
+
} = res;
|
|
1849
|
+
if (error) {
|
|
1850
|
+
showErrorNotification(error);
|
|
1851
|
+
} else {
|
|
1852
|
+
showSuccessNotification((data === null || data === void 0 ? void 0 : data.message) || "Export initiated successfully");
|
|
1853
|
+
}
|
|
1854
|
+
}).catch(err => {
|
|
1855
|
+
showErrorNotification(err.message || "An error occurred during export");
|
|
1856
|
+
});
|
|
1817
1857
|
}
|
|
1818
1858
|
};
|
|
1819
1859
|
|
|
@@ -1854,7 +1894,7 @@ function GenricLayOut(_ref) {
|
|
|
1854
1894
|
};
|
|
1855
1895
|
const rightHeaderSecondButtonClick = async () => {
|
|
1856
1896
|
if ((rightHeaderSecondButton === null || rightHeaderSecondButton === void 0 ? void 0 : rightHeaderSecondButton.action) === "RESET_CUSTOM_DRAWER") {
|
|
1857
|
-
var _state$dropdownSearch10, _state$inputSearch10, _state$tabs16, _tables$pagination11, _tables$pagination12, _tables$filter11, _tables$sorting25, _header$subHeading29, _header$subHeading30, _staticFilter$data12, _tables$sorting26, _state$
|
|
1897
|
+
var _state$dropdownSearch10, _state$inputSearch10, _state$tabs16, _tables$pagination11, _tables$pagination12, _tables$filter11, _tables$sorting25, _header$subHeading29, _header$subHeading30, _staticFilter$data12, _tables$sorting26, _state$misc26, _state$staticFilter$m12, _state$staticFilter12;
|
|
1858
1898
|
const {
|
|
1859
1899
|
error,
|
|
1860
1900
|
data
|
|
@@ -1877,7 +1917,7 @@ function GenricLayOut(_ref) {
|
|
|
1877
1917
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
1878
1918
|
}), {}, {
|
|
1879
1919
|
order: tables === null || tables === void 0 || (_tables$sorting26 = tables.sorting) === null || _tables$sorting26 === void 0 ? void 0 : _tables$sorting26.sortDirection
|
|
1880
|
-
}, (_state$
|
|
1920
|
+
}, (_state$misc26 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc26 !== void 0 ? _state$misc26 : {}), {}, {
|
|
1881
1921
|
multiSelectValue: (_state$staticFilter$m12 = state === null || state === void 0 || (_state$staticFilter12 = state.staticFilter) === null || _state$staticFilter12 === void 0 ? void 0 : _state$staticFilter12.multiSelectValue) !== null && _state$staticFilter$m12 !== void 0 ? _state$staticFilter$m12 : []
|
|
1882
1922
|
}));
|
|
1883
1923
|
if (error) {
|
|
@@ -1930,7 +1970,7 @@ function GenricLayOut(_ref) {
|
|
|
1930
1970
|
};
|
|
1931
1971
|
const handleSubHeadingSelect = async val => {
|
|
1932
1972
|
if (val) {
|
|
1933
|
-
var _state$tabs17, _tables$pagination13, _tables$pagination14, _state$
|
|
1973
|
+
var _state$tabs17, _tables$pagination13, _tables$pagination14, _state$misc27;
|
|
1934
1974
|
dispatch({
|
|
1935
1975
|
type: _layoutReducer.actionTypes.SET_SUBHEADING_SELECTED_CONFIG,
|
|
1936
1976
|
payload: val
|
|
@@ -1944,7 +1984,7 @@ function GenricLayOut(_ref) {
|
|
|
1944
1984
|
current: tables === null || tables === void 0 || (_tables$pagination13 = tables.pagination) === null || _tables$pagination13 === void 0 ? void 0 : _tables$pagination13.current,
|
|
1945
1985
|
pageSize: tables === null || tables === void 0 || (_tables$pagination14 = tables.pagination) === null || _tables$pagination14 === void 0 ? void 0 : _tables$pagination14.pageSize,
|
|
1946
1986
|
subHeadingSelectVal: val
|
|
1947
|
-
}, (_state$
|
|
1987
|
+
}, (_state$misc27 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc27 !== void 0 ? _state$misc27 : {}));
|
|
1948
1988
|
if (error) {
|
|
1949
1989
|
showErrorNotification(error);
|
|
1950
1990
|
dispatch({
|
|
@@ -1980,7 +2020,7 @@ function GenricLayOut(_ref) {
|
|
|
1980
2020
|
|
|
1981
2021
|
// Call the handler if provided
|
|
1982
2022
|
if (handleTableChange) {
|
|
1983
|
-
var _state$dropdownSearch11, _state$inputSearch11, _state$tabs18, _tables$pagination15, _tables$sorting27, _tables$sorting28, _header$subHeading31, _header$subHeading32, _customDrawer$applied10, _state$
|
|
2023
|
+
var _state$dropdownSearch11, _state$inputSearch11, _state$tabs18, _tables$pagination15, _tables$sorting27, _tables$sorting28, _header$subHeading31, _header$subHeading32, _customDrawer$applied10, _state$misc28;
|
|
1984
2024
|
dispatch({
|
|
1985
2025
|
type: _layoutReducer.actionTypes.SET_LOADING,
|
|
1986
2026
|
payload: true
|
|
@@ -2002,7 +2042,7 @@ function GenricLayOut(_ref) {
|
|
|
2002
2042
|
order: tables === null || tables === void 0 || (_tables$sorting28 = tables.sorting) === null || _tables$sorting28 === void 0 ? void 0 : _tables$sorting28.sortDirection
|
|
2003
2043
|
}, (header === null || header === void 0 || (_header$subHeading31 = header.subHeading) === null || _header$subHeading31 === void 0 || (_header$subHeading31 = _header$subHeading31.jsxConfig) === null || _header$subHeading31 === void 0 ? void 0 : _header$subHeading31.type) == "select" ? {
|
|
2004
2044
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading32 = header.subHeading) === null || _header$subHeading32 === void 0 || (_header$subHeading32 = _header$subHeading32.jsxConfig) === null || _header$subHeading32 === void 0 ? void 0 : _header$subHeading32.value
|
|
2005
|
-
} : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied10 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied10 !== void 0 ? _customDrawer$applied10 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$
|
|
2045
|
+
} : {}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied10 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied10 !== void 0 ? _customDrawer$applied10 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$misc28 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc28 !== void 0 ? _state$misc28 : {}), {}, {
|
|
2006
2046
|
staticFilter: filterValue,
|
|
2007
2047
|
// Pass static filter value
|
|
2008
2048
|
multiSelectValue: multiSelectValue
|
|
@@ -2046,7 +2086,7 @@ function GenricLayOut(_ref) {
|
|
|
2046
2086
|
}
|
|
2047
2087
|
});
|
|
2048
2088
|
if (handleTableChange) {
|
|
2049
|
-
var _state$dropdownSearch12, _state$inputSearch12, _state$tabs19, _tables$filter12, _tables$sorting29, _tables$sorting30, _header$subHeading33, _header$subHeading34, _staticFilter$data13, _customDrawer$applied11, _state$
|
|
2089
|
+
var _state$dropdownSearch12, _state$inputSearch12, _state$tabs19, _tables$filter12, _tables$sorting29, _tables$sorting30, _header$subHeading33, _header$subHeading34, _staticFilter$data13, _customDrawer$applied11, _state$misc29, _state$staticFilter$m13, _state$staticFilter13;
|
|
2050
2090
|
const {
|
|
2051
2091
|
error,
|
|
2052
2092
|
data
|
|
@@ -2066,7 +2106,7 @@ function GenricLayOut(_ref) {
|
|
|
2066
2106
|
subHeadingSelectVal: header === null || header === void 0 || (_header$subHeading34 = header.subHeading) === null || _header$subHeading34 === void 0 || (_header$subHeading34 = _header$subHeading34.jsxConfig) === null || _header$subHeading34 === void 0 ? void 0 : _header$subHeading34.value
|
|
2067
2107
|
} : {}), (staticFilter === null || staticFilter === void 0 ? void 0 : staticFilter.visible) && ((_staticFilter$data13 = staticFilter.data) === null || _staticFilter$data13 === void 0 || (_staticFilter$data13 = _staticFilter$data13.find(item => item.selected)) === null || _staticFilter$data13 === void 0 ? void 0 : _staticFilter$data13.value) && {
|
|
2068
2108
|
staticFilter: staticFilter.data.find(item => item.selected).value
|
|
2069
|
-
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied11 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied11 !== void 0 ? _customDrawer$applied11 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$
|
|
2109
|
+
}), (customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) && Object.keys((_customDrawer$applied11 = customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters) !== null && _customDrawer$applied11 !== void 0 ? _customDrawer$applied11 : {}).length > 0 && _objectSpread({}, customDrawer === null || customDrawer === void 0 ? void 0 : customDrawer.appliedFilters)), (_state$misc29 = state === null || state === void 0 ? void 0 : state.misc) !== null && _state$misc29 !== void 0 ? _state$misc29 : {}), {}, {
|
|
2070
2110
|
multiSelectValue: (_state$staticFilter$m13 = state === null || state === void 0 || (_state$staticFilter13 = state.staticFilter) === null || _state$staticFilter13 === void 0 ? void 0 : _state$staticFilter13.multiSelectValue) !== null && _state$staticFilter$m13 !== void 0 ? _state$staticFilter$m13 : []
|
|
2071
2111
|
}));
|
|
2072
2112
|
if (error) {
|
|
@@ -2097,7 +2137,7 @@ function GenricLayOut(_ref) {
|
|
|
2097
2137
|
console.log(state, "GenricLayOutstate");
|
|
2098
2138
|
return /*#__PURE__*/_react.default.createElement(_styles.OapageWithDataStyle, {
|
|
2099
2139
|
marginBottom: infoPanel !== null && infoPanel !== void 0 && infoPanel.bottomMarginRequired ? "18px" : "0",
|
|
2100
|
-
className: (state === null || state === void 0 || (_state$
|
|
2140
|
+
className: (state === null || state === void 0 || (_state$misc30 = state.misc) === null || _state$misc30 === void 0 ? void 0 : _state$misc30.flow) === "hubAutomation" ? "hubAutomationContainer" : ""
|
|
2101
2141
|
}, /*#__PURE__*/_react.default.createElement(_styles.DrawerWithOutFooter, null), /*#__PURE__*/_react.default.createElement("div", {
|
|
2102
2142
|
className: "fullPageLayout"
|
|
2103
2143
|
}, /*#__PURE__*/_react.default.createElement(_GlobalCss.default, null, (sidebar === null || sidebar === void 0 ? void 0 : sidebar.visible) && /*#__PURE__*/_react.default.createElement(_antd.Skeleton, {
|
|
@@ -2290,7 +2330,7 @@ function GenricLayOut(_ref) {
|
|
|
2290
2330
|
onChange: onTableChange,
|
|
2291
2331
|
customTableChange: customTableChange,
|
|
2292
2332
|
pagination: tables === null || tables === void 0 ? void 0 : tables.pagination,
|
|
2293
|
-
selectedRows: (state === null || state === void 0 || (_state$
|
|
2333
|
+
selectedRows: (state === null || state === void 0 || (_state$tables5 = state.tables) === null || _state$tables5 === void 0 ? void 0 : _state$tables5.selectedRowKeys) || [],
|
|
2294
2334
|
rowSelection: (tables === null || tables === void 0 || (_tables$selectionType = tables.selectionType) === null || _tables$selectionType === void 0 ? void 0 : _tables$selectionType[(_tabs$active4 = tabs === null || tabs === void 0 ? void 0 : tabs.active) !== null && _tabs$active4 !== void 0 ? _tabs$active4 : "default"]) && Object.assign({
|
|
2295
2335
|
type: tables === null || tables === void 0 || (_tables$selectionType2 = tables.selectionType) === null || _tables$selectionType2 === void 0 ? void 0 : _tables$selectionType2[tabs === null || tabs === void 0 ? void 0 : tabs.active]
|
|
2296
2336
|
}, rowSelection),
|
|
@@ -56,7 +56,8 @@ const actionTypes = exports.actionTypes = {
|
|
|
56
56
|
CLEAR_ALL_APPLIED_FILTERS: "CLEAR_ALL_APPLIED_FILTERS",
|
|
57
57
|
UPDATE_FILTER_FORM_VALUES: "UPDATE_FILTER_FORM_VALUES",
|
|
58
58
|
SET_STATIC_FILTER: "SET_STATIC_FILTER",
|
|
59
|
-
SET_PROFILE_DATA: "SET_PROFILE_DATA"
|
|
59
|
+
SET_PROFILE_DATA: "SET_PROFILE_DATA",
|
|
60
|
+
CHANGE_ROW: "CHANGE_ROW"
|
|
60
61
|
};
|
|
61
62
|
function getFieldDefaultValue(widget) {
|
|
62
63
|
switch (widget) {
|
|
@@ -300,6 +301,9 @@ const genericLayoutReducer = exports.genericLayoutReducer = (0, _immer.produce)(
|
|
|
300
301
|
case actionTypes.SET_PROFILE_DATA:
|
|
301
302
|
draft.profileData = _objectSpread(_objectSpread({}, draft.profileData), action.payload);
|
|
302
303
|
break;
|
|
304
|
+
case actionTypes.CHANGE_ROW:
|
|
305
|
+
draft.tables = action.payload.tables;
|
|
306
|
+
break;
|
|
303
307
|
default:
|
|
304
308
|
break;
|
|
305
309
|
}
|
|
@@ -46,8 +46,12 @@ function UserManagementWidget(_ref) {
|
|
|
46
46
|
const [addingUser, setAddingUser] = (0, _react.useState)(false);
|
|
47
47
|
const [deleteModalVisible, setDeleteModalVisible] = (0, _react.useState)(false);
|
|
48
48
|
const [userToDelete, setUserToDelete] = (0, _react.useState)(null);
|
|
49
|
-
const [updateTrigger, setUpdateTrigger] = (0, _react.useState)(0);
|
|
50
49
|
const notificationRef = (0, _react.useRef)(null);
|
|
50
|
+
|
|
51
|
+
// Use local state for users, initialized from initialData only
|
|
52
|
+
const [users, setUsers] = (0, _react.useState)(() => {
|
|
53
|
+
return Array.isArray(initialData) ? initialData : [];
|
|
54
|
+
});
|
|
51
55
|
const openNotification = (0, _react.useCallback)(params => notificationRef.current.openNotification(params), []);
|
|
52
56
|
const showErrorNotification = message => {
|
|
53
57
|
openNotification({
|
|
@@ -68,23 +72,21 @@ function UserManagementWidget(_ref) {
|
|
|
68
72
|
});
|
|
69
73
|
};
|
|
70
74
|
|
|
71
|
-
//
|
|
72
|
-
const users = form.getFieldValue(fieldName) || initialData;
|
|
73
|
-
|
|
74
|
-
// Update form state with new user list and trigger re-render
|
|
75
|
+
// Update both local state and form state
|
|
75
76
|
const updateUsers = newUsers => {
|
|
77
|
+
setUsers(newUsers);
|
|
76
78
|
form.setFieldsValue({
|
|
77
79
|
[fieldName]: newUsers
|
|
78
80
|
});
|
|
79
|
-
setUpdateTrigger(prev => prev + 1); // Trigger re-render
|
|
80
81
|
};
|
|
81
82
|
|
|
82
|
-
//
|
|
83
|
+
// Sync users state with form and initialData
|
|
83
84
|
(0, _react.useEffect)(() => {
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
const defaultUsers = Array.isArray(initialData) ? initialData : [];
|
|
86
|
+
setUsers(defaultUsers);
|
|
87
|
+
form.setFieldsValue({
|
|
88
|
+
[fieldName]: defaultUsers
|
|
89
|
+
});
|
|
88
90
|
}, [initialData, fieldName, form]);
|
|
89
91
|
const handleEdit = user => {
|
|
90
92
|
setEditingUserId(user.id);
|