Skip to content

Commit

Permalink
[MD]Address comments from UX signoff meeting-Datasource list and crea…
Browse files Browse the repository at this point in the history
…te page (opensearch-project#2625) (opensearch-project#2642)

Signed-off-by: Yibo Wang <yibow@amazon.com>
(cherry picked from commit fb4bdfa)
Signed-off-by: Su <szhongna@amazon.com>

Signed-off-by: Yibo Wang <yibow@amazon.com>
Signed-off-by: Su <szhongna@amazon.com>
Co-authored-by: Yibo Wang <109543558+yibow98@users.noreply.github.com>
  • Loading branch information
zhongnansu and yibow98 committed Oct 24, 2022
1 parent ae79996 commit 447914b
Show file tree
Hide file tree
Showing 10 changed files with 104 additions and 45 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
* [Multi DataSource] Make text content dynamically translated & update unit tests ([#2570](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2570))
* [Vis Builder] Change classname prefix wiz to vb ([#2581](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2581/files))
* [Windows] Facilitate building and running OSD and plugins on Windows platforms ([#2601](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2601))
* [Multi DataSource] Address UX comments on Data source list and create page ([#2625](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2625))

### 🐛 Bug Fixes
* [Vis Builder] Fixes auto bounds for timeseries bar chart visualization ([2401](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2401))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ const createButtonIdentifier = `[data-test-subj="createDataSourceButton"]`;

describe('CreateButton', () => {
const history = (scopedHistoryMock.create() as unknown) as ScopedHistory;
const dataTestSubj = 'createDataSourceButton';
let component: ShallowWrapper<any, Readonly<{}>, React.Component<{}, {}, any>>;

beforeEach(() => {
component = shallow(<CreateButton history={history} />);
component = shallow(<CreateButton history={history} dataTestSubj={dataTestSubj} />);
});

it('should render normally', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ import { FormattedMessage } from '@osd/i18n/react';

interface Props {
history: History;
isEmptyState?: boolean;
dataTestSubj: string;
}

export const CreateButton = ({ history }: Props) => {
export const CreateButton = ({ history, isEmptyState, dataTestSubj }: Props) => {
return (
<EuiButton
data-test-subj="createDataSourceButton"
fill={true}
data-test-subj={dataTestSubj}
fill={isEmptyState ? false : true}
onClick={() => history.push('/create')}
>
<FormattedMessage
Expand Down

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

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
Expand Up @@ -287,6 +287,7 @@ export class CreateDataSourceForm extends React.Component<
return (
<EuiPageContent>
{this.renderHeader()}
<EuiSpacer size="m" />
<EuiForm data-test-subj="data-source-creation">
{/* Endpoint section */}
{this.renderSectionHeader(
Expand Down Expand Up @@ -354,7 +355,7 @@ export class CreateDataSourceForm extends React.Component<
placeholder={i18n.translate(
'dataSourcesManagement.createDataSource.endpointPlaceholder',
{
defaultMessage: 'Sample URL: https://connectionurl.com',
defaultMessage: 'https://connectionurl.com',
}
)}
isInvalid={!!this.state.formErrorsByField.endpoint.length}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const CreateDataSourceWizard: React.FunctionComponent<CreateDataSourceWiz
};

const handleDisplayToastMessage = ({ id, defaultMessage }: ToastMessageItem) => {
toasts.addWarning(i18n.translate(id, { defaultMessage }));
toasts.addDanger(i18n.translate(id, { defaultMessage }));
};

/* Render the creation wizard */
Expand Down
Loading

0 comments on commit 447914b

Please sign in to comment.