mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 05:10:45 +00:00
CE-938 Add calls to processCancel
This commit is contained in:
@ -94,7 +94,7 @@ const BACKOFF_AMOUNT = 1.5;
|
|||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
let formikSetFieldValueFunction = (field: string, value: any, shouldValidate?: boolean): void =>
|
let formikSetFieldValueFunction = (field: string, value: any, shouldValidate?: boolean): void =>
|
||||||
{
|
{
|
||||||
}
|
};
|
||||||
|
|
||||||
function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, isReport, recordIds, closeModalHandler, forceReInit, overrideLabel}: Props): JSX.Element
|
function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, isReport, recordIds, closeModalHandler, forceReInit, overrideLabel}: Props): JSX.Element
|
||||||
{
|
{
|
||||||
@ -311,12 +311,12 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
|
|||||||
const queryStringParts: string[] = [];
|
const queryStringParts: string[] = [];
|
||||||
for (let name in processValues)
|
for (let name in processValues)
|
||||||
{
|
{
|
||||||
queryStringParts.push(`${name}=${encodeURIComponent(processValues[name])}`)
|
queryStringParts.push(`${name}=${encodeURIComponent(processValues[name])}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderedWidget = (<Box m={-2}>
|
const renderedWidget = (<Box m={-2}>
|
||||||
<DashboardWidgets widgetMetaDataList={[widgetMetaData]} omitWrappingGridContainer={true} childUrlParams={queryStringParts.join("&")} />
|
<DashboardWidgets widgetMetaDataList={[widgetMetaData]} omitWrappingGridContainer={true} childUrlParams={queryStringParts.join("&")} />
|
||||||
</Box>)
|
</Box>);
|
||||||
renderedWidgets[activeStep.name][widgetName] = renderedWidget;
|
renderedWidgets[activeStep.name][widgetName] = renderedWidget;
|
||||||
return renderedWidget;
|
return renderedWidget;
|
||||||
}
|
}
|
||||||
@ -367,8 +367,8 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
|
|||||||
</MDTypography>
|
</MDTypography>
|
||||||
<Box component="div" py={3}>
|
<Box component="div" py={3}>
|
||||||
<Grid container justifyContent="flex-end" spacing={3}>
|
<Grid container justifyContent="flex-end" spacing={3}>
|
||||||
{isModal ? <QCancelButton onClickHandler={handleCancelClicked} disabled={false} label="Close" />
|
{isModal ? <QCancelButton onClickHandler={() => handleCancelClicked(true)} disabled={false} label="Close" />
|
||||||
: !isWidget && <QCancelButton onClickHandler={handleCancelClicked} disabled={false} />
|
: !isWidget && <QCancelButton onClickHandler={() => handleCancelClicked(true)} disabled={false} />
|
||||||
}
|
}
|
||||||
</Grid>
|
</Grid>
|
||||||
</Box>
|
</Box>
|
||||||
@ -1401,8 +1401,20 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCancelClicked = () =>
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
const handleCancelClicked = (isClose: boolean) =>
|
||||||
{
|
{
|
||||||
|
//////////////////////////////////////////////////////////////////
|
||||||
|
// unless this is a 'close', then tell backend we're cancelling //
|
||||||
|
//////////////////////////////////////////////////////////////////
|
||||||
|
if (!isClose)
|
||||||
|
{
|
||||||
|
Client.getInstance().processCancel(processName, processUUID);
|
||||||
|
}
|
||||||
|
|
||||||
if (isModal && closeModalHandler)
|
if (isModal && closeModalHandler)
|
||||||
{
|
{
|
||||||
closeModalHandler(null, "cancelClicked");
|
closeModalHandler(null, "cancelClicked");
|
||||||
@ -1415,6 +1427,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
|
|||||||
navigate(path, {replace: true});
|
navigate(path, {replace: true});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const mainCardStyles: any = {};
|
const mainCardStyles: any = {};
|
||||||
const formStyles: any = {};
|
const formStyles: any = {};
|
||||||
mainCardStyles.minHeight = `calc(100vh - ${isModal ? 150 : 400}px)`;
|
mainCardStyles.minHeight = `calc(100vh - ${isModal ? 150 : 400}px)`;
|
||||||
@ -1526,7 +1539,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
|
|||||||
)}
|
)}
|
||||||
{
|
{
|
||||||
noMoreSteps && <QCancelButton
|
noMoreSteps && <QCancelButton
|
||||||
onClickHandler={handleCancelClicked}
|
onClickHandler={() => handleCancelClicked(true)}
|
||||||
label={isModal ? "Close" : "Return"}
|
label={isModal ? "Close" : "Return"}
|
||||||
iconName={isModal ? "cancel" : "arrow_back"}
|
iconName={isModal ? "cancel" : "arrow_back"}
|
||||||
disabled={isSubmitting} />
|
disabled={isSubmitting} />
|
||||||
@ -1537,7 +1550,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
|
|||||||
<Grid container justifyContent="flex-end" spacing={3}>
|
<Grid container justifyContent="flex-end" spacing={3}>
|
||||||
{
|
{
|
||||||
!isWidget && (
|
!isWidget && (
|
||||||
<QCancelButton onClickHandler={handleCancelClicked} disabled={isSubmitting} />
|
<QCancelButton onClickHandler={() => handleCancelClicked(false)} disabled={isSubmitting} />
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
<QSubmitButton label={nextButtonLabel} iconName={nextButtonIcon} disabled={isSubmitting} />
|
<QSubmitButton label={nextButtonLabel} iconName={nextButtonIcon} disabled={isSubmitting} />
|
||||||
@ -1552,7 +1565,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
|
|||||||
</Box>
|
</Box>
|
||||||
</Card>
|
</Card>
|
||||||
</Form>
|
</Form>
|
||||||
)
|
);
|
||||||
}}
|
}}
|
||||||
</Formik>
|
</Formik>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user