@craftercms/studio-ui
Version:
Services, components, models & utils to build CrafterCMS authoring extensions.
107 lines (105 loc) • 2.92 kB
TypeScript
/*
* Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3 as published by
* the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import { AuditLogEntry, AuditLogEntryParameter } from '../../models/Audit';
import { PagedArray } from '../../models/PagedArray';
import React from 'react';
import { DataGridProps, GridColDef } from '@mui/x-data-grid';
import { AuditOptions } from '../../services/audit';
import { Site } from '../../models/Site';
import User from '../../models/User';
import LookupTable from '../../models/LookupTable';
export interface AuditGridUIProps {
page: number;
auditLogs: PagedArray<AuditLogEntry>;
sites: Site[];
users: PagedArray<User>;
parametersLookup: LookupTable<AuditLogEntryParameter[]>;
operations: {
id: string;
value: string;
name: string;
}[];
origins: {
id: string;
value: string;
name: string;
}[];
filters: AuditOptions;
hasActiveFilters: boolean;
timezones: string[];
siteMode?: boolean;
onPageChange: DataGridProps['onPageChange'];
onResetFilters(): void;
onResetFilter(id: string | string[]): void;
onFetchParameters(id: number): void;
onPageSizeChange: DataGridProps['onPageSizeChange'];
onFilterChange(filter: { id: string; value: string | string[] }): void;
}
export interface GridColumnMenuProps extends React.HTMLAttributes<HTMLUListElement> {
hideMenu: () => void;
currentColumn: GridColDef;
open: boolean;
id?: string;
labelledby?: string;
}
export declare const translations: {
timestamp: {
id: string;
defaultMessage: string;
};
siteName: {
id: string;
defaultMessage: string;
};
operation: {
id: string;
defaultMessage: string;
};
targetValue: {
id: string;
defaultMessage: string;
};
targetType: {
id: string;
defaultMessage: string;
};
username: {
id: string;
defaultMessage: string;
};
name: {
id: string;
defaultMessage: string;
};
origin: {
id: string;
defaultMessage: string;
};
parameters: {
id: string;
defaultMessage: string;
};
};
export declare const fieldIdMapping: {
operationTimestamp: string;
siteName: string;
actorId: string;
origin: string;
operation: string;
primaryTargetValue: string;
};
export declare function AuditGridUI(props: AuditGridUIProps): JSX.Element;
export default AuditGridUI;