Skip to content

Commit

Permalink
[Uptime] Remove pointless max search size box (#29992)
Browse files Browse the repository at this point in the history
This box is just confusing. You can only see 100 results so we should just hard-code that. Having it is left-over from a previous design.
  • Loading branch information
andrewvc authored Feb 5, 2019
1 parent ee71a09 commit 13a213c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,27 +93,6 @@ exports[`PingList component renders sorted list without errors 1`] = `
/>
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem
component="div"
grow={true}
>
<EuiFormRow
describedByIds={Array []}
fullWidth={false}
hasEmptyLabelSpace={false}
label="Max Search Size"
>
<EuiFieldNumber
compressed={false}
defaultValue="200"
fullWidth={false}
isLoading={false}
max={10000}
min={0}
onBlur={[MockFunction]}
/>
</EuiFormRow>
</EuiFlexItem>
</EuiFlexGroup>
<EuiInMemoryTable
columns={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ describe('PingList component', () => {
const component = shallowWithIntl(
<PingList
loading={false}
maxSearchSize={200}
maxSearchSize={100}
pingResults={allPings}
searchSizeOnBlur={jest.fn()}
selectedOption={{ label: 'All', value: '' }}
Expand Down
15 changes: 0 additions & 15 deletions x-pack/plugins/uptime/public/components/functional/ping_list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
EuiBadge,
EuiComboBox,
EuiComboBoxOptionProps,
EuiFieldNumber,
EuiFlexGroup,
EuiFlexItem,
EuiFormRow,
Expand Down Expand Up @@ -177,20 +176,6 @@ export const PingList = ({
/>
</EuiFormRow>
</EuiFlexItem>
<EuiFlexItem>
<EuiFormRow
label={i18n.translate('xpack.uptime.pingList.maxSearchSizeLabel', {
defaultMessage: 'Max Search Size',
})}
>
<EuiFieldNumber
defaultValue={maxSearchSize.toString()}
min={0}
max={10000} // 10k is the max default size in ES, and a good max sane size for this page
onBlur={searchSizeOnBlur}
/>
</EuiFormRow>
</EuiFlexItem>
</EuiFlexGroup>
<EuiInMemoryTable
loading={loading}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { UptimeCommonProps } from '../../../uptime_app';
import { PingList } from '../../functional';
import { getPingsQuery } from './get_pings';

const DEFAULT_MAX_SEARCH_SIZE = 100;

interface PingListProps {
monitorId?: string;
sort?: UMPingSortDirectionArg;
Expand Down Expand Up @@ -54,7 +56,7 @@ export class PingListQuery extends React.Component<Props, PingListState> {
this.state = {
statusOptions,
selectedOption: statusOptions[2],
maxSearchSize: 200,
maxSearchSize: DEFAULT_MAX_SEARCH_SIZE,
};
}
public render() {
Expand All @@ -80,7 +82,7 @@ export class PingListQuery extends React.Component<Props, PingListState> {
? selectedOption.value
: '',
// TODO: get rid of the magic number
size: this.state.maxSearchSize || size || 200,
size: this.state.maxSearchSize || size || DEFAULT_MAX_SEARCH_SIZE,
sort: sort || 'desc',
}}
query={getPingsQuery}
Expand Down

0 comments on commit 13a213c

Please sign in to comment.