[User Experience] fix javascript errors href (#130280) (#130445)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit 968dffac4f)

Co-authored-by: Dominique Clarke <dominique.clarke@elastic.co>
This commit is contained in:
Kibana Machine 2022-04-18 03:50:25 -05:00 committed by GitHub
parent edcb625057
commit b406d2be88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,7 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { useLegacyUrlParams } from '../../../../context/url_params_context/use_url_params';
import { useFetcher } from '../../../../hooks/use_fetcher';
import { useKibanaServices } from '../../../../hooks/use_kibana_services';
import { I18LABELS } from '../translations';
import { CsmSharedContext } from '../csm_shared_context';
import { FETCH_STATUS } from '../../../../../../observability/public';
@ -32,6 +33,8 @@ interface JSErrorItem {
}
export function JSErrors() {
const { http } = useKibanaServices();
const basePath = http.basePath.get();
const { rangeId, urlParams, uxUiFilters } = useLegacyUrlParams();
const { start, end, serviceName, searchTerm } = urlParams;
@ -70,7 +73,9 @@ export function JSErrors() {
field: 'errorMessage',
name: I18LABELS.errorMessage,
render: (errorMessage: string, item: JSErrorItem) => (
<EuiLink href={`/services/${serviceName}/errors/${item.errorGroupId}`}>
<EuiLink
href={`${basePath}/app/apm/services/${serviceName}/errors/${item.errorGroupId}`}
>
{errorMessage}
</EuiLink>
),