mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
This commit is contained in:
parent
0ee9255661
commit
d57b5df77a
5 changed files with 13 additions and 1 deletions
|
@ -503,6 +503,7 @@ export const AllRules = React.memo<AllRulesProps>(
|
|||
onFilterChanged={onFilterChangedCallback}
|
||||
rulesCustomInstalled={rulesCustomInstalled}
|
||||
rulesInstalled={rulesInstalled}
|
||||
currentFilterTags={filterOptions.tags ?? []}
|
||||
/>
|
||||
</HeaderSection>
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ describe('RulesTableFilters', () => {
|
|||
onFilterChanged={jest.fn()}
|
||||
rulesCustomInstalled={null}
|
||||
rulesInstalled={null}
|
||||
currentFilterTags={[]}
|
||||
/>
|
||||
);
|
||||
|
||||
|
@ -37,6 +38,7 @@ describe('RulesTableFilters', () => {
|
|||
onFilterChanged={jest.fn()}
|
||||
rulesCustomInstalled={10}
|
||||
rulesInstalled={9}
|
||||
currentFilterTags={[]}
|
||||
/>
|
||||
);
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ interface RulesTableFiltersProps {
|
|||
onFilterChanged: (filterOptions: Partial<FilterOptions>) => void;
|
||||
rulesCustomInstalled: number | null;
|
||||
rulesInstalled: number | null;
|
||||
currentFilterTags: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,6 +38,7 @@ const RulesTableFiltersComponent = ({
|
|||
onFilterChanged,
|
||||
rulesCustomInstalled,
|
||||
rulesInstalled,
|
||||
currentFilterTags,
|
||||
}: RulesTableFiltersProps) => {
|
||||
const [filter, setFilter] = useState<string>('');
|
||||
const [selectedTags, setSelectedTags] = useState<string[]>([]);
|
||||
|
@ -94,6 +96,7 @@ const RulesTableFiltersComponent = ({
|
|||
onSelectedTagsChanged={handleSelectedTags}
|
||||
selectedTags={selectedTags}
|
||||
tags={tags}
|
||||
currentFilterTags={currentFilterTags}
|
||||
data-test-subj="allRulesTagPopover"
|
||||
/>
|
||||
</EuiFilterGroup>
|
||||
|
|
|
@ -16,6 +16,7 @@ describe('TagsFilterPopover', () => {
|
|||
tags={[]}
|
||||
selectedTags={[]}
|
||||
onSelectedTagsChanged={jest.fn()}
|
||||
currentFilterTags={[]}
|
||||
isLoading={false}
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -33,6 +33,7 @@ interface TagsFilterPopoverProps {
|
|||
selectedTags: string[];
|
||||
tags: string[];
|
||||
onSelectedTagsChanged: Dispatch<SetStateAction<string[]>>;
|
||||
currentFilterTags: string[];
|
||||
// eslint-disable-next-line react/no-unused-prop-types
|
||||
isLoading: boolean; // TO DO reimplement?
|
||||
}
|
||||
|
@ -62,8 +63,12 @@ const TagsFilterPopoverComponent = ({
|
|||
tags,
|
||||
selectedTags,
|
||||
onSelectedTagsChanged,
|
||||
currentFilterTags,
|
||||
}: TagsFilterPopoverProps) => {
|
||||
const sortedTags = useMemo(() => caseInsensitiveSort(tags), [tags]);
|
||||
const sortedTags = useMemo(
|
||||
() => caseInsensitiveSort(Array.from(new Set([...tags, ...currentFilterTags]))),
|
||||
[tags, currentFilterTags]
|
||||
);
|
||||
const [isTagPopoverOpen, setIsTagPopoverOpen] = useState(false);
|
||||
const [searchInput, setSearchInput] = useState('');
|
||||
const [filterTags, setFilterTags] = useState(sortedTags);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue