mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 05:10:45 +00:00
Fixed bug where the grid columns, etc, could get out of sync (in the dishwasher) w/ the table, when doing certain Link operations (discovered from run-record-script process result screen w/ a filter link)
This commit is contained in:
@ -285,9 +285,23 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
|
||||
// if we didn't open a process... not sure what we do in the table/query use-case //
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
setActiveModalProcess(null);
|
||||
}, [ location , tableMetaData]);
|
||||
|
||||
}, [location , tableMetaData]);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
// any time these are out of sync, it means we need to reload things //
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
if(tableMetaData && tableMetaData.name !== tableName)
|
||||
{
|
||||
console.log(" it looks like we changed tables - try to reload the things");
|
||||
setTableMetaData(null)
|
||||
setColumnSortModel([]);
|
||||
setColumnVisibilityModel({});
|
||||
setColumnsModel([]);
|
||||
setFilterModel({items: []});
|
||||
setDefaultFilterLoaded(false);
|
||||
setRows([]);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// note - important to take tableMetaData as a param, even though it's a state var, as the //
|
||||
@ -301,27 +315,13 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
|
||||
return(filter);
|
||||
};
|
||||
|
||||
|
||||
const getTableMetaData = async (): Promise<QTableMetaData> =>
|
||||
{
|
||||
if(tableMetaData !== null)
|
||||
{
|
||||
return(new Promise((resolve) =>
|
||||
{
|
||||
resolve(tableMetaData)
|
||||
}));
|
||||
}
|
||||
|
||||
return (qController.loadTableMetaData(tableName));
|
||||
}
|
||||
|
||||
const updateTable = () =>
|
||||
{
|
||||
setLoading(true);
|
||||
setRows([]);
|
||||
(async () =>
|
||||
{
|
||||
const tableMetaData = await getTableMetaData();
|
||||
const tableMetaData = await qController.loadTableMetaData(tableName);
|
||||
setPageHeader(tableMetaData.label);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user