Skip to content

Commit

Permalink
Merge branch 'main' into 133515-bug-fix-new-created-connectors-rule-d…
Browse files Browse the repository at this point in the history
…etails
  • Loading branch information
kibanamachine committed Jun 7, 2022
2 parents 51463a9 + 795a305 commit 2928ce6
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 25 deletions.

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 @@ -8,7 +8,7 @@

import { i18n } from '@kbn/i18n';
import React, { FunctionComponent } from 'react';
import { EuiButton, EuiCard } from '@elastic/eui';
import { EuiButton, EuiCard, EuiScreenReaderOnly } from '@elastic/eui';

import type { NoDataCardProps } from './types';
import { NoDataCardStyles } from './no_data_card.styles';
Expand All @@ -21,7 +21,7 @@ const defaultDescription = i18n.translate(
);

export const NoDataCard: FunctionComponent<NoDataCardProps> = ({
title,
title: titleProp,
button,
description,
isDisabled,
Expand All @@ -39,10 +39,18 @@ export const NoDataCard: FunctionComponent<NoDataCardProps> = ({
return button;
}
// Default footer action is a button with the provided or default string
return <EuiButton fill>{button || title}</EuiButton>;
return <EuiButton fill>{button || titleProp}</EuiButton>;
};

const cardDescription = description || defaultDescription;

// Fix the need for an a11y title even though the button exists by setting to screen reader only
const title = titleProp ? (
<EuiScreenReaderOnly>
<span>{titleProp}</span>
</EuiScreenReaderOnly>
) : null;

return (
<EuiCard
css={styles}
Expand Down
5 changes: 5 additions & 0 deletions test/functional/apps/discover/_doc_table_newline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,20 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
before(async function () {
await security.testUser.setRoles(['kibana_admin', 'kibana_message_with_newline']);
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/message_with_newline');
await kibanaServer.importExport.load(
'test/functional/fixtures/kbn_archiver/message_with_newline.json'
);
await kibanaServer.uiSettings.replace({
defaultIndex: 'newline-test',
'doc_table:legacy': true,
});
await PageObjects.common.navigateToApp('discover');
});

after(async () => {
await security.testUser.restoreDefaults();
await esArchiver.unload('test/functional/fixtures/es_archiver/message_with_newline');
await kibanaServer.savedObjects.cleanStandardList();
await kibanaServer.uiSettings.unset('defaultIndex');
await kibanaServer.uiSettings.unset('doc_table:legacy');
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
{
"type": "doc",
"value": {
"id": "index-pattern:newline-test",
"index": ".kibana",
"source": {
"index-pattern": {
"fields": "[]",
"title": "newline-test"
},
"type": "index-pattern"
}
}
}

{
"type": "doc",
"value": {
Expand Down
14 changes: 14 additions & 0 deletions test/functional/fixtures/kbn_archiver/message_with_newline.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"attributes": {
"fields": "[]",
"title": "newline-test"
},
"coreMigrationVersion": "8.4.0",
"id": "newline-test",
"migrationVersion": {
"index-pattern": "8.0.0"
},
"references": [],
"type": "index-pattern",
"version": "WzEzLDJd"
}

0 comments on commit 2928ce6

Please sign in to comment.