stevetracvc commented on a change in pull request #18009:
URL: https://github.com/apache/superset/pull/18009#discussion_r783250114
##########
File path:
superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigForm/getControlItemsMap.tsx
##########
@@ -211,6 +213,69 @@ export default function getControlItemsMap({
);
mapControlItems[controlItem.name] = { element, checked: initialValue };
});
+ controlItems
+ .filter(
+ (controlItem: CustomControlItem) =>
+ controlItem?.config?.renderTrigger &&
+ controlItem.name !== 'sortAscending' &&
+ controlItem?.config?.type === 'SelectControl',
+ )
+ .forEach(controlItem => {
+ const initialValue =
+ filterToEdit?.controlValues?.[controlItem.name] ??
+ controlItem?.config?.default;
+ const element = (
+ <>
+ <CleanFormItem
+ name={['filters', filterId, 'requiredFirst', controlItem.name]}
+ hidden
+ initialValue={
+ controlItem?.config?.requiredFirst && filterToEdit?.requiredFirst
+ }
+ />
+ <Tooltip
+ key={controlItem.name}
+ placement="left"
+ title={
+ controlItem.config.affectsDataMask &&
+ disabled &&
+ t('Populate "Default value" to enable this control')
+ }
+ >
+ <StyledRowFormItem
+ key={controlItem.name}
+ name={['filters', filterId, 'controlValues', controlItem.name]}
+ initialValue={initialValue}
+ valuePropName="option"
+ colon={false}
+ label={
+ <StyledLabel>
+ {t(`${controlItem.config?.label}`) || t('Select')}
+ </StyledLabel>
+ }
+ >
+ <SelectControl
+ name={controlItem.name}
+ clearable={false}
+ freeForm={controlItem.config.freeForm}
+ disabled={controlItem.config.affectsDataMask && disabled}
+ onChange={(value: any) => {
Review comment:
I can see changing the "logarithmic scale" from a checkbox to a drop
down, with choices for linear, power, log, symlog (would need an input box for
the symlog constant), maybe others. I'm using d3-scale, which has those built
in:
https://github.com/d3/d3-scale#continuous-scales
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]