From ac07159c6e4e9444bb5f20ce54cdf4e42d219038 Mon Sep 17 00:00:00 2001 From: Kristen Tian <105667444+kristenTian@users.noreply.github.com> Date: Fri, 7 Oct 2022 09:59:07 -0700 Subject: [PATCH] [MD] Update copy on index patten config DS step (#2527) Issue Resolved: https://github.com/opensearch-project/ux/issues/40 Signed-off-by: Kristen Tian --- CHANGELOG.md | 6 +- .../index_patterns/index_pattern.ts | 3 +- .../header/__snapshots__/header.test.tsx.snap | 64 +++---------------- .../components/header/header.scss | 3 - .../components/header/header.test.tsx | 1 - .../components/header/header.tsx | 33 +++------- 6 files changed, 25 insertions(+), 85 deletions(-) delete mode 100644 src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.scss diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a224f8aa542..0dd139a81baf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) * [MD] Support legacy client for data source ([#2204](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2204)) * [Plugin Helpers] Facilitate version changes ([#2398](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2398)) * [MD] Display error toast for create index pattern with data source ([#2506](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2506)) - +* [Multi DataSource] UX enhacement on index pattern management stack ([#2505](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2505)) +* [Multi DataSource] UX enhancement on Data source management stack ([#2521](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2521)) +* [Multi DataSource] UX enhancement on Index Pattern management stack ([#2527](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2527)) ### 🐛 Bug Fixes * [Vis Builder] Fixes auto bounds for timeseries bar chart visualization ([2401](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2401)) * [Vis Builder] Fixes visualization shift when editing agg ([2401](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2401)) @@ -50,7 +52,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) * Add updated_at column to objects' tables ([#1218](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/1218)) * [Viz Builder] State validation before dispatching and loading ([#2351](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2351)) * [Viz Builder] Create a new wizard directly on a dashboard ([#2384](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2384)) -* [Multi DataSource] UX enhacement on index pattern management stack ([#2505]https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2505)) +* [Multi DataSource] UX enhacement on index pattern management stack ([#2505](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2505)) * [Multi DataSource] UX enhancement on Data source management stack ([#2521](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2521)) ### 🐛 Bug Fixes 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 7a966d2849c9..5e4d80df6ccd 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 @@ -370,7 +370,8 @@ export class IndexPattern implements IIndexPattern { return this.dataSourceRef ? [ { - ...this.dataSourceRef, + id: this.dataSourceRef.id, + type: this.dataSourceRef.type, name: DATA_SOURCE_REFERNECE_NAME, }, ] diff --git a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/__snapshots__/header.test.tsx.snap b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/__snapshots__/header.test.tsx.snap index ded0546ce491..e2e49b95177c 100644 --- a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/__snapshots__/header.test.tsx.snap +++ b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/__snapshots__/header.test.tsx.snap @@ -21,7 +21,7 @@ exports[`Header should render existing data sources list when choose to use data @@ -36,25 +36,15 @@ exports[`Header should render existing data sources list when choose to use data id="useDefault" label={ } onChange={[Function]} /> - - - } onChange={[Function]} /> - - - @@ -87,13 +67,7 @@ exports[`Header should render existing data sources list when choose to use data size="m" /> - } + aria-label="Search data sources" isPreFiltered={false} onChange={[Function]} options={Array []} @@ -160,7 +134,7 @@ exports[`Header should render normally 1`] = ` @@ -175,25 +149,15 @@ exports[`Header should render normally 1`] = ` id="useDefault" label={ } onChange={[Function]} /> - - - } onChange={[Function]} /> - - - diff --git a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.scss b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.scss deleted file mode 100644 index 048ae2981c05..000000000000 --- a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.scss +++ /dev/null @@ -1,3 +0,0 @@ -.dataSourceRadioHelperText { - text-indent: 24px; -} diff --git a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.test.tsx b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.test.tsx index dc8b72341b80..8a7aa9b1e461 100644 --- a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.test.tsx +++ b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.test.tsx @@ -5,7 +5,6 @@ import React from 'react'; import { Header } from '../header'; -import { shallow } from 'enzyme'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; jest.mock('../../../../../../../../../plugins/opensearch_dashboards_react/public', () => ({ diff --git a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.tsx b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.tsx index 75f641b70164..d7af93be8f5b 100644 --- a/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.tsx +++ b/src/plugins/index_pattern_management/public/components/create_index_pattern_wizard/components/step_data_source/components/header/header.tsx @@ -4,7 +4,6 @@ */ import React, { Fragment, useState } from 'react'; -import './header.scss'; import { EuiButton, @@ -111,7 +110,7 @@ export const Header: React.FC = (props: HeaderProps) => { @@ -121,49 +120,37 @@ export const Header: React.FC = (props: HeaderProps) => { label={ } checked={defaultChecked} onChange={(e) => onChangeDefaultChecked(e)} compressed /> - - - - + } checked={dataSourceChecked} onChange={(e) => onChangeDataSourceChecked(e)} compressed /> - - - {dataSourceChecked && ( - } + aria-label={i18n.translate( + 'indexPatternManagement.createIndexPattern.stepDataSource.searchlabel', + { + defaultMessage: 'Search data sources', + } + )} searchable searchProps={{ 'data-test-subj': 'selectDataSources',