From 2f45be98a215420de2e7d9d5398cb7612891c071 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Fri, 12 Nov 2021 11:54:10 +0100 Subject: [PATCH 01/10] retry all suggestion checks (#118310) --- test/functional/apps/visualize/_timelion.ts | 23 ++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/test/functional/apps/visualize/_timelion.ts b/test/functional/apps/visualize/_timelion.ts index afbcba7df5216..f8991e17319bd 100644 --- a/test/functional/apps/visualize/_timelion.ts +++ b/test/functional/apps/visualize/_timelion.ts @@ -265,8 +265,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await monacoEditor.typeCodeEditorValue('.es(index=', 'timelionCodeEditor'); // wait for index patterns will be loaded await common.sleep(500); - const suggestions = await timelion.getSuggestionItemsText(); - expect(suggestions[0].includes('log')).to.eql(true); + // other suggestions might be shown for a short amount of time - retry until metric suggestions show up + await retry.try(async () => { + const suggestions = await timelion.getSuggestionItemsText(); + expect(suggestions[0].includes('log')).to.eql(true); + }); }); it('should show field suggestions for timefield argument when index pattern set', async () => { @@ -275,9 +278,12 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { '.es(index=logstash-*, timefield=', 'timelionCodeEditor' ); - const suggestions = await timelion.getSuggestionItemsText(); - expect(suggestions.length).to.eql(4); - expect(suggestions[0].includes('@timestamp')).to.eql(true); + // other suggestions might be shown for a short amount of time - retry until metric suggestions show up + await retry.try(async () => { + const suggestions = await timelion.getSuggestionItemsText(); + expect(suggestions.length).to.eql(4); + expect(suggestions[0].includes('@timestamp')).to.eql(true); + }); }); it('should show field suggestions for split argument when index pattern set', async () => { @@ -288,9 +294,12 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { ); // wait for split fields to load await common.sleep(300); - const suggestions = await timelion.getSuggestionItemsText(); + // other suggestions might be shown for a short amount of time - retry until metric suggestions show up + await retry.try(async () => { + const suggestions = await timelion.getSuggestionItemsText(); - expect(suggestions[0].includes('@message.raw')).to.eql(true); + expect(suggestions[0].includes('@message.raw')).to.eql(true); + }); }); it('should show field suggestions for metric argument when index pattern set', async () => { From 1d49415f3d24257b84921b1256141069bb7520aa Mon Sep 17 00:00:00 2001 From: Oliver Gupte Date: Fri, 12 Nov 2021 05:55:03 -0500 Subject: [PATCH 02/10] [Observability] Fixes incorrect link from empty data message (#118450) (#118451) --- x-pack/plugins/observability/public/utils/no_data_config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/observability/public/utils/no_data_config.ts b/x-pack/plugins/observability/public/utils/no_data_config.ts index c8e7daaf688bc..fdd70401e7097 100644 --- a/x-pack/plugins/observability/public/utils/no_data_config.ts +++ b/x-pack/plugins/observability/public/utils/no_data_config.ts @@ -32,7 +32,7 @@ export function getNoDataConfig({ defaultMessage: 'Use Beats and APM agents to send observability data to Elasticsearch. We make it easy with support for many popular systems, apps, and languages.', }), - href: basePath.prepend(`/app/home#/tutorial/apm`), + href: basePath.prepend(`/app/integrations/browse`), }, }, docsLink, From 0b4ede75cf03d414c4e6e219608c32e2bb1ccdc3 Mon Sep 17 00:00:00 2001 From: Shahzad Date: Fri, 12 Nov 2021 12:33:38 +0100 Subject: [PATCH 03/10] [Exploratory view] Only show metric loading for relevant series (#118299) --- .../shared/exploratory_view/rtl_helpers.tsx | 5 +- .../report_metric_options.test.tsx | 55 +++++++++++++++++++ .../series_editor/report_metric_options.tsx | 2 +- 3 files changed, 59 insertions(+), 3 deletions(-) create mode 100644 x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx index 612cbfcc4bfdf..04d74844beb83 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/rtl_helpers.tsx @@ -23,7 +23,7 @@ import { ObservabilityPublicPluginsStart } from '../../../plugin'; import { EuiThemeProvider } from '../../../../../../../src/plugins/kibana_react/common'; import { lensPluginMock } from '../../../../../lens/public/mocks'; import * as useAppIndexPatternHook from './hooks/use_app_index_pattern'; -import { IndexPatternContextProvider } from './hooks/use_app_index_pattern'; +import { IndexPatternContext, IndexPatternContextProvider } from './hooks/use_app_index_pattern'; import { AllSeries, SeriesContextValue, UrlStorageContext } from './hooks/use_series_storage'; import * as fetcherHook from '../../../hooks/use_fetcher'; @@ -234,7 +234,7 @@ export const mockUseHasData = () => { return { spy, onRefreshTimeRange }; }; -export const mockAppIndexPattern = () => { +export const mockAppIndexPattern = (props?: Partial) => { const loadIndexPattern = jest.fn(); const spy = jest.spyOn(useAppIndexPatternHook, 'useAppIndexPatternContext').mockReturnValue({ indexPattern: mockIndexPattern, @@ -244,6 +244,7 @@ export const mockAppIndexPattern = () => { loadIndexPattern, indexPatterns: { ux: mockIndexPattern } as unknown as Record, indexPatternErrors: {} as any, + ...(props || {}), }); return { spy, loadIndexPattern }; }; diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx new file mode 100644 index 0000000000000..767b765ba1f19 --- /dev/null +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx @@ -0,0 +1,55 @@ +/* + * 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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { screen } from '@testing-library/react'; +import { mockAppIndexPattern, mockIndexPattern, mockUxSeries, render } from '../rtl_helpers'; +import { getDefaultConfigs } from '../configurations/default_configs'; +import { PERCENTILE } from '../configurations/constants'; +import { ReportMetricOptions } from './report_metric_options'; + +describe('ReportMetricOptions', function () { + const dataViewSeries = getDefaultConfigs({ + reportType: 'kpi-over-time', + indexPattern: mockIndexPattern, + dataType: 'ux', + }); + + it('should render properly', async function () { + render( + + ); + + expect(await screen.findByText('No data available')).toBeInTheDocument(); + }); + + it('should display loading if index pattern is not available and is loading', async function () { + mockAppIndexPattern({ loading: true, indexPatterns: undefined }); + const { container } = render( + + ); + + expect(container.getElementsByClassName('euiLoadingSpinner').length).toBe(1); + }); + + it('should not display loading if index pattern is already loaded', async function () { + mockAppIndexPattern({ loading: true }); + render( + + ); + + expect(await screen.findByText('Page load time')).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.tsx b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.tsx index 410356d0078d8..bc7c2328dcbba 100644 --- a/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.tsx +++ b/x-pack/plugins/observability/public/components/shared/exploratory_view/series_editor/report_metric_options.tsx @@ -127,7 +127,7 @@ export function ReportMetricOptions({ seriesId, series, seriesConfig }: Props) { )} {series.selectedMetricField && - (indexPattern && !loading ? ( + (indexPattern ? ( Date: Fri, 12 Nov 2021 15:36:19 +0100 Subject: [PATCH 04/10] unskip lens dashboard tests (#118308) --- x-pack/test/functional/apps/lens/dashboard.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/x-pack/test/functional/apps/lens/dashboard.ts b/x-pack/test/functional/apps/lens/dashboard.ts index e5ae900b4ed38..cef3650db7d04 100644 --- a/x-pack/test/functional/apps/lens/dashboard.ts +++ b/x-pack/test/functional/apps/lens/dashboard.ts @@ -34,8 +34,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await browser.getActions().move({ x, y, origin: el._webElement }).click().perform(); } - // FLAKY: https://github.com/elastic/kibana/issues/117770 - describe.skip('lens dashboard tests', () => { + describe('lens dashboard tests', () => { before(async () => { await PageObjects.common.navigateToApp('dashboard'); await security.testUser.setRoles( @@ -70,7 +69,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await find.clickByButtonText('lnsXYvis'); await dashboardAddPanel.closeAddPanel(); await PageObjects.lens.goToTimeRange(); - await clickInChart(6, 5); // hardcoded position of bar, depends heavy on data and charts implementation + await retry.try(async () => { + await clickInChart(6, 5); // hardcoded position of bar, depends heavy on data and charts implementation + await testSubjects.existOrFail('applyFiltersPopoverButton'); + }); await retry.try(async () => { await testSubjects.click('applyFiltersPopoverButton'); From f22c57d54063ebbedea685c5d21cdbf80bc2fa99 Mon Sep 17 00:00:00 2001 From: Tiago Costa Date: Fri, 12 Nov 2021 19:54:18 +0000 Subject: [PATCH 05/10] skip flaky suite (#118476) --- x-pack/test/functional/apps/uptime/ping_redirects.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/uptime/ping_redirects.ts b/x-pack/test/functional/apps/uptime/ping_redirects.ts index 03185ac9f1466..06352d37ada28 100644 --- a/x-pack/test/functional/apps/uptime/ping_redirects.ts +++ b/x-pack/test/functional/apps/uptime/ping_redirects.ts @@ -19,7 +19,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { const monitor = () => uptime.monitor; - describe('Ping redirects', () => { + // FLAKY: https://github.com/elastic/kibana/issues/118476 + describe.skip('Ping redirects', () => { const start = '~ 15 minutes ago'; const end = 'now'; From bb5e183619ebe555d4e40e412aad84fba4385006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Kopyci=C5=84ski?= Date: Sat, 13 Nov 2021 16:34:00 +0100 Subject: [PATCH 06/10] [Osquery] Fix packs migration script (#118453) --- .../plugins/osquery/public/components/app.tsx | 30 ++++++- .../routes/status/create_status_route.ts | 87 ++++++++++--------- 2 files changed, 73 insertions(+), 44 deletions(-) diff --git a/x-pack/plugins/osquery/public/components/app.tsx b/x-pack/plugins/osquery/public/components/app.tsx index f4c805d375351..ef249d5b8c7aa 100644 --- a/x-pack/plugins/osquery/public/components/app.tsx +++ b/x-pack/plugins/osquery/public/components/app.tsx @@ -9,7 +9,17 @@ import React, { useMemo } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiTabs, EuiTab } from '@elastic/eui'; +import { + EuiButtonEmpty, + EuiFlexGroup, + EuiFlexItem, + EuiTabs, + EuiTab, + EuiLoadingElastic, + EuiPage, + EuiPageBody, + EuiPageContent, +} from '@elastic/eui'; import { useLocation } from 'react-router-dom'; import { Container, Nav, Wrapper } from './layouts'; @@ -24,6 +34,24 @@ const OsqueryAppComponent = () => { const section = useMemo(() => location.pathname.split('/')[1] ?? 'overview', [location.pathname]); const { data: osqueryIntegration, isFetched } = useOsqueryIntegrationStatus(); + if (!isFetched) { + return ( + + + + + + + + ); + } + if (isFetched && osqueryIntegration?.install_status !== 'installed') { return ; } diff --git a/x-pack/plugins/osquery/server/routes/status/create_status_route.ts b/x-pack/plugins/osquery/server/routes/status/create_status_route.ts index 630ec8b3743c8..ae79ef851bed9 100644 --- a/x-pack/plugins/osquery/server/routes/status/create_status_route.ts +++ b/x-pack/plugins/osquery/server/routes/status/create_status_route.ts @@ -107,6 +107,50 @@ export const createStatusRoute = (router: IRouter, osqueryContext: OsqueryAppCon pkgName: OSQUERY_INTEGRATION_NAME, }); + const agentPolicyIds = uniq(map(policyPackages?.items, 'policy_id')); + const agentPolicies = mapKeys( + await agentPolicyService?.getByIds(internalSavedObjectsClient, agentPolicyIds), + 'id' + ); + + await Promise.all( + map(migrationObject.packs, async (packObject) => { + await internalSavedObjectsClient.create( + packSavedObjectType, + { + // @ts-expect-error update types + name: packObject.name, + // @ts-expect-error update types + description: packObject.description, + // @ts-expect-error update types + queries: convertPackQueriesToSO(packObject.queries), + // @ts-expect-error update types + enabled: packObject.enabled, + created_at: new Date().toISOString(), + created_by: 'system', + updated_at: new Date().toISOString(), + updated_by: 'system', + }, + { + // @ts-expect-error update types + references: packObject.policy_ids.map((policyId: string) => ({ + id: policyId, + name: agentPolicies[policyId].name, + type: AGENT_POLICY_SAVED_OBJECT_TYPE, + })), + refresh: 'wait_for', + } + ); + }) + ); + + // delete unnecessary package policies + await packagePolicyService?.delete( + internalSavedObjectsClient, + esClient, + migrationObject.packagePoliciesToDelete + ); + // updatePackagePolicies await Promise.all( map(migrationObject.agentPolicyToPackage, async (value, key) => { @@ -151,49 +195,6 @@ export const createStatusRoute = (router: IRouter, osqueryContext: OsqueryAppCon } }) ); - - const agentPolicyIds = uniq(map(policyPackages?.items, 'policy_id')); - const agentPolicies = mapKeys( - await agentPolicyService?.getByIds(internalSavedObjectsClient, agentPolicyIds), - 'id' - ); - - await Promise.all( - map(migrationObject.packs, async (packObject) => { - await internalSavedObjectsClient.create( - packSavedObjectType, - { - // @ts-expect-error update types - name: packObject.name, - // @ts-expect-error update types - description: packObject.description, - // @ts-expect-error update types - queries: convertPackQueriesToSO(packObject.queries), - // @ts-expect-error update types - enabled: packObject.enabled, - created_at: new Date().toISOString(), - created_by: 'system', - updated_at: new Date().toISOString(), - updated_by: 'system', - }, - { - // @ts-expect-error update types - references: packObject.policy_ids.map((policyId: string) => ({ - id: policyId, - name: agentPolicies[policyId].name, - type: AGENT_POLICY_SAVED_OBJECT_TYPE, - })), - refresh: 'wait_for', - } - ); - }) - ); - - await packagePolicyService?.delete( - internalSavedObjectsClient, - esClient, - migrationObject.packagePoliciesToDelete - ); // eslint-disable-next-line no-empty } catch (e) {} } From f2872d803ddbcc3f9160e1d2bc3e3af6402b48c4 Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Mon, 15 Nov 2021 08:40:42 +0000 Subject: [PATCH 07/10] [ML] Disabling create data view for data frame analytics and transforms wizards (#117690) * [ML] Disabling create data view for data frame analytics and transforms wizards * removing dfa results link Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../create_analytics_advanced_editor.tsx | 56 +++++++++++++++---- .../details_step/details_step_form.tsx | 32 ++++++++++- .../index_pattern_prompt.tsx | 42 +++++++++----- .../step_details/step_details_form.tsx | 44 +++++++++++---- 4 files changed, 138 insertions(+), 36 deletions(-) diff --git a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_analytics_advanced_editor/create_analytics_advanced_editor.tsx b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_analytics_advanced_editor/create_analytics_advanced_editor.tsx index 31072089b8d5c..0a83ed6db6539 100644 --- a/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_analytics_advanced_editor/create_analytics_advanced_editor.tsx +++ b/x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/create_analytics_advanced_editor/create_analytics_advanced_editor.tsx @@ -7,10 +7,19 @@ import React, { FC, Fragment, useEffect, useMemo, useRef } from 'react'; import { debounce } from 'lodash'; -import { EuiCallOut, EuiFieldText, EuiForm, EuiFormRow, EuiSpacer, EuiSwitch } from '@elastic/eui'; +import { + EuiCallOut, + EuiFieldText, + EuiForm, + EuiFormRow, + EuiSpacer, + EuiSwitch, + EuiText, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { useMlKibana } from '../../../../../contexts/kibana'; import { CodeEditor } from '../../../../../../../../../../src/plugins/kibana_react/public'; import { useNotifications } from '../../../../../contexts/kibana'; import { ml } from '../../../../../services/ml_api_service'; @@ -36,11 +45,22 @@ export const CreateAnalyticsAdvancedEditor: FC = (prop const forceInput = useRef(null); const { toasts } = useNotifications(); + const { + services: { + application: { capabilities }, + }, + } = useMlKibana(); const onChange = (str: string) => { setAdvancedEditorRawString(str); }; + const canCreateDataView = useMemo( + () => + capabilities.savedObjectsManagement.edit === true || capabilities.indexPatterns.save === true, + [capabilities] + ); + const debouncedJobIdCheck = useMemo( () => debounce(async () => { @@ -200,18 +220,34 @@ export const CreateAnalyticsAdvancedEditor: FC = (prop {!isJobCreated && ( + {i18n.translate( + 'xpack.ml.dataframe.analytics.create.dataViewPermissionWarning', + { + defaultMessage: 'You need permission to create data views.', + } + )} + , + ] + : []), + ...(createIndexPattern && destinationIndexPatternTitleExists + ? [ + i18n.translate('xpack.ml.dataframe.analytics.create.dataViewExistsError', { + defaultMessage: 'A data view with this title already exists.', + }), + ] + : []), + ]} > = ({ setCurrentStep, }) => { const { - services: { docLinks, notifications }, + services: { + docLinks, + notifications, + application: { capabilities }, + }, } = useMlKibana(); const createIndexLink = docLinks.links.apis.createIndex; const { setFormState } = actions; @@ -71,6 +75,11 @@ export const DetailsStepForm: FC = ({ (cloneJob !== undefined && resultsField === DEFAULT_RESULTS_FIELD) ); + const canCreateDataView = useMemo( + () => + capabilities.savedObjectsManagement.edit === true || capabilities.indexPatterns.save === true, + [capabilities] + ); const forceInput = useRef(null); const isStepInvalid = @@ -149,6 +158,12 @@ export const DetailsStepForm: FC = ({ } }, [destIndexSameAsId, jobId]); + useEffect(() => { + if (canCreateDataView === false) { + setFormState({ createIndexPattern: false }); + } + }, [capabilities]); + return ( = ({ + {i18n.translate('xpack.ml.dataframe.analytics.create.dataViewPermissionWarning', { + defaultMessage: 'You need permission to create data views.', + })} + , + ] + : []), ...(createIndexPattern && destinationIndexPatternTitleExists ? [ i18n.translate('xpack.ml.dataframe.analytics.create.dataViewExistsError', { @@ -373,7 +399,7 @@ export const DetailsStepForm: FC = ({ ]} > = ({ destIndex }) => { const { services: { http: { basePath }, + application: { capabilities }, }, } = useMlKibana(); + const canCreateDataView = useMemo( + () => + capabilities.savedObjectsManagement.edit === true || capabilities.indexPatterns.save === true, + [capabilities] + ); + return ( <> - - - ), }} /> + {canCreateDataView === true ? ( + + + + ), + }} + /> + ) : null} ); diff --git a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx index eda95013f60bd..ad40a65fdf2e5 100644 --- a/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx +++ b/x-pack/plugins/transform/public/app/sections/create_transform/components/step_details/step_details_form.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React, { FC, useEffect, useState } from 'react'; +import React, { FC, useEffect, useState, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; @@ -20,6 +20,7 @@ import { EuiSelect, EuiSpacer, EuiCallOut, + EuiText, } from '@elastic/eui'; import { KBN_FIELD_TYPES } from '../../../../../../../../../src/plugins/data/common'; @@ -68,6 +69,7 @@ interface StepDetailsFormProps { export const StepDetailsForm: FC = React.memo( ({ overrides = {}, onChange, searchItems, stepDefineState }) => { const deps = useAppDependencies(); + const { capabilities } = deps.application; const toastNotifications = useToastNotifications(); const { esIndicesCreateIndex } = useDocumentationLinks(); @@ -83,9 +85,18 @@ export const StepDetailsForm: FC = React.memo( const [transformIds, setTransformIds] = useState([]); const [indexNames, setIndexNames] = useState([]); + const canCreateDataView = useMemo( + () => + capabilities.savedObjectsManagement.edit === true || + capabilities.indexPatterns.save === true, + [capabilities] + ); + // Index pattern state const [indexPatternTitles, setIndexPatternTitles] = useState([]); - const [createIndexPattern, setCreateIndexPattern] = useState(defaults.createIndexPattern); + const [createIndexPattern, setCreateIndexPattern] = useState( + canCreateDataView === false ? false : defaults.createIndexPattern + ); const [indexPatternAvailableTimeFields, setIndexPatternAvailableTimeFields] = useState< string[] >([]); @@ -443,18 +454,31 @@ export const StepDetailsForm: FC = React.memo( ) : null} + {i18n.translate('xpack.transform.stepDetailsForm.dataViewPermissionWarning', { + defaultMessage: 'You need permission to create data views.', + })} + , + ] + : []), + ...(createIndexPattern && indexPatternTitleExists + ? [ + i18n.translate('xpack.transform.stepDetailsForm.dataViewTitleError', { + defaultMessage: 'A data view with this title already exists.', + }), + ] + : []), + ]} > Date: Mon, 15 Nov 2021 11:15:24 +0100 Subject: [PATCH 08/10] chore: removes cast to any of EuiDescriptionList props (#118262) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../public/pages/alerts/alerts_flyout/index.tsx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/x-pack/plugins/observability/public/pages/alerts/alerts_flyout/index.tsx b/x-pack/plugins/observability/public/pages/alerts/alerts_flyout/index.tsx index 41f107437d23b..bb746d0acc1cc 100644 --- a/x-pack/plugins/observability/public/pages/alerts/alerts_flyout/index.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/alerts_flyout/index.tsx @@ -159,16 +159,12 @@ export function AlertsFlyout({ compressed={true} type="responsiveColumn" listItems={overviewListItems} - titleProps={ - { - 'data-test-subj': 'alertsFlyoutDescriptionListTitle', - } as any // NOTE / TODO: This "any" is a temporary workaround: https://github.com/elastic/eui/issues/5148 - } - descriptionProps={ - { - 'data-test-subj': 'alertsFlyoutDescriptionListDescription', - } as any // NOTE / TODO: This "any" is a temporary workaround: https://github.com/elastic/eui/issues/5148 - } + titleProps={{ + 'data-test-subj': 'alertsFlyoutDescriptionListTitle', + }} + descriptionProps={{ + 'data-test-subj': 'alertsFlyoutDescriptionListDescription', + }} /> {alertData.link && !isInApp && ( From c870206c051095b45809627a755ac9b497c5fddc Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Mon, 15 Nov 2021 11:23:59 +0100 Subject: [PATCH 09/10] Use new Document Explorer name in Discover (#118148) * Use new Document Explorer name in Discover * Fix typo * Wording changes * Remove orphaned i18n * Address review feedback Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../top_nav/open_options_popover.scss | 4 +- .../top_nav/open_options_popover.test.tsx | 4 +- .../top_nav/open_options_popover.tsx | 56 +++++++++++-------- src/plugins/discover/server/ui_settings.ts | 10 ++-- .../translations/translations/ja-JP.json | 8 --- .../translations/translations/zh-CN.json | 8 --- 6 files changed, 43 insertions(+), 47 deletions(-) diff --git a/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.scss b/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.scss index f68b2bfe74a9d..28c68506aedc5 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.scss +++ b/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.scss @@ -1,5 +1,5 @@ -$dscOptionsPopoverWidth: $euiSizeL * 12; +$dscOptionsPopoverWidth: $euiSizeL * 14; .dscOptionsPopover { width: $dscOptionsPopoverWidth; -} \ No newline at end of file +} diff --git a/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.test.tsx b/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.test.tsx index c9564a3ed029d..8363bfdc57616 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.test.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.test.tsx @@ -35,7 +35,7 @@ import { OptionsPopover } from './open_options_popover'; test('should display the correct text if datagrid is selected', () => { const element = document.createElement('div'); const component = mountWithIntl(); - expect(findTestSubject(component, 'docTableMode').text()).toBe('New table'); + expect(findTestSubject(component, 'docTableMode').text()).toBe('Document Explorer'); }); test('should display the correct text if legacy table is selected', () => { @@ -45,5 +45,5 @@ test('should display the correct text if legacy table is selected', () => { uiSettings.set('doc_table:legacy', true); const element = document.createElement('div'); const component = mountWithIntl(); - expect(findTestSubject(component, 'docTableMode').text()).toBe('Classic table'); + expect(findTestSubject(component, 'docTableMode').text()).toBe('Classic'); }); diff --git a/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.tsx b/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.tsx index 1b567813c6f7b..a68888acb1f48 100644 --- a/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.tsx +++ b/src/plugins/discover/public/application/main/components/top_nav/open_options_popover.tsx @@ -41,11 +41,11 @@ export function OptionsPopover(props: OptionsPopoverProps) { const isLegacy = uiSettings.get(DOC_TABLE_LEGACY); const mode = isLegacy - ? i18n.translate('discover.openOptionsPopover.legacyTableText', { - defaultMessage: 'Classic table', + ? i18n.translate('discover.openOptionsPopover.classicDiscoverText', { + defaultMessage: 'Classic', }) - : i18n.translate('discover.openOptionsPopover.dataGridText', { - defaultMessage: 'New table', + : i18n.translate('discover.openOptionsPopover.documentExplorerText', { + defaultMessage: 'Document Explorer', }); return ( @@ -60,8 +60,8 @@ export function OptionsPopover(props: OptionsPopoverProps) { viewModeLabel: ( ), @@ -72,21 +72,33 @@ export function OptionsPopover(props: OptionsPopoverProps) { - + {isLegacy ? ( + + ) : ( + + )} - - - {i18n.translate('discover.openOptionsPopover.goToAdvancedSettings', { - defaultMessage: 'Get started', - })} - + {isLegacy && ( + <> + + + {i18n.translate('discover.openOptionsPopover.tryDocumentExplorer', { + defaultMessage: 'Try Document Explorer', + })} + + + )} - {i18n.translate('discover.openOptionsPopover.gotToAllSettings', { - defaultMessage: 'All Discover options', + {i18n.translate('discover.openOptionsPopover.gotToSettings', { + defaultMessage: 'View Discover settings', })} diff --git a/src/plugins/discover/server/ui_settings.ts b/src/plugins/discover/server/ui_settings.ts index df06260d45d21..e9aa51a7384b2 100644 --- a/src/plugins/discover/server/ui_settings.ts +++ b/src/plugins/discover/server/ui_settings.ts @@ -158,14 +158,14 @@ export const getUiSettings: () => Record = () => ({ schema: schema.arrayOf(schema.string()), }, [DOC_TABLE_LEGACY]: { - name: i18n.translate('discover.advancedSettings.docTableVersionName', { - defaultMessage: 'Use classic table', + name: i18n.translate('discover.advancedSettings.disableDocumentExplorer', { + defaultMessage: 'Document Explorer or classic view', }), value: true, - description: i18n.translate('discover.advancedSettings.docTableVersionDescription', { + description: i18n.translate('discover.advancedSettings.disableDocumentExplorerDescription', { defaultMessage: - 'Discover uses a new table layout that includes better data sorting, drag-and-drop columns, and a full screen view. ' + - 'Turn on this option to use the classic table. Turn off to use the new table. ', + 'To use the new Document Explorer instead of the classic view, turn off this option. ' + + 'The Document Explorer offers better data sorting, resizable columns, and a full screen view.', }), category: ['discover'], schema: schema.boolean(), diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index f728ec13847f9..d450f679906bd 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -2300,8 +2300,6 @@ "discover.advancedSettings.discover.showMultifieldsDescription": "拡張ドキュメントビューに{multiFields}が表示されるかどうかを制御します。ほとんどの場合、マルチフィールドは元のフィールドと同じです。「searchFieldsFromSource」がオフのときにのみこのオプションを使用できます。", "discover.advancedSettings.docTableHideTimeColumnText": "Discover と、ダッシュボードのすべての保存された検索で、「時刻」列を非表示にします。", "discover.advancedSettings.docTableHideTimeColumnTitle": "「時刻」列を非表示", - "discover.advancedSettings.docTableVersionDescription": "Discover は、データの並べ替え、列のドラッグアンドドロップ、全画面表示を含む新しいテーブルレイアウトを使用します。このオプションをオンにすると、クラシックテーブルを使用します。オフにすると、新しいテーブルを使用します。", - "discover.advancedSettings.docTableVersionName": "クラシックテーブルを使用", "discover.advancedSettings.fieldsPopularLimitText": "最も頻繁に使用されるフィールドのトップNを表示します", "discover.advancedSettings.fieldsPopularLimitTitle": "頻繁に使用されるフィールドの制限", "discover.advancedSettings.maxDocFieldsDisplayedText": "ドキュメント列でレンダリングされたフィールドの最大数", @@ -2505,10 +2503,6 @@ "discover.notifications.invalidTimeRangeTitle": "無効な時間範囲", "discover.notifications.notSavedSearchTitle": "検索「{savedSearchTitle}」は保存されませんでした。", "discover.notifications.savedSearchTitle": "検索「{savedSearchTitle}」が保存されました。", - "discover.openOptionsPopover.dataGridText": "新しいテーブル", - "discover.openOptionsPopover.goToAdvancedSettings": "使ってみる", - "discover.openOptionsPopover.gotToAllSettings": "すべてのDiscoverオプション", - "discover.openOptionsPopover.legacyTableText": "クラシックテーブル", "discover.reloadSavedSearchButton": "検索をリセット", "discover.removeColumnLabel": "列を削除", "discover.rootBreadcrumb": "Discover", @@ -2527,12 +2521,10 @@ "discover.sourceViewer.errorMessageTitle": "エラーが発生しました", "discover.sourceViewer.refresh": "更新", "discover.toggleSidebarAriaLabel": "サイドバーを切り替える", - "discover.topNav.openOptionsPopover.description": "お知らせDiscoverでは、データの並べ替え、列のドラッグアンドドロップ、ドキュメントの比較を行う方法が改善されました。詳細設定で[クラシックテーブルを使用]を切り替えて、開始します。", "discover.topNav.openSearchPanel.manageSearchesButtonLabel": "検索の管理", "discover.topNav.openSearchPanel.noSearchesFoundDescription": "一致する検索が見つかりませんでした。", "discover.topNav.openSearchPanel.openSearchTitle": "検索を開く", "discover.topNav.optionsPopover.currentViewMode": "{viewModeLabel}: {currentViewMode}", - "discover.topNav.optionsPopover.currentViewModeLabel": "現在のビューモード", "discover.uninitializedRefreshButtonText": "データを更新", "discover.uninitializedText": "クエリを作成、フィルターを追加、または[更新]をクリックして、現在のクエリの結果を取得します。", "discover.uninitializedTitle": "検索開始", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index 33927d4ffbb0b..8839c6bab9aca 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -2322,8 +2322,6 @@ "discover.advancedSettings.discover.showMultifieldsDescription": "控制 {multiFields} 是否显示在展开的文档视图中。多数情况下,多字段与原始字段相同。此选项仅在 `searchFieldsFromSource` 关闭时可用。", "discover.advancedSettings.docTableHideTimeColumnText": "在 Discover 中和仪表板上的所有已保存搜索中隐藏“时间”列。", "discover.advancedSettings.docTableHideTimeColumnTitle": "隐藏“时间”列", - "discover.advancedSettings.docTableVersionDescription": "Discover 使用的新表布局包含更佳的数据排序、拖放列和全屏视图。打开此选项可使用经典表。关闭可使用新表。", - "discover.advancedSettings.docTableVersionName": "使用经典表", "discover.advancedSettings.fieldsPopularLimitText": "要显示的排名前 N 最常见字段", "discover.advancedSettings.fieldsPopularLimitTitle": "常见字段限制", "discover.advancedSettings.maxDocFieldsDisplayedText": "在文档列中渲染的最大字段数目", @@ -2529,10 +2527,6 @@ "discover.notifications.invalidTimeRangeTitle": "时间范围无效", "discover.notifications.notSavedSearchTitle": "搜索“{savedSearchTitle}”未保存。", "discover.notifications.savedSearchTitle": "搜索“{savedSearchTitle}”已保存", - "discover.openOptionsPopover.dataGridText": "新表", - "discover.openOptionsPopover.goToAdvancedSettings": "开始使用", - "discover.openOptionsPopover.gotToAllSettings": "所有 Discover 选项", - "discover.openOptionsPopover.legacyTableText": "经典表", "discover.partialHits": "≥{formattedHits} 个{hits, plural, other {命中}}", "discover.reloadSavedSearchButton": "重置搜索", "discover.removeColumnLabel": "移除列", @@ -2552,12 +2546,10 @@ "discover.sourceViewer.errorMessageTitle": "发生错误", "discover.sourceViewer.refresh": "刷新", "discover.toggleSidebarAriaLabel": "切换侧边栏", - "discover.topNav.openOptionsPopover.description": "好消息!Discover 有更好的方法排序数据、拖放列和比较文档。在“高级模式”中切换“使用经典表”来开始。", "discover.topNav.openSearchPanel.manageSearchesButtonLabel": "管理搜索", "discover.topNav.openSearchPanel.noSearchesFoundDescription": "未找到匹配的搜索。", "discover.topNav.openSearchPanel.openSearchTitle": "打开搜索", "discover.topNav.optionsPopover.currentViewMode": "{viewModeLabel}:{currentViewMode}", - "discover.topNav.optionsPopover.currentViewModeLabel": "当前视图模式", "discover.uninitializedRefreshButtonText": "刷新数据", "discover.uninitializedText": "编写查询,添加一些筛选,或只需单击“刷新”来检索当前查询的结果。", "discover.uninitializedTitle": "开始搜索", From 92f23122cee92b676657d4c03b61e3b1604c8bba Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Mon, 15 Nov 2021 12:06:25 +0100 Subject: [PATCH 10/10] fix exists or fail check (#118499) --- x-pack/test/functional/apps/lens/dashboard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/test/functional/apps/lens/dashboard.ts b/x-pack/test/functional/apps/lens/dashboard.ts index cef3650db7d04..b67e2da4f4ec7 100644 --- a/x-pack/test/functional/apps/lens/dashboard.ts +++ b/x-pack/test/functional/apps/lens/dashboard.ts @@ -71,7 +71,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.lens.goToTimeRange(); await retry.try(async () => { await clickInChart(6, 5); // hardcoded position of bar, depends heavy on data and charts implementation - await testSubjects.existOrFail('applyFiltersPopoverButton'); + await testSubjects.existOrFail('applyFiltersPopoverButton', { timeout: 2500 }); }); await retry.try(async () => {