From c46581180f228e29e4619dca405bf0c30f749b46 Mon Sep 17 00:00:00 2001 From: "ruiyi.jiang" Date: Tue, 8 Aug 2023 08:48:38 +0800 Subject: [PATCH] MUI props rename, onChangePage => onPageChange Signed-off-by: ruiyi.jiang --- client/src/components/grid/Grid.tsx | 6 +++--- client/src/components/grid/TablePaginationActions.tsx | 6 +++--- client/src/components/grid/Types.ts | 4 ++-- client/src/pages/collections/Collections.tsx | 2 +- client/src/pages/database/Database.tsx | 2 +- client/src/pages/partitions/Partitions.tsx | 2 +- client/src/pages/preview/Preview.tsx | 2 +- client/src/pages/query/Query.tsx | 2 +- client/src/pages/schema/Schema.tsx | 2 +- client/src/pages/search/VectorSearch.tsx | 2 +- client/src/pages/user/Roles.tsx | 2 +- client/src/pages/user/User.tsx | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/client/src/components/grid/Grid.tsx b/client/src/components/grid/Grid.tsx index 314f9c76..5feff9b8 100644 --- a/client/src/components/grid/Grid.tsx +++ b/client/src/components/grid/Grid.tsx @@ -71,7 +71,7 @@ const userStyle = makeStyles(theme => ({ * @param rowCount required. totoal data count for pagination * @param rowsPerPage per page for pagination, default is 10 * @param primaryKey required. The unique column for your data. use for checkbox and render key. - * @param onChangePage handle page change + * @param onPageChange handle page change * @param labelDisplayedRows Custom pagination label function, return string; * @param page current page for pagination * @param showToolbar control toolbar display. default is false @@ -106,7 +106,7 @@ const AttuGrid: FC = props => { primaryKey = 'id', showToolbar = false, toolbarConfigs = [], - onChangePage = ( + onPageChange = ( e: MouseEvent | null, nextPageNum: number ) => { @@ -238,7 +238,7 @@ const AttuGrid: FC = props => { labelDisplayedRows={labelDisplayedRows || defaultLabelRows} rowsPerPage={rowsPerPage} rowsPerPageOptions={[]} - onChangePage={onChangePage} + onPageChange={onPageChange} className={classes.pagenation} ActionsComponent={TablePaginationActions} /> diff --git a/client/src/components/grid/TablePaginationActions.tsx b/client/src/components/grid/TablePaginationActions.tsx index 3bd2a283..352b449f 100644 --- a/client/src/components/grid/TablePaginationActions.tsx +++ b/client/src/components/grid/TablePaginationActions.tsx @@ -39,7 +39,7 @@ const useStyles = makeStyles((theme: Theme) => const TablePaginationActions = (props: TablePaginationActionsProps) => { const classes = useStyles(); - const { count, page, rowsPerPage, onChangePage } = props; + const { count, page, rowsPerPage, onPageChange } = props; // i18n const { t: commonTrans } = useTranslation(); @@ -48,13 +48,13 @@ const TablePaginationActions = (props: TablePaginationActionsProps) => { const handleBackButtonClick = ( event: React.MouseEvent ) => { - onChangePage(event, page - 1); + onPageChange(event, page - 1); }; const handleNextButtonClick = ( event: React.MouseEvent ) => { - onChangePage(event, page + 1); + onPageChange(event, page + 1); }; return ( diff --git a/client/src/components/grid/Types.ts b/client/src/components/grid/Types.ts index 62d03cad..0e6eb2ee 100644 --- a/client/src/components/grid/Types.ts +++ b/client/src/components/grid/Types.ts @@ -124,7 +124,7 @@ export type AttuGridType = ToolBarType & { // used to dynamic set page size by table container and row height setRowsPerPage?: (size: number) => void; primaryKey: string; - onChangePage?: (e: any, nextPageNum: number) => void; + onPageChange?: (e: any, nextPageNum: number) => void; labelDisplayedRows?: (obj: LabelDisplayedRowsArgs) => React.ReactNode; page?: number; showToolbar?: boolean; @@ -170,7 +170,7 @@ export type TablePaginationActionsProps = { count: number; page: number; rowsPerPage: number; - onChangePage: ( + onPageChange: ( event: React.MouseEvent, newPage: number ) => void; diff --git a/client/src/pages/collections/Collections.tsx b/client/src/pages/collections/Collections.tsx index e35a4b9e..06c54ba3 100644 --- a/client/src/pages/collections/Collections.tsx +++ b/client/src/pages/collections/Collections.tsx @@ -506,7 +506,7 @@ const Collections = () => { selected={selectedCollections} setSelected={handleSelectChange} page={currentPage} - onChangePage={handlePageChange} + onPageChange={handlePageChange} rowsPerPage={pageSize} setRowsPerPage={handlePageSize} isLoading={loading} diff --git a/client/src/pages/database/Database.tsx b/client/src/pages/database/Database.tsx index 11310282..25035625 100644 --- a/client/src/pages/database/Database.tsx +++ b/client/src/pages/database/Database.tsx @@ -132,7 +132,7 @@ const Database = () => { selected={selectedDatabase} setSelected={handleSelectChange} // page={currentPage} - // onChangePage={handlePageChange} + // onPageChange={handlePageChange} // rowsPerPage={pageSize} // setRowsPerPage={handlePageSize} // isLoading={loading} diff --git a/client/src/pages/partitions/Partitions.tsx b/client/src/pages/partitions/Partitions.tsx index 56e2f0b2..e671dfe8 100644 --- a/client/src/pages/partitions/Partitions.tsx +++ b/client/src/pages/partitions/Partitions.tsx @@ -325,7 +325,7 @@ const Partitions: FC<{ selected={selectedPartitions} setSelected={handleSelectChange} page={currentPage} - onChangePage={handlePageChange} + onPageChange={handlePageChange} rowsPerPage={pageSize} setRowsPerPage={handlePageSize} isLoading={loading} diff --git a/client/src/pages/preview/Preview.tsx b/client/src/pages/preview/Preview.tsx index fddb7bbf..bdfaec06 100644 --- a/client/src/pages/preview/Preview.tsx +++ b/client/src/pages/preview/Preview.tsx @@ -145,7 +145,7 @@ const Preview: FC<{ rows={result} rowCount={total} page={currentPage} - onChangePage={handlePageChange} + onPageChange={handlePageChange} rowsPerPage={pageSize} setRowsPerPage={handlePageSize} /> diff --git a/client/src/pages/query/Query.tsx b/client/src/pages/query/Query.tsx index a813f21b..c114e159 100644 --- a/client/src/pages/query/Query.tsx +++ b/client/src/pages/query/Query.tsx @@ -276,7 +276,7 @@ const Query: FC<{ selected={selectedData} setSelected={handleSelectChange} page={currentPage} - onChangePage={handlePageChange} + onPageChange={handlePageChange} rowsPerPage={pageSize} setRowsPerPage={handlePageSize} orderBy={orderBy} diff --git a/client/src/pages/schema/Schema.tsx b/client/src/pages/schema/Schema.tsx index 596cfe1b..6dbf1b88 100644 --- a/client/src/pages/schema/Schema.tsx +++ b/client/src/pages/schema/Schema.tsx @@ -282,7 +282,7 @@ const Schema: FC<{ primaryKey="_fieldId" showHoverStyle={false} page={currentPage} - onChangePage={handlePageChange} + onPageChange={handlePageChange} rowsPerPage={pageSize} setRowsPerPage={handlePageSize} isLoading={loading} diff --git a/client/src/pages/search/VectorSearch.tsx b/client/src/pages/search/VectorSearch.tsx index 85344845..bf1eaa8b 100644 --- a/client/src/pages/search/VectorSearch.tsx +++ b/client/src/pages/search/VectorSearch.tsx @@ -555,7 +555,7 @@ const VectorSearch = () => { rowCount={total} primaryKey="rank" page={currentPage} - onChangePage={handlePageChange} + onPageChange={handlePageChange} rowsPerPage={pageSize} setRowsPerPage={handlePageSize} openCheckBox={false} diff --git a/client/src/pages/user/Roles.tsx b/client/src/pages/user/Roles.tsx index 0acd66fb..dfb29b51 100644 --- a/client/src/pages/user/Roles.tsx +++ b/client/src/pages/user/Roles.tsx @@ -196,7 +196,7 @@ const Roles = () => { selected={selectedRole} setSelected={handleSelectChange} // page={currentPage} - // onChangePage={handlePageChange} + // onPageChange={handlePageChange} // rowsPerPage={pageSize} // setRowsPerPage={handlePageSize} // isLoading={loading} diff --git a/client/src/pages/user/User.tsx b/client/src/pages/user/User.tsx index 9da25885..250f8de7 100644 --- a/client/src/pages/user/User.tsx +++ b/client/src/pages/user/User.tsx @@ -242,7 +242,7 @@ const Users = () => { selected={selectedUser} setSelected={handleSelectChange} // page={currentPage} - // onChangePage={handlePageChange} + // onPageChange={handlePageChange} // rowsPerPage={pageSize} // setRowsPerPage={handlePageSize} // isLoading={loading}