Skip to content

Commit

Permalink
set back available filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
jcger committed Nov 27, 2023
1 parent c746466 commit ff764d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ export const useFilterConfig = ({
setActiveByFilterKey(newActiveByFilterKey);
};

const filterConfigArray = Array.from(filterConfigs.values()).filter(
(filter) => filter.isAvailable
);
const filterConfigArray = Array.from(filterConfigs.values());
const selectableOptions = filterConfigArray
.map(({ key, label }) => ({
key,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { SeverityFilter } from '../severity_filter';
import { AssigneesFilterPopover } from '../assignees_filter';
import type { CurrentUserProfile } from '../../types';
import type { AssigneesFilteringSelection } from '../../user_profiles/types';
import type { FilterChangeHandler, FilterConfig } from './types';
import type { FilterChangeHandler, FilterConfig, FilterConfigRenderParams } from './types';

interface UseFilterConfigProps {
availableSolutions: string[];
Expand Down Expand Up @@ -61,7 +61,7 @@ export const getSystemFilterConfig = ({
deactivate: () => {
onFilterOptionChange({ filterId: 'severity', selectedOptionKeys: [] });
},
render: ({ filterOptions, onChange }) => (
render: ({ filterOptions, onChange }: FilterConfigRenderParams) => (
<SeverityFilter selectedOptionKeys={filterOptions.severity} onChange={onChange} />
),
},
Expand All @@ -73,7 +73,7 @@ export const getSystemFilterConfig = ({
deactivate: () => {
onFilterOptionChange({ filterId: 'status', selectedOptionKeys: [] });
},
render: ({ filterOptions, onChange }) => (
render: ({ filterOptions, onChange }: FilterConfigRenderParams) => (
<StatusFilter
selectedOptionKeys={filterOptions?.status}
onChange={onChange}
Expand All @@ -92,7 +92,7 @@ export const getSystemFilterConfig = ({
deactivate: () => {
handleSelectedAssignees([]);
},
render: ({ filterOptions, onChange }) => {
render: ({ filterOptions, onChange }: FilterConfigRenderParams) => {
return (
<AssigneesFilterPopover
selectedAssignees={selectedAssignees}
Expand All @@ -111,7 +111,7 @@ export const getSystemFilterConfig = ({
deactivate: () => {
onFilterOptionChange({ filterId: 'tags', selectedOptionKeys: [] });
},
render: ({ filterOptions, onChange }) => (
render: ({ filterOptions, onChange }: FilterConfigRenderParams) => (
<MultiSelectFilter
buttonLabel={i18n.TAGS}
id={'tags'}
Expand All @@ -131,7 +131,7 @@ export const getSystemFilterConfig = ({
deactivate: () => {
onFilterOptionChange({ filterId: 'category', selectedOptionKeys: [] });
},
render: ({ filterOptions, onChange }) => (
render: ({ filterOptions, onChange }: FilterConfigRenderParams) => (
<MultiSelectFilter
buttonLabel={i18n.CATEGORIES}
id={'category'}
Expand All @@ -151,15 +151,15 @@ export const getSystemFilterConfig = ({
deactivate: () => {
onFilterOptionChange({ filterId: 'owner', selectedOptionKeys: availableSolutions });
},
render: ({ filterOptions, onChange }) => (
render: ({ filterOptions, onChange }: FilterConfigRenderParams) => (
<SolutionFilter
onChange={onChange}
selectedOptionKeys={filterOptions?.owner}
availableSolutions={availableSolutions}
/>
),
},
];
].filter((filter) => filter.isAvailable) as FilterConfig[];
};

export const useSystemFilterConfig = ({
Expand Down

0 comments on commit ff764d0

Please sign in to comment.