mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
# Conflicts: # x-pack/plugins/fleet/public/applications/fleet/sections/epm/screens/detail/index.tsx
This commit is contained in:
parent
cf948c3465
commit
b31dca840b
2 changed files with 8 additions and 2 deletions
|
@ -21,6 +21,8 @@ import {
|
|||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import semverLt from 'semver/functions/lt';
|
||||
|
||||
import { useUIExtension } from '../../../../hooks/use_ui_extension';
|
||||
import { PAGE_ROUTING_PATHS, PLUGIN_ID } from '../../../../constants';
|
||||
import { useCapabilities, useGetPackageInfoByKey, useLink } from '../../../../hooks';
|
||||
|
@ -88,7 +90,7 @@ export function Detail() {
|
|||
packageInfo &&
|
||||
'savedObject' in packageInfo &&
|
||||
packageInfo.savedObject &&
|
||||
packageInfo.savedObject.attributes.version < packageInfo.latestVersion;
|
||||
semverLt(packageInfo.savedObject.attributes.version, packageInfo.latestVersion);
|
||||
|
||||
// Fetch package info
|
||||
const { data: packageInfoData, error: packageInfoError, isLoading } = useGetPackageInfoByKey(
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
import React, { memo } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import semverLt from 'semver/functions/lt';
|
||||
|
||||
import { EuiTitle, EuiFlexGroup, EuiFlexItem, EuiText, EuiSpacer } from '@elastic/eui';
|
||||
import { InstallStatus, PackageInfo } from '../../../../../types';
|
||||
import { useGetPackagePolicies } from '../../../../../hooks';
|
||||
|
@ -55,7 +57,9 @@ export const SettingsPage: React.FC<Props> = memo(({ packageInfo }: Props) => {
|
|||
});
|
||||
const { status: installationStatus, version: installedVersion } = getPackageInstallStatus(name);
|
||||
const packageHasUsages = !!packagePoliciesData?.total;
|
||||
const updateAvailable = installedVersion && installedVersion < latestVersion ? true : false;
|
||||
const updateAvailable =
|
||||
installedVersion && semverLt(installedVersion, latestVersion) ? true : false;
|
||||
|
||||
const isViewingOldPackage = version < latestVersion;
|
||||
// hide install/remove options if the user has version of the package is installed
|
||||
// and this package is out of date or if they do have a version installed but it's not this one
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue