mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-17 12:50:43 +00:00
Merge branch 'feature/CE-1068-add-basic-functionality-of' into integration/sprint-41
This commit is contained in:
@ -286,7 +286,7 @@ function FilterCriteriaRowValues({operatorOption, criteria, field, table, valueC
|
|||||||
isExpression ? (
|
isExpression ? (
|
||||||
makeTextField(field, criteria, valueChangeHandler, 0, undefined, undefined, allowVariables)
|
makeTextField(field, criteria, valueChangeHandler, 0, undefined, undefined, allowVariables)
|
||||||
) : (
|
) : (
|
||||||
<Box mb={-1.5} width={allowVariables && !isExpression ? "100%" : "100%"}>
|
<Box width={"100%"}>
|
||||||
<DynamicSelect
|
<DynamicSelect
|
||||||
tableName={table.name}
|
tableName={table.name}
|
||||||
fieldName={field.name}
|
fieldName={field.name}
|
||||||
@ -320,31 +320,20 @@ function FilterCriteriaRowValues({operatorOption, criteria, field, table, valueC
|
|||||||
initialValues = criteria.values;
|
initialValues = criteria.values;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return <Box display="flex">
|
return <Box mb={-1.5}>
|
||||||
{
|
<DynamicSelect
|
||||||
isExpression ? (
|
tableName={table.name}
|
||||||
makeTextField(field, criteria, valueChangeHandler, 0, undefined, undefined, allowVariables)
|
fieldName={field.name}
|
||||||
) : (
|
overrideId={field.name + "-multi-" + criteria.id}
|
||||||
<Box mb={-1.5} width={allowVariables && !isExpression ? "90%" : "100%"}>
|
key={field.name + "-multi-" + criteria.id}
|
||||||
<DynamicSelect
|
isMultiple
|
||||||
tableName={table.name}
|
fieldLabel="Values"
|
||||||
fieldName={field.name}
|
initialValues={initialValues}
|
||||||
overrideId={field.name + "-multi-" + criteria.id}
|
initiallyOpen={false /*initiallyOpenMultiValuePvs*/}
|
||||||
key={field.name + "-multi-" + criteria.id}
|
inForm={false}
|
||||||
isMultiple
|
onChange={(value: any) => valueChangeHandler(null, "all", value)}
|
||||||
fieldLabel="Values"
|
variant="standard"
|
||||||
initialValues={initialValues}
|
/>
|
||||||
initiallyOpen={false /*initiallyOpenMultiValuePvs*/}
|
|
||||||
inForm={false}
|
|
||||||
onChange={(value: any) => valueChangeHandler(null, "all", value)}
|
|
||||||
variant="standard"
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
{
|
|
||||||
allowVariables && !isExpression && <Box mt={2.0} sx={{width: "10%"}}><AssignFilterVariable field={field} valueChangeHandler={valueChangeHandler} valueIndex={0} /></Box>
|
|
||||||
}
|
|
||||||
</Box>;
|
</Box>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,6 +109,7 @@ class FilterUtils
|
|||||||
let [field, fieldTable] = TableUtils.getFieldAndTable(tableMetaData, criteria.fieldName);
|
let [field, fieldTable] = TableUtils.getFieldAndTable(tableMetaData, criteria.fieldName);
|
||||||
|
|
||||||
let values = criteria.values;
|
let values = criteria.values;
|
||||||
|
let hasFilterVariable = false;
|
||||||
if (field.possibleValueSourceName)
|
if (field.possibleValueSourceName)
|
||||||
{
|
{
|
||||||
//////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -122,7 +123,14 @@ class FilterUtils
|
|||||||
//////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
if (values && values.length > 0 && values[0] !== null && values[0] !== undefined && values[0] !== "")
|
if (values && values.length > 0 && values[0] !== null && values[0] !== undefined && values[0] !== "")
|
||||||
{
|
{
|
||||||
values = await qController.possibleValues(fieldTable.name, null, field.name, "", values);
|
if (values[0].type && values[0].type == "FilterVariableExpression")
|
||||||
|
{
|
||||||
|
hasFilterVariable = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
values = await qController.possibleValues(fieldTable.name, null, field.name, "", values);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////
|
////////////////////////////////////////////
|
||||||
@ -134,7 +142,11 @@ class FilterUtils
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (values && values.length)
|
if (hasFilterVariable)
|
||||||
|
{
|
||||||
|
values[0] = new FilterVariableExpression({fieldName: field.name, valueIndex: 0});
|
||||||
|
}
|
||||||
|
else if (values && values.length)
|
||||||
{
|
{
|
||||||
for (let i = 0; i < values.length; i++)
|
for (let i = 0; i < values.length; i++)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user