Skip to content

Commit

Permalink
[MD] Address UX comments on index pattern stack (opensearch-project#…
Browse files Browse the repository at this point in the history
…2611)

- Update data source column header in index pattern table
    - Update index pattern column name to Title
    - Remove data source search field error check given it is not required

Signed-off-by: Kristen Tian <[email protected]>

Signed-off-by: Kristen Tian <[email protected]>
(cherry picked from commit 189cf81)
  • Loading branch information
kristenTian authored and zhongnansu committed Oct 24, 2022
1 parent 447914b commit 8e8bbf6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 221 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
* [MD] Add data source param to low-level search call in Discover ([#2431](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2431))
* [Multi DataSource] Skip data source view in index pattern step when pick default ([#2574](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2574))
* [Multi DataSource] Address UX comments on Edit Data source page ([#2629](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2629))
* [Multi DataSource] Address UX comments on index pattern management stack ([#2611](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2611))

### 🚞 Infrastructure

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class DataSourceColumn implements IndexPatternTableColumn<DataSourceMap>
public euiColumn = {
field: 'referenceId',
name: i18n.translate('dataSource.management.dataSourceColumn', {
defaultMessage: 'Data Source',
defaultMessage: 'Data Source Connection',
}),
render: (referenceId: string, index: IndexPatternTableRecord) => {
if (!referenceId) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,6 @@ jest.mock('../../../../../../../../../plugins/opensearch_dashboards_react/public
afterAll(() => jest.clearAllMocks());

describe('Header', () => {
it('should render normally', () => {
const component = shallowWithIntl(
<Header
onDataSourceSelected={() => {}}
dataSourceRef={{ type: 'type', id: 'id', title: 'title' }!}
goToNextStep={() => {}}
isNextStepDisabled={true}
stepInfo={{ totalStepNumber: 0, currentStepNumber: 0 }}
/>
);

expect(component).toMatchSnapshot();
});

it('should render existing data sources list when choose to use data source', () => {
const component = shallowWithIntl(
<Header
Expand All @@ -51,7 +37,12 @@ describe('Header', () => {
},
});

expect(component).toMatchSnapshot();
expect(
component
.find('[data-test-subj="createIndexPatternStepDataSourceSelectDataSource"]')
.first()
.exists()
).toBeTruthy();
});

it('should disable next step before select data source', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const Header: React.FC<HeaderProps> = (props: HeaderProps) => {
}
})
.catch(() => {
toasts.addWarning(
toasts.addDanger(
i18n.translate(
'indexPatternManagement.createIndexPattern.stepDataSource.fetchDataSourceError',
{
Expand Down Expand Up @@ -145,6 +145,7 @@ export const Header: React.FC<HeaderProps> = (props: HeaderProps) => {
<EuiFlexItem grow={false}>
<EuiSpacer size="m" />
<EuiSelectable
data-test-subj="createIndexPatternStepDataSourceSelectDataSource"
aria-label={i18n.translate(
'indexPatternManagement.createIndexPattern.stepDataSource.searchlabel',
{
Expand All @@ -160,7 +161,6 @@ export const Header: React.FC<HeaderProps> = (props: HeaderProps) => {
defaultMessage: 'Search data sources',
}
),
isInvalid: !!dataSources,
}}
singleSelection={'always'}
options={dataSources}
Expand Down

0 comments on commit 8e8bbf6

Please sign in to comment.