@bigbinary/neeto-molecules 4.0.93 → 4.0.95
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/AuditLogs.js +376 -434
- package/dist/AuditLogs.js.map +1 -1
- package/dist/EmailForm.js +20 -5
- package/dist/EmailForm.js.map +1 -1
- package/dist/cjs/AuditLogs.js +373 -431
- package/dist/cjs/AuditLogs.js.map +1 -1
- package/dist/cjs/EmailForm.js +20 -5
- package/dist/cjs/EmailForm.js.map +1 -1
- package/package.json +1 -1
- package/src/translations/ar.json +23 -0
- package/src/translations/ca.json +23 -0
- package/src/translations/cs.json +23 -0
- package/src/translations/da.json +23 -0
- package/src/translations/de.json +23 -0
- package/src/translations/en.json +22 -13
- package/src/translations/es-MX.json +23 -0
- package/src/translations/es.json +23 -0
- package/src/translations/et.json +23 -0
- package/src/translations/fi.json +23 -0
- package/src/translations/fil.json +23 -0
- package/src/translations/fr.json +23 -0
- package/src/translations/he.json +152 -0
- package/src/translations/hr.json +23 -0
- package/src/translations/id.json +23 -0
- package/src/translations/it.json +23 -0
- package/src/translations/ja.json +23 -0
- package/src/translations/ko.json +23 -0
- package/src/translations/nl.json +23 -0
- package/src/translations/pl.json +23 -0
- package/src/translations/pt-BR.json +23 -0
- package/src/translations/pt.json +23 -0
- package/src/translations/ro.json +23 -0
- package/src/translations/ru.json +23 -0
- package/src/translations/sk.json +23 -0
- package/src/translations/sl.json +23 -0
- package/src/translations/sv.json +23 -0
- package/src/translations/th.json +23 -0
- package/src/translations/tr.json +23 -0
- package/src/translations/uk.json +23 -0
- package/src/translations/vi.json +23 -0
- package/src/translations/zh-CN.json +23 -0
- package/src/translations/zh-TW.json +23 -0
package/dist/AuditLogs.js
CHANGED
|
@@ -1,305 +1,57 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { _humanize, isNotEmpty, capitalize, snakeToCamelCase, _capitalize, isPresent } from '@bigbinary/neeto-cist';
|
|
5
|
-
import { SINGULAR, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_INDEX } from '@bigbinary/neeto-commons-frontend/constants';
|
|
2
|
+
import { snakeToCamelCase, humanize, isNotEmpty, isPresent } from '@bigbinary/neeto-cist';
|
|
3
|
+
import { DEFAULT_PAGE_INDEX } from '@bigbinary/neeto-commons-frontend/constants';
|
|
6
4
|
import { useQueryParams } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
7
5
|
import NoData from '@bigbinary/neetoui/NoData';
|
|
8
|
-
import Table from '@bigbinary/neetoui/Table';
|
|
9
|
-
import Typography from '@bigbinary/neetoui/Typography';
|
|
10
6
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
11
|
-
import
|
|
7
|
+
import Pagination from '@bigbinary/neetoui/Pagination';
|
|
8
|
+
import { Trans as Trans$1, useTranslation } from 'react-i18next';
|
|
12
9
|
import Container from './Container.js';
|
|
13
10
|
import Header from './Header.js';
|
|
14
|
-
import
|
|
15
|
-
import TableWrapper from './TableWrapper.js';
|
|
16
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
17
|
-
import Pane from '@bigbinary/neetoui/Pane';
|
|
18
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
19
|
-
import { t } from 'i18next';
|
|
11
|
+
import classnames from 'classnames';
|
|
20
12
|
import { dateFormat } from '@bigbinary/neeto-commons-frontend/utils';
|
|
21
|
-
import
|
|
13
|
+
import Typography from '@bigbinary/neetoui/Typography';
|
|
14
|
+
import User from '@bigbinary/neeto-icons/User';
|
|
15
|
+
import UserAdd from '@bigbinary/neeto-icons/UserAdd';
|
|
16
|
+
import UserCircle from '@bigbinary/neeto-icons/UserCircle';
|
|
17
|
+
import UserRemove from '@bigbinary/neeto-icons/UserRemove';
|
|
18
|
+
import UserSettings from '@bigbinary/neeto-icons/UserSettings';
|
|
19
|
+
import CustomDomain from '@bigbinary/neeto-icons/CustomDomain';
|
|
20
|
+
import GoogleCalendar from '@bigbinary/neeto-icons/misc/GoogleCalendar';
|
|
21
|
+
import Zoom from '@bigbinary/neeto-icons/misc/Zoom';
|
|
22
|
+
import Stripe from '@bigbinary/neeto-icons/misc/Stripe';
|
|
23
|
+
import StripeTypeface from '@bigbinary/neeto-icons/misc/StripeTypeface';
|
|
24
|
+
import { values } from 'ramda';
|
|
25
|
+
import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
26
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
22
27
|
import { useQuery } from '@tanstack/react-query';
|
|
23
28
|
import axios from 'axios';
|
|
24
|
-
import '
|
|
29
|
+
import { createElement } from 'react';
|
|
25
30
|
import './index-DAYCJu79.js';
|
|
26
31
|
import './_commonjsHelpers-BFTU3MAI.js';
|
|
27
32
|
import './inject-css-C2dztUxs.js';
|
|
33
|
+
import '@babel/runtime/helpers/objectWithoutProperties';
|
|
28
34
|
import './Breadcrumbs.js';
|
|
29
35
|
import '@bigbinary/neeto-commons-frontend/utils/general';
|
|
30
36
|
import 'react-router-dom';
|
|
31
37
|
import './HelpPopover.js';
|
|
32
38
|
import '@bigbinary/neeto-icons/Help';
|
|
39
|
+
import '@bigbinary/neetoui/Button';
|
|
33
40
|
import '@bigbinary/neetoui/Popover';
|
|
34
41
|
import './MoreDropdown.js';
|
|
35
42
|
import '@bigbinary/neeto-icons/MenuHorizontal';
|
|
36
43
|
import '@bigbinary/neeto-icons/MenuVertical';
|
|
37
44
|
import '@bigbinary/neetoui/Dropdown';
|
|
38
45
|
import '@bigbinary/neetoui/Tooltip';
|
|
39
|
-
import 'ramda';
|
|
40
46
|
import './Search.js';
|
|
47
|
+
import '@babel/runtime/helpers/slicedToArray';
|
|
41
48
|
import '@bigbinary/neeto-commons-frontend/react-utils/useFuncDebounce';
|
|
42
49
|
import '@bigbinary/neeto-commons-frontend/react-utils/useQueryParams';
|
|
43
50
|
import '@bigbinary/neeto-commons-frontend/react-utils/useUpdateEffect';
|
|
44
51
|
import '@bigbinary/neeto-icons/Search';
|
|
45
52
|
import '@bigbinary/neetoui/Input';
|
|
46
|
-
import '@bigbinary/neeto-icons/Column';
|
|
47
|
-
import './Columns-CsOYfWFt.js';
|
|
48
|
-
import '@babel/runtime/helpers/toConsumableArray';
|
|
49
|
-
import '@dnd-kit/core';
|
|
50
|
-
import '@dnd-kit/sortable';
|
|
51
|
-
import '@bigbinary/neetoui/Checkbox';
|
|
52
|
-
import '@bigbinary/neetoui/Label';
|
|
53
|
-
import '@bigbinary/neeto-icons/Reorder';
|
|
54
|
-
import '@bigbinary/neeto-commons-frontend/react-utils/useMutationWithInvalidation';
|
|
55
|
-
import '@bigbinary/neeto-icons/Download';
|
|
56
|
-
import '@bigbinary/neeto-filters-frontend/Filters';
|
|
57
|
-
import '@bigbinary/neeto-icons/Filter';
|
|
58
|
-
|
|
59
|
-
var LabelledDetail = function LabelledDetail(_ref) {
|
|
60
|
-
var label = _ref.label,
|
|
61
|
-
value = _ref.value;
|
|
62
|
-
return /*#__PURE__*/jsx(Typography, {
|
|
63
|
-
className: "mb-4",
|
|
64
|
-
style: "body2",
|
|
65
|
-
children: /*#__PURE__*/jsx(Trans, {
|
|
66
|
-
components: {
|
|
67
|
-
strong: /*#__PURE__*/jsx("strong", {})
|
|
68
|
-
},
|
|
69
|
-
i18nKey: "neetoMolecules.auditLogs.additionalDetails.".concat(label),
|
|
70
|
-
values: {
|
|
71
|
-
value: value
|
|
72
|
-
}
|
|
73
|
-
})
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
var DATE_FORMATS = {
|
|
78
|
-
"%d/%m/%Y": "DD/MM/YYYY",
|
|
79
|
-
"%m/%d/%Y": "MM/DD/YYYY",
|
|
80
|
-
"%Y/%m/%d": "YYYY/MM/DD"
|
|
81
|
-
};
|
|
82
|
-
var DETAILS_KEYS = {
|
|
83
|
-
AFFECTED_EMAIL: "affectedEmail",
|
|
84
|
-
ERROR_MESSAGE: "errorMessage",
|
|
85
|
-
NAME: "name",
|
|
86
|
-
ORGANIZATION_ROLE: "organizationRole",
|
|
87
|
-
GENERIC_DETAILS: "details",
|
|
88
|
-
ADDED_PERMISSIONS: "addedPermissions",
|
|
89
|
-
REMOVED_PERMISSIONS: "removedPermissions"
|
|
90
|
-
};
|
|
91
|
-
var EMAILS_TABLE_COLUMN_DATA = [{
|
|
92
|
-
title: t("neetoMolecules.auditLogs.details.emails.title"),
|
|
93
|
-
key: "email",
|
|
94
|
-
dataIndex: "email"
|
|
95
|
-
}];
|
|
96
|
-
var CHANGELOG_COLUMN_DATA = [{
|
|
97
|
-
title: t("neetoMolecules.auditLogs.details.changelog.field"),
|
|
98
|
-
key: "field",
|
|
99
|
-
dataIndex: "field",
|
|
100
|
-
ellipsis: false
|
|
101
|
-
}, {
|
|
102
|
-
title: t("neetoMolecules.auditLogs.details.changelog.from"),
|
|
103
|
-
key: "from",
|
|
104
|
-
dataIndex: "from",
|
|
105
|
-
width: "38%",
|
|
106
|
-
ellipsis: false
|
|
107
|
-
}, {
|
|
108
|
-
title: t("neetoMolecules.auditLogs.details.changelog.to"),
|
|
109
|
-
key: "to",
|
|
110
|
-
dataIndex: "to",
|
|
111
|
-
width: "38%",
|
|
112
|
-
ellipsis: false
|
|
113
|
-
}];
|
|
114
|
-
|
|
115
|
-
var formatToFromValue = function formatToFromValue(value) {
|
|
116
|
-
if (value === true) {
|
|
117
|
-
return t("neetoMolecules.auditLogs.details.changelog.true");
|
|
118
|
-
}
|
|
119
|
-
if (value === false) {
|
|
120
|
-
return t("neetoMolecules.auditLogs.details.changelog.false");
|
|
121
|
-
}
|
|
122
|
-
if (value === null) return "-";
|
|
123
|
-
return value;
|
|
124
|
-
};
|
|
125
|
-
var transformDateFormat = function transformDateFormat(rawDateFormat) {
|
|
126
|
-
return DATE_FORMATS[rawDateFormat];
|
|
127
|
-
};
|
|
128
|
-
var getFormattedValue = function getFormattedValue(field, value) {
|
|
129
|
-
return field === "dateFormat" ? transformDateFormat(value) : formatToFromValue(value);
|
|
130
|
-
};
|
|
131
|
-
var formatEmails = function formatEmails(emails) {
|
|
132
|
-
return emails.map(function (email) {
|
|
133
|
-
return {
|
|
134
|
-
email: email
|
|
135
|
-
};
|
|
136
|
-
});
|
|
137
|
-
};
|
|
138
|
-
var formatChangeLog = function formatChangeLog(changes) {
|
|
139
|
-
return Object.entries(changes).map(function (_ref) {
|
|
140
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
141
|
-
field = _ref2[0],
|
|
142
|
-
_ref2$ = _ref2[1],
|
|
143
|
-
from = _ref2$.from,
|
|
144
|
-
to = _ref2$.to;
|
|
145
|
-
var formattedField = _humanize(field);
|
|
146
|
-
return {
|
|
147
|
-
field: formattedField,
|
|
148
|
-
from: getFormattedValue(field, from),
|
|
149
|
-
to: getFormattedValue(field, to)
|
|
150
|
-
};
|
|
151
|
-
});
|
|
152
|
-
};
|
|
153
|
-
var getFullName = function getFullName(firstName) {
|
|
154
|
-
var lastName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
155
|
-
return "".concat(firstName, " ").concat(lastName).trim();
|
|
156
|
-
};
|
|
157
|
-
var getLabel = function getLabel(_ref3) {
|
|
158
|
-
var firstName = _ref3.firstName,
|
|
159
|
-
lastName = _ref3.lastName,
|
|
160
|
-
organizationRole = _ref3.organizationRole;
|
|
161
|
-
if (firstName || lastName) {
|
|
162
|
-
return DETAILS_KEYS.NAME;
|
|
163
|
-
}
|
|
164
|
-
if (organizationRole) {
|
|
165
|
-
return DETAILS_KEYS.ORGANIZATION_ROLE;
|
|
166
|
-
}
|
|
167
|
-
return DETAILS_KEYS.GENERIC_DETAILS;
|
|
168
|
-
};
|
|
169
|
-
var formatPermissionsChangeLog = function formatPermissionsChangeLog(_ref4) {
|
|
170
|
-
var from = _ref4.from,
|
|
171
|
-
to = _ref4.to;
|
|
172
|
-
return [{
|
|
173
|
-
field: t("neetoMolecules.auditLogs.details.permissions.description"),
|
|
174
|
-
from: getFormattedValue("description", from),
|
|
175
|
-
to: getFormattedValue("description", to)
|
|
176
|
-
}];
|
|
177
|
-
};
|
|
178
|
-
var transformPermissions = function transformPermissions(permissions) {
|
|
179
|
-
return permissions.map(function (permission) {
|
|
180
|
-
var humanizedParts = permission.split(".").map(_humanize);
|
|
181
|
-
return humanizedParts.join(" - ");
|
|
182
|
-
}).join(", ");
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
var GenericChangelog = function GenericChangelog(_ref) {
|
|
186
|
-
var details = _ref.details;
|
|
187
|
-
var _useTranslation = useTranslation(),
|
|
188
|
-
t = _useTranslation.t;
|
|
189
|
-
var _details$email = details.email,
|
|
190
|
-
email = _details$email === void 0 ? "" : _details$email,
|
|
191
|
-
_details$changes = details.changes,
|
|
192
|
-
changes = _details$changes === void 0 ? {} : _details$changes,
|
|
193
|
-
_details$errorMessage = details.errorMessage,
|
|
194
|
-
errorMessage = _details$errorMessage === void 0 ? "" : _details$errorMessage,
|
|
195
|
-
status = details.status;
|
|
196
|
-
return /*#__PURE__*/jsxs("div", {
|
|
197
|
-
children: [/*#__PURE__*/jsx(LabelledDetail, {
|
|
198
|
-
label: DETAILS_KEYS.AFFECTED_EMAIL,
|
|
199
|
-
value: email
|
|
200
|
-
}), isNotEmpty(changes) && status === "success" ? /*#__PURE__*/jsx("div", {
|
|
201
|
-
className: "w-full min-w-0 max-w-full",
|
|
202
|
-
children: /*#__PURE__*/jsx(Table, {
|
|
203
|
-
columnData: CHANGELOG_COLUMN_DATA,
|
|
204
|
-
enableColumnFreeze: false,
|
|
205
|
-
enableColumnResize: false,
|
|
206
|
-
rowData: formatChangeLog(changes),
|
|
207
|
-
scroll: {
|
|
208
|
-
x: "100%"
|
|
209
|
-
}
|
|
210
|
-
})
|
|
211
|
-
}) : /*#__PURE__*/jsx(LabelledDetail, {
|
|
212
|
-
label: DETAILS_KEYS.ERROR_MESSAGE,
|
|
213
|
-
value: errorMessage || t("neetoMolecules.auditLogs.noError")
|
|
214
|
-
})]
|
|
215
|
-
});
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
var PermissionsChangelog = function PermissionsChangelog(_ref) {
|
|
219
|
-
var details = _ref.details;
|
|
220
|
-
var _details$description = details.description,
|
|
221
|
-
description = _details$description === void 0 ? {} : _details$description,
|
|
222
|
-
_details$organization = details.organizationRole,
|
|
223
|
-
organizationRole = _details$organization === void 0 ? "" : _details$organization,
|
|
224
|
-
_details$addedPermiss = details.addedPermissions,
|
|
225
|
-
addedPermissions = _details$addedPermiss === void 0 ? [] : _details$addedPermiss,
|
|
226
|
-
_details$removedPermi = details.removedPermissions,
|
|
227
|
-
removedPermissions = _details$removedPermi === void 0 ? [] : _details$removedPermi;
|
|
228
|
-
return /*#__PURE__*/jsxs("div", {
|
|
229
|
-
children: [/*#__PURE__*/jsx(LabelledDetail, {
|
|
230
|
-
label: DETAILS_KEYS.ORGANIZATION_ROLE,
|
|
231
|
-
value: organizationRole
|
|
232
|
-
}), isNotEmpty(addedPermissions) && /*#__PURE__*/jsx(LabelledDetail, {
|
|
233
|
-
label: DETAILS_KEYS.ADDED_PERMISSIONS,
|
|
234
|
-
value: transformPermissions(addedPermissions)
|
|
235
|
-
}), isNotEmpty(removedPermissions) && /*#__PURE__*/jsx(LabelledDetail, {
|
|
236
|
-
label: DETAILS_KEYS.REMOVED_PERMISSIONS,
|
|
237
|
-
value: transformPermissions(removedPermissions)
|
|
238
|
-
}), isNotEmpty(description) && /*#__PURE__*/jsx("div", {
|
|
239
|
-
className: "w-full min-w-0 max-w-full",
|
|
240
|
-
children: /*#__PURE__*/jsx(Table, {
|
|
241
|
-
columnData: CHANGELOG_COLUMN_DATA,
|
|
242
|
-
enableColumnFreeze: false,
|
|
243
|
-
enableColumnResize: false,
|
|
244
|
-
rowData: formatPermissionsChangeLog(description),
|
|
245
|
-
scroll: {
|
|
246
|
-
x: "100%"
|
|
247
|
-
}
|
|
248
|
-
})
|
|
249
|
-
})]
|
|
250
|
-
});
|
|
251
|
-
};
|
|
252
|
-
|
|
253
|
-
var Emails = function Emails(_ref) {
|
|
254
|
-
var details = _ref.details;
|
|
255
|
-
var _useTranslation = useTranslation(),
|
|
256
|
-
t = _useTranslation.t;
|
|
257
|
-
var _details$emails = details.emails,
|
|
258
|
-
emails = _details$emails === void 0 ? [] : _details$emails,
|
|
259
|
-
status = details.status,
|
|
260
|
-
_details$errorMessage = details.errorMessage,
|
|
261
|
-
errorMessage = _details$errorMessage === void 0 ? "" : _details$errorMessage;
|
|
262
|
-
return /*#__PURE__*/jsx(Fragment, {
|
|
263
|
-
children: isNotEmpty(emails) && status === "success" ? /*#__PURE__*/jsx("div", {
|
|
264
|
-
className: "w-full min-w-0 max-w-full",
|
|
265
|
-
children: /*#__PURE__*/jsx(Table, {
|
|
266
|
-
columns: EMAILS_TABLE_COLUMN_DATA,
|
|
267
|
-
enableColumnFreeze: false,
|
|
268
|
-
enableColumnResize: false,
|
|
269
|
-
loading: false,
|
|
270
|
-
rowData: formatEmails(emails),
|
|
271
|
-
scroll: {
|
|
272
|
-
x: "100%"
|
|
273
|
-
}
|
|
274
|
-
})
|
|
275
|
-
}) : /*#__PURE__*/jsx(LabelledDetail, {
|
|
276
|
-
label: DETAILS_KEYS.ERROR_MESSAGE,
|
|
277
|
-
value: errorMessage || t("neetoMolecules.auditLogs.noError")
|
|
278
|
-
})
|
|
279
|
-
});
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
var GenericDetails = function GenericDetails(_ref) {
|
|
283
|
-
var details = _ref.details;
|
|
284
|
-
var _details$firstName = details.firstName,
|
|
285
|
-
firstName = _details$firstName === void 0 ? "" : _details$firstName,
|
|
286
|
-
_details$lastName = details.lastName,
|
|
287
|
-
lastName = _details$lastName === void 0 ? "" : _details$lastName,
|
|
288
|
-
_details$organization = details.organizationRole,
|
|
289
|
-
organizationRole = _details$organization === void 0 ? "" : _details$organization;
|
|
290
|
-
var name = getFullName(firstName, lastName);
|
|
291
|
-
var label = getLabel({
|
|
292
|
-
firstName: firstName,
|
|
293
|
-
lastName: lastName,
|
|
294
|
-
organizationRole: organizationRole
|
|
295
|
-
});
|
|
296
|
-
var value = name || organizationRole || JSON.stringify(details);
|
|
297
|
-
return /*#__PURE__*/jsx(LabelledDetail, {
|
|
298
|
-
label: label,
|
|
299
|
-
value: value
|
|
300
|
-
});
|
|
301
|
-
};
|
|
302
53
|
|
|
54
|
+
var _AUDIT_ICON_MAP;
|
|
303
55
|
var AUDIT_LOGS_QUERY_KEY = "audit-logs";
|
|
304
56
|
var ACTIONS = {
|
|
305
57
|
INVITED_USERS: "invitedUsers",
|
|
@@ -309,131 +61,345 @@ var ACTIONS = {
|
|
|
309
61
|
UPDATED_USER_PROFILE: "updatedUserProfile",
|
|
310
62
|
CREATED_ROLE: "createdRole",
|
|
311
63
|
UPDATED_ROLE: "updatedRole",
|
|
312
|
-
DELETED_ROLE: "deletedRole"
|
|
64
|
+
DELETED_ROLE: "deletedRole",
|
|
65
|
+
CONNECTED_GOOGLE_CALENDER: "connectedGoogleCalendar",
|
|
66
|
+
DISCONNECTED_GOOGLE_CALENDER: "disconnectedGoogleCalendar",
|
|
67
|
+
CONNECTED_STRIPE_ACCOUNT: "connectedStripeAccount",
|
|
68
|
+
DISCONNECTED_STRIPE_ACCOUNT: "disconnectedStripeAccount",
|
|
69
|
+
CONNECTED_ZOOM_INTEGRATION: "connectedZoomIntegration",
|
|
70
|
+
DISCONNECTED_ZOOM_INTEGRATION: "disconnectedZoomIntegration",
|
|
71
|
+
CONNECTED_CUSTOM_DOMAIN: "connectedCustomDomain"
|
|
313
72
|
};
|
|
314
|
-
var
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
73
|
+
var AUDIT_ICON_MAP = (_AUDIT_ICON_MAP = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_AUDIT_ICON_MAP, ACTIONS.INVITED_USERS, UserCircle), ACTIONS.USER_SIGNED_UP, UserAdd), ACTIONS.UPDATED_USER, User), ACTIONS.BULK_UPDATE_USERS, User), ACTIONS.UPDATED_USER_PROFILE, UserSettings), ACTIONS.CREATED_ROLE, UserAdd), ACTIONS.UPDATED_ROLE, UserSettings), ACTIONS.DELETED_ROLE, UserRemove), ACTIONS.CONNECTED_GOOGLE_CALENDER, GoogleCalendar), ACTIONS.DISCONNECTED_GOOGLE_CALENDER, GoogleCalendar), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_AUDIT_ICON_MAP, ACTIONS.CONNECTED_STRIPE_ACCOUNT, StripeTypeface), ACTIONS.DISCONNECTED_STRIPE_ACCOUNT, Stripe), ACTIONS.CONNECTED_ZOOM_INTEGRATION, Zoom), ACTIONS.DISCONNECTED_ZOOM_INTEGRATION, Zoom), ACTIONS.CONNECTED_CUSTOM_DOMAIN, CustomDomain));
|
|
74
|
+
var AUDIT_LOGS_PAGE_SIZE = 12;
|
|
75
|
+
|
|
76
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
77
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
78
|
+
var Trans = function Trans(_ref) {
|
|
79
|
+
var i18nKey = _ref.i18nKey,
|
|
80
|
+
_ref$additionalValues = _ref.additionalValues,
|
|
81
|
+
additionalValues = _ref$additionalValues === void 0 ? {} : _ref$additionalValues,
|
|
82
|
+
_ref$additionalCompon = _ref.additionalComponents,
|
|
83
|
+
additionalComponents = _ref$additionalCompon === void 0 ? {} : _ref$additionalCompon;
|
|
84
|
+
return /*#__PURE__*/jsx(Trans$1, {
|
|
85
|
+
i18nKey: i18nKey,
|
|
86
|
+
components: _objectSpread$3({
|
|
87
|
+
Code: /*#__PURE__*/jsx(Typography, {
|
|
88
|
+
className: "neeto-ui-rounded-md neeto-ui-bg-gray-100 p-1",
|
|
89
|
+
component: "code",
|
|
90
|
+
style: "body3"
|
|
91
|
+
}),
|
|
92
|
+
Semibold: /*#__PURE__*/jsx(Typography, {
|
|
93
|
+
className: "n inline-block text-sm font-medium",
|
|
94
|
+
component: "p"
|
|
95
|
+
})
|
|
96
|
+
}, additionalComponents),
|
|
97
|
+
values: _objectSpread$3({
|
|
98
|
+
productSuffix: globalProps.appName
|
|
99
|
+
}, additionalValues)
|
|
100
|
+
});
|
|
319
101
|
};
|
|
320
|
-
var DETAILS_COMPONENT_MAP = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, ACTIONS.INVITED_USERS, Emails), ACTIONS.BULK_UPDATE_USERS, Emails), ACTIONS.USER_SIGNED_UP, GenericDetails), ACTIONS.UPDATED_USER, GenericChangelog), ACTIONS.UPDATED_USER_PROFILE, GenericChangelog), ACTIONS.CREATED_ROLE, GenericDetails), ACTIONS.UPDATED_ROLE, PermissionsChangelog), ACTIONS.DELETED_ROLE, GenericDetails);
|
|
321
102
|
|
|
322
|
-
var
|
|
323
|
-
|
|
324
|
-
|
|
103
|
+
var formatChangedFields = function formatChangedFields(changes) {
|
|
104
|
+
var fields = Object.keys(changes).map(function (field, index) {
|
|
105
|
+
var change = changes[field];
|
|
106
|
+
var element;
|
|
107
|
+
if (change && isPresent(change.from)) {
|
|
108
|
+
element = /*#__PURE__*/jsx("span", {
|
|
109
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
110
|
+
i18nKey: "neetoMolecules.auditLogs.text.updatedFieldsWithPreviousValue",
|
|
111
|
+
additionalValues: {
|
|
112
|
+
field: humanize(field),
|
|
113
|
+
from: change.from,
|
|
114
|
+
to: change.to
|
|
115
|
+
}
|
|
116
|
+
})
|
|
117
|
+
}, field);
|
|
118
|
+
} else {
|
|
119
|
+
element = /*#__PURE__*/jsx("span", {
|
|
120
|
+
children: /*#__PURE__*/jsx(Trans, {
|
|
121
|
+
additionalValues: {
|
|
122
|
+
field: humanize(field),
|
|
123
|
+
to: change.to
|
|
124
|
+
},
|
|
125
|
+
i18nKey: "neetoMolecules.auditLogs.text.updatedFieldsWithNewValue"
|
|
126
|
+
})
|
|
127
|
+
}, field);
|
|
128
|
+
}
|
|
129
|
+
return index > 0 ? [/*#__PURE__*/jsx("span", {
|
|
130
|
+
children: ", "
|
|
131
|
+
}, "sep-".concat(field)), element] : element;
|
|
132
|
+
});
|
|
133
|
+
return fields.flat();
|
|
134
|
+
};
|
|
325
135
|
var transformAction = function transformAction(action) {
|
|
326
136
|
return snakeToCamelCase(action.replace("audit_logs.organization.", ""));
|
|
327
137
|
};
|
|
328
|
-
var
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
};
|
|
355
|
-
var getColumnData = function getColumnData(handleClick) {
|
|
356
|
-
return [{
|
|
357
|
-
title: t("neetoMolecules.auditLogs.table.headers.action", SINGULAR),
|
|
358
|
-
key: "action",
|
|
359
|
-
dataIndex: "action",
|
|
360
|
-
render: function render(action, _ref2) {
|
|
361
|
-
var additionalDetails = _ref2.additionalDetails;
|
|
362
|
-
return /*#__PURE__*/jsx(Button, {
|
|
363
|
-
"data-testid": "action-link-button",
|
|
364
|
-
label: t("neetoMolecules.auditLogs.actions.".concat(action)),
|
|
365
|
-
style: "link",
|
|
366
|
-
onClick: function onClick() {
|
|
367
|
-
return handleClick(additionalDetails);
|
|
138
|
+
var constructAuditLogText = function constructAuditLogText(_ref) {
|
|
139
|
+
var action = _ref.action,
|
|
140
|
+
performedBy = _ref.performedBy,
|
|
141
|
+
_ref$emails = _ref.emails,
|
|
142
|
+
emails = _ref$emails === void 0 ? [] : _ref$emails,
|
|
143
|
+
firstName = _ref.firstName,
|
|
144
|
+
lastName = _ref.lastName,
|
|
145
|
+
organizationRole = _ref.organizationRole,
|
|
146
|
+
email = _ref.email,
|
|
147
|
+
_ref$changes = _ref.changes,
|
|
148
|
+
changes = _ref$changes === void 0 ? {} : _ref$changes,
|
|
149
|
+
status = _ref.status,
|
|
150
|
+
message = _ref.message,
|
|
151
|
+
errorMessage = _ref.errorMessage,
|
|
152
|
+
addedPermissions = _ref.addedPermissions;
|
|
153
|
+
switch (action) {
|
|
154
|
+
case ACTIONS.INVITED_USERS:
|
|
155
|
+
{
|
|
156
|
+
if (status === "success" && isNotEmpty(emails)) {
|
|
157
|
+
var emailList = emails.join(", ");
|
|
158
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
159
|
+
additionalValues: {
|
|
160
|
+
performedBy: performedBy,
|
|
161
|
+
emailList: emailList
|
|
162
|
+
},
|
|
163
|
+
i18nKey: "neetoMolecules.auditLogs.text.invitedUsers"
|
|
164
|
+
});
|
|
368
165
|
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
166
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
167
|
+
additionalValues: {
|
|
168
|
+
performedBy: performedBy,
|
|
169
|
+
errorMessage: errorMessage
|
|
170
|
+
},
|
|
171
|
+
i18nKey: "neetoMolecules.auditLogs.text.invitedUsersFailed"
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
case ACTIONS.USER_SIGNED_UP:
|
|
175
|
+
{
|
|
176
|
+
var name = [firstName, lastName].filter(Boolean).join(" ");
|
|
177
|
+
var userIdentifier = name || organizationRole || email || "User";
|
|
178
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
179
|
+
additionalValues: {
|
|
180
|
+
userIdentifier: userIdentifier
|
|
181
|
+
},
|
|
182
|
+
i18nKey: "neetoMolecules.auditLogs.text.userSignedUp"
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
case ACTIONS.UPDATED_USER:
|
|
186
|
+
{
|
|
187
|
+
var changedFields = formatChangedFields(changes);
|
|
188
|
+
var affectedUser = email || "user";
|
|
189
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
190
|
+
additionalComponents: {
|
|
191
|
+
ChangedFields: /*#__PURE__*/jsx(Fragment, {
|
|
192
|
+
children: changedFields
|
|
193
|
+
})
|
|
194
|
+
},
|
|
195
|
+
additionalValues: {
|
|
196
|
+
performedBy: performedBy,
|
|
197
|
+
affectedUser: affectedUser,
|
|
198
|
+
changedFields: changedFields
|
|
199
|
+
},
|
|
200
|
+
i18nKey: "neetoMolecules.auditLogs.text.updatedUser"
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
case ACTIONS.BULK_UPDATE_USERS:
|
|
204
|
+
{
|
|
205
|
+
if (status === "success" && isNotEmpty(emails)) {
|
|
206
|
+
var _emailList = emails.join(", ");
|
|
207
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
208
|
+
additionalValues: {
|
|
209
|
+
performedBy: performedBy,
|
|
210
|
+
emailList: _emailList,
|
|
211
|
+
message: message
|
|
212
|
+
},
|
|
213
|
+
i18nKey: "neetoMolecules.auditLogs.text.bulkUpdateUsers"
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
217
|
+
additionalValues: {
|
|
218
|
+
performedBy: performedBy,
|
|
219
|
+
errorMessage: errorMessage
|
|
220
|
+
},
|
|
221
|
+
i18nKey: "neetoMolecules.auditLogs.text.bulkUpdateUsersFailed"
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
case ACTIONS.UPDATED_USER_PROFILE:
|
|
225
|
+
{
|
|
226
|
+
var _changedFields = formatChangedFields(changes);
|
|
227
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
228
|
+
additionalComponents: {
|
|
229
|
+
ChangedFields: /*#__PURE__*/jsx(Fragment, {
|
|
230
|
+
children: _changedFields
|
|
231
|
+
})
|
|
232
|
+
},
|
|
233
|
+
additionalValues: {
|
|
234
|
+
performedBy: performedBy
|
|
235
|
+
},
|
|
236
|
+
i18nKey: "neetoMolecules.auditLogs.text.updatedUserProfile"
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
case ACTIONS.CREATED_ROLE:
|
|
240
|
+
{
|
|
241
|
+
var roleName = organizationRole || "role";
|
|
242
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
243
|
+
additionalValues: {
|
|
244
|
+
performedBy: performedBy,
|
|
245
|
+
roleName: roleName
|
|
246
|
+
},
|
|
247
|
+
i18nKey: "neetoMolecules.auditLogs.text.createdRole"
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
case ACTIONS.UPDATED_ROLE:
|
|
251
|
+
{
|
|
252
|
+
var _roleName = organizationRole || "role";
|
|
253
|
+
var permissionsArray = values(addedPermissions).map(function (permission) {
|
|
254
|
+
return humanize(permission.split(".")[1]);
|
|
255
|
+
});
|
|
256
|
+
var addedPermissionsText = permissionsArray.join(", ");
|
|
257
|
+
return (
|
|
258
|
+
/*#__PURE__*/
|
|
259
|
+
// Disabling as we're using the same key for both singular and plural cases
|
|
260
|
+
// eslint-disable-next-line @bigbinary/neeto/no-missing-localization
|
|
261
|
+
jsx(Trans, {
|
|
262
|
+
i18nKey: "neetoMolecules.auditLogs.text.updatedRole",
|
|
263
|
+
additionalValues: {
|
|
264
|
+
performedBy: performedBy,
|
|
265
|
+
roleName: _roleName,
|
|
266
|
+
addedPermissionsText: addedPermissionsText,
|
|
267
|
+
count: permissionsArray.length
|
|
268
|
+
}
|
|
269
|
+
})
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
case ACTIONS.CONNECTED_GOOGLE_CALENDER:
|
|
273
|
+
{
|
|
274
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
275
|
+
i18nKey: "neetoMolecules.auditLogs.text.connectedGoogleCalender",
|
|
276
|
+
additionalValues: {
|
|
277
|
+
performedBy: performedBy,
|
|
278
|
+
emailAddress: changes.emailAddress
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
case ACTIONS.DISCONNECTED_GOOGLE_CALENDER:
|
|
283
|
+
{
|
|
284
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
285
|
+
additionalValues: {
|
|
286
|
+
performedBy: performedBy
|
|
287
|
+
},
|
|
288
|
+
i18nKey: "neetoMolecules.auditLogs.text.disconnectedGoogleCalender"
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
case ACTIONS.CONNECTED_STRIPE_ACCOUNT:
|
|
292
|
+
{
|
|
293
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
294
|
+
i18nKey: "neetoMolecules.auditLogs.text.connectedStripeAccount",
|
|
295
|
+
additionalValues: {
|
|
296
|
+
performedBy: performedBy,
|
|
297
|
+
stripeAccountId: changes.stripeAccountId
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
case ACTIONS.DISCONNECTED_STRIPE_ACCOUNT:
|
|
302
|
+
{
|
|
303
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
304
|
+
additionalValues: {
|
|
305
|
+
performedBy: performedBy
|
|
306
|
+
},
|
|
307
|
+
i18nKey: "neetoMolecules.auditLogs.text.disconnectedStripeAccount"
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
case ACTIONS.CONNECTED_ZOOM_INTEGRATION:
|
|
311
|
+
{
|
|
312
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
313
|
+
i18nKey: "neetoMolecules.auditLogs.text.connectedZoomAccount",
|
|
314
|
+
additionalValues: {
|
|
315
|
+
performedBy: performedBy,
|
|
316
|
+
zoomAccountId: changes.zoomAccountId
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
case ACTIONS.DISCONNECTED_ZOOM_INTEGRATION:
|
|
321
|
+
{
|
|
322
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
323
|
+
additionalValues: {
|
|
324
|
+
performedBy: performedBy
|
|
325
|
+
},
|
|
326
|
+
i18nKey: "neetoMolecules.auditLogs.text.disconnectedZoomAccount"
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
case ACTIONS.CONNECTED_CUSTOM_DOMAIN:
|
|
330
|
+
{
|
|
331
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
332
|
+
additionalValues: {
|
|
333
|
+
performedBy: performedBy,
|
|
334
|
+
hostname: changes.hostname
|
|
335
|
+
},
|
|
336
|
+
i18nKey: "neetoMolecules.auditLogs.text.connectedCustomDomain"
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
case ACTIONS.DELETED_ROLE:
|
|
340
|
+
{
|
|
341
|
+
var _roleName2 = organizationRole || "role";
|
|
342
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
343
|
+
additionalValues: {
|
|
344
|
+
performedBy: performedBy,
|
|
345
|
+
roleName: _roleName2
|
|
346
|
+
},
|
|
347
|
+
i18nKey: "neetoMolecules.auditLogs.text.deletedRole"
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
default:
|
|
351
|
+
{
|
|
352
|
+
return /*#__PURE__*/jsx(Trans, {
|
|
353
|
+
additionalValues: {
|
|
354
|
+
performedBy: performedBy
|
|
355
|
+
},
|
|
356
|
+
i18nKey: "neetoMolecules.auditLogs.text.performedAction"
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
}
|
|
391
360
|
};
|
|
392
361
|
|
|
393
|
-
var
|
|
394
|
-
var
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
var
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
children: [/*#__PURE__*/jsx(LabelledDetail, {
|
|
422
|
-
label: ADDITIONAL_DETAILS_KEYS.ACTION,
|
|
423
|
-
value: action
|
|
424
|
-
}), /*#__PURE__*/jsx(LabelledDetail, {
|
|
425
|
-
label: ADDITIONAL_DETAILS_KEYS.PERFORMED_BY,
|
|
426
|
-
value: performedBy
|
|
427
|
-
}), /*#__PURE__*/jsx(LabelledDetail, {
|
|
428
|
-
label: ADDITIONAL_DETAILS_KEYS.PERFORMED_AT,
|
|
429
|
-
value: performedAt
|
|
430
|
-
}), /*#__PURE__*/jsx(LabelledDetail, {
|
|
431
|
-
label: ADDITIONAL_DETAILS_KEYS.PRODUCT,
|
|
432
|
-
value: _capitalize(product)
|
|
433
|
-
}), /*#__PURE__*/jsx(DetailComponent, {
|
|
434
|
-
details: details
|
|
435
|
-
})]
|
|
362
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
363
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
364
|
+
var Card = function Card(_ref) {
|
|
365
|
+
var auditLog = _ref.auditLog,
|
|
366
|
+
index = _ref.index,
|
|
367
|
+
totalCount = _ref.totalCount;
|
|
368
|
+
var key = auditLog.key,
|
|
369
|
+
metadata = auditLog.metadata,
|
|
370
|
+
performer = auditLog.performer,
|
|
371
|
+
updatedAt = auditLog.updatedAt;
|
|
372
|
+
var action = transformAction(key);
|
|
373
|
+
var performedBy = (performer === null || performer === void 0 ? void 0 : performer.name) || "";
|
|
374
|
+
var performedAt = dateFormat.dateTime(updatedAt);
|
|
375
|
+
var auditText = constructAuditLogText(_objectSpread$2({
|
|
376
|
+
action: action,
|
|
377
|
+
performedBy: performedBy
|
|
378
|
+
}, metadata));
|
|
379
|
+
var Icon = AUDIT_ICON_MAP[action];
|
|
380
|
+
return /*#__PURE__*/jsxs("div", {
|
|
381
|
+
className: classnames("align-items-center neeto-ui-border-gray-200 flex w-full gap-x-4 border-b border-l border-r p-3", {
|
|
382
|
+
"rounded-t-md border-t": index === 0,
|
|
383
|
+
"rounded-b-md": index === totalCount - 1
|
|
384
|
+
}),
|
|
385
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
386
|
+
className: "neeto-ui-rounded-full neeto-ui-bg-gray-100 flex size-10 flex-shrink-0 items-center justify-center",
|
|
387
|
+
children: /*#__PURE__*/jsx(Icon, {
|
|
388
|
+
className: "neeto-ui-text-gray-600 flex-shrink-0",
|
|
389
|
+
size: 22
|
|
436
390
|
})
|
|
391
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
392
|
+
className: "flex flex-col gap-y-2",
|
|
393
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
394
|
+
component: "span",
|
|
395
|
+
lineHeight: "normal",
|
|
396
|
+
style: "body2",
|
|
397
|
+
children: auditText
|
|
398
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
399
|
+
className: "neeto-ui-text-gray-500 m-0",
|
|
400
|
+
style: "body3",
|
|
401
|
+
children: performedAt
|
|
402
|
+
})]
|
|
437
403
|
})]
|
|
438
404
|
});
|
|
439
405
|
};
|
|
@@ -467,14 +433,6 @@ var AuditLogs = function AuditLogs(_ref) {
|
|
|
467
433
|
var headerProps = _ref.headerProps,
|
|
468
434
|
noDataHelpText = _ref.noDataHelpText,
|
|
469
435
|
noDataTitle = _ref.noDataTitle;
|
|
470
|
-
var _useState = useState(false),
|
|
471
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
472
|
-
isAdditionalDetailsPaneOpen = _useState2[0],
|
|
473
|
-
setIsAdditionalDetailsPaneOpen = _useState2[1];
|
|
474
|
-
var _useState3 = useState({}),
|
|
475
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
476
|
-
additionalDetails = _useState4[0],
|
|
477
|
-
setAdditionalDetails = _useState4[1];
|
|
478
436
|
var _useTranslation = useTranslation(),
|
|
479
437
|
t = _useTranslation.t;
|
|
480
438
|
var _useQueryParams = useQueryParams(),
|
|
@@ -482,7 +440,8 @@ var AuditLogs = function AuditLogs(_ref) {
|
|
|
482
440
|
page = _useQueryParams$page === void 0 ? DEFAULT_PAGE_INDEX : _useQueryParams$page;
|
|
483
441
|
var _useFetchAuditLogs = useFetchAuditLogs({
|
|
484
442
|
params: {
|
|
485
|
-
page: page
|
|
443
|
+
page: page,
|
|
444
|
+
pageSize: AUDIT_LOGS_PAGE_SIZE
|
|
486
445
|
}
|
|
487
446
|
}),
|
|
488
447
|
_useFetchAuditLogs$da = _useFetchAuditLogs.data,
|
|
@@ -493,54 +452,37 @@ var AuditLogs = function AuditLogs(_ref) {
|
|
|
493
452
|
totalCount = _useFetchAuditLogs$da4 === void 0 ? 0 : _useFetchAuditLogs$da4,
|
|
494
453
|
isLoading = _useFetchAuditLogs.isLoading,
|
|
495
454
|
isFetching = _useFetchAuditLogs.isFetching;
|
|
496
|
-
|
|
497
|
-
setIsAdditionalDetailsPaneOpen(true);
|
|
498
|
-
setAdditionalDetails(additionalDetails);
|
|
499
|
-
};
|
|
500
|
-
var handleClose = function handleClose() {
|
|
501
|
-
setIsAdditionalDetailsPaneOpen(false);
|
|
502
|
-
setAdditionalDetails({});
|
|
503
|
-
};
|
|
504
|
-
if (isLoading) {
|
|
455
|
+
if (isLoading || isFetching) {
|
|
505
456
|
return /*#__PURE__*/jsx("div", {
|
|
506
457
|
className: "flex h-full w-full items-center justify-center",
|
|
507
458
|
children: /*#__PURE__*/jsx(Spinner, {})
|
|
508
459
|
});
|
|
509
460
|
}
|
|
510
461
|
return /*#__PURE__*/jsxs(Container, {
|
|
462
|
+
className: "relative",
|
|
511
463
|
children: [/*#__PURE__*/jsx(Header, _objectSpread({
|
|
512
464
|
title: t("neetoMolecules.auditLogs.title")
|
|
513
|
-
}, headerProps)), /*#__PURE__*/jsx(
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
465
|
+
}, headerProps)), isPresent(auditLogs) ? /*#__PURE__*/jsx("div", {
|
|
466
|
+
className: "w-full",
|
|
467
|
+
children: auditLogs.map(function (auditLog, index) {
|
|
468
|
+
return /*#__PURE__*/createElement(Card, {
|
|
469
|
+
auditLog: auditLog,
|
|
470
|
+
index: index,
|
|
471
|
+
key: auditLog.id,
|
|
472
|
+
totalCount: auditLogs.length
|
|
473
|
+
});
|
|
519
474
|
})
|
|
520
|
-
})
|
|
521
|
-
className: "
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
fixedHeight: true,
|
|
526
|
-
columnData: getColumnData(handleClick),
|
|
527
|
-
currentPageNumber: parseInt(page),
|
|
528
|
-
"data-testid": "audit-logs-table",
|
|
529
|
-
defaultPageSize: DEFAULT_PAGE_SIZE,
|
|
530
|
-
enableColumnFreeze: false,
|
|
531
|
-
loading: isFetching,
|
|
532
|
-
rowData: transformLogsForTable(auditLogs)
|
|
533
|
-
}) : /*#__PURE__*/jsx("div", {
|
|
534
|
-
className: "flex h-full w-full items-center justify-center",
|
|
535
|
-
children: /*#__PURE__*/jsx(NoData, {
|
|
536
|
-
helpText: noDataHelpText,
|
|
537
|
-
title: noDataTitle || t("neetoMolecules.auditLogs.noData")
|
|
538
|
-
})
|
|
475
|
+
}) : /*#__PURE__*/jsx("div", {
|
|
476
|
+
className: "flex h-full w-full items-center justify-center",
|
|
477
|
+
children: /*#__PURE__*/jsx(NoData, {
|
|
478
|
+
helpText: noDataHelpText,
|
|
479
|
+
title: noDataTitle || t("neetoMolecules.auditLogs.noData")
|
|
539
480
|
})
|
|
540
|
-
}), /*#__PURE__*/jsx(
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
481
|
+
}), /*#__PURE__*/jsx(Pagination, {
|
|
482
|
+
className: "neeto-ui-bg-white fixed bottom-5 right-6",
|
|
483
|
+
count: totalCount,
|
|
484
|
+
pageNo: parseInt(page),
|
|
485
|
+
pageSize: AUDIT_LOGS_PAGE_SIZE
|
|
544
486
|
})]
|
|
545
487
|
});
|
|
546
488
|
};
|