From d06584075cac2414b8a2aa3bc891d8ce7bfd0d83 Mon Sep 17 00:00:00 2001 From: Yngrid Coello Date: Mon, 11 Dec 2023 10:51:58 +0100 Subject: [PATCH 1/2] [Dataset quality] Remove add button (#172581) This PR removes `Add data` button from dataset quality ### Before image ### After image --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../dataset_quality/common/translations.ts | 4 -- .../components/dataset_quality/header.tsx | 41 ++----------------- x-pack/plugins/dataset_quality/tsconfig.json | 1 - 3 files changed, 3 insertions(+), 43 deletions(-) diff --git a/x-pack/plugins/dataset_quality/common/translations.ts b/x-pack/plugins/dataset_quality/common/translations.ts index b26b7ca5c9029..596d1f38ab70c 100644 --- a/x-pack/plugins/dataset_quality/common/translations.ts +++ b/x-pack/plugins/dataset_quality/common/translations.ts @@ -11,10 +11,6 @@ export const datasetQualityAppTitle = i18n.translate('xpack.datasetQuality.appTi defaultMessage: 'Datasets', }); -export const onboardingLinkTitle = i18n.translate('xpack.datasetQuality.onboardingLinkTitle', { - defaultMessage: 'Add data', -}); - export const noDatasetsDescription = i18n.translate('xpack.datasetQuality.noDatasetsDescription', { defaultMessage: 'Try adjusting your time or filter.', }); diff --git a/x-pack/plugins/dataset_quality/public/components/dataset_quality/header.tsx b/x-pack/plugins/dataset_quality/public/components/dataset_quality/header.tsx index 5126a645f7b6f..23753941cbe49 100644 --- a/x-pack/plugins/dataset_quality/public/components/dataset_quality/header.tsx +++ b/x-pack/plugins/dataset_quality/public/components/dataset_quality/header.tsx @@ -5,45 +5,10 @@ * 2.0. */ +import { EuiPageHeader } from '@elastic/eui'; import React from 'react'; -import { EuiPageHeader, EuiButton } from '@elastic/eui'; -import { - ObservabilityOnboardingLocatorParams, - OBSERVABILITY_ONBOARDING_LOCATOR, -} from '@kbn/deeplinks-observability'; -import { datasetQualityAppTitle, onboardingLinkTitle } from '../../../common/translations'; -import { useKibanaContextForPlugin } from '../../utils'; +import { datasetQualityAppTitle } from '../../../common/translations'; export function Header() { - const { - services: { share }, - } = useKibanaContextForPlugin(); - - const OnboardingLink = React.memo(() => { - const locator = share.url.locators.get( - OBSERVABILITY_ONBOARDING_LOCATOR - ); - - const onboardingUrl = locator?.getRedirectUrl({}); - - return ( - - {onboardingLinkTitle} - - ); - }); - - return ( - ]} - /> - ); + return ; } diff --git a/x-pack/plugins/dataset_quality/tsconfig.json b/x-pack/plugins/dataset_quality/tsconfig.json index 3bfb546ed49ec..5d1bf785b81ad 100644 --- a/x-pack/plugins/dataset_quality/tsconfig.json +++ b/x-pack/plugins/dataset_quality/tsconfig.json @@ -13,7 +13,6 @@ "@kbn/core", "@kbn/core-plugins-server", "@kbn/core-elasticsearch-server-mocks", - "@kbn/deeplinks-observability", "@kbn/fleet-plugin", "@kbn/observability-shared-plugin", "@kbn/server-route-repository", From 946b38ed577ddfccf1fb022d7fa1ff6e9cdd1606 Mon Sep 17 00:00:00 2001 From: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com> Date: Mon, 11 Dec 2023 10:01:01 +0000 Subject: [PATCH 2/2] [Advanced Settings] Fix defaultIndex setting's default value (#170865) Fixes https://github.com/elastic/kibana/issues/168732 ## Summary This PR changes the default value of the `defaultIndex` setting to an empty string. Previously, the default value was set to `null` and this was causing a wrong behaviour in the Advanced Settings UI as it expects a string value for the settings of type `string`. **Before - the "Reset to default" link did not clear the user value:** https://github.com/elastic/kibana/assets/59341489/2c47306b-feac-4e08-bbae-3db7b0a3e5fd **With these changes:** https://github.com/elastic/kibana/assets/59341489/dc46caa8-9860-4b66-87ca-9c184c5a8391 --- src/plugins/data/server/ui_settings.ts | 4 ++-- .../data_views/default_index_pattern/default_index_pattern.ts | 2 +- .../data_views/default_index_pattern/default_index_pattern.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/data/server/ui_settings.ts b/src/plugins/data/server/ui_settings.ts index 7b386e864fbc1..5ab638a087783 100644 --- a/src/plugins/data/server/ui_settings.ts +++ b/src/plugins/data/server/ui_settings.ts @@ -168,12 +168,12 @@ export function getUiSettings( name: i18n.translate('data.advancedSettings.defaultIndexTitle', { defaultMessage: 'Default data view', }), - value: null, + value: '', type: 'string', description: i18n.translate('data.advancedSettings.defaultIndexText', { defaultMessage: 'Used by discover and visualizations when a data view is not set.', }), - schema: schema.nullable(schema.string()), + schema: schema.string(), }, [UI_SETTINGS.COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX]: { name: i18n.translate('data.advancedSettings.courier.ignoreFilterTitle', { diff --git a/test/api_integration/apis/data_views/default_index_pattern/default_index_pattern.ts b/test/api_integration/apis/data_views/default_index_pattern/default_index_pattern.ts index d34ad5ccd5f4d..b980c684e529b 100644 --- a/test/api_integration/apis/data_views/default_index_pattern/default_index_pattern.ts +++ b/test/api_integration/apis/data_views/default_index_pattern/default_index_pattern.ts @@ -48,7 +48,7 @@ export default function ({ getService }: FtrProviderContext) { expect(response5.status).to.be(200); const response6 = await supertest.get(defaultPath); - expect(response6.body[serviceKeyId]).to.be(null); + expect(response6.body[serviceKeyId]).to.be(''); }); }); }); diff --git a/x-pack/test_serverless/api_integration/test_suites/common/data_views/default_index_pattern/default_index_pattern.ts b/x-pack/test_serverless/api_integration/test_suites/common/data_views/default_index_pattern/default_index_pattern.ts index 0ac0bec2250ed..067c24d605e6c 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/data_views/default_index_pattern/default_index_pattern.ts +++ b/x-pack/test_serverless/api_integration/test_suites/common/data_views/default_index_pattern/default_index_pattern.ts @@ -72,7 +72,7 @@ export default function ({ getService }: FtrProviderContext) { // TODO: The response comes back undefined in Serverless const body = response6.body[serviceKeyId]; const expected = body === undefined ? null : body; - expect(expected).to.be(null); + expect(expected).to.be(''); }); }); });