mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 05:10:45 +00:00
update processClicked to set alert if min/max input records isn't satisfied
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
"@auth0/auth0-react": "1.10.2",
|
"@auth0/auth0-react": "1.10.2",
|
||||||
"@emotion/react": "11.7.1",
|
"@emotion/react": "11.7.1",
|
||||||
"@emotion/styled": "11.6.0",
|
"@emotion/styled": "11.6.0",
|
||||||
"@kingsrook/qqq-frontend-core": "1.0.114",
|
"@kingsrook/qqq-frontend-core": "1.0.119",
|
||||||
"@mui/icons-material": "5.4.1",
|
"@mui/icons-material": "5.4.1",
|
||||||
"@mui/material": "5.11.1",
|
"@mui/material": "5.11.1",
|
||||||
"@mui/styles": "5.11.1",
|
"@mui/styles": "5.11.1",
|
||||||
|
@ -1612,6 +1612,22 @@ const RecordQuery = forwardRef(({table, usage, isModal, isPreview, allowVariable
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
const processClicked = (process: QProcessMetaData) =>
|
const processClicked = (process: QProcessMetaData) =>
|
||||||
{
|
{
|
||||||
|
if (process.minInputRecords != null && process.minInputRecords > 0 && getNoOfSelectedRecords() === 0)
|
||||||
|
{
|
||||||
|
setAlertContent(`No records were selected for the process: ${process.label}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (process.minInputRecords != null && getNoOfSelectedRecords() < process.minInputRecords)
|
||||||
|
{
|
||||||
|
setAlertContent(`Too few records were selected for the process: ${process.label}. A minimum of ${process.minInputRecords} is required.`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (process.maxInputRecords != null && getNoOfSelectedRecords() > process.maxInputRecords)
|
||||||
|
{
|
||||||
|
setAlertContent(`Too many records were selected for the process: ${process.label}. A maximum of ${process.maxInputRecords} is allowed.`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// todo - let the process specify that it needs initial rows - err if none selected.
|
// todo - let the process specify that it needs initial rows - err if none selected.
|
||||||
// alternatively, let a process itself have an initial screen to select rows...
|
// alternatively, let a process itself have an initial screen to select rows...
|
||||||
openModalProcess(process);
|
openModalProcess(process);
|
||||||
|
Reference in New Issue
Block a user