From 19b8aa798ca2c373e0c96bd47eab9c65bf00c673 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Tue, 1 Jun 2021 12:54:15 +0100 Subject: [PATCH 01/33] skip flaky suite (#90565) --- .../apis/management/index_management/indices.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/api_integration/apis/management/index_management/indices.js b/x-pack/test/api_integration/apis/management/index_management/indices.js index e664d138274ffe..d0e17476530b7e 100644 --- a/x-pack/test/api_integration/apis/management/index_management/indices.js +++ b/x-pack/test/api_integration/apis/management/index_management/indices.js @@ -209,7 +209,8 @@ export default function ({ getService }) { }); describe('reload', function () { - describe('(not on Cloud)', function () { + // FLAKY: https://github.com/elastic/kibana/issues/90565 + describe.skip('(not on Cloud)', function () { this.tags(['skipCloud']); it('should list all the indices with the expected properties and data enrichers', async function () { From 4aa3920746645ac65e25e732bfaf2645c59b211e Mon Sep 17 00:00:00 2001 From: Shahzad Date: Tue, 1 Jun 2021 14:05:56 +0200 Subject: [PATCH 02/33] [Index Patterns Field Formatter] Added human readable precise formatter for duration (#100540) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../field_formats/converters/duration.test.ts | 174 +++++++++++++- .../field_formats/converters/duration.ts | 137 ++++++++++- .../__snapshots__/duration.test.tsx.snap | 221 ++++++++++++++++++ .../editors/duration/duration.test.tsx | 53 +++++ .../editors/duration/duration.tsx | 55 ++++- .../translations/translations/ja-JP.json | 1 - .../translations/translations/zh-CN.json | 1 - 7 files changed, 628 insertions(+), 14 deletions(-) diff --git a/src/plugins/data/common/field_formats/converters/duration.test.ts b/src/plugins/data/common/field_formats/converters/duration.test.ts index fc019720425dfd..72551f4b7b236f 100644 --- a/src/plugins/data/common/field_formats/converters/duration.test.ts +++ b/src/plugins/data/common/field_formats/converters/duration.test.ts @@ -139,17 +139,182 @@ describe('Duration Format', () => { ], }); + testCase({ + inputFormat: 'nanoseconds', + outputFormat: 'humanizePrecise', + outputPrecision: 2, + showSuffix: true, + fixtures: [ + { + input: 1988, + output: '0.00 Milliseconds', + }, + { + input: 658, + output: '0.00 Milliseconds', + }, + { + input: 3857, + output: '0.00 Milliseconds', + }, + ], + }); + + testCase({ + inputFormat: 'microseconds', + outputFormat: 'humanizePrecise', + outputPrecision: 2, + showSuffix: true, + fixtures: [ + { + input: 1988, + output: '1.99 Milliseconds', + }, + { + input: 658, + output: '0.66 Milliseconds', + }, + { + input: 3857, + output: '3.86 Milliseconds', + }, + ], + }); + + testCase({ + inputFormat: 'microseconds', + outputFormat: 'humanizePrecise', + outputPrecision: 1, + showSuffix: true, + fixtures: [ + { + input: 1988, + output: '2.0 Milliseconds', + }, + { + input: 0, + output: '0.0 Milliseconds', + }, + { + input: 658, + output: '0.7 Milliseconds', + }, + { + input: 3857, + output: '3.9 Milliseconds', + }, + ], + }); + + testCase({ + inputFormat: 'seconds', + outputFormat: 'humanizePrecise', + outputPrecision: 0, + showSuffix: true, + fixtures: [ + { + input: 600, + output: '10 Minutes', + }, + { + input: 30, + output: '30 Seconds', + }, + { + input: 3000, + output: '50 Minutes', + }, + ], + }); + + testCase({ + inputFormat: 'milliseconds', + outputFormat: 'humanizePrecise', + outputPrecision: 0, + showSuffix: true, + useShortSuffix: true, + fixtures: [ + { + input: -123, + output: '-123 ms', + }, + { + input: 1, + output: '1 ms', + }, + { + input: 600, + output: '600 ms', + }, + { + input: 30, + output: '30 ms', + }, + { + input: 3000, + output: '3 s', + }, + { + input: 300000, + output: '5 min', + }, + { + input: 30000000, + output: '8 h', + }, + { + input: 90000000, + output: '1 d', + }, + { + input: 9000000000, + output: '3 mon', + }, + { + input: 99999999999, + output: '3 y', + }, + ], + }); + + testCase({ + inputFormat: 'milliseconds', + outputFormat: 'humanizePrecise', + outputPrecision: 0, + showSuffix: true, + useShortSuffix: true, + includeSpaceWithSuffix: false, + fixtures: [ + { + input: -123, + output: '-123ms', + }, + { + input: 1, + output: '1ms', + }, + { + input: 600, + output: '600ms', + }, + ], + }); + function testCase({ inputFormat, outputFormat, outputPrecision, showSuffix, + useShortSuffix, + includeSpaceWithSuffix, fixtures, }: { inputFormat: string; outputFormat: string; outputPrecision: number | undefined; showSuffix: boolean | undefined; + useShortSuffix?: boolean; + includeSpaceWithSuffix?: boolean; fixtures: any[]; }) { fixtures.forEach((fixture: Record) => { @@ -160,7 +325,14 @@ describe('Duration Format', () => { outputPrecision ? `, ${outputPrecision} decimals` : '' }`, () => { const duration = new DurationFormat( - { inputFormat, outputFormat, outputPrecision, showSuffix }, + { + inputFormat, + outputFormat, + outputPrecision, + showSuffix, + useShortSuffix, + includeSpaceWithSuffix, + }, jest.fn() ); expect(duration.convert(input)).toBe(output); diff --git a/src/plugins/data/common/field_formats/converters/duration.ts b/src/plugins/data/common/field_formats/converters/duration.ts index ef8c1df3704a83..c9a7091db84716 100644 --- a/src/plugins/data/common/field_formats/converters/duration.ts +++ b/src/plugins/data/common/field_formats/converters/duration.ts @@ -18,6 +18,7 @@ const ratioToSeconds: Record = { microseconds: 0.000001, }; const HUMAN_FRIENDLY = 'humanize'; +const HUMAN_FRIENDLY_PRECISE = 'humanizePrecise'; const DEFAULT_OUTPUT_PRECISION = 2; const DEFAULT_INPUT_FORMAT = { text: i18n.translate('data.fieldFormats.duration.inputFormats.seconds', { @@ -89,59 +90,89 @@ const inputFormats = [ }, ]; const DEFAULT_OUTPUT_FORMAT = { - text: i18n.translate('data.fieldFormats.duration.outputFormats.humanize', { - defaultMessage: 'Human Readable', + text: i18n.translate('data.fieldFormats.duration.outputFormats.humanize.approximate', { + defaultMessage: 'Human-readable (approximate)', }), method: 'humanize', }; const outputFormats = [ { ...DEFAULT_OUTPUT_FORMAT }, + { + text: i18n.translate('data.fieldFormats.duration.outputFormats.humanize.precise', { + defaultMessage: 'Human-readable (precise)', + }), + method: 'humanizePrecise', + }, { text: i18n.translate('data.fieldFormats.duration.outputFormats.asMilliseconds', { defaultMessage: 'Milliseconds', }), + shortText: i18n.translate('data.fieldFormats.duration.outputFormats.asMilliseconds.short', { + defaultMessage: 'ms', + }), method: 'asMilliseconds', }, { text: i18n.translate('data.fieldFormats.duration.outputFormats.asSeconds', { defaultMessage: 'Seconds', }), + shortText: i18n.translate('data.fieldFormats.duration.outputFormats.asSeconds.short', { + defaultMessage: 's', + }), method: 'asSeconds', }, { text: i18n.translate('data.fieldFormats.duration.outputFormats.asMinutes', { defaultMessage: 'Minutes', }), + shortText: i18n.translate('data.fieldFormats.duration.outputFormats.asMinutes.short', { + defaultMessage: 'min', + }), method: 'asMinutes', }, { text: i18n.translate('data.fieldFormats.duration.outputFormats.asHours', { defaultMessage: 'Hours', }), + shortText: i18n.translate('data.fieldFormats.duration.outputFormats.asHours.short', { + defaultMessage: 'h', + }), method: 'asHours', }, { text: i18n.translate('data.fieldFormats.duration.outputFormats.asDays', { defaultMessage: 'Days', }), + shortText: i18n.translate('data.fieldFormats.duration.outputFormats.asDays.short', { + defaultMessage: 'd', + }), method: 'asDays', }, { text: i18n.translate('data.fieldFormats.duration.outputFormats.asWeeks', { defaultMessage: 'Weeks', }), + shortText: i18n.translate('data.fieldFormats.duration.outputFormats.asWeeks.short', { + defaultMessage: 'w', + }), method: 'asWeeks', }, { text: i18n.translate('data.fieldFormats.duration.outputFormats.asMonths', { defaultMessage: 'Months', }), + shortText: i18n.translate('data.fieldFormats.duration.outputFormats.asMonths.short', { + defaultMessage: 'mon', + }), method: 'asMonths', }, { text: i18n.translate('data.fieldFormats.duration.outputFormats.asYears', { defaultMessage: 'Years', }), + shortText: i18n.translate('data.fieldFormats.duration.outputFormats.asYears.short', { + defaultMessage: 'y', + }), method: 'asYears', }, ]; @@ -154,6 +185,29 @@ function parseInputAsDuration(val: number, inputFormat: string) { return moment.duration(val * ratio, kind); } +function formatInputHumanPrecise( + val: number, + inputFormat: string, + outputPrecision: number, + useShortSuffix: boolean, + includeSpace: string +) { + const ratio = ratioToSeconds[inputFormat] || 1; + const kind = (inputFormat in ratioToSeconds + ? 'seconds' + : inputFormat) as unitOfTime.DurationConstructor; + const valueInDuration = moment.duration(val * ratio, kind); + + return formatDuration( + val, + valueInDuration, + inputFormat, + outputPrecision, + useShortSuffix, + includeSpace + ); +} + export class DurationFormat extends FieldFormat { static id = FIELD_FORMAT_IDS.DURATION; static title = i18n.translate('data.fieldFormats.duration.title', { @@ -167,11 +221,17 @@ export class DurationFormat extends FieldFormat { isHuman() { return this.param('outputFormat') === HUMAN_FRIENDLY; } + + isHumanPrecise() { + return this.param('outputFormat') === HUMAN_FRIENDLY_PRECISE; + } + getParamDefaults() { return { inputFormat: DEFAULT_INPUT_FORMAT.kind, outputFormat: DEFAULT_OUTPUT_FORMAT.method, outputPrecision: DEFAULT_OUTPUT_PRECISION, + includeSpaceWithSuffix: true, }; } @@ -180,19 +240,84 @@ export class DurationFormat extends FieldFormat { const outputFormat = this.param('outputFormat') as keyof Duration; const outputPrecision = this.param('outputPrecision'); const showSuffix = Boolean(this.param('showSuffix')); + const useShortSuffix = Boolean(this.param('useShortSuffix')); + const includeSpaceWithSuffix = this.param('includeSpaceWithSuffix'); + + const includeSpace = includeSpaceWithSuffix ? ' ' : ''; + const human = this.isHuman(); + const humanPrecise = this.isHumanPrecise(); + const prefix = val < 0 && human ? i18n.translate('data.fieldFormats.duration.negativeLabel', { defaultMessage: 'minus', }) + ' ' : ''; + const duration = parseInputAsDuration(val, inputFormat) as Record; - const formatted = duration[outputFormat](); - const precise = human ? formatted : formatted.toFixed(outputPrecision); + const formatted = humanPrecise + ? formatInputHumanPrecise(val, inputFormat, outputPrecision, useShortSuffix, includeSpace) + : duration[outputFormat](); + + const precise = human || humanPrecise ? formatted : formatted.toFixed(outputPrecision); const type = outputFormats.find(({ method }) => method === outputFormat); - const suffix = showSuffix && type ? ` ${type.text}` : ''; - return prefix + precise + suffix; + const unitText = useShortSuffix ? type?.shortText : type?.text; + + const suffix = showSuffix && unitText && !human ? `${includeSpace}${unitText}` : ''; + + return humanPrecise ? precise : prefix + precise + suffix; }; } + +function formatDuration( + val: number, + duration: moment.Duration, + inputFormat: string, + outputPrecision: number, + useShortSuffix: boolean, + includeSpace: string +) { + // return nothing when the duration is falsy or not correctly parsed (P0D) + if (!duration || !duration.isValid()) return; + const units = [ + { unit: duration.years(), nextUnitRate: 12, method: 'asYears' }, + { unit: duration.months(), nextUnitRate: 4, method: 'asMonths' }, + { unit: duration.weeks(), nextUnitRate: 7, method: 'asWeeks' }, + { unit: duration.days(), nextUnitRate: 24, method: 'asDays' }, + { unit: duration.hours(), nextUnitRate: 60, method: 'asHours' }, + { unit: duration.minutes(), nextUnitRate: 60, method: 'asMinutes' }, + { unit: duration.seconds(), nextUnitRate: 1000, method: 'asSeconds' }, + { unit: duration.milliseconds(), nextUnitRate: 1000, method: 'asMilliseconds' }, + ]; + + const getUnitText = (method: string) => { + const type = outputFormats.find(({ method: methodT }) => method === methodT); + return useShortSuffix ? type?.shortText : type?.text; + }; + + for (let i = 0; i < units.length; i++) { + const unitValue = units[i].unit; + if (unitValue >= 1) { + const unitText = getUnitText(units[i].method); + + const value = Math.floor(unitValue); + if (units?.[i + 1]) { + const decimalPointValue = Math.floor(units[i + 1].unit); + return ( + (value + decimalPointValue / units[i].nextUnitRate).toFixed(outputPrecision) + + includeSpace + + unitText + ); + } else { + return unitValue.toFixed(outputPrecision) + includeSpace + unitText; + } + } + } + + const unitValue = units[units.length - 1].unit; + const unitText = getUnitText(units[units.length - 1].method); + + return unitValue.toFixed(outputPrecision) + includeSpace + unitText; +} diff --git a/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap b/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap index cb7949deda64f6..d000af4453cd14 100644 --- a/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap +++ b/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/__snapshots__/duration.test.tsx.snap @@ -1,5 +1,184 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`DurationFormatEditor should not render show suffix on dynamic output 1`] = ` + + + } + labelType="label" + > + + + + } + labelType="label" + > + + + + } + labelType="label" + > + + + + + } + onChange={[Function]} + /> + + + + } + onChange={[Function]} + /> + + + +`; + exports[`DurationFormatEditor should render human readable output normally 1`] = ` + + + } + onChange={[Function]} + /> + + + + } + onChange={[Function]} + /> + true, + isHumanPrecise: () => false, type: { inputFormats: [ { @@ -78,6 +81,7 @@ describe('DurationFormatEditor', () => { inputFormat: 'seconds', outputFormat: 'asMinutes', outputPrecision: 10, + includeSpaceWithSuffix: true, }; }), isHuman: () => false, @@ -91,6 +95,55 @@ describe('DurationFormatEditor', () => { onError={onError} /> ); + const labels = component.find(EuiSwitch); + expect(labels.length).toEqual(3); + expect(labels.get(0).props.label.props.defaultMessage).toEqual('Show suffix'); + expect(labels.get(1).props.label.props.defaultMessage).toEqual('Use short suffix'); + expect(labels.get(2).props.label.props.defaultMessage).toEqual( + 'Include space between suffix and value' + ); + + expect(component).toMatchSnapshot(); + }); + + it('should not render show suffix on dynamic output', async () => { + const newFormat = { + ...format, + getParamDefaults: jest.fn().mockImplementation(() => { + return { + inputFormat: 'seconds', + outputFormat: 'dynamic', + outputPrecision: 2, + includeSpaceWithSuffix: true, + }; + }), + isHuman: () => false, + isHumanPrecise: () => true, + }; + const component = shallow( + + ); + + const labels = component.find(EuiSwitch); + expect(labels.length).toEqual(2); + const useShortSuffixSwitch = labels.get(0); + + expect(useShortSuffixSwitch.props.label.props.defaultMessage).toEqual('Use short suffix'); + expect(useShortSuffixSwitch.props.disabled).toEqual(false); + + const includeSpaceSwitch = labels.get(1); + + expect(includeSpaceSwitch.props.disabled).toEqual(false); + expect(includeSpaceSwitch.props.label.props.defaultMessage).toEqual( + 'Include space between suffix and value' + ); + expect(component).toMatchSnapshot(); }); }); diff --git a/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/duration.tsx b/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/duration.tsx index de413d02c5011c..d61d14aac3fc7b 100644 --- a/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/duration.tsx +++ b/src/plugins/index_pattern_field_editor/public/components/field_format_editor/editors/duration/duration.tsx @@ -41,6 +41,8 @@ interface DurationFormatEditorFormatParams { inputFormat: string; outputFormat: string; showSuffix?: boolean; + useShortSuffix?: boolean; + includeSpaceWithSuffix?: boolean; } export class DurationFormatEditor extends DefaultFormatEditor< @@ -83,9 +85,14 @@ export class DurationFormatEditor extends DefaultFormatEditor< } render() { - const { format, formatParams } = this.props; + const { format } = this.props; const { error, samples, hasDecimalError } = this.state; + const formatParams: DurationFormatEditorFormatParams = { + includeSpaceWithSuffix: format.getParamDefaults().includeSpaceWithSuffix, + ...this.props.formatParams, + }; + return ( + {!(format as DurationFormat).isHumanPrecise() && ( + + + } + checked={Boolean(formatParams.showSuffix)} + onChange={(e) => { + this.onChange({ + showSuffix: !formatParams.showSuffix, + }); + }} + /> + + )} + } + checked={Boolean(formatParams.useShortSuffix)} + onChange={(e) => { + this.onChange({ useShortSuffix: !formatParams.useShortSuffix }); + }} + /> + + + } - checked={Boolean(formatParams.showSuffix)} + checked={Boolean(formatParams.includeSpaceWithSuffix)} onChange={(e) => { - this.onChange({ showSuffix: !formatParams.showSuffix }); + this.onChange({ includeSpaceWithSuffix: !formatParams.includeSpaceWithSuffix }); }} /> diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 68f3e95ba33d3c..56548ea7602a73 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -820,7 +820,6 @@ "data.fieldFormats.duration.outputFormats.asSeconds": "秒", "data.fieldFormats.duration.outputFormats.asWeeks": "週間", "data.fieldFormats.duration.outputFormats.asYears": "年", - "data.fieldFormats.duration.outputFormats.humanize": "人間に読解可能", "data.fieldFormats.duration.title": "期間", "data.fieldFormats.histogram.title": "ヒストグラム", "data.fieldFormats.ip.title": "IP アドレス", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index fa7b9648a95fbf..c8802633a5556d 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -823,7 +823,6 @@ "data.fieldFormats.duration.outputFormats.asSeconds": "秒", "data.fieldFormats.duration.outputFormats.asWeeks": "周", "data.fieldFormats.duration.outputFormats.asYears": "年", - "data.fieldFormats.duration.outputFormats.humanize": "可人工读取", "data.fieldFormats.duration.title": "持续时间", "data.fieldFormats.histogram.title": "直方图", "data.fieldFormats.ip.title": "IP 地址", From 151f5fdee1d8353ab011e5e5e599c0529163e702 Mon Sep 17 00:00:00 2001 From: Kyle Pollich Date: Tue, 1 Jun 2021 09:30:51 -0400 Subject: [PATCH 03/33] Allow for ID in create package policy request (#100908) E2E tests are failing because they include the ID field returned by the package list endpoint. This just updates our request schema to accept an ID, though we don't persist or deal with the ID anywhere. Closes #100897 Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/plugins/fleet/server/types/models/package_policy.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/x-pack/plugins/fleet/server/types/models/package_policy.ts b/x-pack/plugins/fleet/server/types/models/package_policy.ts index cbf311cac4e3bf..3735cfffeaa715 100644 --- a/x-pack/plugins/fleet/server/types/models/package_policy.ts +++ b/x-pack/plugins/fleet/server/types/models/package_policy.ts @@ -82,6 +82,7 @@ const PackagePolicyBaseSchema = { export const NewPackagePolicySchema = schema.object({ ...PackagePolicyBaseSchema, + id: schema.maybe(schema.string()), force: schema.maybe(schema.boolean()), }); From 61a49c6119917c4a292edf7651b893ca16f4cc6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20St=C3=BCrmer?= Date: Tue, 1 Jun 2021 15:48:40 +0200 Subject: [PATCH 04/33] [Logs UI] Replace legacy es client usage in category examples (#100716) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../log_entry_categories_analysis.ts | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts b/x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts index aea946ae87e747..ee2441d5911341 100644 --- a/x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts +++ b/x-pack/plugins/infra/server/lib/log_analysis/log_entry_categories_analysis.ts @@ -6,7 +6,7 @@ */ import type { estypes } from '@elastic/elasticsearch'; -import type { ILegacyScopedClusterClient } from 'src/core/server'; +import type { ElasticsearchClient } from 'src/core/server'; import { compareDatasetsByMaximumAnomalyScore, getJobId, @@ -136,7 +136,7 @@ export async function getLogEntryCategoryDatasets( export async function getLogEntryCategoryExamples( context: { - core: { elasticsearch: { legacy: { client: ILegacyScopedClusterClient } } }; + core: { elasticsearch: { client: { asCurrentUser: ElasticsearchClient } } }; infra: { mlAnomalyDetectors: MlAnomalyDetectors; mlSystem: MlSystem; @@ -402,7 +402,7 @@ async function fetchTopLogEntryCategoryHistograms( } async function fetchLogEntryCategoryExamples( - requestContext: { core: { elasticsearch: { legacy: { client: ILegacyScopedClusterClient } } } }, + requestContext: { core: { elasticsearch: { client: { asCurrentUser: ElasticsearchClient } } } }, indices: string, runtimeMappings: estypes.RuntimeFields, timestampField: string, @@ -417,19 +417,20 @@ async function fetchLogEntryCategoryExamples( const { hits: { hits }, } = decodeOrThrow(logEntryCategoryExamplesResponseRT)( - await requestContext.core.elasticsearch.legacy.client.callAsCurrentUser( - 'search', - createLogEntryCategoryExamplesQuery( - indices, - runtimeMappings, - timestampField, - tiebreakerField, - startTime, - endTime, - categoryQuery, - exampleCount + ( + await requestContext.core.elasticsearch.client.asCurrentUser.search( + createLogEntryCategoryExamplesQuery( + indices, + runtimeMappings, + timestampField, + tiebreakerField, + startTime, + endTime, + categoryQuery, + exampleCount + ) ) - ) + ).body ); const esSearchSpan = finalizeEsSearchSpan(); From 8ed2add1a2e3311f18413d33b9b2de6ed6286a29 Mon Sep 17 00:00:00 2001 From: Jason Rhodes Date: Tue, 1 Jun 2021 10:58:39 -0400 Subject: [PATCH 05/33] Re-enable _mb suffixed stack monitoring func tests (#98354) * Reenabled _mb suffixed stack monitoring func tests These tests were disabled temporarily in #98238 because of intermittent failures in master. * use test_user instead of basic_monitoring_user * remove security service * remove logout and cleanup Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: neptunian --- .../apps/monitoring/_get_lifecycle_methods.js | 10 ++++---- .../monitoring/enable_monitoring/index.js | 2 +- .../test/functional/apps/monitoring/index.js | 23 ++++++++----------- .../page_objects/monitoring_page.ts | 17 -------------- 4 files changed, 17 insertions(+), 35 deletions(-) diff --git a/x-pack/test/functional/apps/monitoring/_get_lifecycle_methods.js b/x-pack/test/functional/apps/monitoring/_get_lifecycle_methods.js index ae33d275a96b60..fce6fcfff7772c 100644 --- a/x-pack/test/functional/apps/monitoring/_get_lifecycle_methods.js +++ b/x-pack/test/functional/apps/monitoring/_get_lifecycle_methods.js @@ -8,12 +8,15 @@ export const getLifecycleMethods = (getService, getPageObjects) => { const esArchiver = getService('esArchiver'); const security = getService('security'); - const PageObjects = getPageObjects(['monitoring', 'timePicker', 'security']); + const PageObjects = getPageObjects(['monitoring', 'timePicker', 'security', 'common']); let _archive; return { async setup(archive, { from, to, useSuperUser = false }) { _archive = archive; + if (!useSuperUser) { + await security.testUser.setRoles(['monitoring_user', 'kibana_admin']); + } const kibanaServer = getService('kibanaServer'); const browser = getService('browser'); @@ -24,7 +27,7 @@ export const getLifecycleMethods = (getService, getPageObjects) => { await esArchiver.load(archive); await kibanaServer.uiSettings.replace({}); - await PageObjects.monitoring.navigateTo(useSuperUser); + await PageObjects.common.navigateToApp('monitoring'); // pause autorefresh in the time filter because we don't wait any ticks, // and we don't want ES to log a warning when data gets wiped out @@ -34,8 +37,7 @@ export const getLifecycleMethods = (getService, getPageObjects) => { }, async tearDown() { - await PageObjects.security.forceLogout(); - await security.user.delete('basic_monitoring_user'); + await security.testUser.restoreDefaults(); return esArchiver.unload(_archive); }, }; diff --git a/x-pack/test/functional/apps/monitoring/enable_monitoring/index.js b/x-pack/test/functional/apps/monitoring/enable_monitoring/index.js index cada5ce8827603..dca81fd6fc07e5 100644 --- a/x-pack/test/functional/apps/monitoring/enable_monitoring/index.js +++ b/x-pack/test/functional/apps/monitoring/enable_monitoring/index.js @@ -22,7 +22,7 @@ export default function ({ getService, getPageObjects }) { before(async () => { const browser = getService('browser'); await browser.setWindowSize(1600, 1000); - await PageObjects.monitoring.navigateTo(true); + await PageObjects.common.navigateToApp('monitoring'); await noData.isOnNoDataPage(); }); diff --git a/x-pack/test/functional/apps/monitoring/index.js b/x-pack/test/functional/apps/monitoring/index.js index 37d5d2083c4b1d..24ace88f334f0d 100644 --- a/x-pack/test/functional/apps/monitoring/index.js +++ b/x-pack/test/functional/apps/monitoring/index.js @@ -8,41 +8,38 @@ export default function ({ loadTestFile }) { describe('Monitoring app', function () { this.tags('ciGroup1'); - loadTestFile(require.resolve('./feature_controls')); loadTestFile(require.resolve('./cluster/list')); loadTestFile(require.resolve('./cluster/overview')); // loadTestFile(require.resolve('./cluster/license')); - // NOTE: All _mb tests skipped because of various failures: https://github.com/elastic/kibana/issues/98239 - loadTestFile(require.resolve('./elasticsearch/overview')); - // loadTestFile(require.resolve('./elasticsearch/overview_mb')); + loadTestFile(require.resolve('./elasticsearch/overview_mb')); loadTestFile(require.resolve('./elasticsearch/nodes')); - // loadTestFile(require.resolve('./elasticsearch/nodes_mb')); + loadTestFile(require.resolve('./elasticsearch/nodes_mb')); loadTestFile(require.resolve('./elasticsearch/node_detail')); - // loadTestFile(require.resolve('./elasticsearch/node_detail_mb')); + loadTestFile(require.resolve('./elasticsearch/node_detail_mb')); loadTestFile(require.resolve('./elasticsearch/indices')); - // loadTestFile(require.resolve('./elasticsearch/indices_mb')); + loadTestFile(require.resolve('./elasticsearch/indices_mb')); loadTestFile(require.resolve('./elasticsearch/index_detail')); - // loadTestFile(require.resolve('./elasticsearch/index_detail_mb')); + loadTestFile(require.resolve('./elasticsearch/index_detail_mb')); loadTestFile(require.resolve('./elasticsearch/shards')); // loadTestFile(require.resolve('./elasticsearch/shard_activity')); loadTestFile(require.resolve('./kibana/overview')); - // loadTestFile(require.resolve('./kibana/overview_mb')); + loadTestFile(require.resolve('./kibana/overview_mb')); loadTestFile(require.resolve('./kibana/instances')); - // loadTestFile(require.resolve('./kibana/instances_mb')); + loadTestFile(require.resolve('./kibana/instances_mb')); loadTestFile(require.resolve('./kibana/instance')); - // loadTestFile(require.resolve('./kibana/instance_mb')); + loadTestFile(require.resolve('./kibana/instance_mb')); // loadTestFile(require.resolve('./logstash/overview')); // loadTestFile(require.resolve('./logstash/nodes')); // loadTestFile(require.resolve('./logstash/node')); loadTestFile(require.resolve('./logstash/pipelines')); - // loadTestFile(require.resolve('./logstash/pipelines_mb')); + loadTestFile(require.resolve('./logstash/pipelines_mb')); loadTestFile(require.resolve('./beats/cluster')); loadTestFile(require.resolve('./beats/overview')); @@ -53,6 +50,6 @@ export default function ({ loadTestFile }) { loadTestFile(require.resolve('./enable_monitoring')); loadTestFile(require.resolve('./setup/metricbeat_migration')); - // loadTestFile(require.resolve('./setup/metricbeat_migration_mb')); + loadTestFile(require.resolve('./setup/metricbeat_migration_mb')); }); } diff --git a/x-pack/test/functional/page_objects/monitoring_page.ts b/x-pack/test/functional/page_objects/monitoring_page.ts index a499b53c226066..d32528f44613c5 100644 --- a/x-pack/test/functional/page_objects/monitoring_page.ts +++ b/x-pack/test/functional/page_objects/monitoring_page.ts @@ -10,24 +10,7 @@ import { FtrProviderContext } from '../ftr_provider_context'; export function MonitoringPageProvider({ getPageObjects, getService }: FtrProviderContext) { const PageObjects = getPageObjects(['common', 'header', 'security', 'login']); const testSubjects = getService('testSubjects'); - const security = getService('security'); - return new (class MonitoringPage { - async navigateTo(useSuperUser = false) { - // always create this because our tear down tries to delete it - await security.user.create('basic_monitoring_user', { - password: 'monitoring_user_password', - roles: ['monitoring_user', 'kibana_admin'], - full_name: 'basic monitoring', - }); - - if (!useSuperUser) { - await PageObjects.security.forceLogout(); - await PageObjects.login.login('basic_monitoring_user', 'monitoring_user_password'); - } - await PageObjects.common.navigateToApp('monitoring'); - } - async getAccessDeniedMessage() { return testSubjects.getVisibleText('accessDeniedTitle'); } From 675997731dde84aa6cab5b8a69bee64d5ae0b86c Mon Sep 17 00:00:00 2001 From: gchaps <33642766+gchaps@users.noreply.github.com> Date: Tue, 1 Jun 2021 08:01:02 -0700 Subject: [PATCH 06/33] [DOCS] Remove recommendation of coordinating only node (#100632) (#100954) --- .../production.asciidoc | 58 +------------------ 1 file changed, 2 insertions(+), 56 deletions(-) diff --git a/docs/user/production-considerations/production.asciidoc b/docs/user/production-considerations/production.asciidoc index 726747d5d69d0e..1ffca4b6ae6ab1 100644 --- a/docs/user/production-considerations/production.asciidoc +++ b/docs/user/production-considerations/production.asciidoc @@ -8,7 +8,6 @@ * <> * <> * <> -* <> * <> * <> * <> @@ -22,9 +21,8 @@ Kibana instances that are all connected to the same Elasticsearch instance. While Kibana isn't terribly resource intensive, we still recommend running Kibana separate from your Elasticsearch data or master nodes. To distribute Kibana -traffic across the nodes in your Elasticsearch cluster, you can run Kibana -and an Elasticsearch client node on the same machine. For more information, see -<>. +traffic across the nodes in your Elasticsearch cluster, +you can configure Kibana to use a list of Elasticsearch hosts. [float] [[configuring-kibana-shield]] @@ -69,58 +67,6 @@ csp.strict: true See <>. -[float] -[[load-balancing-es]] -=== Load Balancing across multiple {es} nodes -If you have multiple nodes in your Elasticsearch cluster, the easiest way to distribute Kibana requests -across the nodes is to run an Elasticsearch _Coordinating only_ node on the same machine as Kibana. -Elasticsearch Coordinating only nodes are essentially smart load balancers that are part of the cluster. They -process incoming HTTP requests, redirect operations to the other nodes in the cluster as needed, and -gather and return the results. For more information, see -{ref}/modules-node.html[Node] in the Elasticsearch reference. - -To use a local client node to load balance Kibana requests: - -. Install Elasticsearch on the same machine as Kibana. -. Configure the node as a Coordinating only node. In `elasticsearch.yml`, set `node.data`, `node.master` and `node.ingest` to `false`: -+ -[source,js] --------- -# 3. You want this node to be neither master nor data node nor ingest node, but -# to act as a "search load balancer" (fetching data from nodes, -# aggregating results, etc.) -# -node.master: false -node.data: false -node.ingest: false --------- -. Configure the client node to join your Elasticsearch cluster. In `elasticsearch.yml`, set the `cluster.name` to the -name of your cluster. -+ -[source,js] --------- -cluster.name: "my_cluster" --------- -. Check your transport and HTTP host configs in `elasticsearch.yml` under `network.host` and `transport.host`. The `transport.host` needs to be on the network reachable to the cluster members, the `network.host` is the network for the HTTP connection for Kibana (localhost:9200 by default). -+ -[source,js] --------- -network.host: localhost -http.port: 9200 - -# by default transport.host refers to network.host -transport.host: -transport.tcp.port: 9300 - 9400 --------- -. Make sure Kibana is configured to point to your local client node. In `kibana.yml`, the `elasticsearch.hosts` setting should be set to -`["localhost:9200"]`. -+ -[source,js] --------- -# The Elasticsearch instance to use for all your queries. -elasticsearch.hosts: ["http://localhost:9200"] --------- - [float] [[load-balancing-kibana]] === Load balancing across multiple Kibana instances From 9734d1cfe8baff1879a2240456159c9b2033c63d Mon Sep 17 00:00:00 2001 From: Matthew Kime Date: Tue, 1 Jun 2021 10:34:06 -0500 Subject: [PATCH 07/33] [Index patterns] Deprecate scripted field API functions (#100907) * deprecate scripted field functions in index patterns api --- ...lugins-data-public.indexpattern.addscriptedfield.md | 4 ++++ ...ns-data-public.indexpattern.getnonscriptedfields.md | 4 ++++ ...ugins-data-public.indexpattern.getscriptedfields.md | 4 ++++ ...ins-data-public.indexpattern.removescriptedfield.md | 4 ++++ ...lugins-data-server.indexpattern.addscriptedfield.md | 4 ++++ ...ns-data-server.indexpattern.getnonscriptedfields.md | 4 ++++ ...ugins-data-server.indexpattern.getscriptedfields.md | 4 ++++ ...ins-data-server.indexpattern.removescriptedfield.md | 4 ++++ .../index_patterns/index_patterns/index_pattern.ts | 10 ++++++++++ src/plugins/data/public/public.api.md | 6 ++++-- src/plugins/data/server/server.api.md | 6 ++++-- 11 files changed, 50 insertions(+), 4 deletions(-) diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md index 99d2fc00a6b7b6..812f014b15a6c9 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.addscriptedfield.md @@ -4,6 +4,10 @@ ## IndexPattern.addScriptedField() method +> Warning: This API is now obsolete. +> +> + Add scripted field to field list Signature: diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md index 77ce6f6f23a671..1792a979bf7490 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getnonscriptedfields.md @@ -4,6 +4,10 @@ ## IndexPattern.getNonScriptedFields() method +> Warning: This API is now obsolete. +> +> + Signature: ```typescript diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md index 055f07367c96e0..b6b3dcb19bac17 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.getscriptedfields.md @@ -4,6 +4,10 @@ ## IndexPattern.getScriptedFields() method +> Warning: This API is now obsolete. +> +> + Signature: ```typescript diff --git a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md index aaaebdaccca5d7..91f25c09ab197a 100644 --- a/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md +++ b/docs/development/plugins/data/public/kibana-plugin-plugins-data-public.indexpattern.removescriptedfield.md @@ -4,6 +4,10 @@ ## IndexPattern.removeScriptedField() method +> Warning: This API is now obsolete. +> +> + Remove scripted field from field list Signature: diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md index a86fea3106225a..981f28a51ae09d 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.addscriptedfield.md @@ -4,6 +4,10 @@ ## IndexPattern.addScriptedField() method +> Warning: This API is now obsolete. +> +> + Add scripted field to field list Signature: diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md index 89d79d9b750faf..cff2c5de98de61 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getnonscriptedfields.md @@ -4,6 +4,10 @@ ## IndexPattern.getNonScriptedFields() method +> Warning: This API is now obsolete. +> +> + Signature: ```typescript diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getscriptedfields.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getscriptedfields.md index edfff8ec5efacc..62b8f1b62ac787 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getscriptedfields.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.getscriptedfields.md @@ -4,6 +4,10 @@ ## IndexPattern.getScriptedFields() method +> Warning: This API is now obsolete. +> +> + Signature: ```typescript diff --git a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md index 3162a7f42dd121..f6beed7389e438 100644 --- a/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md +++ b/docs/development/plugins/data/server/kibana-plugin-plugins-data-server.indexpattern.removescriptedfield.md @@ -4,6 +4,10 @@ ## IndexPattern.removeScriptedField() method +> Warning: This API is now obsolete. +> +> + Remove scripted field from field list Signature: diff --git a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts index 41ce7ba4bab4a1..1552bed210e8c9 100644 --- a/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts +++ b/src/plugins/data/common/index_patterns/index_patterns/index_pattern.ts @@ -240,6 +240,7 @@ export class IndexPattern implements IIndexPattern { * @param script script code * @param fieldType * @param lang + * @deprecated use runtime field instead */ async addScriptedField(name: string, script: string, fieldType: string = 'string') { const scriptedFields = this.getScriptedFields(); @@ -265,6 +266,7 @@ export class IndexPattern implements IIndexPattern { /** * Remove scripted field from field list * @param fieldName + * @deprecated use runtime field instead */ removeScriptedField(fieldName: string) { @@ -274,10 +276,18 @@ export class IndexPattern implements IIndexPattern { } } + /** + * + * @deprecated use runtime field instead + */ getNonScriptedFields() { return [...this.fields.getAll().filter((field) => !field.scripted)]; } + /** + * + * @deprecated use runtime field instead + */ getScriptedFields() { return [...this.fields.getAll().filter((field) => field.scripted)]; } diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index fde7075d9e760e..069b0a21c9c774 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -1307,6 +1307,7 @@ export class IndexPattern implements IIndexPattern { // Warning: (ae-forgotten-export) The symbol "IndexPatternDeps" needs to be exported by the entry point index.d.ts constructor({ spec, fieldFormats, shortDotsEnable, metaFields, }: IndexPatternDeps); addRuntimeField(name: string, runtimeField: RuntimeField): void; + // @deprecated addScriptedField(name: string, script: string, fieldType?: string): Promise; readonly allowNoIndex: boolean; // (undocumented) @@ -1366,7 +1367,7 @@ export class IndexPattern implements IIndexPattern { getFieldByName(name: string): IndexPatternField | undefined; getFormatterForField(field: IndexPatternField | IndexPatternField['spec'] | IFieldType): FieldFormat; getFormatterForFieldNoDefault(fieldname: string): FieldFormat | undefined; - // (undocumented) + // @deprecated (undocumented) getNonScriptedFields(): IndexPatternField[]; getOriginalSavedObjectBody: () => { fieldAttrs?: string | undefined; @@ -1379,7 +1380,7 @@ export class IndexPattern implements IIndexPattern { typeMeta?: string | undefined; type?: string | undefined; }; - // (undocumented) + // @deprecated (undocumented) getScriptedFields(): IndexPatternField[]; getSourceFiltering(): { excludes: any[]; @@ -1397,6 +1398,7 @@ export class IndexPattern implements IIndexPattern { // (undocumented) metaFields: string[]; removeRuntimeField(name: string): void; + // @deprecated removeScriptedField(fieldName: string): void; resetOriginalSavedObjectBody: () => void; // (undocumented) diff --git a/src/plugins/data/server/server.api.md b/src/plugins/data/server/server.api.md index 4abf4302521644..4f3802cda7a3a4 100644 --- a/src/plugins/data/server/server.api.md +++ b/src/plugins/data/server/server.api.md @@ -749,6 +749,7 @@ export class IndexPattern implements IIndexPattern { // Warning: (ae-forgotten-export) The symbol "IndexPatternDeps" needs to be exported by the entry point index.d.ts constructor({ spec, fieldFormats, shortDotsEnable, metaFields, }: IndexPatternDeps); addRuntimeField(name: string, runtimeField: RuntimeField): void; + // @deprecated addScriptedField(name: string, script: string, fieldType?: string): Promise; readonly allowNoIndex: boolean; // (undocumented) @@ -812,7 +813,7 @@ export class IndexPattern implements IIndexPattern { getFormatterForFieldNoDefault(fieldname: string): FieldFormat | undefined; // Warning: (ae-forgotten-export) The symbol "IndexPatternField" needs to be exported by the entry point index.d.ts // - // (undocumented) + // @deprecated (undocumented) getNonScriptedFields(): IndexPatternField[]; getOriginalSavedObjectBody: () => { fieldAttrs?: string | undefined; @@ -825,7 +826,7 @@ export class IndexPattern implements IIndexPattern { typeMeta?: string | undefined; type?: string | undefined; }; - // (undocumented) + // @deprecated (undocumented) getScriptedFields(): IndexPatternField[]; getSourceFiltering(): { excludes: any[]; @@ -843,6 +844,7 @@ export class IndexPattern implements IIndexPattern { // (undocumented) metaFields: string[]; removeRuntimeField(name: string): void; + // @deprecated removeScriptedField(fieldName: string): void; resetOriginalSavedObjectBody: () => void; // (undocumented) From 38fd8a268ad7661d92f0d84c52d6f0a3d84c9801 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Tue, 1 Jun 2021 10:53:07 -0500 Subject: [PATCH 08/33] Upgrade EUI to v33.0.0 (#99382) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * eui to 33.0.0 * resize observer type inclusion - revisit * src snapshot updates * x-pack snapshot updates * table sort test updates * code block language sh -> bash * datagrid datetime sort inversion * types * kbn-crypto * refractor yarn resolution * refractor yarn resolution * update cypress tests * url state test * trial * Revert "trial" This reverts commit adc3538145d613279445f0c93308ed712adb7611. * trial anomaly timeout * Revert "trial anomaly timeout" This reverts commit 9a11711ba898b51d9f2979fa64f8907759b33fe4. * kbn-telemetry-tools * Change a useMemo to useCallback so the code executes when intended * Removed no-longer-used import * exitOrFail already retries for longer than tryForTime * Wait for loading indicator to disappear * Intentionally adding `.only` * Revert .only * Increase wait time for the ML chart to load * Remove unused var * overflow * chartWidth Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Alejandro Fernández Haro Co-authored-by: Chandler Prall --- package.json | 3 +- packages/kbn-crypto/BUILD.bazel | 1 + packages/kbn-telemetry-tools/BUILD.bazel | 1 + .../collapsible_nav.test.tsx.snap | 24 +- .../header/__snapshots__/header.test.tsx.snap | 14 +- .../flyout_service.test.tsx.snap | 4 +- .../__snapshots__/modal_service.test.tsx.snap | 6 +- .../__snapshots__/data_view.test.tsx.snap | 153 +++---- ...ver_index_pattern_management.test.tsx.snap | 2 + .../components/tutorial/instruction.js | 2 +- .../url/__snapshots__/url.test.tsx.snap | 8 +- .../warning_call_out.test.tsx.snap | 2 + .../inspector_panel.test.tsx.snap | 3 + .../__snapshots__/header.test.tsx.snap | 4 + .../__snapshots__/intro.test.tsx.snap | 2 + .../not_found_errors.test.tsx.snap | 8 + .../public/components/vega_vis_component.tsx | 4 +- test/functional/services/data_grid.ts | 4 +- test/tsconfig.json | 2 +- tsconfig.base.json | 3 +- .../List/__snapshots__/List.test.tsx.snap | 64 ++- .../ServiceList/service_list.test.tsx | 8 +- .../TransactionActionMenu.test.tsx.snap | 1 + .../time_filter.stories.storyshot | 15 +- .../__snapshots__/asset.stories.storyshot | 8 + .../asset_manager.stories.storyshot | 10 + .../color_manager.stories.storyshot | 8 + .../color_picker.stories.storyshot | 8 + .../custom_element_modal.stories.storyshot | 4 + .../datasource_component.stories.storyshot | 2 + .../keyboard_shortcuts_doc.stories.storyshot | 1 + .../element_controls.stories.storyshot | 2 + .../element_grid.stories.storyshot | 6 + .../saved_elements_modal.stories.storyshot | 11 + .../sidebar_header.stories.storyshot | 4 + .../text_style_picker.stories.storyshot | 12 + .../__snapshots__/toolbar.stories.storyshot | 7 + .../delete_var.stories.storyshot | 1 + .../__snapshots__/edit_var.stories.storyshot | 7 + .../var_config.stories.storyshot | 1 + .../element_menu.stories.storyshot | 1 + .../workpad_templates.stories.storyshot | 20 +- .../api/__snapshots__/shareable.test.tsx.snap | 10 +- .../__snapshots__/canvas.stories.storyshot | 9 + .../__snapshots__/footer.stories.storyshot | 6 + .../page_controls.stories.storyshot | 6 + .../__snapshots__/settings.test.tsx.snap | 10 +- .../__snapshots__/settings.stories.storyshot | 2 + .../components/table/table.test.tsx | 10 +- .../extend_index_management.test.tsx.snap | 3 + .../__snapshots__/policy_table.test.tsx.snap | 1 + .../infra/public/components/auto_sizer.tsx | 2 +- .../upload_license.test.tsx.snap | 9 + .../embeddable_anomaly_charts_container.tsx | 8 +- .../nodes/__snapshots__/cells.test.js.snap | 2 + .../report_listing.test.tsx.snap | 288 ++++++++++---- .../report_info_button.test.tsx.snap | 10 + .../timelines/flyout_button.spec.ts | 2 +- .../cypress/integration/urls/state.spec.ts | 1 + .../cypress/tasks/timeline.ts | 1 + .../components/hosts_table/index.test.tsx | 8 +- .../trusted_app_deletion_dialog.test.tsx.snap | 3 + .../__snapshots__/index.test.tsx.snap | 372 ++++++++--------- .../__snapshots__/index.test.tsx.snap | 376 +++++++++++++----- .../index.test.tsx | 8 +- .../network_top_n_flow_table/index.test.tsx | 8 +- .../components/tls_table/index.test.tsx | 2 +- .../components/users_table/index.test.tsx | 4 +- .../__snapshots__/index.test.tsx.snap | 8 + .../add_data_provider_popover.tsx | 1 - .../fingerprint_col.test.tsx.snap | 2 + .../uptime_date_picker.test.tsx.snap | 2 + .../__snapshots__/license_info.test.tsx.snap | 1 + .../ml/__snapshots__/ml_flyout.test.tsx.snap | 2 + .../availability_reporting.test.tsx.snap | 12 +- .../location_status_tags.test.tsx.snap | 38 +- .../__snapshots__/monitor_list.test.tsx.snap | 37 +- .../services/ml/dashboard_embeddables.ts | 2 +- yarn.lock | 57 +-- 79 files changed, 1152 insertions(+), 622 deletions(-) diff --git a/package.json b/package.json index e5b9ca1ef98cc6..9a076ee28bc04e 100644 --- a/package.json +++ b/package.json @@ -86,6 +86,7 @@ "**/prismjs": "1.23.0", "**/react-syntax-highlighter": "^15.3.1", "**/react-syntax-highlighter/**/highlight.js": "^10.4.1", + "**/refractor": "^3.3.1", "**/request": "^2.88.2", "**/trim": "1.0.1", "**/typescript": "4.1.3", @@ -102,7 +103,7 @@ "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath/npm_module", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.4", "@elastic/ems-client": "7.13.0", - "@elastic/eui": "32.1.0", + "@elastic/eui": "33.0.0", "@elastic/filesaver": "1.1.2", "@elastic/good": "^9.0.1-kibana3", "@elastic/maki": "6.3.0", diff --git a/packages/kbn-crypto/BUILD.bazel b/packages/kbn-crypto/BUILD.bazel index b1723e4120e797..20793e27de6298 100644 --- a/packages/kbn-crypto/BUILD.bazel +++ b/packages/kbn-crypto/BUILD.bazel @@ -38,6 +38,7 @@ TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/node-forge", "@npm//@types/testing-library__jest-dom", + "@npm//resize-observer-polyfill" ] DEPS = SRC_DEPS + TYPES_DEPS diff --git a/packages/kbn-telemetry-tools/BUILD.bazel b/packages/kbn-telemetry-tools/BUILD.bazel index 9a6b4a10bd1905..d394b0c93d45fb 100644 --- a/packages/kbn-telemetry-tools/BUILD.bazel +++ b/packages/kbn-telemetry-tools/BUILD.bazel @@ -47,6 +47,7 @@ TYPES_DEPS = [ "@npm//@types/node", "@npm//@types/normalize-path", "@npm//@types/testing-library__jest-dom", + "@npm//resize-observer-polyfill" ] DEPS = SRC_DEPS + TYPES_DEPS diff --git a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap index 575a247ffeccb5..0f5efe667ec2fc 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/collapsible_nav.test.tsx.snap @@ -587,10 +587,12 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` > @@ -1921,6 +1923,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` > @@ -1999,6 +2004,7 @@ exports[`CollapsibleNav renders links grouped by category 1`] = ` @@ -3084,6 +3094,7 @@ exports[`CollapsibleNav renders the default nav 3`] = ` > @@ -3162,6 +3175,7 @@ exports[`CollapsibleNav renders the default nav 3`] = ` @@ -5469,6 +5473,7 @@ exports[`Header renders 1`] = ` > @@ -5547,6 +5554,7 @@ exports[`Header renders 1`] = `
Flyout content
"`; +exports[`FlyoutService openFlyout() renders a flyout to the DOM 2`] = `"
Flyout content
"`; exports[`FlyoutService openFlyout() with a currently active flyout replaces the current flyout with a new one 1`] = ` Array [ @@ -59,4 +59,4 @@ Array [ ] `; -exports[`FlyoutService openFlyout() with a currently active flyout replaces the current flyout with a new one 2`] = `"
Flyout content 2
"`; +exports[`FlyoutService openFlyout() with a currently active flyout replaces the current flyout with a new one 2`] = `"
Flyout content 2
"`; diff --git a/src/core/public/overlays/modal/__snapshots__/modal_service.test.tsx.snap b/src/core/public/overlays/modal/__snapshots__/modal_service.test.tsx.snap index 19ebb5a9113c3d..9c39776fcea5c0 100644 --- a/src/core/public/overlays/modal/__snapshots__/modal_service.test.tsx.snap +++ b/src/core/public/overlays/modal/__snapshots__/modal_service.test.tsx.snap @@ -29,7 +29,7 @@ Array [ ] `; -exports[`ModalService openConfirm() renders a mountpoint confirm message 2`] = `"
Modal content
"`; +exports[`ModalService openConfirm() renders a mountpoint confirm message 2`] = `"
Modal content
"`; exports[`ModalService openConfirm() renders a string confirm message 1`] = ` Array [ @@ -49,7 +49,7 @@ Array [ ] `; -exports[`ModalService openConfirm() renders a string confirm message 2`] = `"

Some message

"`; +exports[`ModalService openConfirm() renders a string confirm message 2`] = `"

Some message

"`; exports[`ModalService openConfirm() with a currently active confirm replaces the current confirm with the new one 1`] = ` Array [ @@ -131,7 +131,7 @@ Array [ ] `; -exports[`ModalService openModal() renders a modal to the DOM 2`] = `"
Modal content
"`; +exports[`ModalService openModal() renders a modal to the DOM 2`] = `"
Modal content
"`; exports[`ModalService openModal() with a currently active confirm replaces the current confirm with the new one 1`] = ` Array [ diff --git a/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap b/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap index 9896a6dbdc7b7f..a0a7e54d275322 100644 --- a/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap +++ b/src/plugins/data/public/utils/table_inspector_view/components/__snapshots__/data_view.test.tsx.snap @@ -718,11 +718,13 @@ exports[`Inspector Data View component should render single table without select > @@ -996,6 +998,7 @@ exports[`Inspector Data View component should render single table without select - - - - - column1 - - - - - - - Click to sort in ascending order - + + + + column1 + + + - + @@ -1322,6 +1320,7 @@ exports[`Inspector Data View component should render single table without select