Skip to content

Commit

Permalink
fix: fix failing tests
Browse files Browse the repository at this point in the history
Signed-off-by: Pianist038801 <[email protected]>
  • Loading branch information
Pianist038801 committed Oct 26, 2021
1 parent ce64ae9 commit be5ee74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/Executions/ExecutionFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@ const RenderFilter: React.FC<{ filter: FilterState }> = ({ filter }) => {
*/
export const ExecutionFilters: React.FC<{
filters: (FilterState | BooleanFilterState)[];
chartIds: string[];
clearCharts: () => void;
chartIds?: string[];
clearCharts?: () => void;
}> = ({ filters, chartIds, clearCharts }) => {
const styles = useStyles();

filters = filters.map(filter => {
const onChangeFunc = filter.onChange;
filter.onChange = value => {
clearCharts();
onChangeFunc(value);
if (clearCharts) clearCharts();
if (onChangeFunc) onChangeFunc(value);
};
return filter;
});
Expand Down Expand Up @@ -113,7 +113,7 @@ export const ExecutionFilters: React.FC<{
/>
);
})}
{chartIds.length > 0 && (
{chartIds && chartIds.length > 0 && (
<FilterPopoverButton
open={false}
active={true}
Expand Down
1 change: 1 addition & 0 deletions src/components/Executions/filters/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface FilterState {
status?: string;
getFilter: () => FilterOperation[];
onReset: () => void;
onChange?: (value) => void;
}

export interface SingleFilterState<FilterKey extends string>
Expand Down

0 comments on commit be5ee74

Please sign in to comment.