Updates app_id to use integrations one instead of fleet for back button link (#102312) (#102345)

Co-authored-by: David Sánchez <davidsansol92@gmail.com>
This commit is contained in:
Kibana Machine 2021-06-16 13:08:57 -04:00 committed by GitHub
parent aa9571b2cc
commit d04d9e10f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 9 deletions

View file

@ -20,7 +20,7 @@ import {
GetExceptionSummaryResponse,
ListPageRouteState,
} from '../../../../../../../../common/endpoint/types';
import { PLUGIN_ID as FLEET_PLUGIN_ID } from '../../../../../../../../../fleet/common';
import { INTEGRATIONS_PLUGIN_ID } from '../../../../../../../../../fleet/common';
import { MANAGEMENT_APP_ID } from '../../../../../../common/constants';
import { useToasts } from '../../../../../../../common/lib/kibana';
import { LinkWithIcon } from './link_with_icon';
@ -68,19 +68,21 @@ export const FleetEventFiltersCard = memo<PackageCustomExtensionComponentProps>(
}, [eventFiltersApi, toasts]);
const eventFiltersRouteState = useMemo<ListPageRouteState>(() => {
const fleetPackageCustomUrlPath = `#${pagePathGetters.integration_details_custom({ pkgkey })}`;
const fleetPackageCustomUrlPath = `#${
pagePathGetters.integration_details_custom({ pkgkey })[1]
}`;
return {
backButtonLabel: i18n.translate(
'xpack.securitySolution.endpoint.fleetCustomExtension.backButtonLabel',
{ defaultMessage: 'Back to Endpoint Integration' }
),
onBackButtonNavigateTo: [
FLEET_PLUGIN_ID,
INTEGRATIONS_PLUGIN_ID,
{
path: fleetPackageCustomUrlPath,
},
],
backButtonUrl: getUrlForApp(FLEET_PLUGIN_ID, {
backButtonUrl: getUrlForApp(INTEGRATIONS_PLUGIN_ID, {
path: fleetPackageCustomUrlPath,
}),
};

View file

@ -20,7 +20,7 @@ import {
ListPageRouteState,
GetExceptionSummaryResponse,
} from '../../../../../../../../common/endpoint/types';
import { PLUGIN_ID as FLEET_PLUGIN_ID } from '../../../../../../../../../fleet/common';
import { INTEGRATIONS_PLUGIN_ID } from '../../../../../../../../../fleet/common';
import { MANAGEMENT_APP_ID } from '../../../../../../common/constants';
import { useToasts } from '../../../../../../../common/lib/kibana';
import { LinkWithIcon } from './link_with_icon';
@ -68,24 +68,26 @@ export const FleetTrustedAppsCard = memo<PackageCustomExtensionComponentProps>((
const trustedAppsListUrlPath = getTrustedAppsListPath();
const trustedAppRouteState = useMemo<ListPageRouteState>(() => {
const fleetPackageCustomUrlPath = `#${pagePathGetters.integration_details_custom({ pkgkey })}`;
const fleetPackageCustomUrlPath = `#${
pagePathGetters.integration_details_custom({ pkgkey })[1]
}`;
return {
backButtonLabel: i18n.translate(
'xpack.securitySolution.endpoint.fleetCustomExtension.backButtonLabel',
{ defaultMessage: 'Back to Endpoint Integration' }
),
onBackButtonNavigateTo: [
FLEET_PLUGIN_ID,
INTEGRATIONS_PLUGIN_ID,
{
path: fleetPackageCustomUrlPath,
},
],
backButtonUrl: getUrlForApp(FLEET_PLUGIN_ID, {
backButtonUrl: getUrlForApp(INTEGRATIONS_PLUGIN_ID, {
path: fleetPackageCustomUrlPath,
}),
};
}, [getUrlForApp, pkgkey]);
return (
<EuiPanel paddingSize="l">
<StyledEuiFlexGridGroup alignItems="baseline" justifyContent="center">