[Serverless] Add deployment URL (#163925)

## Summary

This adds a link to the concrete project in Serverless ES3. We can't
link to performance directly because that has been descoped for now.
This commit is contained in:
Sander Philipse 2023-08-15 18:31:22 +02:00 committed by GitHub
parent 9da44e3571
commit d5a3ed1dee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View file

@ -45,7 +45,7 @@ export type AppDeepLinkId =
| ObservabilityLink;
/** @public */
export type CloudLinkId = 'userAndRoles' | 'performance' | 'billingAndSub';
export type CloudLinkId = 'userAndRoles' | 'performance' | 'billingAndSub' | 'deployment';
export type GetIsActiveFn = (params: {
/** The current path name including the basePath + hash value but **without** any query params */

View file

@ -17,7 +17,7 @@ export type CloudLinks = {
};
export const getCloudLinks = (cloud: CloudStart): CloudLinks => {
const { billingUrl, performanceUrl, usersAndRolesUrl } = cloud;
const { billingUrl, deploymentUrl, performanceUrl, usersAndRolesUrl } = cloud;
const links: CloudLinks = {};
@ -54,5 +54,17 @@ export const getCloudLinks = (cloud: CloudStart): CloudLinks => {
};
}
if (deploymentUrl) {
links.deployment = {
title: i18n.translate(
'sharedUXPackages.chrome.sideNavigation.cloudLinks.deploymentLinkText',
{
defaultMessage: 'Project',
}
),
href: deploymentUrl,
};
}
return links;
};

View file

@ -134,6 +134,13 @@ const navigationTree: NavigationTreeDefinition = {
defaultMessage: 'Management',
}),
},
{
id: 'cloudLinkDeployment',
cloudLink: 'deployment',
title: i18n.translate('xpack.serverlessSearch.nav.performance', {
defaultMessage: 'Performance',
}),
},
{
id: 'cloudLinkUserAndRoles',
cloudLink: 'userAndRoles',