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

[Cloud Posture] Agent link now has underline #141118

Merged
Merged
Changes from 1 commit
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 @@ -11,8 +11,9 @@ import {
type EuiBasicTableProps,
type Pagination,
type CriteriaWithPagination,
EuiLink,
} from '@elastic/eui';
import React from 'react';
import React, { MouseEvent } from 'react';
import { Link, useHistory, generatePath } from 'react-router-dom';
import { pagePathGetters } from '@kbn/fleet-plugin/public';
import { FormattedMessage } from '@kbn/i18n-react';
Expand All @@ -34,18 +35,20 @@ interface BenchmarksTableProps
const AgentPolicyButtonLink = ({ name, id: policyId }: { name: string; id: string }) => {
const { http, application } = useKibana().services;
const [fleetBase, path] = pagePathGetters.policy_details({ policyId });

return (
<a
// eslint-disable-next-line @elastic/eui/href-or-on-click
Copy link
Contributor Author

@JordanSh JordanSh Sep 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're not the only ones that did this

<EuiLink
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to still be able to navigate with href ("open in new tab")

href={http.basePath.prepend([fleetBase, path].join(''))}
title={name}
onClick={(e) => {
onClick={(e: MouseEvent<HTMLAnchorElement>) => {
e.stopPropagation();
e.preventDefault();
application.navigateToApp('fleet', { path });
}}
>
{name}
</a>
</EuiLink>
);
};

Expand Down