forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add getter function for app availability for plugins that will be int…
…egrated with Uptime in the future. (elastic#35543) (elastic#35868)
- Loading branch information
1 parent
3b6dd3b
commit 083241f
Showing
5 changed files
with
49 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export const INTEGRATED_SOLUTIONS = ['apm', 'infrastructure', 'logs']; |
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
22 changes: 22 additions & 0 deletions
22
x-pack/plugins/uptime/public/lib/adapters/framework/capabilities_adapter.ts
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,22 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { capabilities as uiCapabilities } from 'ui/capabilities'; | ||
|
||
interface IntegratedAppsAvailability { | ||
[key: string]: boolean; | ||
} | ||
|
||
export const getIntegratedAppAvailability = ( | ||
integratedApps: string[] | ||
): IntegratedAppsAvailability => { | ||
const capabilities = uiCapabilities.get(); | ||
return integratedApps.reduce((supportedSolutions: IntegratedAppsAvailability, solutionName) => { | ||
supportedSolutions[solutionName] = | ||
capabilities[solutionName] && capabilities[solutionName].show === true; | ||
return supportedSolutions; | ||
}, {}); | ||
}; |
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