diff --git a/src/qqq/pages/processes/ProcessRun.tsx b/src/qqq/pages/processes/ProcessRun.tsx
index c99d816..dc04e26 100644
--- a/src/qqq/pages/processes/ProcessRun.tsx
+++ b/src/qqq/pages/processes/ProcessRun.tsx
@@ -94,7 +94,7 @@ const BACKOFF_AMOUNT = 1.5;
////////////////////////////////////////////////////////////////////////////
let formikSetFieldValueFunction = (field: string, value: any, shouldValidate?: boolean): void =>
{
-}
+};
function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, isReport, recordIds, closeModalHandler, forceReInit, overrideLabel}: Props): JSX.Element
{
@@ -134,7 +134,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
const [showErrorDetail, setShowErrorDetail] = useState(false);
const [showFullHelpText, setShowFullHelpText] = useState(false);
- const [renderedWidgets, setRenderedWidgets] = useState({} as {[step: string]: {[widgetName: string]: any}});
+ const [renderedWidgets, setRenderedWidgets] = useState({} as { [step: string]: { [widgetName: string]: any } });
const {pageHeader, recordAnalytics, setPageHeader, helpHelpActive} = useContext(QContext);
@@ -238,15 +238,15 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
setShowFullHelpText(!showFullHelpText);
};
- const download = (processValues: {[key: string]: string}) =>
+ const download = (processValues: { [key: string]: string }) =>
{
let url;
let fileName = processValues.downloadFileName;
- if(processValues.serverFilePath)
+ if (processValues.serverFilePath)
{
url = `/download/${encodeURIComponent(processValues.downloadFileName)}?filePath=${encodeURIComponent(processValues.serverFilePath)}`;
}
- else if(processValues.storageTableName && processValues.storageReference)
+ else if (processValues.storageTableName && processValues.storageReference)
{
url = `/download/${encodeURIComponent(processValues.downloadFileName)}?storageTableName=${encodeURIComponent(processValues.storageTableName)}&storageReference=${encodeURIComponent(processValues.storageReference)}`;
}
@@ -291,19 +291,19 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
*******************************************************************************/
function renderWidget(widgetName: string)
{
- if(!renderedWidgets[activeStep.name])
+ if (!renderedWidgets[activeStep.name])
{
renderedWidgets[activeStep.name] = {};
setRenderedWidgets(renderedWidgets);
}
- if(renderedWidgets[activeStep.name][widgetName])
+ if (renderedWidgets[activeStep.name][widgetName])
{
return renderedWidgets[activeStep.name][widgetName];
}
const widgetMetaData = qInstance.widgets.get(widgetName);
- if(!widgetMetaData)
+ if (!widgetMetaData)
{
return (Unrecognized widget name: {widgetName});
}
@@ -311,12 +311,12 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
const queryStringParts: string[] = [];
for (let name in processValues)
{
- queryStringParts.push(`${name}=${encodeURIComponent(processValues[name])}`)
+ queryStringParts.push(`${name}=${encodeURIComponent(processValues[name])}`);
}
const renderedWidget = (
- )
+ );
renderedWidgets[activeStep.name][widgetName] = renderedWidget;
return renderedWidget;
}
@@ -367,8 +367,8 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
- {isModal ?
- : !isWidget &&
+ {isModal ? handleCancelClicked(true)} disabled={false} label="Close" />
+ : !isWidget && handleCancelClicked(true)} disabled={false} />
}
@@ -500,7 +500,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
// edit the formData object to just include those. //
//////////////////////////////////////////////////////////////////////////
let formDataToUse = formData;
- if(component.values && component.values.includeFieldNames)
+ if (component.values && component.values.includeFieldNames)
{
formDataToUse = Object.assign({}, formData);
@@ -608,21 +608,21 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
}
{
component.type === QComponentType.EDIT_FORM &&
- <>
- {
- component.values?.sectionLabel ?
-
-
-
- {component.values?.sectionLabel}
-
-
-
-
-
- :
- }
- >
+ <>
+ {
+ component.values?.sectionLabel ?
+
+
+
+ {component.values?.sectionLabel}
+
+
+
+
+
+ :
+ }
+ >
}
{
component.type === QComponentType.VIEW_FORM && step.viewFields && (
@@ -1079,14 +1079,14 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
setProcessValues(qJobComplete.values);
setQJobRunning(null);
- if(formikSetFieldValueFunction)
+ if (formikSetFieldValueFunction)
{
//////////////////////////////////
// reset field values in formik //
//////////////////////////////////
for (let key in qJobComplete.values)
{
- if(Object.hasOwn(formFields, key))
+ if (Object.hasOwn(formFields, key))
{
console.log(`(re)setting form field [${key}] to [${qJobComplete.values[key]}]`);
formikSetFieldValueFunction(key, qJobComplete.values[key]);
@@ -1098,7 +1098,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
// if the process step sent a new frontend-step-list, then refresh what we have in state (constructing new full model objects) //
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const updatedFrontendStepList = qJobComplete.updatedFrontendStepList;
- if(updatedFrontendStepList)
+ if (updatedFrontendStepList)
{
setSteps(updatedFrontendStepList);
}
@@ -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)
{
closeModalHandler(null, "cancelClicked");
@@ -1415,6 +1427,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
navigate(path, {replace: true});
};
+
const mainCardStyles: any = {};
const formStyles: any = {};
mainCardStyles.minHeight = `calc(100vh - ${isModal ? 150 : 400}px)`;
@@ -1490,8 +1503,8 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
{/***************************************************************************
- ** step content - e.g., the appropriate form or other screen for the step **
- ***************************************************************************/}
+ ** step content - e.g., the appropriate form or other screen for the step **
+ ***************************************************************************/}
{getDynamicStepContent(
activeStepIndex,
activeStep,
@@ -1507,8 +1520,8 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
setFieldValue,
)}
{/********************************
- ** back &| next/submit buttons **
- ********************************/}
+ ** back &| next/submit buttons **
+ ********************************/}
{true || activeStepIndex === 0 ? (
@@ -1526,7 +1539,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
)}
{
noMoreSteps && handleCancelClicked(true)}
label={isModal ? "Close" : "Return"}
iconName={isModal ? "cancel" : "arrow_back"}
disabled={isSubmitting} />
@@ -1537,7 +1550,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
{
!isWidget && (
-
+ handleCancelClicked(false)} disabled={isSubmitting} />
)
}
@@ -1552,7 +1565,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
- )
+ );
}}
);