@dashadmin/dash-components 1.3.25 → 1.3.26
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/dist/components/AuditLog/AuditLog.js +345 -1
- package/dist/components/AuditLog/index.js +4 -1
- package/dist/components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput.js +630 -3
- package/dist/components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput.js +53 -1
- package/dist/components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput.js +647 -3
- package/dist/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput.js +53 -1
- package/dist/components/Json/Json.js +235 -1
- package/dist/components/JsonColorSelector/JsonColorSelector.js +1172 -1
- package/dist/components/JsonColorSelector/JsonColorSelectorEnhanced.js +863 -2
- package/dist/components/JsonColorSelector/JsonCssVarValues.js +738 -1
- package/dist/components/JsonColorSelector/components/ColorEditDialog.js +426 -1
- package/dist/components/JsonColorSelector/components/ColorPaletteItem.js +75 -1
- package/dist/components/JsonColorSelector/components/ImageColorExtractor.js +283 -1
- package/dist/components/JsonColorSelector/helpers/functions.js +101 -1
- package/dist/components/JsonColorSelector/useAsyncColorThief.js +105 -1
- package/dist/components/ListActive/ListActive.js +126 -1
- package/dist/components/ListActive/ListBoolean.js +124 -1
- package/dist/components/NotificationPreferences/NotificationPreferences.js +317 -1
- package/dist/components/NotificationPreferences/index.js +7 -1
- package/dist/components/SearchableSelects/RASearchableSelect.js +236 -1
- package/dist/components/SearchableSelects/RASearchableSelectCheckboxes.js +479 -1
- package/dist/components/SearchableSelects/RASearchableSelectChips.js +465 -1
- package/dist/components/SearchableSelects/RASearchableSelectChipsRecordContext.js +295 -1
- package/dist/components/SearchableSelects/SearchableSelect.js +202 -1
- package/dist/components/SearchableSelects/SearchableSelectCheckboxes.js +290 -1
- package/dist/components/SortableDataGrid/SortableDataGrid.js +72 -1
- package/dist/components/SortableDataGrid/SortableDataGridBody.js +167 -1
- package/dist/components/SortableDataGrid/SortableDataGridHeader.js +109 -1
- package/dist/components/SortableDataGrid/SortableDataGridRow.js +283 -1
- package/dist/components/Upload/SingleImageUploader.js +40 -1
- package/dist/components/custom/PackageCopyMethod.js +78 -1
- package/dist/components/custom/PackageRadioButtonGroup.js +45 -1
- package/dist/components/dialog/Basic.js +8 -1
- package/dist/components/dialog/Correct.js +14 -1
- package/dist/components/dialog/Error.js +14 -1
- package/dist/components/dialog/Info.js +14 -1
- package/dist/components/dialog/InfoV2.js +21 -1
- package/dist/components/dialog/NotFound.js +14 -1
- package/dist/components/dialog/QuickSearch.js +117 -1
- package/dist/components/notifications/NotificationsCenter.js +597 -1
- package/dist/components/notifications/index.js +24 -1
- package/dist/components/tables/PaginationComponent.js +36 -1
- package/dist/components/theme/AppLoadingFallback.js +38 -2
- package/dist/components/theme/ErrorBoundary.js +52 -1
- package/dist/components/theme/InitialLoader.js +13 -1
- package/dist/components/theme/NotFound.js +136 -1
- package/dist/components/theme/NotResults.js +38 -1
- package/dist/hooks/useDraggable.js +6 -1
- package/dist/hooks/useNotifications.js +8 -1
- package/dist/hooks/useQuickSearch.js +26 -1
- package/dist/index.js +66 -5567
- package/dist/utils/setNativeValue.js +17 -1
- package/package.json +149 -132
- package/src/components/AuditLog/AuditLog.tsx +476 -0
- package/src/components/AuditLog/index.ts +2 -0
- package/src/components/AutoCompleteArrayInput/AutoCompleteCheckBoxInput.tsx +917 -0
- package/src/components/AutoCompleteArrayInput/AutocompleteCheckBoxArrayInput.tsx +39 -0
- package/src/components/AutoCompleteArrayInputAutoSearch/AutoCompleteCheckBoxInput.tsx +916 -0
- package/src/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayInput.tsx +44 -0
- package/src/components/Json/Json.tsx +312 -0
- package/src/components/JsonColorSelector/JsonColorSelector.tsx +1435 -0
- package/src/components/JsonColorSelector/JsonColorSelectorEnhanced.tsx +1029 -0
- package/src/components/JsonColorSelector/JsonCssVarValues.tsx +863 -0
- package/src/components/JsonColorSelector/components/ColorEditDialog.tsx +491 -0
- package/src/components/JsonColorSelector/components/ColorPaletteItem.tsx +80 -0
- package/src/components/JsonColorSelector/components/ImageColorExtractor.tsx +328 -0
- package/src/components/JsonColorSelector/helpers/functions.tsx +123 -0
- package/src/components/JsonColorSelector/interfaces/interfaces.tsx +22 -0
- package/src/components/JsonColorSelector/useAsyncColorThief.tsx +97 -0
- package/src/components/ListActive/ListActive.tsx +106 -0
- package/src/components/ListActive/ListBoolean.tsx +96 -0
- package/src/components/NotificationPreferences/NotificationPreferences.tsx +463 -0
- package/src/components/NotificationPreferences/index.tsx +2 -0
- package/src/components/SearchableSelects/RASearchableSelect.tsx +300 -0
- package/src/components/SearchableSelects/RASearchableSelectCheckboxes.tsx +604 -0
- package/src/components/SearchableSelects/RASearchableSelectChips.tsx +558 -0
- package/src/components/SearchableSelects/RASearchableSelectChipsRecordContext.tsx +362 -0
- package/src/components/SearchableSelects/SearchableSelect.tsx +321 -0
- package/src/components/SearchableSelects/SearchableSelectCheckboxes.tsx +355 -0
- package/src/components/SortableDataGrid/SortableDataGrid.tsx +56 -0
- package/src/components/SortableDataGrid/SortableDataGridBody.tsx +175 -0
- package/src/components/SortableDataGrid/SortableDataGridHeader.tsx +171 -0
- package/src/components/SortableDataGrid/SortableDataGridRow.tsx +247 -0
- package/src/components/Upload/SingleImageUploader.tsx +55 -0
- package/src/components/custom/PackageCopyMethod.tsx +109 -0
- package/src/components/custom/PackageRadioButtonGroup.tsx +47 -0
- package/src/components/dialog/Basic.tsx +11 -0
- package/src/components/dialog/Correct.tsx +16 -0
- package/src/components/dialog/Error.tsx +15 -0
- package/src/components/dialog/Info.tsx +15 -0
- package/src/components/dialog/InfoV2.tsx +35 -0
- package/src/components/dialog/NotFound.tsx +18 -0
- package/src/components/dialog/QuickSearch.tsx +115 -0
- package/src/components/notifications/NotificationsCenter.tsx +792 -0
- package/src/components/notifications/index.ts +42 -0
- package/src/components/tables/PaginationComponent.tsx +17 -0
- package/src/components/theme/AppLoadingFallback.tsx +42 -0
- package/src/components/theme/ErrorBoundary.tsx +57 -0
- package/src/components/theme/InitialLoader.tsx +16 -0
- package/src/components/theme/NotFound.tsx +124 -0
- package/src/components/theme/NotResults.tsx +54 -0
- package/src/hooks/useDraggable.ts +11 -0
- package/src/hooks/useNotifications.ts +14 -0
- package/src/hooks/useQuickSearch.tsx +29 -0
- package/src/index.tsx +77 -0
- package/src/utils/setNativeValue.tsx +23 -0
- package/dist/color-thief-CTwGFhOB.js +0 -272
- /package/{dist → src}/components/AutoCompleteArrayInputAutoSearch/AutocompleteCheckBoxArrayAutoSearch.tsx.wip +0 -0
- /package/{dist → src}/components/JsonColorSelector/JsonColorSelector.tsx.bkup +0 -0
- /package/{dist → src}/components/SortableDataGrid/README.md +0 -0
- /package/{dist → src}/styles/index.less +0 -0
|
@@ -1 +1,345 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { useState, useMemo, useCallback } from "react";
|
|
19
|
+
import { useRecordContext, useGetList, Loading } from "react-admin";
|
|
20
|
+
import {
|
|
21
|
+
Box,
|
|
22
|
+
Typography,
|
|
23
|
+
Paper,
|
|
24
|
+
Button,
|
|
25
|
+
Dialog,
|
|
26
|
+
DialogTitle,
|
|
27
|
+
DialogContent,
|
|
28
|
+
DialogActions,
|
|
29
|
+
IconButton,
|
|
30
|
+
Chip,
|
|
31
|
+
Tooltip
|
|
32
|
+
} from "@mui/material";
|
|
33
|
+
import {
|
|
34
|
+
DataGrid as MUIGrid,
|
|
35
|
+
GridToolbarContainer,
|
|
36
|
+
GridToolbarExport
|
|
37
|
+
} from "@mui/x-data-grid";
|
|
38
|
+
import VisibilityIcon from "@mui/icons-material/Visibility";
|
|
39
|
+
import CloseIcon from "@mui/icons-material/Close";
|
|
40
|
+
import HistoryIcon from "@mui/icons-material/History";
|
|
41
|
+
const AuditToolbar = () => {
|
|
42
|
+
return /* @__PURE__ */ jsx(GridToolbarContainer, { children: /* @__PURE__ */ jsx(
|
|
43
|
+
GridToolbarExport,
|
|
44
|
+
{
|
|
45
|
+
csvOptions: {
|
|
46
|
+
fileName: "audit-logs-export",
|
|
47
|
+
delimiter: ",",
|
|
48
|
+
utf8WithBom: true
|
|
49
|
+
},
|
|
50
|
+
printOptions: {
|
|
51
|
+
hideFooter: true,
|
|
52
|
+
hideToolbar: true
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
) });
|
|
56
|
+
};
|
|
57
|
+
const AuditJsonDialog = ({ open, log, onClose }) => {
|
|
58
|
+
if (!log) return null;
|
|
59
|
+
const formatJson = (obj) => {
|
|
60
|
+
try {
|
|
61
|
+
return JSON.stringify(obj, null, 2);
|
|
62
|
+
} catch (e) {
|
|
63
|
+
return String(obj);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
return /* @__PURE__ */ jsxs(
|
|
67
|
+
Dialog,
|
|
68
|
+
{
|
|
69
|
+
open,
|
|
70
|
+
onClose,
|
|
71
|
+
maxWidth: "md",
|
|
72
|
+
fullWidth: true,
|
|
73
|
+
"aria-labelledby": "audit-log-dialog-title",
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ jsx(DialogTitle, { id: "audit-log-dialog-title", children: /* @__PURE__ */ jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", children: [
|
|
76
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "h6", children: [
|
|
77
|
+
"Audit Log Details - ",
|
|
78
|
+
log.event || log.description
|
|
79
|
+
] }),
|
|
80
|
+
/* @__PURE__ */ jsx(
|
|
81
|
+
IconButton,
|
|
82
|
+
{
|
|
83
|
+
edge: "end",
|
|
84
|
+
color: "inherit",
|
|
85
|
+
onClick: onClose,
|
|
86
|
+
"aria-label": "close",
|
|
87
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
88
|
+
}
|
|
89
|
+
)
|
|
90
|
+
] }) }),
|
|
91
|
+
/* @__PURE__ */ jsxs(DialogContent, { dividers: true, children: [
|
|
92
|
+
/* @__PURE__ */ jsxs(Box, { mb: 2, children: [
|
|
93
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", color: "textSecondary", children: "Event Information" }),
|
|
94
|
+
/* @__PURE__ */ jsxs(Paper, { variant: "outlined", sx: { p: 2, mt: 1 }, children: [
|
|
95
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
|
|
96
|
+
/* @__PURE__ */ jsx("strong", { children: "ID:" }),
|
|
97
|
+
" ",
|
|
98
|
+
log.id
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
|
|
101
|
+
/* @__PURE__ */ jsx("strong", { children: "Event:" }),
|
|
102
|
+
" ",
|
|
103
|
+
log.event || "N/A"
|
|
104
|
+
] }),
|
|
105
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
|
|
106
|
+
/* @__PURE__ */ jsx("strong", { children: "Description:" }),
|
|
107
|
+
" ",
|
|
108
|
+
log.description
|
|
109
|
+
] }),
|
|
110
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
|
|
111
|
+
/* @__PURE__ */ jsx("strong", { children: "Log Name:" }),
|
|
112
|
+
" ",
|
|
113
|
+
log.log_name
|
|
114
|
+
] }),
|
|
115
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
|
|
116
|
+
/* @__PURE__ */ jsx("strong", { children: "Created At:" }),
|
|
117
|
+
" ",
|
|
118
|
+
new Date(log.created_at).toLocaleString()
|
|
119
|
+
] }),
|
|
120
|
+
log.causer_name && /* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
|
|
121
|
+
/* @__PURE__ */ jsx("strong", { children: "Changed By:" }),
|
|
122
|
+
" ",
|
|
123
|
+
log.causer_name
|
|
124
|
+
] })
|
|
125
|
+
] })
|
|
126
|
+
] }),
|
|
127
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
128
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", color: "textSecondary", children: "Properties (JSON)" }),
|
|
129
|
+
/* @__PURE__ */ jsx(
|
|
130
|
+
Paper,
|
|
131
|
+
{
|
|
132
|
+
variant: "outlined",
|
|
133
|
+
sx: {
|
|
134
|
+
p: 2,
|
|
135
|
+
mt: 1,
|
|
136
|
+
bgcolor: "grey.900",
|
|
137
|
+
color: "grey.100",
|
|
138
|
+
maxHeight: 400,
|
|
139
|
+
overflow: "auto"
|
|
140
|
+
},
|
|
141
|
+
children: /* @__PURE__ */ jsx("pre", { style: { margin: 0, whiteSpace: "pre-wrap", wordBreak: "break-word" }, children: formatJson(log.properties) })
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
] })
|
|
145
|
+
] }),
|
|
146
|
+
/* @__PURE__ */ jsx(DialogActions, { children: /* @__PURE__ */ jsx(Button, { onClick: onClose, color: "primary", children: "Close" }) })
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
};
|
|
151
|
+
const getEventChip = (event, logName) => {
|
|
152
|
+
const eventLower = (event || "").toLowerCase();
|
|
153
|
+
let color = "default";
|
|
154
|
+
switch (eventLower) {
|
|
155
|
+
case "created":
|
|
156
|
+
color = "success";
|
|
157
|
+
break;
|
|
158
|
+
case "updated":
|
|
159
|
+
color = "warning";
|
|
160
|
+
break;
|
|
161
|
+
case "deleted":
|
|
162
|
+
color = "error";
|
|
163
|
+
break;
|
|
164
|
+
case "restored":
|
|
165
|
+
color = "info";
|
|
166
|
+
break;
|
|
167
|
+
default:
|
|
168
|
+
color = "default";
|
|
169
|
+
}
|
|
170
|
+
return /* @__PURE__ */ jsx(
|
|
171
|
+
Chip,
|
|
172
|
+
{
|
|
173
|
+
label: event || "N/A",
|
|
174
|
+
color,
|
|
175
|
+
size: "small",
|
|
176
|
+
variant: "outlined"
|
|
177
|
+
}
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
const AuditLogView = ({ resourceConfig, resource: resourceOverride }) => {
|
|
181
|
+
const record = useRecordContext();
|
|
182
|
+
const [paginationModel, setPaginationModel] = useState({
|
|
183
|
+
page: 0,
|
|
184
|
+
pageSize: 10
|
|
185
|
+
});
|
|
186
|
+
const [dialogState, setDialogState] = useState({
|
|
187
|
+
open: false,
|
|
188
|
+
log: null
|
|
189
|
+
});
|
|
190
|
+
const baseResource = resourceOverride || (resourceConfig == null ? void 0 : resourceConfig.model) || "";
|
|
191
|
+
const auditResource = `${baseResource}/audit`;
|
|
192
|
+
const { data, total, isLoading, error } = useGetList(
|
|
193
|
+
auditResource,
|
|
194
|
+
{
|
|
195
|
+
pagination: {
|
|
196
|
+
page: paginationModel.page + 1,
|
|
197
|
+
perPage: paginationModel.pageSize
|
|
198
|
+
},
|
|
199
|
+
sort: { field: "created_at", order: "DESC" },
|
|
200
|
+
filter: { subject_id: record == null ? void 0 : record.id }
|
|
201
|
+
},
|
|
202
|
+
{ enabled: !!(record == null ? void 0 : record.id), refetchOnWindowFocus: false }
|
|
203
|
+
);
|
|
204
|
+
const handleViewLog = useCallback((log) => {
|
|
205
|
+
setDialogState({ open: true, log });
|
|
206
|
+
}, []);
|
|
207
|
+
const handleCloseDialog = useCallback(() => {
|
|
208
|
+
setDialogState({ open: false, log: null });
|
|
209
|
+
}, []);
|
|
210
|
+
const columns = useMemo(
|
|
211
|
+
() => [
|
|
212
|
+
{
|
|
213
|
+
field: "id",
|
|
214
|
+
headerName: "ID",
|
|
215
|
+
type: "number",
|
|
216
|
+
width: 80
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
field: "event",
|
|
220
|
+
headerName: "Event",
|
|
221
|
+
width: 120,
|
|
222
|
+
renderCell: (params) => getEventChip(params.value)
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
field: "description",
|
|
226
|
+
headerName: "Description",
|
|
227
|
+
flex: 1,
|
|
228
|
+
minWidth: 200
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
field: "causer_name",
|
|
232
|
+
headerName: "Changed By",
|
|
233
|
+
width: 150,
|
|
234
|
+
valueGetter: (value, row) => row.causer_name || "System"
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
field: "created_at",
|
|
238
|
+
headerName: "Date",
|
|
239
|
+
width: 180,
|
|
240
|
+
valueFormatter: (value) => value ? new Date(value).toLocaleString() : ""
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
field: "actions",
|
|
244
|
+
headerName: "Actions",
|
|
245
|
+
type: "actions",
|
|
246
|
+
width: 100,
|
|
247
|
+
getActions: (params) => [
|
|
248
|
+
/* @__PURE__ */ jsx(Tooltip, { title: "View Details", children: /* @__PURE__ */ jsx(
|
|
249
|
+
IconButton,
|
|
250
|
+
{
|
|
251
|
+
size: "small",
|
|
252
|
+
onClick: () => handleViewLog(params.row),
|
|
253
|
+
color: "primary",
|
|
254
|
+
children: /* @__PURE__ */ jsx(VisibilityIcon, { fontSize: "small" })
|
|
255
|
+
}
|
|
256
|
+
) }, "view")
|
|
257
|
+
]
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
[handleViewLog]
|
|
261
|
+
);
|
|
262
|
+
if (!(record == null ? void 0 : record.id)) {
|
|
263
|
+
return /* @__PURE__ */ jsxs(Paper, { variant: "outlined", sx: { p: 3, textAlign: "center" }, children: [
|
|
264
|
+
/* @__PURE__ */ jsx(HistoryIcon, { sx: { fontSize: 48, color: "text.secondary", mb: 1 } }),
|
|
265
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", color: "text.secondary", children: "Save the record first to view audit logs" })
|
|
266
|
+
] });
|
|
267
|
+
}
|
|
268
|
+
if (isLoading) {
|
|
269
|
+
return /* @__PURE__ */ jsx(Loading, {});
|
|
270
|
+
}
|
|
271
|
+
if (error) {
|
|
272
|
+
return /* @__PURE__ */ jsx(Paper, { variant: "outlined", sx: { p: 2 }, children: /* @__PURE__ */ jsxs(Typography, { color: "error", children: [
|
|
273
|
+
"Error loading audit logs: ",
|
|
274
|
+
(error == null ? void 0 : error.message) || "Unknown error"
|
|
275
|
+
] }) });
|
|
276
|
+
}
|
|
277
|
+
if (!data || data.length === 0) {
|
|
278
|
+
return /* @__PURE__ */ jsxs(Paper, { variant: "outlined", sx: { p: 3, textAlign: "center" }, children: [
|
|
279
|
+
/* @__PURE__ */ jsx(HistoryIcon, { sx: { fontSize: 48, color: "text.secondary", mb: 1 } }),
|
|
280
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", color: "text.secondary", children: "No audit logs available for this record" })
|
|
281
|
+
] });
|
|
282
|
+
}
|
|
283
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
284
|
+
/* @__PURE__ */ jsx(Box, { sx: { width: "100%" }, children: /* @__PURE__ */ jsx(Paper, { variant: "outlined", children: /* @__PURE__ */ jsx(
|
|
285
|
+
MUIGrid,
|
|
286
|
+
{
|
|
287
|
+
rows: data,
|
|
288
|
+
columns,
|
|
289
|
+
rowCount: total || 0,
|
|
290
|
+
loading: isLoading,
|
|
291
|
+
pageSizeOptions: [5, 10, 25, 50],
|
|
292
|
+
paginationModel,
|
|
293
|
+
paginationMode: "server",
|
|
294
|
+
onPaginationModelChange: setPaginationModel,
|
|
295
|
+
disableRowSelectionOnClick: true,
|
|
296
|
+
autoHeight: true,
|
|
297
|
+
slots: {
|
|
298
|
+
toolbar: AuditToolbar
|
|
299
|
+
},
|
|
300
|
+
sx: {
|
|
301
|
+
"& .MuiDataGrid-cell:focus": {
|
|
302
|
+
outline: "none"
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
) }) }),
|
|
307
|
+
/* @__PURE__ */ jsx(
|
|
308
|
+
AuditJsonDialog,
|
|
309
|
+
{
|
|
310
|
+
open: dialogState.open,
|
|
311
|
+
log: dialogState.log,
|
|
312
|
+
onClose: handleCloseDialog
|
|
313
|
+
}
|
|
314
|
+
)
|
|
315
|
+
] });
|
|
316
|
+
};
|
|
317
|
+
const AuditLogEdit = (props) => {
|
|
318
|
+
return /* @__PURE__ */ jsx(AuditLogView, __spreadValues({}, props));
|
|
319
|
+
};
|
|
320
|
+
const AuditLogList = () => {
|
|
321
|
+
return /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", children: "\u2014" });
|
|
322
|
+
};
|
|
323
|
+
const AuditLog = (props) => {
|
|
324
|
+
const { method } = props;
|
|
325
|
+
switch (method) {
|
|
326
|
+
case "view":
|
|
327
|
+
case "show":
|
|
328
|
+
return /* @__PURE__ */ jsx(AuditLogView, __spreadValues({}, props));
|
|
329
|
+
case "edit":
|
|
330
|
+
return /* @__PURE__ */ jsx(AuditLogEdit, __spreadValues({}, props));
|
|
331
|
+
case "list":
|
|
332
|
+
return /* @__PURE__ */ jsx(AuditLogList, __spreadValues({}, props));
|
|
333
|
+
case "create":
|
|
334
|
+
return /* @__PURE__ */ jsxs(Paper, { variant: "outlined", sx: { p: 3, textAlign: "center" }, children: [
|
|
335
|
+
/* @__PURE__ */ jsx(HistoryIcon, { sx: { fontSize: 48, color: "text.secondary", mb: 1 } }),
|
|
336
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", color: "text.secondary", children: "Audit logs will be available after the record is created" })
|
|
337
|
+
] });
|
|
338
|
+
default:
|
|
339
|
+
return /* @__PURE__ */ jsx(AuditLogView, __spreadValues({}, props));
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
var AuditLog_default = AuditLog;
|
|
343
|
+
export {
|
|
344
|
+
AuditLog_default as default
|
|
345
|
+
};
|