Skip to content

Commit 04b5d04

Browse files
authored
[APM] Fix license management URL (#73294) (#73343)
The URL to license management has changed, so update our links, both in the prompt on the Service Map, and in the app-wide expired license message. Use `useKibanaUrl` in both places and update that hook to make the `hash` argument optional, since many apps don't use a hash now. I looked for a more reliable way to get the URL for that app but couldn't come up with anything. I'd appreciate any suggestions if there's a better method.
1 parent 2421363 commit 04b5d04

3 files changed

Lines changed: 4 additions & 6 deletions

File tree

x-pack/plugins/apm/public/components/shared/LicensePrompt/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ interface Props {
1616

1717
export function LicensePrompt({ text, showBetaBadge = false }: Props) {
1818
const licensePageUrl = useKibanaUrl(
19-
'/app/kibana',
20-
'/management/stack/license_management/home'
19+
'/app/management/stack/license_management'
2120
);
2221

2322
const renderLicenseBody = (

x-pack/plugins/apm/public/context/LicenseContext/InvalidLicenseNotification.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
import { EuiButton, EuiEmptyPrompt } from '@elastic/eui';
77
import { i18n } from '@kbn/i18n';
88
import React from 'react';
9-
import { useApmPluginContext } from '../../hooks/useApmPluginContext';
9+
import { useKibanaUrl } from '../../hooks/useKibanaUrl';
1010

1111
export function InvalidLicenseNotification() {
12-
const { core } = useApmPluginContext();
13-
const manageLicenseURL = core.http.basePath.prepend(
12+
const manageLicenseURL = useKibanaUrl(
1413
'/app/management/stack/license_management'
1514
);
1615

x-pack/plugins/apm/public/hooks/useKibanaUrl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { useApmPluginContext } from './useApmPluginContext';
99

1010
export function useKibanaUrl(
1111
/** The path to the plugin */ path: string,
12-
/** The hash path */ hash: string
12+
/** The hash path */ hash?: string
1313
) {
1414
const { core } = useApmPluginContext();
1515
return url.format({

0 commit comments

Comments
 (0)