mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-17 21:00:45 +00:00
CE-798 - fix typing 'o' bug in quick filters; add missing 'start of' in expression toString calls
This commit is contained in:
@ -480,7 +480,12 @@ export default function QuickFilter({tableMetaData, fullFieldName, fieldMetaData
|
|||||||
<Box display="inline-block" width={widthAndMaxWidth} maxWidth={widthAndMaxWidth} className="operatorColumn">
|
<Box display="inline-block" width={widthAndMaxWidth} maxWidth={widthAndMaxWidth} className="operatorColumn">
|
||||||
<Autocomplete
|
<Autocomplete
|
||||||
id={"criteriaOperator"}
|
id={"criteriaOperator"}
|
||||||
renderInput={(params) => (<TextField {...params} label={"Operator"} variant="standard" autoComplete="off" type="search" InputProps={{...params.InputProps}} />)}
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// ok, so, by default, if you type an 'o' as the first letter in the FilterCriteriaRowValues box, //
|
||||||
|
// something is causing THIS element to become selected, if the first letter in its label is 'O'. //
|
||||||
|
// ... work around is to put invisible ‌ entity as first character in label instead... //
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
renderInput={(params) => (<TextField {...params} label={<>‌Operator</>} variant="standard" autoComplete="off" type="search" InputProps={{...params.InputProps}} />)}
|
||||||
options={operatorOptions}
|
options={operatorOptions}
|
||||||
value={operatorSelectedValue as any}
|
value={operatorSelectedValue as any}
|
||||||
inputValue={operatorInputValue}
|
inputValue={operatorInputValue}
|
||||||
|
@ -64,7 +64,6 @@ class FilterUtils
|
|||||||
let rs = [];
|
let rs = [];
|
||||||
for (let i = 0; i < param.length; i++)
|
for (let i = 0; i < param.length; i++)
|
||||||
{
|
{
|
||||||
console.log(param[i]);
|
|
||||||
if (param[i] && param[i].id && param[i].label)
|
if (param[i] && param[i].id && param[i].label)
|
||||||
{
|
{
|
||||||
/////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////
|
||||||
@ -361,7 +360,12 @@ class FilterUtils
|
|||||||
else if (value.type == "ThisOrLastPeriod")
|
else if (value.type == "ThisOrLastPeriod")
|
||||||
{
|
{
|
||||||
const expression = new ThisOrLastPeriodExpression(value);
|
const expression = new ThisOrLastPeriodExpression(value);
|
||||||
labels.push(expression.toString());
|
let startOfPrefix = "";
|
||||||
|
if(fieldMetaData.type == QFieldType.DATE_TIME || expression.timeUnit != "DAYS")
|
||||||
|
{
|
||||||
|
startOfPrefix = "start of ";
|
||||||
|
}
|
||||||
|
labels.push(`${startOfPrefix}${expression.toString()}`);
|
||||||
}
|
}
|
||||||
else if(fieldMetaData.type == QFieldType.BOOLEAN)
|
else if(fieldMetaData.type == QFieldType.BOOLEAN)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user