fix(dashboard): align filter bar elements vertically in horizontal mode (#36036)

This commit is contained in:
Richard Fogaca Nienkotter
2025-11-11 05:48:25 -03:00
committed by GitHub
parent 4376476ec4
commit d123249bd2
4 changed files with 20 additions and 5 deletions

View File

@@ -49,7 +49,9 @@ const LoaderWrapper = styled.div<{
&.inline-centered {
margin: 0 auto;
display: block;
display: flex;
align-items: center;
justify-content: center;
}
&.floating {
position: absolute;

View File

@@ -152,7 +152,6 @@ const ActionButtons = ({
<Button
disabled={!isClearAllEnabled}
buttonStyle="link"
buttonSize="small"
className="filter-clear-all-button"
onClick={onClearAll}
{...getFilterBarTestId('clear-button')}

View File

@@ -53,6 +53,7 @@ const VerticalFilterControlTitle = styled.h4`
const HorizontalFilterControlTitle = styled(VerticalFilterControlTitle)`
font-weight: ${({ theme }) => theme.fontWeightNormal};
color: ${({ theme }) => theme.colorText};
margin: 0;
${truncationCSS};
`;
@@ -60,6 +61,7 @@ const HorizontalOverflowFilterControlTitle = styled(
HorizontalFilterControlTitle,
)`
max-width: none;
margin: ${({ theme }) => `${theme.sizeUnit * 2}px 0 ${theme.sizeUnit}px`};
`;
const VerticalFilterControlTitleBox = styled.div`
@@ -162,7 +164,7 @@ const HorizontalFormItem = styled(StyledFormItem)<{
align-items: center;
}
.ant-form-item-label {
&& > .ant-row > .ant-form-item-label {
display: flex;
align-items: center;
overflow: visible;

View File

@@ -62,7 +62,15 @@ import { useFilterOutlined } from '../useFilterOutlined';
const HEIGHT = 32;
// Overrides superset-ui height with min-height
const StyledDiv = styled.div`
const StyledDiv = styled.div<{
orientation: FilterBarOrientation;
overflow: boolean;
}>`
padding-bottom: ${({ theme, orientation, overflow }) =>
orientation === FilterBarOrientation.Horizontal && !overflow
? 0
: (theme?.sizeUnit ?? 4)}px;
& > div {
height: auto !important;
min-height: ${HEIGHT}px;
@@ -353,7 +361,11 @@ const FilterValue: FC<FilterControlProps> = ({
}
return (
<StyledDiv data-test="form-item-value">
<StyledDiv
data-test="form-item-value"
orientation={orientation}
overflow={overflow}
>
{isLoading ? (
<Loading position="inline-centered" size="s" muted />
) : (