mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
## Summary Backport https://github.com/elastic/kibana/pull/149486 to 8.6
This commit is contained in:
parent
452d2a8d5a
commit
c325e4762c
2 changed files with 9 additions and 4 deletions
|
@ -181,7 +181,9 @@ const packageListToIntegrationsList = (packages: PackageList): PackageList => {
|
||||||
|
|
||||||
// TODO: clintandrewhall - this component is hard to test due to the hooks, particularly those that use `http`
|
// TODO: clintandrewhall - this component is hard to test due to the hooks, particularly those that use `http`
|
||||||
// or `location` to load data. Ideally, we'll split this into "connected" and "pure" components.
|
// or `location` to load data. Ideally, we'll split this into "connected" and "pure" components.
|
||||||
export const AvailablePackages: React.FC<{}> = ({}) => {
|
export const AvailablePackages: React.FC<{
|
||||||
|
setPrereleaseEnabled: (isEnabled: boolean) => void;
|
||||||
|
}> = ({ setPrereleaseEnabled }) => {
|
||||||
const [preference, setPreference] = useState<IntegrationPreferenceType>('recommended');
|
const [preference, setPreference] = useState<IntegrationPreferenceType>('recommended');
|
||||||
const [prereleaseIntegrationsEnabled, setPrereleaseIntegrationsEnabled] = React.useState<
|
const [prereleaseIntegrationsEnabled, setPrereleaseIntegrationsEnabled] = React.useState<
|
||||||
boolean | undefined
|
boolean | undefined
|
||||||
|
@ -304,6 +306,7 @@ export const AvailablePackages: React.FC<{}> = ({}) => {
|
||||||
onChange={setPreference}
|
onChange={setPreference}
|
||||||
onPrereleaseEnabledChange={(isEnabled) => {
|
onPrereleaseEnabledChange={(isEnabled) => {
|
||||||
setPrereleaseIntegrationsEnabled(isEnabled);
|
setPrereleaseIntegrationsEnabled(isEnabled);
|
||||||
|
setPrereleaseEnabled(isEnabled);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</EuiFlexItem>,
|
</EuiFlexItem>,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
* 2.0.
|
* 2.0.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useMemo } from 'react';
|
import React, { useMemo, useState } from 'react';
|
||||||
import { Switch, Route } from 'react-router-dom';
|
import { Switch, Route } from 'react-router-dom';
|
||||||
|
|
||||||
import type { CustomIntegration } from '@kbn/custom-integrations-plugin/common';
|
import type { CustomIntegration } from '@kbn/custom-integrations-plugin/common';
|
||||||
|
@ -113,9 +113,11 @@ export const mapToCard = ({
|
||||||
};
|
};
|
||||||
|
|
||||||
export const EPMHomePage: React.FC = () => {
|
export const EPMHomePage: React.FC = () => {
|
||||||
|
const [prereleaseEnabled, setPrereleaseEnabled] = useState<boolean>(false);
|
||||||
|
|
||||||
// loading packages to find installed ones
|
// loading packages to find installed ones
|
||||||
const { data: allPackages, isLoading } = useGetPackages({
|
const { data: allPackages, isLoading } = useGetPackages({
|
||||||
prerelease: true,
|
prerelease: prereleaseEnabled,
|
||||||
});
|
});
|
||||||
|
|
||||||
const installedPackages = useMemo(
|
const installedPackages = useMemo(
|
||||||
|
@ -138,7 +140,7 @@ export const EPMHomePage: React.FC = () => {
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={INTEGRATIONS_ROUTING_PATHS.integrations_all}>
|
<Route path={INTEGRATIONS_ROUTING_PATHS.integrations_all}>
|
||||||
<DefaultLayout section="browse" sectionsWithWarning={sectionsWithWarning}>
|
<DefaultLayout section="browse" sectionsWithWarning={sectionsWithWarning}>
|
||||||
<AvailablePackages />
|
<AvailablePackages setPrereleaseEnabled={setPrereleaseEnabled} />
|
||||||
</DefaultLayout>
|
</DefaultLayout>
|
||||||
</Route>
|
</Route>
|
||||||
</Switch>
|
</Switch>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue