fix: [GH-4383]: handle special characters in the services name (#4388)

* fix: [GH-4383]: handle special characters in the services name
This commit is contained in:
Vikrant Gupta 2024-01-18 15:01:32 +05:30 committed by GitHub
parent 4a1c48b72b
commit f99da73098
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -16,6 +16,7 @@ import {
import useUrlQuery from 'hooks/useUrlQuery'; import useUrlQuery from 'hooks/useUrlQuery';
import history from 'lib/history'; import history from 'lib/history';
import { OnClickPluginOpts } from 'lib/uPlotLib/plugins/onClickPlugin'; import { OnClickPluginOpts } from 'lib/uPlotLib/plugins/onClickPlugin';
import { defaultTo } from 'lodash-es';
import { useCallback, useMemo, useState } from 'react'; import { useCallback, useMemo, useState } from 'react';
import { useQuery } from 'react-query'; import { useQuery } from 'react-query';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
@ -107,7 +108,10 @@ function Application(): JSX.Element {
); );
const topLevelOperationsRoute = useMemo( const topLevelOperationsRoute = useMemo(
() => (topLevelOperations ? topLevelOperations[servicename || ''] : []), () =>
topLevelOperations
? defaultTo(topLevelOperations[servicename || ''], [])
: [],
[servicename, topLevelOperations], [servicename, topLevelOperations],
); );

View File

@ -26,7 +26,11 @@ export const getColumnSearchProps = (
const queryString = getQueryString(avialableParams, urlParams); const queryString = getQueryString(avialableParams, urlParams);
return ( return (
<Link to={`${ROUTES.APPLICATION}/${metrics}?${queryString.join('')}`}> <Link
to={`${ROUTES.APPLICATION}/${encodeURIComponent(
metrics,
)}?${queryString.join('')}`}
>
<Name>{metrics}</Name> <Name>{metrics}</Name>
</Link> </Link>
); );