Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into implement/sha…
Browse files Browse the repository at this point in the history
…re-all-plugin-bundles
  • Loading branch information
spalger committed Jun 15, 2020
2 parents 9ec9881 + 4f5e279 commit 38a6597
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { TypeOf } from '@kbn/config-schema';
import { RequestHandler, Logger } from 'kibana/server';
import { validateAlerts } from '../../../../common/endpoint/schema/resolver';
import { eventsIndexPattern } from '../../../../common/endpoint/constants';
import { Fetcher } from './utils/fetch';
import { EndpointAppContext } from '../../types';

Expand All @@ -20,11 +21,9 @@ export function handleAlerts(
query: { alerts, afterAlert, legacyEndpointID: endpointID },
} = req;
try {
const indexRetriever = endpointAppContext.service.getIndexPatternRetriever();
const client = context.core.elasticsearch.legacy.client;
const indexPattern = await indexRetriever.getEventIndexPattern(context);

const fetcher = new Fetcher(client, id, indexPattern, endpointID);
const fetcher = new Fetcher(client, id, eventsIndexPattern, endpointID);

return res.ok({
body: await fetcher.alerts(alerts, afterAlert),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@ import { useUrlParams } from '../../hooks';
import { CLIENT_DEFAULTS } from '../../../common/constants';
import { UptimeRefreshContext, UptimeSettingsContext } from '../../contexts';

// TODO: when EUI exports types for this, this should be replaced
interface SuperDateRangePickerRangeChangedEvent {
start: string;
end: string;
}

interface SuperDateRangePickerRefreshChangedEvent {
isPaused: boolean;
refreshInterval?: number;
}

export interface CommonlyUsedRange {
from: string;
to: string;
Expand Down Expand Up @@ -52,12 +41,12 @@ export const UptimeDatePicker = () => {
commonlyUsedRanges={euiCommonlyUsedRanges}
isPaused={autorefreshIsPaused}
refreshInterval={autorefreshInterval}
onTimeChange={({ start, end }: SuperDateRangePickerRangeChangedEvent) => {
onTimeChange={({ start, end }) => {
updateUrl({ dateRangeStart: start, dateRangeEnd: end });
refreshApp();
}}
onRefresh={refreshApp}
onRefreshChange={({ isPaused, refreshInterval }: SuperDateRangePickerRefreshChangedEvent) => {
onRefreshChange={({ isPaused, refreshInterval }) => {
updateUrl({
autorefreshInterval:
refreshInterval === undefined ? autorefreshInterval : refreshInterval,
Expand Down

0 comments on commit 38a6597

Please sign in to comment.