-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 160371-infra-ui-add-alerts-to-asset-details-…
…flyout
- Loading branch information
Showing
61 changed files
with
1,568 additions
and
393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
import { i18n } from '@kbn/i18n'; | ||
import type { CloudLinkId } from '@kbn/core-chrome-browser'; | ||
import type { CloudStart } from '@kbn/cloud-plugin/public'; | ||
|
||
export type CloudLinks = { | ||
[id in CloudLinkId]?: { | ||
title: string; | ||
href: string; | ||
}; | ||
}; | ||
|
||
export const getCloudLinks = (cloud: CloudStart): CloudLinks => { | ||
const { billingUrl, performanceUrl, usersAndRolesUrl } = cloud; | ||
|
||
const links: CloudLinks = {}; | ||
|
||
if (usersAndRolesUrl) { | ||
links.userAndRoles = { | ||
title: i18n.translate( | ||
'sharedUXPackages.chrome.sideNavigation.cloudLinks.usersAndRolesLinkText', | ||
{ | ||
defaultMessage: 'Users and roles', | ||
} | ||
), | ||
href: usersAndRolesUrl, | ||
}; | ||
} | ||
|
||
if (performanceUrl) { | ||
links.performance = { | ||
title: i18n.translate( | ||
'sharedUXPackages.chrome.sideNavigation.cloudLinks.performanceLinkText', | ||
{ | ||
defaultMessage: 'Performance', | ||
} | ||
), | ||
href: performanceUrl, | ||
}; | ||
} | ||
|
||
if (billingUrl) { | ||
links.billingAndSub = { | ||
title: i18n.translate('sharedUXPackages.chrome.sideNavigation.cloudLinks.billingLinkText', { | ||
defaultMessage: 'Billing and subscription', | ||
}), | ||
href: billingUrl, | ||
}; | ||
} | ||
|
||
return links; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.