Skip to content

Commit 0277dfe

Browse files
committed
[MD]Address comments from UX signoff meeting-Datasource list and create page
Signed-off-by: Yibo Wang <yibow@amazon.com>
1 parent e3e7605 commit 0277dfe

File tree

9 files changed

+103
-45
lines changed

9 files changed

+103
-45
lines changed

src/plugins/data_source_management/public/components/create_button/create_button.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ const createButtonIdentifier = `[data-test-subj="createDataSourceButton"]`;
1313

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

1819
beforeEach(() => {
19-
component = shallow(<CreateButton history={history} />);
20+
component = shallow(<CreateButton history={history} dataTestSubj={dataTestSubj} />);
2021
});
2122

2223
it('should render normally', () => {

src/plugins/data_source_management/public/components/create_button/create_button.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ import { FormattedMessage } from '@osd/i18n/react';
1111

1212
interface Props {
1313
history: History;
14+
isEmptyState?: boolean;
15+
dataTestSubj: string;
1416
}
1517

16-
export const CreateButton = ({ history }: Props) => {
18+
export const CreateButton = ({ history, isEmptyState, dataTestSubj }: Props) => {
1719
return (
1820
<EuiButton
19-
data-test-subj="createDataSourceButton"
20-
fill={true}
21+
data-test-subj={dataTestSubj}
22+
fill={isEmptyState ? false : true}
2123
onClick={() => history.push('/create')}
2224
>
2325
<FormattedMessage

src/plugins/data_source_management/public/components/create_data_source_wizard/__snapshots__/create_data_source_wizard.test.tsx.snap

Lines changed: 18 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/__snapshots__/create_data_source_form.test.tsx.snap

Lines changed: 36 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ export class CreateDataSourceForm extends React.Component<
287287
return (
288288
<EuiPageContent>
289289
{this.renderHeader()}
290+
<EuiSpacer size="m" />
290291
<EuiForm data-test-subj="data-source-creation">
291292
{/* Endpoint section */}
292293
{this.renderSectionHeader(
@@ -354,7 +355,7 @@ export class CreateDataSourceForm extends React.Component<
354355
placeholder={i18n.translate(
355356
'dataSourcesManagement.createDataSource.endpointPlaceholder',
356357
{
357-
defaultMessage: 'Sample URL: https://connectionurl.com',
358+
defaultMessage: 'https://connectionurl.com',
358359
}
359360
)}
360361
isInvalid={!!this.state.formErrorsByField.endpoint.length}

src/plugins/data_source_management/public/components/create_data_source_wizard/create_data_source_wizard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export const CreateDataSourceWizard: React.FunctionComponent<CreateDataSourceWiz
7575
};
7676

7777
const handleDisplayToastMessage = ({ id, defaultMessage }: ToastMessageItem) => {
78-
toasts.addWarning(i18n.translate(id, { defaultMessage }));
78+
toasts.addDanger(i18n.translate(id, { defaultMessage }));
7979
};
8080

8181
/* Render the creation wizard */

0 commit comments

Comments
 (0)