mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Fleet] Correctly track install status of an integration (#93464)
This commit is contained in:
parent
284a77c7c0
commit
a050b7af79
1 changed files with 10 additions and 2 deletions
|
@ -37,7 +37,7 @@ import { Error, Loading } from '../../../../components';
|
|||
import { useBreadcrumbs } from '../../../../hooks';
|
||||
import { WithHeaderLayout, WithHeaderLayoutProps } from '../../../../layouts';
|
||||
import { RELEASE_BADGE_DESCRIPTION, RELEASE_BADGE_LABEL } from '../../components/release_badge';
|
||||
import { useSetPackageInstallStatus } from '../../hooks';
|
||||
import { useGetPackageInstallStatus, useSetPackageInstallStatus } from '../../hooks';
|
||||
|
||||
import { IntegrationAgentPolicyCount, UpdateIcon, IconPanel, LoadingIconPanel } from './components';
|
||||
import { OverviewPage } from './overview';
|
||||
|
@ -77,6 +77,15 @@ export function Detail() {
|
|||
// Package info state
|
||||
const [packageInfo, setPackageInfo] = useState<PackageInfo | null>(null);
|
||||
const setPackageInstallStatus = useSetPackageInstallStatus();
|
||||
const getPackageInstallStatus = useGetPackageInstallStatus();
|
||||
|
||||
const packageInstallStatus = useMemo(() => {
|
||||
if (packageInfo === null || !packageInfo.name) {
|
||||
return undefined;
|
||||
}
|
||||
return getPackageInstallStatus(packageInfo.name).status;
|
||||
}, [packageInfo, getPackageInstallStatus]);
|
||||
|
||||
const updateAvailable =
|
||||
packageInfo &&
|
||||
'savedObject' in packageInfo &&
|
||||
|
@ -88,7 +97,6 @@ export function Detail() {
|
|||
pkgkey
|
||||
);
|
||||
|
||||
const packageInstallStatus = packageInfoData?.response.status;
|
||||
const showCustomTab =
|
||||
useUIExtension(packageInfoData?.response.name ?? '', 'package-detail-custom') !== undefined;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue