mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
refactor: icon to icons for filterbadge components (#15557)
* initial commit * fix test
This commit is contained in:
parent
ae160f7f21
commit
abd999bd6b
@ -38,7 +38,7 @@ describe('Dashboard filter', () => {
|
|||||||
cy.get('.Select__placeholder:first').click();
|
cy.get('.Select__placeholder:first').click();
|
||||||
|
|
||||||
// should show the filter indicator
|
// should show the filter indicator
|
||||||
cy.get('svg[data-test="filter"]:visible').should(nodes => {
|
cy.get('span[aria-label="filter"]:visible').should(nodes => {
|
||||||
expect(nodes.length).to.least(9);
|
expect(nodes.length).to.least(9);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ describe('Dashboard filter', () => {
|
|||||||
cy.get('.Select__menu').first().contains('South Asia').click();
|
cy.get('.Select__menu').first().contains('South Asia').click();
|
||||||
|
|
||||||
// should still have all filter indicators
|
// should still have all filter indicators
|
||||||
cy.get('svg[data-test="filter"]:visible').should(nodes => {
|
cy.get('span[aria-label="filter"]:visible').should(nodes => {
|
||||||
expect(nodes.length).to.least(9);
|
expect(nodes.length).to.least(9);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ import {
|
|||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import Popover from 'src/components/Popover';
|
import Popover from 'src/components/Popover';
|
||||||
import Collapse from 'src/components/Collapse';
|
import Collapse from 'src/components/Collapse';
|
||||||
import Icon from 'src/components/Icon';
|
import Icons from 'src/components/Icons';
|
||||||
import {
|
import {
|
||||||
Indent,
|
Indent,
|
||||||
Panel,
|
Panel,
|
||||||
@ -169,9 +169,9 @@ const DetailsPanelPopover = ({
|
|||||||
key="appliedCrossFilters"
|
key="appliedCrossFilters"
|
||||||
header={
|
header={
|
||||||
<Title bold color={theme.colors.primary.light1}>
|
<Title bold color={theme.colors.primary.light1}>
|
||||||
<Icon
|
<Icons.CursorTarget
|
||||||
name="cross-filter-badge"
|
|
||||||
css={{ fill: theme.colors.primary.light1 }}
|
css={{ fill: theme.colors.primary.light1 }}
|
||||||
|
iconSize="xl"
|
||||||
/>
|
/>
|
||||||
{t(
|
{t(
|
||||||
'Applied Cross Filters (%d)',
|
'Applied Cross Filters (%d)',
|
||||||
|
@ -35,7 +35,7 @@ export const Pill = styled.div`
|
|||||||
|
|
||||||
svg {
|
svg {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -1px;
|
top: -2px;
|
||||||
color: ${({ theme }) => theme.colors.grayscale.light5};
|
color: ${({ theme }) => theme.colors.grayscale.light5};
|
||||||
width: 1em;
|
width: 1em;
|
||||||
height: 1em;
|
height: 1em;
|
||||||
|
@ -20,7 +20,6 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { uniqWith } from 'lodash';
|
import { uniqWith } from 'lodash';
|
||||||
import cx from 'classnames';
|
import cx from 'classnames';
|
||||||
import Icon from 'src/components/Icon';
|
|
||||||
import Icons from 'src/components/Icons';
|
import Icons from 'src/components/Icons';
|
||||||
import { usePrevious } from 'src/common/hooks/usePrevious';
|
import { usePrevious } from 'src/common/hooks/usePrevious';
|
||||||
import { DataMaskStateWithId } from 'src/dataMask/types';
|
import { DataMaskStateWithId } from 'src/dataMask/types';
|
||||||
@ -199,7 +198,7 @@ export const FiltersBadge = ({ chartId }: FiltersBadgeProps) => {
|
|||||||
isInactive && 'filters-inactive',
|
isInactive && 'filters-inactive',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Icon name="filter" />
|
<Icons.Filter iconSize="m" />
|
||||||
{!isInactive && (
|
{!isInactive && (
|
||||||
<span data-test="applied-filter-count">
|
<span data-test="applied-filter-count">
|
||||||
{appliedIndicators.length + appliedCrossFilterIndicators.length}
|
{appliedIndicators.length + appliedCrossFilterIndicators.length}
|
||||||
|
Loading…
Reference in New Issue
Block a user