Skip to content

Commit

Permalink
add switch for experimental callout & update snapshots
Browse files Browse the repository at this point in the history
Signed-off-by: Yibo Wang <yibow@amazon.com>
  • Loading branch information
yibow98 committed Oct 6, 2022
1 parent ad8bf13 commit 839a4c4
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export class CreateIndexPatternWizard extends Component<

return (
<>
<ExperimentalCallout />
{this.dataSourceEnabled ? <ExperimentalCallout /> : null}
{content}
<EuiGlobalToastList
toasts={this.state.toasts}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import React from 'react';
import { shallow } from 'enzyme';
import { ExperimentalCallout } from './experimental_callout';

describe('Index pattern experimental callout component', () => {
test('should render normally', () => {
const component = shallow(<ExperimentalCallout />);
expect(component).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ import { EuiCallOut, EuiSpacer, EuiText } from '@elastic/eui';
export const ExperimentalCallout = () => {
return (
<>
<EuiCallOut title={TITLE} iconType="alert" color="warning">
<EuiCallOut
title={TITLE}
iconType="alert"
color="warning"
data-test-subj="index-pattern-experimental-callout"
>
<p>
<EuiText>
<EuiText data-test-subj="index-pattern-experimental-callout-text">
{DESCRIPTION_FIRST_PART}
<b>{DATASOURCE_CONNECTION}</b>
{DESCRIPTION_SECOND_PART}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export const IndexPatternTable = ({ canSave, history }: Props) => {

return (
<>
<ExperimentalCallout />
{dataSourceEnabled ? <ExperimentalCallout /> : null}
<EuiPageContent data-test-subj="indexPatternTable" role="region" aria-label={ariaRegion}>
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexItem grow={false}>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 839a4c4

Please sign in to comment.