From 8f63ba3ee78384f77e7866c04c27aea08ef29dad Mon Sep 17 00:00:00 2001 From: asingh <11219262+ashutosh16@users.noreply.github.com> Date: Fri, 16 Jun 2023 13:39:57 -0700 Subject: [PATCH] fix(ui): use react link to route to relative deep-link path (#13529) Signed-off-by: ashutosh16 <11219262+ashutosh16@users.noreply.github.com> --- ui/src/app/shared/components/deep-links.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ui/src/app/shared/components/deep-links.tsx b/ui/src/app/shared/components/deep-links.tsx index f7881bff537d..6d9f614ea966 100644 --- a/ui/src/app/shared/components/deep-links.tsx +++ b/ui/src/app/shared/components/deep-links.tsx @@ -1,4 +1,5 @@ -import * as React from 'react'; +import React from 'react'; +import {Link} from 'react-router-dom'; import {LinkInfo} from '../models'; export const DeepLinks = (props: {links: LinkInfo[]}) => { @@ -7,10 +8,17 @@ export const DeepLinks = (props: {links: LinkInfo[]}) => {
{(links || []).map((link: LinkInfo) => (
- - -
{link.title}
-
+ {link.url.startsWith('http') ? ( + + +
{link.title}
+
+ ) : ( + + +
{link.title}
+ + )} {link.description && <>({link.description})}
))}