Skip to content
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 @@ -15,8 +15,8 @@ import {
import { ArrowRightIcon, ExternalLinkAltIcon } from '@patternfly/react-icons';
import { Link } from 'react-router-dom-v5-compat';
import { useActivePerspective } from '@console/dynamic-plugin-sdk';
import { ExternalLink } from '@console/shared/src/components/links/ExternalLink';
import { useTelemetry } from '@console/shared/src/hooks/useTelemetry';
import { ExternalLink } from '../links/ExternalLink';
import './GettingStartedCard.scss';

export interface GettingStartedLink {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1120,16 +1120,15 @@ export const ClusterServiceVersionDetails: React.FC<ClusterServiceVersionDetails
<DescriptionListTerm>{t('olm~Links')}</DescriptionListTerm>
{spec.links && spec.links.length > 0 ? (
spec.links.map((link) => (
<DescriptionListDescription
key={link.url}
style={{ display: 'flex', flexDirection: 'column' }}
>
{link.name}{' '}
<ExternalLink
href={link.url}
text={link.url || '-'}
className="co-break-all"
/>
<DescriptionListDescription key={link.url}>
<div className="pf-v6-u-display-flex pf-v6-u-flex-direction-column">
Copy link
Member

Choose a reason for hiding this comment

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

This is fine, but it's more markup than my suggestion. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Did you mean to use link.name as the text of the ExternalLink?

{link.name}
<ExternalLink
href={link.url}
text={link.url || '-'}
className="co-break-all"
/>
</div>
</DescriptionListDescription>
))
) : (
Expand Down
13 changes: 6 additions & 7 deletions frontend/public/components/masthead-toolbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
YellowExclamationTriangleIcon,
} from '@console/shared';
import { formatNamespacedRouteForResource } from '@console/shared/src/utils';
import { ExternalLinkButton } from '@console/shared/src/components/links/ExternalLinkButton';
import { LinkTo } from '@console/shared/src/components/links/LinkTo';
import CloudShellMastheadButton from '@console/webterminal-plugin/src/components/cloud-shell/CloudShellMastheadButton';
import CloudShellMastheadAction from '@console/webterminal-plugin/src/components/cloud-shell/CloudShellMastheadAction';
Expand Down Expand Up @@ -104,15 +105,13 @@ const FeedbackModalLocalized = ({ isOpen, onClose, reportBugLink }) => {
const SystemStatusButton = ({ statuspageData }) => {
const { t } = useTranslation();
return !_.isEmpty(_.get(statuspageData, 'incidents')) ? (
<a
className="pf-v6-c-button pf-m-plain co-masthead-button"
<ExternalLinkButton
variant="plain"
className="co-masthead-button"
aria-label={t('public~System status')}
icon={<YellowExclamationTriangleIcon />}
href={statuspageData.page.url}
target="_blank"
rel="noopener noreferrer"
>
<YellowExclamationTriangleIcon />
</a>
/>
) : null;
};

Expand Down
4 changes: 2 additions & 2 deletions frontend/public/components/utils/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ export const ExternalLinkWithCopy = ({
};

// Open links in a new window and set noopener/noreferrer.
export const LinkifyExternal: React.FC<{ children: React.ReactNode }> = ({ children }) => (
<Linkify properties={{ target: '_blank', rel: 'noopener noreferrer' }}>{children}</Linkify>
export const LinkifyExternal = ({ children }: { children: React.ReactNode }) => (
<Linkify component={ExternalLink}>{children}</Linkify>
);
LinkifyExternal.displayName = 'LinkifyExternal';

Expand Down