more updates to allow process to be manually ran

This commit is contained in:
Tim Chamberlain
2023-09-20 19:52:13 -05:00
parent 53d5bc58c1
commit 01d18902d7
2 changed files with 28 additions and 12 deletions

View File

@ -62,10 +62,12 @@ import {GoogleDriveFolderPickerWrapper} from "qqq/components/processes/GoogleDri
import ProcessSummaryResults from "qqq/components/processes/ProcessSummaryResults"; import ProcessSummaryResults from "qqq/components/processes/ProcessSummaryResults";
import ValidationReview from "qqq/components/processes/ValidationReview"; import ValidationReview from "qqq/components/processes/ValidationReview";
import BaseLayout from "qqq/layouts/BaseLayout"; import BaseLayout from "qqq/layouts/BaseLayout";
import {TABLE_VARIANT_LOCAL_STORAGE_KEY_ROOT} from "qqq/pages/records/query/RecordQuery";
import Client from "qqq/utils/qqq/Client"; import Client from "qqq/utils/qqq/Client";
import TableUtils from "qqq/utils/qqq/TableUtils"; import TableUtils from "qqq/utils/qqq/TableUtils";
import ValueUtils from "qqq/utils/qqq/ValueUtils"; import ValueUtils from "qqq/utils/qqq/ValueUtils";
interface Props interface Props
{ {
process?: QProcessMetaData; process?: QProcessMetaData;
@ -88,6 +90,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
{ {
const processNameParam = useParams().processName; const processNameParam = useParams().processName;
const processName = process === null ? processNameParam : process.name; const processName = process === null ? processNameParam : process.name;
const tableVariantLocalStorageKey = `${TABLE_VARIANT_LOCAL_STORAGE_KEY_ROOT}.${table.name}`;
/////////////////// ///////////////////
// process state // // process state //
@ -376,7 +379,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
{ {
if (processValues[key]) if (processValues[key])
{ {
formFields[key].possibleValueProps.initialDisplayValue = processValues[key] formFields[key].possibleValueProps.initialDisplayValue = processValues[key];
} }
formFields[key].possibleValueProps.otherValues = formFields[key].possibleValueProps.otherValues ?? new Map<string, any>(); formFields[key].possibleValueProps.otherValues = formFields[key].possibleValueProps.otherValues ?? new Map<string, any>();
@ -385,7 +388,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
formFields[key].possibleValueProps.otherValues.set(otherKey, processValues[otherKey]); formFields[key].possibleValueProps.otherValues.set(otherKey, processValues[otherKey]);
}); });
} }
}) });
} }
return ( return (
@ -800,9 +803,9 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
Object.keys(initialValues).forEach((ivKey: any) => Object.keys(initialValues).forEach((ivKey: any) =>
{ {
dynamicFormFields[key].possibleValueProps.otherValues.set(ivKey, initialValues[ivKey]); dynamicFormFields[key].possibleValueProps.otherValues.set(ivKey, initialValues[ivKey]);
}) });
} }
}) });
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
// disable all fields if this is a bulk edit form // // disable all fields if this is a bulk edit form //
@ -1102,6 +1105,12 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
} }
} }
if (localStorage.getItem(tableVariantLocalStorageKey))
{
let tableVariant = JSON.parse(localStorage.getItem(tableVariantLocalStorageKey));
queryStringPairsForInit.push(`tableVariant=${JSON.stringify(tableVariant)}`);
}
try try
{ {
const qInstance = await Client.getInstance().loadMetaData(); const qInstance = await Client.getInstance().loadMetaData();
@ -1149,7 +1158,7 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
if (tableMetaData) if (tableMetaData)
{ {
queryStringPairsForInit.push(`tableName=${tableMetaData.name}`) queryStringPairsForInit.push(`tableName=${tableMetaData.name}`);
} }
try try
@ -1187,6 +1196,12 @@ function ProcessRun({process, table, defaultProcessValues, isModal, isWidget, is
formData.append(key, values[key]); formData.append(key, values[key]);
}); });
if (localStorage.getItem(tableVariantLocalStorageKey))
{
let tableVariant = JSON.parse(localStorage.getItem(tableVariantLocalStorageKey));
formData.append("tableVariant", JSON.stringify(tableVariant));
}
if (doesStepHaveComponent(activeStep, QComponentType.BULK_EDIT_FORM)) if (doesStepHaveComponent(activeStep, QComponentType.BULK_EDIT_FORM))
{ {
const bulkEditEnabledFields: string[] = []; const bulkEditEnabledFields: string[] = [];

View File

@ -82,7 +82,8 @@ const ROWS_PER_PAGE_LOCAL_STORAGE_KEY_ROOT = "qqq.rowsPerPage";
const PINNED_COLUMNS_LOCAL_STORAGE_KEY_ROOT = "qqq.pinnedColumns"; const PINNED_COLUMNS_LOCAL_STORAGE_KEY_ROOT = "qqq.pinnedColumns";
const SEEN_JOIN_TABLES_LOCAL_STORAGE_KEY_ROOT = "qqq.seenJoinTables"; const SEEN_JOIN_TABLES_LOCAL_STORAGE_KEY_ROOT = "qqq.seenJoinTables";
const DENSITY_LOCAL_STORAGE_KEY_ROOT = "qqq.density"; const DENSITY_LOCAL_STORAGE_KEY_ROOT = "qqq.density";
const TABLE_VARIANT_LOCAL_STORAGE_KEY_ROOT = "qqq.tableVariant";
export const TABLE_VARIANT_LOCAL_STORAGE_KEY_ROOT = "qqq.tableVariant";
interface Props interface Props
{ {