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

[data view mgmt] fix data view name wrap #127319

Merged
merged 4 commits into from
Mar 10, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { css } from '@emotion/react';

import {
EuiBadge,
EuiButton,
EuiButtonEmpty,
EuiLink,
EuiInMemoryTable,
EuiPageHeader,
EuiSpacer,
EuiFlexItem,
EuiFlexGroup,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { RouteComponentProps, withRouter, useLocation } from 'react-router-dom';
Expand Down Expand Up @@ -53,10 +51,6 @@ const securityDataView = i18n.translate(

const securitySolution = 'security-solution';

const flexItemStyles = css`
justify-content: center;
`;

interface Props extends RouteComponentProps {
canSave: boolean;
showCreateDialog?: boolean;
Expand Down Expand Up @@ -140,25 +134,19 @@ export const IndexPatternTable = ({
defaultMessage: 'Name',
}),
render: (name: string, dataView: IndexPatternTableItem) => (
<>
<EuiFlexGroup gutterSize="s" wrap>
<EuiFlexItem grow={false} css={flexItemStyles}>
<EuiButtonEmpty size="s" {...reactRouterNavigate(history, `patterns/${dataView.id}`)}>
{name}
</EuiButtonEmpty>
</EuiFlexItem>
{dataView?.id?.indexOf(securitySolution) === 0 && (
<EuiFlexItem grow={false} css={flexItemStyles}>
<EuiBadge>{securityDataView}</EuiBadge>
</EuiFlexItem>
)}
{dataView?.tags?.map(({ key: tagKey, name: tagName }) => (
<EuiFlexItem grow={false} css={flexItemStyles} key={tagKey}>
<EuiBadge>{tagName}</EuiBadge>
</EuiFlexItem>
))}
</EuiFlexGroup>
</>
<div>
<EuiLink {...reactRouterNavigate(history, `patterns/${dataView.id}`)}>{name}</EuiLink>
{dataView?.id?.indexOf(securitySolution) === 0 && (
<>
&emsp;<EuiBadge>{securityDataView}</EuiBadge>
</>
)}
{dataView?.tags?.map(({ key: tagKey, name: tagName }) => (
<>
&emsp;<EuiBadge key={tagKey}>{tagName}</EuiBadge>
</>
))}
</div>
),
dataType: 'string' as const,
sortable: ({ sort }: { sort: string }) => sort,
Expand Down
2 changes: 1 addition & 1 deletion test/functional/page_objects/settings_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export class SettingsPageObject extends FtrService {
}

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();
}

Expand Down