Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
[APM] Fix license management URL (elastic#73294) (elastic#73342)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kibanamachine authored Jul 27, 2020
1 parent 9e4ac4c commit 5b3f5e9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ interface Props {

export const LicensePrompt = ({ text, showBetaBadge = false }: Props) => {
const licensePageUrl = useKibanaUrl(
'/app/kibana',
'/management/stack/license_management/home'
'/app/management/stack/license_management'
);

const renderLicenseBody = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
import { EuiButton, EuiEmptyPrompt } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React from 'react';
import { useApmPluginContext } from '../../hooks/useApmPluginContext';
import { useKibanaUrl } from '../../hooks/useKibanaUrl';

export function InvalidLicenseNotification() {
const { core } = useApmPluginContext();
const manageLicenseURL = core.http.basePath.prepend(
const manageLicenseURL = useKibanaUrl(
'/app/management/stack/license_management'
);

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/public/hooks/useKibanaUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useApmPluginContext } from './useApmPluginContext';

export function useKibanaUrl(
/** The path to the plugin */ path: string,
/** The hash path */ hash: string
/** The hash path */ hash?: string
) {
const { core } = useApmPluginContext();
return url.format({
Expand Down

0 comments on commit 5b3f5e9

Please sign in to comment.