(
@@ -1439,6 +1447,15 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
}
);
+ const safeToLocaleString = (n: Number): string =>
+ {
+ if(n != null && n != undefined)
+ {
+ return (n.toLocaleString());
+ }
+ return ("");
+ }
+
function CustomToolbar()
{
const handleMouseDown: GridEventListener<"cellMouseDown"> = (
@@ -1473,15 +1490,6 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
const joinIsMany = isJoinMany(tableMetaData, visibleJoinTables);
- const safeToLocaleString = (n: Number): string =>
- {
- if(n != null && n != undefined)
- {
- return (n.toLocaleString());
- }
- return ("");
- }
-
const selectionMenuOptions: string[] = [];
selectionMenuOptions.push(`This page (${safeToLocaleString(distinctRecordsOnPageCount)} ${joinIsMany ? "distinct " : ""}record${distinctRecordsOnPageCount == 1 ? "" : "s"})`);
selectionMenuOptions.push(`Full query result (${joinIsMany ? safeToLocaleString(distinctRecords) + ` distinct record${distinctRecords == 1 ? "" : "s"}` : safeToLocaleString(totalRecords) + ` record${totalRecords == 1 ? "" : "s"}`})`);
@@ -1552,9 +1560,11 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
Refresh
-
+ {/* @ts-ignore */}
+
-
+ {/* @ts-ignore */}
+
{
hasValidFilters && (
@@ -1567,7 +1577,6 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
if (e.key == "Enter")
{
setShowClearFiltersWarning(false)
- navigate(metaData.getTablePathByName(tableName));
handleFilterChange({items: []} as GridFilterModel);
}
}}>
@@ -1580,7 +1589,6 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
{
setShowClearFiltersWarning(false);
- navigate(metaData.getTablePathByName(tableName));
handleFilterChange({items: []} as GridFilterModel);
}}/>
@@ -1588,8 +1596,10 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
)
}
-
-
+ {/* @ts-ignore */}
+
+ {/* @ts-ignore */}
+
@@ -1671,22 +1681,22 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
{
if (menuItems.length > 0)
{
- menuItems.push();
+ menuItems.push();
}
};
const menuItems: JSX.Element[] = [];
if (table.capabilities.has(Capability.TABLE_INSERT) && table.insertPermission)
{
- menuItems.push();
+ menuItems.push();
}
if (table.capabilities.has(Capability.TABLE_UPDATE) && table.editPermission)
{
- menuItems.push();
+ menuItems.push();
}
if (table.capabilities.has(Capability.TABLE_DELETE) && table.deletePermission)
{
- menuItems.push();
+ menuItems.push();
}
const runRecordScriptProcess = metaData?.processes.get("runRecordScript");
@@ -1696,7 +1706,7 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
menuItems.push();
}
- menuItems.push();
+ menuItems.push();
if (tableProcesses && tableProcesses.length)
{
@@ -1711,7 +1721,7 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
if (menuItems.length === 0)
{
- menuItems.push();
+ menuItems.push();
}
const renderActionsMenu = (
@@ -1898,7 +1908,7 @@ function RecordQuery({table, launchProcess}: Props): JSX.Element
-
+
closeColumnStats(null, null)} disabled={false} />
diff --git a/src/qqq/utils/qqq/FilterUtils.ts b/src/qqq/utils/qqq/FilterUtils.ts
index 1c61364..7c56bf6 100644
--- a/src/qqq/utils/qqq/FilterUtils.ts
+++ b/src/qqq/utils/qqq/FilterUtils.ts
@@ -360,7 +360,7 @@ class FilterUtils
let defaultFilter = {items: []} as GridFilterModel;
let defaultSort = [] as GridSortItem[];
- if (tableMetaData.fields !== undefined)
+ if (tableMetaData && tableMetaData.fields !== undefined)
{
if (filterString != null || (searchParams && searchParams.has("filter")))
{
@@ -376,7 +376,33 @@ class FilterUtils
for (let i = 0; i < qQueryFilter?.criteria?.length; i++)
{
const criteria = qQueryFilter.criteria[i];
- const field = tableMetaData.fields.get(criteria.fieldName);
+ let fieldTable = tableMetaData;
+ let field = null;
+ if (criteria.fieldName.indexOf(".") > -1)
+ {
+ const nameParts = criteria.fieldName.split(".", 2);
+ for (let i = 0; i < tableMetaData?.exposedJoins?.length; i++)
+ {
+ const joinTable = tableMetaData.exposedJoins[i].joinTable;
+ if (joinTable.name == nameParts[0])
+ {
+ fieldTable = joinTable;
+ field = joinTable.fields.get(nameParts[1]);
+ break;
+ }
+ }
+ }
+ else
+ {
+ field = tableMetaData.fields.get(criteria.fieldName);
+ }
+
+ if (field == null)
+ {
+ console.log("Couldn't find field for filter: " + criteria.fieldName);
+ continue;
+ }
+
let values = criteria.values;
if (field.possibleValueSourceName)
{
@@ -388,7 +414,7 @@ class FilterUtils
//////////////////////////////////////////////////////////////////////////////////
if (values && values.length > 0)
{
- values = await qController.possibleValues(tableMetaData.name, null, field.name, "", values);
+ values = await qController.possibleValues(fieldTable.name, null, field.name, "", values);
}
////////////////////////////////////////////