mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Fleet] fix updates available when beta integrations are off (#149486)
## Summary Fixes https://github.com/elastic/kibana/issues/149470 Loading installed packages with prerelease flag, so that the `Updates available` is not showing prerelease versions when prerelease flag is off. How to test: - Install endpoint latest GA (8.6.1) - Check that there are no updates available on `Installed integrations` tab - Enable `Show Beta integrations` switch - Check that there is 1 badge in `Updates available`, showing the latest `Endpoint` `8.7.0-next` version. <img width="1183" alt="image" src="https://user-images.githubusercontent.com/90178898/214531019-e1971f73-669d-4eda-b968-0d007763ca59.png"> <img width="832" alt="image" src="https://user-images.githubusercontent.com/90178898/214530754-0131e3e0-ae43-47cb-9454-fb4ab72adc2c.png"> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
631675ba39
commit
43247bdc0f
2 changed files with 9 additions and 4 deletions
|
@ -97,7 +97,9 @@ function OnPremLink() {
|
|||
);
|
||||
}
|
||||
|
||||
export const AvailablePackages: React.FC<{}> = ({}) => {
|
||||
export const AvailablePackages: React.FC<{
|
||||
setPrereleaseEnabled: (isEnabled: boolean) => void;
|
||||
}> = ({ setPrereleaseEnabled }) => {
|
||||
useBreadcrumbs('integrations_all');
|
||||
|
||||
const {
|
||||
|
@ -137,6 +139,7 @@ export const AvailablePackages: React.FC<{}> = ({}) => {
|
|||
onChange={setPreference}
|
||||
onPrereleaseEnabledChange={(isEnabled) => {
|
||||
setPrereleaseIntegrationsEnabled(isEnabled);
|
||||
setPrereleaseEnabled(isEnabled);
|
||||
}}
|
||||
/>
|
||||
</EuiFlexItem>,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import React, { useMemo } from 'react';
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import { Switch, Route } from 'react-router-dom';
|
||||
|
||||
import type { CustomIntegration } from '@kbn/custom-integrations-plugin/common';
|
||||
|
@ -112,9 +112,11 @@ export const mapToCard = ({
|
|||
};
|
||||
|
||||
export const EPMHomePage: React.FC = () => {
|
||||
const [prereleaseEnabled, setPrereleaseEnabled] = useState<boolean>(false);
|
||||
|
||||
// loading packages to find installed ones
|
||||
const { data: allPackages, isLoading } = useGetPackages({
|
||||
prerelease: true,
|
||||
prerelease: prereleaseEnabled,
|
||||
});
|
||||
|
||||
const installedPackages = useMemo(
|
||||
|
@ -141,7 +143,7 @@ export const EPMHomePage: React.FC = () => {
|
|||
</Route>
|
||||
<Route path={INTEGRATIONS_ROUTING_PATHS.integrations_all}>
|
||||
<DefaultLayout section="browse" notificationsBySection={notificationsBySection}>
|
||||
<AvailablePackages />
|
||||
<AvailablePackages setPrereleaseEnabled={setPrereleaseEnabled} />
|
||||
</DefaultLayout>
|
||||
</Route>
|
||||
</Switch>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue