[Uptime] Issue/48845 Disable filter and Add link to location docs when no location exists (#49175) (#49903)

* disable search text if no item exists

* update snaps
This commit is contained in:
Shahzad 2019-10-31 20:36:38 +01:00 committed by GitHub
parent 5d6cf13849
commit bc77e711bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -25,6 +25,7 @@ exports[`FilterPopover component does not show item list when loading 1`] = `
<EuiPopoverTitle>
<EuiFieldSearch
compressed={false}
disabled={false}
fullWidth={false}
incremental={false}
isLoading={false}
@ -60,6 +61,7 @@ exports[`FilterPopover component renders without errors for valid props 1`] = `
<EuiPopoverTitle>
<EuiFieldSearch
compressed={false}
disabled={false}
fullWidth={false}
incremental={false}
isLoading={false}

View file

@ -9,6 +9,7 @@ import React, { useState, useEffect } from 'react';
import { i18n } from '@kbn/i18n';
import { UptimeFilterButton } from './uptime_filter_button';
import { toggleSelectedItems } from './toggle_selected_item';
import { LocationLink } from '../monitor_list/location_link';
export interface FilterPopoverProps {
fieldName: string;
@ -73,6 +74,7 @@ export const FilterPopover = ({
>
<EuiPopoverTitle>
<EuiFieldSearch
disabled={items.length === 0}
onSearch={query => setSearchQuery(query)}
placeholder={
isLoading
@ -98,6 +100,7 @@ export const FilterPopover = ({
{item}
</EuiFilterSelectItem>
))}
{id === 'location' && items.length === 0 && <LocationLink />}
</EuiPopover>
);
};