From a05cb1e78e77fefad7d474001f59b38819904b1f Mon Sep 17 00:00:00 2001 From: William Assis <35489495+gassiss@users.noreply.github.com> Date: Fri, 10 Mar 2023 08:18:12 -0500 Subject: [PATCH] Frontend: Fix broken links in /plugins when pathname has a trailing slash (#64348) Fix broken links in /plugins when pathname has a trailing slash --- public/app/features/plugins/admin/components/PluginList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/app/features/plugins/admin/components/PluginList.tsx b/public/app/features/plugins/admin/components/PluginList.tsx index 9e12fbf3824..afa87074e14 100644 --- a/public/app/features/plugins/admin/components/PluginList.tsx +++ b/public/app/features/plugins/admin/components/PluginList.tsx @@ -18,8 +18,8 @@ interface Props { export const PluginList = ({ plugins, displayMode }: Props) => { const isList = displayMode === PluginListDisplayMode.List; const styles = useStyles2(getStyles); - const location = useLocation(); - const pathName = config.appSubUrl + location.pathname; + const { pathname } = useLocation(); + const pathName = config.appSubUrl + (pathname.endsWith('/') ? pathname.slice(0, -1) : pathname); return (