mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 13:20:43 +00:00
Merge pull request #71 from Kingsrook/feature/CE-1646-possible-value-filter-bug
Feature/ce 1646 possible value filter bug
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
"@auth0/auth0-react": "1.10.2",
|
"@auth0/auth0-react": "1.10.2",
|
||||||
"@emotion/react": "11.7.1",
|
"@emotion/react": "11.7.1",
|
||||||
"@emotion/styled": "11.6.0",
|
"@emotion/styled": "11.6.0",
|
||||||
"@kingsrook/qqq-frontend-core": "1.0.104",
|
"@kingsrook/qqq-frontend-core": "1.0.105",
|
||||||
"@mui/icons-material": "5.4.1",
|
"@mui/icons-material": "5.4.1",
|
||||||
"@mui/material": "5.11.1",
|
"@mui/material": "5.11.1",
|
||||||
"@mui/styles": "5.11.1",
|
"@mui/styles": "5.11.1",
|
||||||
|
@ -183,6 +183,7 @@ function QDynamicForm({formData, formLabel, bulkEditMode, bulkEditSwitchChangeHa
|
|||||||
bulkEditMode={bulkEditMode}
|
bulkEditMode={bulkEditMode}
|
||||||
bulkEditSwitchChangeHandler={bulkEditSwitchChanged}
|
bulkEditSwitchChangeHandler={bulkEditSwitchChanged}
|
||||||
otherValues={otherValuesMap}
|
otherValues={otherValuesMap}
|
||||||
|
useCase="form"
|
||||||
/>
|
/>
|
||||||
{formattedHelpContent}
|
{formattedHelpContent}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
@ -53,6 +53,7 @@ interface Props
|
|||||||
otherValues?: Map<string, any>;
|
otherValues?: Map<string, any>;
|
||||||
variant: "standard" | "outlined";
|
variant: "standard" | "outlined";
|
||||||
initiallyOpen: boolean;
|
initiallyOpen: boolean;
|
||||||
|
useCase: "form" | "filter";
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicSelect.defaultProps = {
|
DynamicSelect.defaultProps = {
|
||||||
@ -102,7 +103,7 @@ export const getAutocompleteOutlinedStyle = (isDisabled: boolean) =>
|
|||||||
|
|
||||||
const qController = Client.getInstance();
|
const qController = Client.getInstance();
|
||||||
|
|
||||||
function DynamicSelect({tableName, processName, fieldName, possibleValueSourceName, overrideId, fieldLabel, inForm, initialValue, initialDisplayValue, initialValues, onChange, isEditable, isMultiple, bulkEditMode, bulkEditSwitchChangeHandler, otherValues, variant, initiallyOpen}: Props)
|
function DynamicSelect({tableName, processName, fieldName, possibleValueSourceName, overrideId, fieldLabel, inForm, initialValue, initialDisplayValue, initialValues, onChange, isEditable, isMultiple, bulkEditMode, bulkEditSwitchChangeHandler, otherValues, variant, initiallyOpen, useCase}: Props)
|
||||||
{
|
{
|
||||||
const [open, setOpen] = useState(initiallyOpen);
|
const [open, setOpen] = useState(initiallyOpen);
|
||||||
const [options, setOptions] = useState<readonly QPossibleValue[]>([]);
|
const [options, setOptions] = useState<readonly QPossibleValue[]>([]);
|
||||||
@ -194,7 +195,7 @@ function DynamicSelect({tableName, processName, fieldName, possibleValueSourceNa
|
|||||||
(async () =>
|
(async () =>
|
||||||
{
|
{
|
||||||
// console.log(`doing a search with ${searchTerm}`);
|
// console.log(`doing a search with ${searchTerm}`);
|
||||||
const results: QPossibleValue[] = await qController.possibleValues(tableName, processName, possibleValueSourceName ?? fieldName, searchTerm ?? "", null, otherValues);
|
const results: QPossibleValue[] = await qController.possibleValues(tableName, processName, possibleValueSourceName ?? fieldName, searchTerm ?? "", null, otherValues, useCase);
|
||||||
|
|
||||||
if (tableMetaData == null && tableName)
|
if (tableMetaData == null && tableName)
|
||||||
{
|
{
|
||||||
@ -227,7 +228,7 @@ function DynamicSelect({tableName, processName, fieldName, possibleValueSourceNa
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
setOptions([]);
|
setOptions([]);
|
||||||
console.log("Refreshing possible values...");
|
console.log("Refreshing possible values...");
|
||||||
const results: QPossibleValue[] = await qController.possibleValues(tableName, processName, possibleValueSourceName ?? fieldName, searchTerm ?? "", null, otherValues);
|
const results: QPossibleValue[] = await qController.possibleValues(tableName, processName, possibleValueSourceName ?? fieldName, searchTerm ?? "", null, otherValues, useCase);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
setOptions([...results]);
|
setOptions([...results]);
|
||||||
setOtherValuesWhenResultsWereLoaded(JSON.stringify(Object.fromEntries(otherValues)));
|
setOtherValuesWhenResultsWereLoaded(JSON.stringify(Object.fromEntries(otherValues)));
|
||||||
|
@ -377,6 +377,7 @@ function FilterCriteriaRowValues({operatorOption, criteria, field, table, valueC
|
|||||||
inForm={false}
|
inForm={false}
|
||||||
onChange={(value: any) => valueChangeHandler(null, 0, value)}
|
onChange={(value: any) => valueChangeHandler(null, 0, value)}
|
||||||
variant="standard"
|
variant="standard"
|
||||||
|
useCase="filter"
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
)
|
)
|
||||||
@ -412,6 +413,7 @@ function FilterCriteriaRowValues({operatorOption, criteria, field, table, valueC
|
|||||||
inForm={false}
|
inForm={false}
|
||||||
onChange={(value: any) => valueChangeHandler(null, "all", value)}
|
onChange={(value: any) => valueChangeHandler(null, "all", value)}
|
||||||
variant="standard"
|
variant="standard"
|
||||||
|
useCase="filter"
|
||||||
/>
|
/>
|
||||||
</Box>;
|
</Box>;
|
||||||
}
|
}
|
||||||
|
@ -440,10 +440,10 @@ function ScriptEditor({title, scriptId, scriptRevisionRecord, closeCallback, tab
|
|||||||
<Box sx={{height: openTool ? "45%" : "100%"}}>
|
<Box sx={{height: openTool ? "45%" : "100%"}}>
|
||||||
<Grid container alignItems="flex-end">
|
<Grid container alignItems="flex-end">
|
||||||
<Box maxWidth={"50%"} minWidth={300}>
|
<Box maxWidth={"50%"} minWidth={300}>
|
||||||
<DynamicSelect fieldName={"apiName"} initialValue={apiName} initialDisplayValue={apiNameLabel} fieldLabel={"API Name *"} tableName={"scriptRevision"} inForm={false} onChange={changeApiName} />
|
<DynamicSelect fieldName={"apiName"} initialValue={apiName} initialDisplayValue={apiNameLabel} fieldLabel={"API Name *"} tableName={"scriptRevision"} inForm={false} onChange={changeApiName} useCase="form" />
|
||||||
</Box>
|
</Box>
|
||||||
<Box maxWidth={"50%"} minWidth={300} pl={2}>
|
<Box maxWidth={"50%"} minWidth={300} pl={2}>
|
||||||
<DynamicSelect fieldName={"apiVersion"} initialValue={apiVersion} initialDisplayValue={apiVersionLabel} fieldLabel={"API Version *"} tableName={"scriptRevision"} inForm={false} onChange={changeApiVersion} />
|
<DynamicSelect fieldName={"apiVersion"} initialValue={apiVersion} initialDisplayValue={apiVersionLabel} fieldLabel={"API Version *"} tableName={"scriptRevision"} inForm={false} onChange={changeApiVersion} useCase="form" />
|
||||||
</Box>
|
</Box>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Box display="flex" sx={{height: "100%"}}>
|
<Box display="flex" sx={{height: "100%"}}>
|
||||||
|
@ -397,6 +397,7 @@ export default function ShareModal({open, onClose, tableMetaData, record}: Share
|
|||||||
initialDisplayValue={selectedAudienceOption?.label}
|
initialDisplayValue={selectedAudienceOption?.label}
|
||||||
inForm={false}
|
inForm={false}
|
||||||
onChange={handleAudienceChange}
|
onChange={handleAudienceChange}
|
||||||
|
useCase="form"
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
{/*
|
{/*
|
||||||
|
@ -786,6 +786,7 @@ function InputPossibleValueSourceSingle(tableName: string, field: QFieldMetaData
|
|||||||
initialDisplayValue={selectedPossibleValue?.label}
|
initialDisplayValue={selectedPossibleValue?.label}
|
||||||
inForm={false}
|
inForm={false}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
|
useCase="filter"
|
||||||
// InputProps={applying ? {endAdornment: <Icon>sync</Icon>} : {}}
|
// InputProps={applying ? {endAdornment: <Icon>sync</Icon>} : {}}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
@ -854,6 +855,7 @@ function InputPossibleValueSourceMultiple(tableName: string, field: QFieldMetaDa
|
|||||||
initialValues={selectedPossibleValues}
|
initialValues={selectedPossibleValues}
|
||||||
inForm={false}
|
inForm={false}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
|
useCase="filter"
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user