feat(native-filters): add tooltip to control values (#14312)

This commit is contained in:
Ville Brofeldt 2021-04-23 19:29:51 +03:00 committed by GitHub
parent 67535bb320
commit 2b57ebaffd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -16,7 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
import { CustomControlItem } from '@superset-ui/chart-controls';
import {
CustomControlItem,
InfoTooltipWithTrigger,
} from '@superset-ui/chart-controls';
import React, { FC } from 'react';
import { Checkbox } from 'src/common/components';
import { FormInstance } from 'antd/lib/form';
@ -77,7 +80,14 @@ const ControlItems: FC<ControlItemsProps> = ({
forceUpdate();
}}
>
{controlItem.config.label}
{controlItem.config.label}{' '}
{controlItem.config.description && (
<InfoTooltipWithTrigger
placement="top"
label={controlItem.config.name}
tooltip={controlItem.config.description}
/>
)}
</Checkbox>
</StyledCheckboxFormItem>
))}

View File

@ -75,7 +75,7 @@ const config: ControlPanelConfig = {
default: enableEmptyFilter,
renderTrigger: true,
description: t(
'When selection is empty, should an always false filter event be emitted',
'When selection is empty, an always false filter event be emitted',
),
},
},