Skip to content

Commit

Permalink
MUI props rename, onChangePage => onPageChange
Browse files Browse the repository at this point in the history
Signed-off-by: ruiyi.jiang <[email protected]>
  • Loading branch information
shanghaikid committed Aug 8, 2023
1 parent 2ab857d commit c465811
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions client/src/components/grid/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -106,7 +106,7 @@ const AttuGrid: FC<AttuGridType> = props => {
primaryKey = 'id',
showToolbar = false,
toolbarConfigs = [],
onChangePage = (
onPageChange = (
e: MouseEvent<HTMLButtonElement> | null,
nextPageNum: number
) => {
Expand Down Expand Up @@ -238,7 +238,7 @@ const AttuGrid: FC<AttuGridType> = props => {
labelDisplayedRows={labelDisplayedRows || defaultLabelRows}
rowsPerPage={rowsPerPage}
rowsPerPageOptions={[]}
onChangePage={onChangePage}
onPageChange={onPageChange}
className={classes.pagenation}
ActionsComponent={TablePaginationActions}
/>
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/grid/TablePaginationActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -48,13 +48,13 @@ const TablePaginationActions = (props: TablePaginationActionsProps) => {
const handleBackButtonClick = (
event: React.MouseEvent<HTMLButtonElement>
) => {
onChangePage(event, page - 1);
onPageChange(event, page - 1);
};

const handleNextButtonClick = (
event: React.MouseEvent<HTMLButtonElement>
) => {
onChangePage(event, page + 1);
onPageChange(event, page + 1);
};

return (
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/grid/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -170,7 +170,7 @@ export type TablePaginationActionsProps = {
count: number;
page: number;
rowsPerPage: number;
onChangePage: (
onPageChange: (
event: React.MouseEvent<HTMLButtonElement>,
newPage: number
) => void;
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/collections/Collections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ const Collections = () => {
selected={selectedCollections}
setSelected={handleSelectChange}
page={currentPage}
onChangePage={handlePageChange}
onPageChange={handlePageChange}
rowsPerPage={pageSize}
setRowsPerPage={handlePageSize}
isLoading={loading}
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/database/Database.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const Database = () => {
selected={selectedDatabase}
setSelected={handleSelectChange}
// page={currentPage}
// onChangePage={handlePageChange}
// onPageChange={handlePageChange}
// rowsPerPage={pageSize}
// setRowsPerPage={handlePageSize}
// isLoading={loading}
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/partitions/Partitions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ const Partitions: FC<{
selected={selectedPartitions}
setSelected={handleSelectChange}
page={currentPage}
onChangePage={handlePageChange}
onPageChange={handlePageChange}
rowsPerPage={pageSize}
setRowsPerPage={handlePageSize}
isLoading={loading}
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/preview/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const Preview: FC<{
rows={result}
rowCount={total}
page={currentPage}
onChangePage={handlePageChange}
onPageChange={handlePageChange}
rowsPerPage={pageSize}
setRowsPerPage={handlePageSize}
/>
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/query/Query.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ const Query: FC<{
selected={selectedData}
setSelected={handleSelectChange}
page={currentPage}
onChangePage={handlePageChange}
onPageChange={handlePageChange}
rowsPerPage={pageSize}
setRowsPerPage={handlePageSize}
orderBy={orderBy}
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/schema/Schema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ const Schema: FC<{
primaryKey="_fieldId"
showHoverStyle={false}
page={currentPage}
onChangePage={handlePageChange}
onPageChange={handlePageChange}
rowsPerPage={pageSize}
setRowsPerPage={handlePageSize}
isLoading={loading}
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/search/VectorSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ const VectorSearch = () => {
rowCount={total}
primaryKey="rank"
page={currentPage}
onChangePage={handlePageChange}
onPageChange={handlePageChange}
rowsPerPage={pageSize}
setRowsPerPage={handlePageSize}
openCheckBox={false}
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/user/Roles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const Roles = () => {
selected={selectedRole}
setSelected={handleSelectChange}
// page={currentPage}
// onChangePage={handlePageChange}
// onPageChange={handlePageChange}
// rowsPerPage={pageSize}
// setRowsPerPage={handlePageSize}
// isLoading={loading}
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/user/User.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ const Users = () => {
selected={selectedUser}
setSelected={handleSelectChange}
// page={currentPage}
// onChangePage={handlePageChange}
// onPageChange={handlePageChange}
// rowsPerPage={pageSize}
// setRowsPerPage={handlePageSize}
// isLoading={loading}
Expand Down

0 comments on commit c465811

Please sign in to comment.