diff --git a/package.json b/package.json index e7b3d25..73ad90d 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "@types/uuid": "8.3.4", "@typescript-eslint/eslint-plugin": "5.10.2", "@typescript-eslint/parser": "5.10.2", - "cypress": "^10.3.1", + "cypress": "10.3.1", "eslint": "8.8.0", "eslint-config-airbnb": "19.0.4", "eslint-import-resolver-typescript": "2.5.0", diff --git a/src/qqq/pages/entity-list/index.tsx b/src/qqq/pages/entity-list/index.tsx index d049834..bae32c6 100644 --- a/src/qqq/pages/entity-list/index.tsx +++ b/src/qqq/pages/entity-list/index.tsx @@ -20,7 +20,7 @@ import Icon from "@mui/material/Icon"; import Menu from "@mui/material/Menu"; import MenuItem from "@mui/material/MenuItem"; import Link from "@mui/material/Link"; -import {Alert, tableFooterClasses} from "@mui/material"; +import {Alert, TablePagination} from "@mui/material"; import { DataGridPro, GridCallbackDetails, @@ -498,6 +498,25 @@ function EntityList({table}: Props): JSX.Element document.location.href = `/processes/${tableName}.bulkDelete${getRecordsQueryString()}`; }; + // @ts-ignore + const defaultLabelDisplayedRows = ({from, to, count}) => `${from.toLocaleString()}–${to.toLocaleString()} of ${count !== -1 ? count.toLocaleString() : `more than ${to.toLocaleString()}`}`; + + function CustomPagination() + { + return ( + handlePageChange(value)} + onRowsPerPageChange={(event) => handleRowsPerPageChange(Number(event.target.value))} + labelDisplayedRows={defaultLabelDisplayedRows} + /> + ); + } + function CustomToolbar() { const [bulkActionsMenuAnchor, setBulkActionsMenuAnchor] = useState(null as HTMLElement); @@ -519,8 +538,8 @@ function EntityList({table}: Props): JSX.Element @@ -538,8 +557,8 @@ function EntityList({table}: Props): JSX.Element aria-controls={bulkActionsMenuOpen ? "basic-menu" : undefined} aria-haspopup="true" aria-expanded={bulkActionsMenuOpen ? "true" : undefined} + startIcon={table_rows} > - fact_check Bulk Actions `${from.toLocaleString()}–${to.toLocaleString()} of ${count !== -1 ? count.toLocaleString() : `more than ${to.toLocaleString()}`}`; + + // @ts-ignore + // eslint-disable-next-line react/no-unstable-nested-components + function CustomPagination() + { + return ( + recordConfig.handlePageChange(value)} + onRowsPerPageChange={(event) => recordConfig.handleRowsPerPageChange(Number(event.target.value))} + labelDisplayedRows={defaultLabelDisplayedRows} + /> + ); + } + ////////////////////////////////////////////////////////////// // event handler for the bulk-edit field-enabled checkboxes // ////////////////////////////////////////////////////////////// @@ -136,7 +152,7 @@ function ProcessRun(): JSX.Element { if (value === null || value === undefined) { - return --; + return ; } if (typeof value === "string") @@ -234,7 +250,7 @@ function ProcessRun(): JSX.Element } )))} - {(step.formFields) && ( + {step.formFields && ( true); } } - }, [newStep, rowsPerPage, pageNumber]); + }, [newStep]); ///////////////////////////////////////////////////////////////////////////////////////////// // if there are records to load: build a record config, and set the needRecords state flag // @@ -448,12 +463,10 @@ function ProcessRun(): JSX.Element newDynamicFormFields[field.name].isRequired = false; newFormValidations[field.name] = null; } - - logFormValidations("Upon update", newFormValidations); - - setFormFields(newDynamicFormFields); - setValidationScheme(Yup.object().shape(newFormValidations)); }); + + setFormFields(newDynamicFormFields); + setValidationScheme(Yup.object().shape(newFormValidations)); } }, [disabledBulkEditFields]);