Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Add limit to number of selected indices
Browse files Browse the repository at this point in the history
  • Loading branch information
ohltyler committed Apr 6, 2020
1 parent 683269c commit 82bd8f5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
EuiPagination,
} from '@elastic/eui';
import React from 'react';
import { ALL_DETECTOR_STATES, ALL_INDICES } from '../../utils/constants';
import { ALL_DETECTOR_STATES } from '../../utils/constants';
import { getDetectorStateOptions } from '../../utils/helpers';

interface ListControlsProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ exports[`<ListControls /> spec Empty results renders component with empty messag
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
style="width: 50%;"
style="width: 40%;"
>
<div
class="euiFormControlLayout euiFormControlLayout--fullWidth"
Expand Down
3 changes: 2 additions & 1 deletion public/pages/DetectorsList/List/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import {
ALL_DETECTOR_STATES,
MAX_DETECTORS,
MAX_DISPLAY_LEN,
MAX_SELECTED_INDICES,
} from '../utils/constants';
import { getURLQueryParams } from '../utils/helpers';
import { staticColumn } from '../utils/tableUtils';
Expand Down Expand Up @@ -200,7 +201,7 @@ export const DetectorList = (props: ListProps) => {

setState({
...state,
selectedIndices: indices,
selectedIndices: indices.slice(0, MAX_SELECTED_INDICES),
});
};

Expand Down
2 changes: 1 addition & 1 deletion public/pages/DetectorsList/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import { SORT_DIRECTION } from '../../../../server/utils/constants';

export const ALL_DETECTOR_STATES = '';
export const ALL_INDICES = '';
export const MAX_DETECTORS = 1000;
export const MAX_DISPLAY_LEN = 20;
export const MAX_SELECTED_INDICES = 10;

// TODO: finish when we know all possible detector states
export enum DETECTOR_STATES {
Expand Down

0 comments on commit 82bd8f5

Please sign in to comment.