Skip to content

Commit

Permalink
Merge branch 'master' into renable-shareable-flaky
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored May 3, 2021
2 parents 92e920a + 38a8989 commit eac2fa5
Show file tree
Hide file tree
Showing 83 changed files with 724 additions and 473 deletions.
Binary file modified docs/discover/images/search-session-awhile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/discover/images/search-session.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/discover/images/search-sessions-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions docs/discover/search-sessions.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ and when your session is complete, view and manage it in *Stack Management*.
[role="screenshot"]
image::images/search-session.png[Search Session indicator displaying the current state of the search, which you can click to stop or save a running Search Session ]

Search sessions are <<search-session-settings-kb,enabled by default>>. Saving
a search session is only available when
<<set-time-filter,auto refresh>> is off.

Search sessions are <<search-session-settings-kb,enabled by default>>.

[float]
==== Requirements
Expand Down Expand Up @@ -59,6 +56,7 @@ image::images/search-sessions-menu.png[Search Sessions management view with acti

. Use the edit menu in *Search Sessions* to:
* *Inspect* the queries and filters that makeup the session.
* *Edit the name* of a session.
* *Extend* the expiration of a completed session.
* *Delete* a session.

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pageLoadAssetSize:
visTypeVega: 153573
visTypeVislib: 242838
visTypeXy: 113478
visualizations: 295025
visualizations: 90000
visualize: 57431
watcher: 43598
runtimeFields: 41752
Expand Down
11 changes: 9 additions & 2 deletions packages/kbn-storybook/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* Side Public License, v 1.
*/

import { resolve } from 'path';
import { externals } from '@kbn/ui-shared-deps';
import { stringifyRequest } from 'loader-utils';
import { resolve } from 'path';
import { Configuration, Stats } from 'webpack';
import webpackMerge from 'webpack-merge';
import { externals } from '@kbn/ui-shared-deps';
import { REPO_ROOT } from './lib/constants';

const stats = {
Expand Down Expand Up @@ -80,6 +80,12 @@ export default function ({ config: storybookConfig }: { config: Configuration })
stats,
};

// Disable the progress plugin
const progressPlugin: any = (storybookConfig.plugins || []).find((plugin: any) => {
return 'handler' in plugin && plugin.showActiveModules && plugin.showModules;
});
progressPlugin.handler = () => {};

// This is the hacky part. We find something that looks like the
// HtmlWebpackPlugin and mutate its `options.template` to point at our
// revised template.
Expand All @@ -89,5 +95,6 @@ export default function ({ config: storybookConfig }: { config: Configuration })
if (htmlWebpackPlugin) {
htmlWebpackPlugin.options.template = require.resolve('../lib/templates/index.ejs');
}

return webpackMerge(storybookConfig, config);
}
10 changes: 6 additions & 4 deletions src/dev/chromium_version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ async function getPuppeteerRelease(log: ToolingLog): Promise<PuppeteerRelease> {
'Could not get the Puppeteer version! Check node_modules/puppteer/package.json'
);
}
log.info(`Kibana is using Puppeteer ${version} (${forkCompatibilityMap[version]})`);
return forkCompatibilityMap[version];
const puppeteerRelease = forkCompatibilityMap[version] ?? version;

log.info(`Kibana is using Puppeteer ${version} (${puppeteerRelease})`);
return puppeteerRelease;
}

