);
}
diff --git a/frontend/app/components/Client/Audit/AuditList/AuditList.tsx b/frontend/app/components/Client/Audit/AuditList/AuditList.tsx
index fc135f102..2b4249155 100644
--- a/frontend/app/components/Client/Audit/AuditList/AuditList.tsx
+++ b/frontend/app/components/Client/Audit/AuditList/AuditList.tsx
@@ -1,14 +1,60 @@
-import React from 'react';
+import { useModal } from 'App/components/Modal';
+import { useStore } from 'App/mstore';
+import { useObserver } from 'mobx-react-lite';
+import React, { useEffect } from 'react';
+import { Loader, Pagination, NoContent } from 'UI';
+import AuditDetailModal from '../AuditDetailModal';
+import AuditListItem from '../AuditListItem';
interface Props {
}
function AuditList(props: Props) {
- return (
-
- );
+ const { auditStore } = useStore();
+ const loading = useObserver(() => auditStore.isLoading);
+ const list = useObserver(() => auditStore.list);
+ const searchQuery = useObserver(() => auditStore.searchQuery);
+ const page = useObserver(() => auditStore.page);
+ const { showModal } = useModal();
+
+ useEffect(() => {
+ auditStore.fetchAudits({
+ page: auditStore.page,
+ limit: auditStore.pageSize,
+ query: auditStore.searchQuery,
+ });
+ }, [page, searchQuery]);
+
+ return useObserver(() => (
+
+ ));
}
export default AuditList;
\ No newline at end of file
diff --git a/frontend/app/components/Client/Audit/AuditListItem/AuditListItem.tsx b/frontend/app/components/Client/Audit/AuditListItem/AuditListItem.tsx
index b587f08e7..492d5c140 100644
--- a/frontend/app/components/Client/Audit/AuditListItem/AuditListItem.tsx
+++ b/frontend/app/components/Client/Audit/AuditListItem/AuditListItem.tsx
@@ -1,12 +1,17 @@
import React from 'react';
+import { checkForRecent } from 'App/date';
interface Props {
-
+ audit: any;
+ onShowDetails: () => void;
}
function AuditListItem(props: Props) {
+ const { audit, onShowDetails } = props;
return (
-
-
+
+
asd
+
{audit.action}
+
{audit.createdAt && checkForRecent(audit.createdAt, 'LLL dd, yyyy, hh:mm a')}
);
}
diff --git a/frontend/app/components/Client/Audit/AuditSearchField/AuditSearchField.tsx b/frontend/app/components/Client/Audit/AuditSearchField/AuditSearchField.tsx
new file mode 100644
index 000000000..8c0d32d5b
--- /dev/null
+++ b/frontend/app/components/Client/Audit/AuditSearchField/AuditSearchField.tsx
@@ -0,0 +1,33 @@
+import React, { useEffect } from 'react';
+import { Icon } from 'UI';
+import { debounce } from 'App/utils';
+
+let debounceUpdate: any = () => {}
+interface Props {
+ onChange: (value: string) => void;
+}
+function AuditSearchField(props: Props) {
+ const { onChange } = props;
+
+ useEffect(() => {
+ debounceUpdate = debounce((value) => onChange(value), 500);
+ }, [])
+
+ const write = ({ target: { name, value } }) => {
+ debounceUpdate(value);
+ }
+
+ return (
+
+
+
+
+ );
+}
+
+export default AuditSearchField;
\ No newline at end of file
diff --git a/frontend/app/components/Client/Audit/AuditSearchField/index.ts b/frontend/app/components/Client/Audit/AuditSearchField/index.ts
new file mode 100644
index 000000000..646947095
--- /dev/null
+++ b/frontend/app/components/Client/Audit/AuditSearchField/index.ts
@@ -0,0 +1 @@
+export { default } from './AuditSearchField';
\ No newline at end of file
diff --git a/frontend/app/components/Client/Audit/AuditView/AuditView.tsx b/frontend/app/components/Client/Audit/AuditView/AuditView.tsx
index 02554fe1d..ec9904567 100644
--- a/frontend/app/components/Client/Audit/AuditView/AuditView.tsx
+++ b/frontend/app/components/Client/Audit/AuditView/AuditView.tsx
@@ -1,11 +1,24 @@
import React from 'react';
+import { PageTitle } from 'UI';
+import AuditList from '../AuditList';
+import AuditSearchField from '../AuditSearchField';
+import { useStore } from 'App/mstore';
+import { useObserver } from 'mobx-react-lite';
function AuditView(props) {
- return (
+ const { auditStore } = useStore();
+ return useObserver(() => (
- View
+
+
+
+
auditStore.updateKey('searchQuery', value) }/>
+
+
+
+
- );
+ ));
}
export default AuditView;
\ No newline at end of file
diff --git a/frontend/app/components/Client/Client.js b/frontend/app/components/Client/Client.js
index 518148a5c..c58056b5f 100644
--- a/frontend/app/components/Client/Client.js
+++ b/frontend/app/components/Client/Client.js
@@ -8,6 +8,7 @@ import ProfileSettings from './ProfileSettings';
import Integrations from './Integrations';
import ManageUsers from './ManageUsers';
import UserView from './Users/UsersView';
+import AuditView from './Audit/AuditView';
import Sites from './Sites';
import CustomFields from './CustomFields';
import Webhooks from './Webhooks';
@@ -43,6 +44,7 @@ export default class Client extends React.PureComponent {
+
)
diff --git a/frontend/app/components/Client/ManageUsers/ManageUsers.js b/frontend/app/components/Client/ManageUsers/ManageUsers.js
index 9071ee46b..1504a0631 100644
--- a/frontend/app/components/Client/ManageUsers/ManageUsers.js
+++ b/frontend/app/components/Client/ManageUsers/ManageUsers.js
@@ -236,7 +236,7 @@ class ManageUsers extends React.PureComponent {
title="No users are available."
size="small"
show={ members.size === 0 }
- icon
+ animatedIcon="empty-state"
>
{
diff --git a/frontend/app/components/Client/PreferencesMenu/PreferencesMenu.js b/frontend/app/components/Client/PreferencesMenu/PreferencesMenu.js
index 0c57c1ab7..682d1519a 100644
--- a/frontend/app/components/Client/PreferencesMenu/PreferencesMenu.js
+++ b/frontend/app/components/Client/PreferencesMenu/PreferencesMenu.js
@@ -78,6 +78,17 @@ function PreferencesMenu({ activeTab, appearance, history, isEnterprise }) {
/>
)}
+
+ { isEnterprise && (
+
+ setTab(CLIENT_TABS.AUDIT) }
+ />
+
+ )}
setTab(CLIENT_TABS.NOTIFICATIONS) }
/>
-
+