Skip to content

Commit

Permalink
fixes type mismatch for sorting and rulesStatuses
Browse files Browse the repository at this point in the history
  • Loading branch information
dhurley14 committed Apr 2, 2020
1 parent cd705ec commit d20a621
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Func = (ruleId: string) => void;
export type ReturnRuleStatus = [boolean, RuleStatus | null, Func | null];
export interface ReturnRulesStatuses {
loading: boolean;
rulesStatuses: RuleStatusRowItemType[] | null;
rulesStatuses: RuleStatusRowItemType[];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { Loader } from '../../../../components/loader';
import { Panel } from '../../../../components/panel';
import { PrePackagedRulesPrompt } from '../components/pre_packaged_rules/load_empty_prompt';
import { GenericDownloader } from '../../../../components/generic_downloader';
import { AllRulesTables } from '../components/all_rules_tables';
import { AllRulesTables, SortingType } from '../components/all_rules_tables';
import { getPrePackagedRuleStatus } from '../helpers';
import * as i18n from '../translations';
import { EuiBasicTableOnChange } from '../types';
Expand Down Expand Up @@ -128,7 +128,7 @@ export const AllRules = React.memo<AllRulesProps>(
});

const sorting = useMemo(
() => ({ sort: { field: 'enabled', direction: filterOptions.sortOrder } }),
(): SortingType => ({ sort: { field: 'enabled', direction: filterOptions.sortOrder } }),
[filterOptions.sortOrder]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ import { Rule, Rules } from '../../../../../containers/detection_engine/rules';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const MyEuiBasicTable = styled(EuiBasicTable as any)`` as any;

export interface SortingType {
sort: {
field: 'enabled';
direction: Direction;
};
}

interface AllRulesTablesProps {
euiBasicTableSelectionProps: EuiTableSelectionType<Rule>;
hasNoPermissions: boolean;
Expand Down

0 comments on commit d20a621

Please sign in to comment.