Skip to content

Commit

Permalink
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
Browse files Browse the repository at this point in the history
…-fix'
  • Loading branch information
kibanamachine committed May 24, 2024
1 parent 9f8bfaa commit 74100d4
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 60 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export const LOG_STREAM_EMBEDDABLE = 'LOG_STREAM_EMBEDDABLE';
export const ADD_LOG_STREAM_ACTION_ID = 'ADD_SEARCH_ACTION_ID';
export const ADD_LOG_STREAM_ACTION_ID = 'ADD_SEARCH_ACTION_ID';
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React, { useEffect, useMemo, useState } from 'react';
import { ReactEmbeddableFactory } from '@kbn/embeddable-plugin/public';
import { initializeTimeRange, initializeTitles, useFetchContext } from '@kbn/presentation-publishing';
import {
initializeTimeRange,
initializeTitles,
useFetchContext,
} from '@kbn/presentation-publishing';
import { LogStream } from '@kbn/logs-shared-plugin/public';
import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common';
import { Query } from '@kbn/es-query';
import type { LogStreamApi, LogStreamSerializedState, Services } from './types';
import { datemathToEpochMillis } from '../../utils/datemath';
import { LogStream } from '@kbn/logs-shared-plugin/public';
import { LOG_STREAM_EMBEDDABLE } from './constants';
import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common';
import { CoreProviders } from '../../apps/common_providers';
import { Query } from '@kbn/es-query';

export function getLogStreamEmbeddableFactory(services: Services) {
const factory: ReactEmbeddableFactory<
LogStreamSerializedState,
LogStreamApi
> = {
const factory: ReactEmbeddableFactory<LogStreamSerializedState, LogStreamApi> = {
type: LOG_STREAM_EMBEDDABLE,
deserializeState: (state) => state.rawState,
buildEmbeddable: async (state, buildApi) => {
Expand All @@ -36,14 +36,14 @@ export function getLogStreamEmbeddableFactory(services: Services) {
return {
rawState: {
...timeRange.serialize(),
...serializeTitles()
...serializeTitles(),
},
};
},
},
{
...timeRange.comparators,
...titleComparators
...titleComparators,
}
);

Expand All @@ -65,31 +65,31 @@ export function getLogStreamEmbeddableFactory(services: Services) {
});
return () => subscription.unsubscribe();
}, [services.coreStart.theme.theme$]);
return !startTimestamp || !endTimestamp
? null
: <CoreProviders
core={services.coreStart}
plugins={services.pluginDeps}
pluginStart={services.pluginStart}
theme$={services.coreStart.theme.theme$}
>
<EuiThemeProvider darkMode={darkMode}>
<div style={{ width: '100%' }}>
<LogStream
logView={{ type: 'log-view-reference', logViewId: 'default' }}
startTimestamp={startTimestamp}
endTimestamp={endTimestamp}
height="100%"
query={query as Query | undefined}
filters={filters}
/>
</div>
</EuiThemeProvider>
</CoreProviders>;

return !startTimestamp || !endTimestamp ? null : (
<CoreProviders
core={services.coreStart}
plugins={services.pluginDeps}
pluginStart={services.pluginStart}
theme$={services.coreStart.theme.theme$}
>
<EuiThemeProvider darkMode={darkMode}>
<div style={{ width: '100%' }}>
<LogStream
logView={{ type: 'log-view-reference', logViewId: 'default' }}
startTimestamp={startTimestamp}
endTimestamp={endTimestamp}
height="100%"
query={query as Query | undefined}
filters={filters}
/>
</div>
</EuiThemeProvider>
</CoreProviders>
);
},
};
},
};
return factory;
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { CoreStart } from '@kbn/core/public';
import { DefaultEmbeddableApi } from "@kbn/embeddable-plugin/public";
import { SerializedTimeRange, SerializedTitles } from "@kbn/presentation-publishing";
import { InfraClientStartDeps, InfraClientStartExports } from "../../types";
import { DefaultEmbeddableApi } from '@kbn/embeddable-plugin/public';
import { SerializedTimeRange, SerializedTitles } from '@kbn/presentation-publishing';
import { InfraClientStartDeps, InfraClientStartExports } from '../../types';

export type LogStreamSerializedState = SerializedTitles & SerializedTimeRange;

export type LogStreamApi = DefaultEmbeddableApi<LogStreamSerializedState>;

export interface Services {
coreStart: CoreStart,
pluginDeps: InfraClientStartDeps,
pluginStart: InfraClientStartExports
}
coreStart: CoreStart;
pluginDeps: InfraClientStartDeps;
pluginStart: InfraClientStartExports;
}
22 changes: 12 additions & 10 deletions x-pack/plugins/observability_solution/infra/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ import { enableInfrastructureHostsView } from '@kbn/observability-plugin/public'
import { ObservabilityTriggerId } from '@kbn/observability-shared-plugin/common';
import { BehaviorSubject, combineLatest, from } from 'rxjs';
import { map } from 'rxjs';
import { EmbeddableApiContext } from '@kbn/presentation-publishing';
import { apiCanAddNewPanel } from '@kbn/presentation-containers';
import { IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
import type { InfraPublicConfig } from '../common/plugin_config_types';
import { createInventoryMetricRuleType } from './alerting/inventory';
import { createLogThresholdRuleType } from './alerting/log_threshold';
Expand All @@ -43,9 +46,6 @@ import type {
InfraClientStartExports,
} from './types';
import { getLogsHasDataFetcher, getLogsOverviewDataFetcher } from './utils/logs_overview_fetchers';
import { EmbeddableApiContext } from '@kbn/presentation-publishing';
import { apiCanAddNewPanel } from '@kbn/presentation-containers';
import { IncompatibleActionError } from '@kbn/ui-actions-plugin/public';
import type { LogStreamSerializedState } from './components/log_stream/types';

export class Plugin implements InfraClientPluginClass {
Expand Down Expand Up @@ -400,12 +400,14 @@ export class Plugin implements InfraClientPluginClass {

plugins.uiActions.registerAction<EmbeddableApiContext>({
id: ADD_LOG_STREAM_ACTION_ID,
getDisplayName: () => i18n.translate('xpack.infra.logStreamEmbeddable.displayName', {
defaultMessage: 'Log stream',
}),
getDisplayNameTooltip: () => i18n.translate('xpack.infra.logStreamEmbeddable.description', {
defaultMessage: 'Add a table of live streaming logs.',
}),
getDisplayName: () =>
i18n.translate('xpack.infra.logStreamEmbeddable.displayName', {
defaultMessage: 'Log stream',
}),
getDisplayNameTooltip: () =>
i18n.translate('xpack.infra.logStreamEmbeddable.description', {
defaultMessage: 'Add a table of live streaming logs.',
}),
getIconType: () => 'logsApp',
isCompatible: async ({ embeddable }) => {
return apiCanAddNewPanel(embeddable);
Expand All @@ -418,7 +420,7 @@ export class Plugin implements InfraClientPluginClass {
initialState: {
title: i18n.translate('xpack.infra.logStreamEmbeddable.title', {
defaultMessage: 'Log stream',
})
}),
},
},
true
Expand Down

0 comments on commit 74100d4

Please sign in to comment.