async function getChromiumRevision(
Expand Down Expand Up @@ -129,8 +131,8 @@ run(
description: chalk`
Display the Chromium git commit that correlates to a given Puppeteer release.
- node x-pack/dev-tools/chromium_version 5.5.0 {dim # gets the Chromium commit for Puppeteer v5.5.0}
- node x-pack/dev-tools/chromium_version {dim # gets the Chromium commit for the Kibana dependency version of Puppeteer}
- node scripts/chromium_version 5.5.0 {dim # gets the Chromium commit for Puppeteer v5.5.0}
- node scripts/chromium_version {dim # gets the Chromium commit for the Kibana dependency version of Puppeteer}
You can use https://omahaproxy.appspot.com/ to look up the Chromium release that first shipped with that commit.
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ const log = new ToolingLog({
});

describe(`enumeratePatterns`, () => {
it(`should resolve x-pack/plugins/reporting/server/browsers/extract/unzip.js to kibana-reporting`, () => {
it(`should resolve x-pack/plugins/reporting/server/browsers/extract/unzip.ts to kibana-reporting`, () => {
const actual = enumeratePatterns(REPO_ROOT)(log)(
new Map([['x-pack/plugins/reporting', ['kibana-reporting']]])
);

expect(
actual[0].includes(
'x-pack/plugins/reporting/server/browsers/extract/unzip.js kibana-reporting'
'x-pack/plugins/reporting/server/browsers/extract/unzip.ts kibana-reporting'
)
).toBe(true);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ x-pack/plugins/reporting/server/browsers/download/download.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/download/ensure_downloaded.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/download/index.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/download/util.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/extract.js kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/extract_error.js kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/index.js kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/unzip.js kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/extract.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/extract_error.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/index.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/extract/unzip.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/index.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/install.ts kibana-reporting
x-pack/plugins/reporting/server/browsers/network_policy.test.ts kibana-reporting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@ describe(`Transform fns`, () => {
it(`should remove the jenkins workspace path`, () => {
const obj = {
staticSiteUrl:
'/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/plugins/reporting/server/browsers/extract/unzip.js',
'/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana/x-pack/plugins/reporting/server/browsers/extract/unzip.ts',
COVERAGE_INGESTION_KIBANA_ROOT:
'/var/lib/jenkins/workspace/elastic+kibana+code-coverage/kibana',
};
expect(coveredFilePath(obj)).toHaveProperty(
'coveredFilePath',
'x-pack/plugins/reporting/server/browsers/extract/unzip.js'
'x-pack/plugins/reporting/server/browsers/extract/unzip.ts'
);
});
});
describe(`in the qa research job`, () => {
it(`should remove the jenkins workspace path`, () => {
const obj = {
staticSiteUrl:
'/var/lib/jenkins/workspace/elastic+kibana+qa-research/kibana/x-pack/plugins/reporting/server/browsers/extract/unzip.js',
'/var/lib/jenkins/workspace/elastic+kibana+qa-research/kibana/x-pack/plugins/reporting/server/browsers/extract/unzip.ts',
COVERAGE_INGESTION_KIBANA_ROOT:
'/var/lib/jenkins/workspace/elastic+kibana+qa-research/kibana',
};
expect(coveredFilePath(obj)).toHaveProperty(
'coveredFilePath',
'x-pack/plugins/reporting/server/browsers/extract/unzip.js'
'x-pack/plugins/reporting/server/browsers/extract/unzip.ts'
);
});
});
Expand Down Expand Up @@ -82,7 +82,7 @@ describe(`Transform fns`, () => {
describe(`teamAssignment`, () => {
const teamAssignmentsPathMOCK =
'src/dev/code_coverage/ingest_coverage/__tests__/mocks/team_assign_mock.txt';
const coveredFilePath = 'x-pack/plugins/reporting/server/browsers/extract/unzip.js';
const coveredFilePath = 'x-pack/plugins/reporting/server/browsers/extract/unzip.ts';
const obj = { coveredFilePath };
const log = new ToolingLog({
level: 'info',
Expand Down
1 change: 0 additions & 1 deletion src/plugins/visualizations/public/components/_index.scss

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
* Side Public License, v 1.
*/

import React, { ReactNode, Suspense } from 'react';
import React, { ReactNode, Suspense, lazy } from 'react';
import { EuiLoadingChart } from '@elastic/eui';
import classNames from 'classnames';
import { VisualizationNoResults } from './visualization_noresults';
import { VisualizationError } from './visualization_error';

import { IInterpreterRenderHandlers } from '../../../expressions/common';

interface VisualizationContainerProps {
export interface VisualizationContainerProps {
'data-test-subj'?: string;
className?: string;
children: ReactNode;
Expand All @@ -22,6 +21,9 @@ interface VisualizationContainerProps {
error?: string;
}

const VisualizationNoResults = lazy(() => import('./visualization_noresults'));
const VisualizationError = lazy(() => import('./visualization_error'));

export const VisualizationContainer = ({
'data-test-subj': dataTestSubj = '',
className,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ export class VisualizationError extends React.Component<VisualizationNoResultsPr
}
}
}

// eslint-disable-next-line import/no-default-export
export default VisualizationError;
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,6 @@ export class VisualizationNoResults extends React.Component<VisualizationNoResul
}
}
}

// eslint-disable-next-line import/no-default-export
export default VisualizationNoResults;
1 change: 0 additions & 1 deletion src/plugins/visualizations/public/embeddable/_index.scss

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import { Vis } from '../types';
import {
import type {
VisualizeInput,
VisualizeEmbeddable,
VisualizeByValueInput,
Expand All @@ -31,6 +31,7 @@ import { VisualizeEmbeddableFactoryDeps } from './visualize_embeddable_factory';
import { VISUALIZE_ENABLE_LABS_SETTING } from '../../common/constants';
import { SavedVisualizationsLoader } from '../saved_visualizations';
import { IndexPattern } from '../../../data/public';
import { createVisualizeEmbeddableAsync } from './visualize_embeddable_async';

export const createVisEmbeddableFromObject = (deps: VisualizeEmbeddableFactoryDeps) => async (
vis: Vis,
Expand Down Expand Up @@ -72,7 +73,7 @@ export const createVisEmbeddableFromObject = (deps: VisualizeEmbeddableFactoryDe
dashboardSave: Boolean(getCapabilities().dashboard?.showWriteControls),
};

return new VisualizeEmbeddable(
return createVisualizeEmbeddableAsync(
getTimeFilter(),
{
vis,
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/visualizations/public/embeddable/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
*/

export { DisabledLabEmbeddable } from './disabled_lab_embeddable';
export { VisualizeEmbeddable, VisualizeInput } from './visualize_embeddable';
export { VisualizeEmbeddableFactory } from './visualize_embeddable_factory';
export { VISUALIZE_EMBEDDABLE_TYPE } from './constants';
export { VIS_EVENT_TO_TRIGGER } from './events';
export { createVisEmbeddableFromObject } from './create_vis_embeddable_from_object';

export type { VisualizeEmbeddable, VisualizeInput } from './visualize_embeddable';
Original file line number Diff line number Diff line change
@@ -0,0 +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.
*/

import type { VisualizeEmbeddable as VisualizeEmbeddableType } from './visualize_embeddable';

export const createVisualizeEmbeddableAsync = async (
...args: ConstructorParameters<typeof VisualizeEmbeddableType>
) => {
// Build optimization. Move app styles from main bundle
// @ts-expect-error TS error, cannot find type declaration for scss
await import('./embeddables.scss');

const { VisualizeEmbeddable } = await import('./visualize_embeddable');

return new VisualizeEmbeddable(...args);
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
*/

import { i18n } from '@kbn/i18n';
import { SavedObjectMetaData, OnSaveProps } from 'src/plugins/saved_objects/public';
import { first } from 'rxjs/operators';
import { EmbeddableStateWithType } from 'src/plugins/embeddable/common';
import { SavedObjectAttributes } from '../../../../core/public';
import type { SavedObjectMetaData, OnSaveProps } from 'src/plugins/saved_objects/public';
import type { EmbeddableStateWithType } from 'src/plugins/embeddable/common';

import { extractSearchSourceReferences } from '../../../data/public';
import { SavedObjectReference } from '../../../../core/public';
import type { SavedObjectAttributes, SavedObjectReference } from '../../../../core/public';

import {
EmbeddableFactoryDefinition,
Expand All @@ -21,8 +21,8 @@ import {
IContainer,
AttributeService,
} from '../../../embeddable/public';
import { DisabledLabEmbeddable } from './disabled_lab_embeddable';
import {
import type { DisabledLabEmbeddable } from './disabled_lab_embeddable';
import type {
VisualizeByReferenceInput,
VisualizeByValueInput,
VisualizeEmbeddable,
Expand All @@ -31,7 +31,8 @@ import {
VisualizeSavedObjectAttributes,
} from './visualize_embeddable';
import { VISUALIZE_EMBEDDABLE_TYPE } from './constants';
import { SerializedVis, Vis } from '../vis';
import type { SerializedVis, Vis } from '../vis';
import { createVisAsync } from '../vis_async';
import {
getCapabilities,
getTypes,
Expand All @@ -47,10 +48,10 @@ import {
injectControlsReferences,
} from '../saved_visualizations/saved_visualization_references';
import { createVisEmbeddableFromObject } from './create_vis_embeddable_from_object';
import { StartServicesGetter } from '../../../kibana_utils/public';
import { VisualizationsStartDeps } from '../plugin';
import { VISUALIZE_ENABLE_LABS_SETTING } from '../../common/constants';
import { checkForDuplicateTitle } from '../../../saved_objects/public';
import type { StartServicesGetter } from '../../../kibana_utils/public';
import type { VisualizationsStartDeps } from '../plugin';

interface VisualizationAttributes extends SavedObjectAttributes {
visState: string;
Expand Down Expand Up @@ -147,8 +148,8 @@ export class VisualizeEmbeddableFactory
try {
const savedObject = await savedVisualizations.get(savedObjectId);
const visState = convertToSerializedVis(savedObject);
const vis = new Vis(savedObject.visState.type, visState);
await vis.setState(visState);
const vis = await createVisAsync(savedObject.visState.type, visState);

return createVisEmbeddableFromObject(this.deps)(
vis,
input,
Expand All @@ -167,8 +168,7 @@ export class VisualizeEmbeddableFactory
// to allow for in place creation of visualizations without having to navigate away to a new URL.
if (input.savedVis) {
const visState = input.savedVis;
const vis = new Vis(visState.type, visState);
await vis.setState(visState);
const vis = await createVisAsync(visState.type, visState);
const savedVisualizations = getSavedVisualizationsLoader();
return createVisEmbeddableFromObject(this.deps)(
vis,
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/visualizations/public/index.scss

This file was deleted.

9 changes: 4 additions & 5 deletions src/plugins/visualizations/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,29 @@
import { PublicContract } from '@kbn/utility-types';
import { PluginInitializerContext } from 'src/core/public';
import { VisualizationsPlugin, VisualizationsSetup, VisualizationsStart } from './plugin';
import { VisualizeEmbeddableFactory, VisualizeEmbeddable } from './embeddable';
import type { VisualizeEmbeddableFactory, VisualizeEmbeddable } from './embeddable';

export function plugin(initializerContext: PluginInitializerContext) {
return new VisualizationsPlugin(initializerContext);
}

/** @public static code */
export { Vis } from './vis';
export { TypesService } from './vis_types/types_service';
export { VISUALIZE_EMBEDDABLE_TYPE, VIS_EVENT_TO_TRIGGER } from './embeddable';
export { VisualizationContainer } from './components';
export { getVisSchemas } from './vis_schemas';

/** @public types */
export { VisualizationsSetup, VisualizationsStart };
export { VisGroups } from './vis_types';
export { VisGroups } from './vis_types/vis_groups_enum';
export type { BaseVisType, VisTypeAlias, VisTypeDefinition, Schema, ISchemas } from './vis_types';
export { SerializedVis, SerializedVisData, VisData } from './vis';
export type { Vis, SerializedVis, SerializedVisData, VisData } from './vis';
export type VisualizeEmbeddableFactoryContract = PublicContract<VisualizeEmbeddableFactory>;
export type VisualizeEmbeddableContract = PublicContract<VisualizeEmbeddable>;
export { VisualizeInput } from './embeddable';
export { SchemaConfig } from './vis_schemas';
export { updateOldState } from './legacy/vis_update_state';
export { PersistedState } from './persisted_state';
export type { PersistedState } from './persisted_state';
export {
ISavedVis,
VisSavedObject,
Expand Down
Loading

0 comments on commit eac2fa5

Please sign in to comment.