Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x][MD]Address comments from UX sign-off meeting-Datasource list and create page #2642

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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