Skip to content

Commit

Permalink
[Serverless] Add deployment URL (#163925)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
sphilipse authored Aug 15, 2023
1 parent 9da44e3 commit d5a3ed1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
14 changes: 13 additions & 1 deletion packages/shared-ux/chrome/navigation/src/cloud_links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};

Expand Down Expand Up @@ -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;
};
7 changes: 7 additions & 0 deletions x-pack/plugins/serverless_search/public/layout/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit d5a3ed1

Please sign in to comment.