mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
* use EuiLink instead of EuiButton
* better tag positions
* fix rendering and text
* lint fixes
(cherry picked from commit c7734bc945
)
This commit is contained in:
parent
07b9f37693
commit
a94043b55e
2 changed files with 17 additions and 29 deletions
|
@ -5,16 +5,14 @@
|
||||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||||
* Side Public License, v 1.
|
* Side Public License, v 1.
|
||||||
*/
|
*/
|
||||||
import { css } from '@emotion/react';
|
|
||||||
import {
|
import {
|
||||||
EuiBadge,
|
EuiBadge,
|
||||||
EuiButton,
|
EuiButton,
|
||||||
EuiButtonEmpty,
|
EuiLink,
|
||||||
EuiInMemoryTable,
|
EuiInMemoryTable,
|
||||||
EuiPageHeader,
|
EuiPageHeader,
|
||||||
EuiSpacer,
|
EuiSpacer,
|
||||||
EuiFlexItem,
|
|
||||||
EuiFlexGroup,
|
|
||||||
} from '@elastic/eui';
|
} from '@elastic/eui';
|
||||||
import { FormattedMessage } from '@kbn/i18n-react';
|
import { FormattedMessage } from '@kbn/i18n-react';
|
||||||
import { RouteComponentProps, withRouter, useLocation } from 'react-router-dom';
|
import { RouteComponentProps, withRouter, useLocation } from 'react-router-dom';
|
||||||
|
@ -60,10 +58,6 @@ const securityDataView = i18n.translate(
|
||||||
|
|
||||||
const securitySolution = 'security-solution';
|
const securitySolution = 'security-solution';
|
||||||
|
|
||||||
const flexItemStyles = css`
|
|
||||||
justify-content: center;
|
|
||||||
`;
|
|
||||||
|
|
||||||
interface Props extends RouteComponentProps {
|
interface Props extends RouteComponentProps {
|
||||||
canSave: boolean;
|
canSave: boolean;
|
||||||
showCreateDialog?: boolean;
|
showCreateDialog?: boolean;
|
||||||
|
@ -124,26 +118,20 @@ export const IndexPatternTable = ({
|
||||||
}>;
|
}>;
|
||||||
}
|
}
|
||||||
) => (
|
) => (
|
||||||
<>
|
<div>
|
||||||
<EuiFlexGroup gutterSize="s" wrap>
|
<EuiLink {...reactRouterNavigate(history, `patterns/${index.id}`)}>{name}</EuiLink>
|
||||||
<EuiFlexItem grow={false} css={flexItemStyles}>
|
|
||||||
<EuiButtonEmpty size="s" {...reactRouterNavigate(history, `patterns/${index.id}`)}>
|
|
||||||
{name}
|
|
||||||
</EuiButtonEmpty>
|
|
||||||
</EuiFlexItem>
|
|
||||||
{index.id && index.id.indexOf(securitySolution) === 0 && (
|
{index.id && index.id.indexOf(securitySolution) === 0 && (
|
||||||
<EuiFlexItem grow={false} css={flexItemStyles}>
|
<>
|
||||||
<EuiBadge>{securityDataView}</EuiBadge>
|
 <EuiBadge>{securityDataView}</EuiBadge>
|
||||||
</EuiFlexItem>
|
</>
|
||||||
)}
|
)}
|
||||||
{index.tags &&
|
{index.tags &&
|
||||||
index.tags.map(({ key: tagKey, name: tagName }) => (
|
index.tags.map(({ key: tagKey, name: tagName }) => (
|
||||||
<EuiFlexItem grow={false} css={flexItemStyles} key={tagKey}>
|
<>
|
||||||
<EuiBadge>{tagName}</EuiBadge>
|
 <EuiBadge key={tagKey}>{tagName}</EuiBadge>
|
||||||
</EuiFlexItem>
|
|
||||||
))}
|
|
||||||
</EuiFlexGroup>
|
|
||||||
</>
|
</>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
),
|
),
|
||||||
dataType: 'string' as const,
|
dataType: 'string' as const,
|
||||||
sortable: ({ sort }: { sort: string }) => sort,
|
sortable: ({ sort }: { sort: string }) => sort,
|
||||||
|
|
|
@ -315,7 +315,7 @@ export class SettingsPageObject extends FtrService {
|
||||||
}
|
}
|
||||||
|
|
||||||
async clickIndexPatternByName(name: string) {
|
async clickIndexPatternByName(name: string) {
|
||||||
const indexLink = await this.find.byXPath(`//a[descendant::*[text()='${name}']]`);
|
const indexLink = await this.find.byXPath(`//a[text()='${name}']`);
|
||||||
await indexLink.click();
|
await indexLink.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue