2023-03-03 00:16:26 +08:00
|
|
|
import {
|
|
|
|
CollectionManagerProvider,
|
|
|
|
SchemaInitializerProvider,
|
2023-04-06 16:10:38 +08:00
|
|
|
TableBlockProvider
|
2023-03-03 00:16:26 +08:00
|
|
|
} from '@nocobase/client';
|
2023-04-06 16:10:38 +08:00
|
|
|
import React from 'react';
|
2023-03-03 00:16:26 +08:00
|
|
|
import { useAuditChangesCollection, useAuditLogsCollection, useCollectionsCollection } from './collections';
|
|
|
|
import { AuditLogsTableActionColumnInitializers } from './initializers/AuditLogsTableActionColumnInitializers';
|
|
|
|
import { AuditLogsTableActionInitializers } from './initializers/AuditLogsTableActionInitializers';
|
|
|
|
import { AuditLogsTableColumnInitializers } from './initializers/AuditLogsTableColumnInitializers';
|
|
|
|
|
|
|
|
export const AuditLogsBlockProvider: React.FC = ({ children, ...restProps }) => {
|
|
|
|
const auditChangesCollection = useAuditChangesCollection();
|
|
|
|
const auditLogsCollection = useAuditLogsCollection();
|
|
|
|
const collectionsCollection = useCollectionsCollection();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<SchemaInitializerProvider
|
|
|
|
initializers={{
|
|
|
|
AuditLogsTableActionInitializers,
|
|
|
|
AuditLogsTableActionColumnInitializers,
|
|
|
|
AuditLogsTableColumnInitializers,
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
<CollectionManagerProvider collections={[auditLogsCollection, auditChangesCollection, collectionsCollection]}>
|
|
|
|
<TableBlockProvider {...restProps}>{children}</TableBlockProvider>
|
|
|
|
</CollectionManagerProvider>
|
|
|
|
</SchemaInitializerProvider>
|
|
|
|
);
|
|
|
|
};
|