mirror of
https://github.com/apache/superset.git
synced 2026-06-04 15:19:25 +00:00
feat(explore): UX improvements for drag'n'dropping time column (#15740)
This commit is contained in:
committed by
GitHub
parent
e9383e6d00
commit
4234031cba
@@ -32,22 +32,28 @@ const StyledInfoTooltipWithTrigger = styled(InfoTooltipWithTrigger)`
|
||||
margin: 0 ${({ theme }) => theme.gridUnit}px;
|
||||
`;
|
||||
|
||||
export default function Option(props: OptionProps) {
|
||||
export default function Option({
|
||||
children,
|
||||
index,
|
||||
clickClose,
|
||||
withCaret,
|
||||
isExtra,
|
||||
canDelete = true,
|
||||
}: OptionProps) {
|
||||
const theme = useTheme();
|
||||
return (
|
||||
<OptionControlContainer
|
||||
data-test="option-label"
|
||||
withCaret={props.withCaret}
|
||||
>
|
||||
<CloseContainer
|
||||
role="button"
|
||||
data-test="remove-control-button"
|
||||
onClick={() => props.clickClose(props.index)}
|
||||
>
|
||||
<Icons.XSmall iconColor={theme.colors.grayscale.light1} />
|
||||
</CloseContainer>
|
||||
<Label data-test="control-label">{props.children}</Label>
|
||||
{props.isExtra && (
|
||||
<OptionControlContainer data-test="option-label" withCaret={withCaret}>
|
||||
{canDelete && (
|
||||
<CloseContainer
|
||||
role="button"
|
||||
data-test="remove-control-button"
|
||||
onClick={() => clickClose(index)}
|
||||
>
|
||||
<Icons.XSmall iconColor={theme.colors.grayscale.light1} />
|
||||
</CloseContainer>
|
||||
)}
|
||||
<Label data-test="control-label">{children}</Label>
|
||||
{isExtra && (
|
||||
<StyledInfoTooltipWithTrigger
|
||||
icon="exclamation-triangle"
|
||||
placement="top"
|
||||
@@ -58,7 +64,7 @@ export default function Option(props: OptionProps) {
|
||||
`)}
|
||||
/>
|
||||
)}
|
||||
{props.withCaret && (
|
||||
{withCaret && (
|
||||
<CaretContainer>
|
||||
<Icons.CaretRight iconColor={theme.colors.grayscale.light1} />
|
||||
</CaretContainer>
|
||||
|
||||
Reference in New Issue
Block a user