mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Use consistent-type-imports lint rule to autofix type-only imports (#94464)
## Summary Use the [`consistent-type-imports` lint rule ](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/consistent-type-imports.md) to use `import type ...` where possible Code-only changes like this were recently added in https://github.com/elastic/kibana/pull/92979, but it was a more manual process. This PR adds an autofixable lint rule which will keep the changes up-to-date and Just Work ™️
This commit is contained in:
parent
df98465982
commit
a4fa4a62cb
160 changed files with 348 additions and 307 deletions
|
@ -794,6 +794,7 @@ module.exports = {
|
|||
{
|
||||
files: ['x-pack/plugins/fleet/**/*.{js,mjs,ts,tsx}'],
|
||||
rules: {
|
||||
'@typescript-eslint/consistent-type-imports': 'error',
|
||||
'import/order': [
|
||||
'warn',
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { Observable, Subscription } from 'rxjs';
|
||||
import type { Observable, Subscription } from 'rxjs';
|
||||
|
||||
import type { ILicense } from '../../../licensing/common/types';
|
||||
|
||||
|
|
|
@ -5,7 +5,11 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { AGENT_TYPE_EPHEMERAL, AGENT_TYPE_PERMANENT, AGENT_TYPE_TEMPORARY } from '../../constants';
|
||||
import type {
|
||||
AGENT_TYPE_EPHEMERAL,
|
||||
AGENT_TYPE_PERMANENT,
|
||||
AGENT_TYPE_TEMPORARY,
|
||||
} from '../../constants';
|
||||
|
||||
import type { FullAgentPolicy } from './agent_policy';
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { agentPolicyStatuses } from '../../constants';
|
||||
import type { agentPolicyStatuses } from '../../constants';
|
||||
import type { DataType, ValueOf } from '../../types';
|
||||
|
||||
import type { PackagePolicy, PackagePolicyPackage } from './package_policy';
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// TODO: Update when https://github.com/elastic/kibana/issues/53021 is closed
|
||||
import type { SavedObject, SavedObjectAttributes, SavedObjectReference } from 'src/core/public';
|
||||
|
||||
import {
|
||||
import type {
|
||||
ASSETS_SAVED_OBJECT_TYPE,
|
||||
agentAssetTypes,
|
||||
dataTypes,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { outputType } from '../../constants';
|
||||
import type { outputType } from '../../constants';
|
||||
import type { ValueOf } from '../index';
|
||||
|
||||
export type OutputType = typeof outputType;
|
||||
|
|
|
@ -6,16 +6,17 @@
|
|||
*/
|
||||
|
||||
import React, { memo, useEffect, useState } from 'react';
|
||||
import { AppMountParameters } from 'kibana/public';
|
||||
import type { AppMountParameters } from 'kibana/public';
|
||||
import { EuiCode, EuiEmptyPrompt, EuiErrorBoundary, EuiPanel } from '@elastic/eui';
|
||||
import { createHashHistory, History } from 'history';
|
||||
import type { History } from 'history';
|
||||
import { createHashHistory } from 'history';
|
||||
import { Router, Redirect, Route, Switch } from 'react-router-dom';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import styled from 'styled-components';
|
||||
import useObservable from 'react-use/lib/useObservable';
|
||||
|
||||
import { FleetConfigType, FleetStartServices } from '../../plugin';
|
||||
import type { FleetConfigType, FleetStartServices } from '../../plugin';
|
||||
import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public';
|
||||
import { EuiThemeProvider } from '../../../../../../src/plugins/kibana_react/common';
|
||||
|
||||
|
@ -39,7 +40,7 @@ import { DataStreamApp } from './sections/data_stream';
|
|||
import { FleetApp } from './sections/agents';
|
||||
import { IngestManagerOverview } from './sections/overview';
|
||||
import { ProtectedRoute } from './index';
|
||||
import { UIExtensionsStorage } from './types';
|
||||
import type { UIExtensionsStorage } from './types';
|
||||
import { UIExtensionsContext } from './hooks/use_ui_extension';
|
||||
|
||||
const ErrorLayout = ({ children }: { children: JSX.Element }) => (
|
||||
|
|
|
@ -14,9 +14,9 @@ import {
|
|||
EuiPopover,
|
||||
EuiButton,
|
||||
} from '@elastic/eui';
|
||||
import { EuiButtonProps } from '@elastic/eui/src/components/button/button';
|
||||
import { EuiContextMenuProps } from '@elastic/eui/src/components/context_menu/context_menu';
|
||||
import { EuiContextMenuPanelProps } from '@elastic/eui/src/components/context_menu/context_menu_panel';
|
||||
import type { EuiButtonProps } from '@elastic/eui/src/components/button/button';
|
||||
import type { EuiContextMenuProps } from '@elastic/eui/src/components/context_menu/context_menu';
|
||||
import type { EuiContextMenuPanelProps } from '@elastic/eui/src/components/context_menu/context_menu_panel';
|
||||
|
||||
type Props = {
|
||||
button?: {
|
||||
|
|
|
@ -10,7 +10,7 @@ import styled from 'styled-components';
|
|||
import { EuiText, EuiSpacer, EuiLink, EuiTitle, EuiCodeBlock } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { EnrollmentAPIKey } from '../../../types';
|
||||
import type { EnrollmentAPIKey } from '../../../types';
|
||||
|
||||
interface Props {
|
||||
kibanaUrl: string;
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import React, { memo, ReactNode, Suspense } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import React, { memo, Suspense } from 'react';
|
||||
import { EuiErrorBoundary } from '@elastic/eui';
|
||||
|
||||
import { Loading } from './loading';
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
import React, { memo } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { EuiFlexGroup, EuiFlexItem, EuiTabs, EuiTab, EuiSpacer } from '@elastic/eui';
|
||||
import { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab';
|
||||
import { EuiFlexItemProps } from '@elastic/eui/src/components/flex/flex_item';
|
||||
import type { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab';
|
||||
import type { EuiFlexItemProps } from '@elastic/eui/src/components/flex/flex_item';
|
||||
|
||||
const Container = styled.div`
|
||||
border-bottom: ${(props) => props.theme.eui.euiBorderThin};
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React, { memo } from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { EuiText, EuiLink, EuiSpacer } from '@elastic/eui';
|
||||
import { TutorialModuleNoticeComponent } from 'src/plugins/home/public';
|
||||
import type { TutorialModuleNoticeComponent } from 'src/plugins/home/public';
|
||||
|
||||
import { useGetPackages, useLink, useCapabilities } from '../../hooks';
|
||||
import { pkgKeyFromPackageInfo } from '../../services/pkg_key_from_package_info';
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
|
||||
import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiText } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import React, { CSSProperties, memo } from 'react';
|
||||
import { EuiLinkProps } from '@elastic/eui/src/components/link/link';
|
||||
import type { CSSProperties } from 'react';
|
||||
import React, { memo } from 'react';
|
||||
import type { EuiLinkProps } from '@elastic/eui/src/components/link/link';
|
||||
|
||||
const MIN_WIDTH: CSSProperties = { minWidth: 0 };
|
||||
const NO_WRAP_WHITE_SPACE: CSSProperties = { whiteSpace: 'nowrap' };
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
*/
|
||||
|
||||
import React, { memo } from 'react';
|
||||
import { EuiLink, EuiLinkAnchorProps } from '@elastic/eui';
|
||||
import type { EuiLinkAnchorProps } from '@elastic/eui';
|
||||
import { EuiLink } from '@elastic/eui';
|
||||
|
||||
import { useLink } from '../hooks';
|
||||
import { AGENT_SAVED_OBJECT_TYPE } from '../constants';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui';
|
||||
import { EuiLoadingSpinnerSize } from '@elastic/eui/src/components/loading/loading_spinner';
|
||||
import type { EuiLoadingSpinnerSize } from '@elastic/eui/src/components/loading/loading_spinner';
|
||||
|
||||
export const Loading: React.FunctionComponent<{ size?: EuiLoadingSpinnerSize }> = ({ size }) => (
|
||||
<EuiFlexGroup justifyContent="spaceAround">
|
||||
|
|
|
@ -6,9 +6,11 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { EuiIcon, EuiIconProps } from '@elastic/eui';
|
||||
import type { EuiIconProps } from '@elastic/eui';
|
||||
import { EuiIcon } from '@elastic/eui';
|
||||
|
||||
import { usePackageIconType, UsePackageIconType } from '../hooks';
|
||||
import type { UsePackageIconType } from '../hooks';
|
||||
import { usePackageIconType } from '../hooks';
|
||||
|
||||
export const PackageIcon: React.FunctionComponent<
|
||||
UsePackageIconType & Omit<EuiIconProps, 'type'>
|
||||
|
|
|
@ -7,11 +7,8 @@
|
|||
|
||||
import React, { useState, useEffect, useMemo } from 'react';
|
||||
|
||||
import {
|
||||
QueryStringInput,
|
||||
IFieldType,
|
||||
esKuery,
|
||||
} from '../../../../../../../src/plugins/data/public';
|
||||
import type { IFieldType } from '../../../../../../../src/plugins/data/public';
|
||||
import { QueryStringInput, esKuery } from '../../../../../../../src/plugins/data/public';
|
||||
import { useStartServices } from '../hooks';
|
||||
import { INDEX_NAME, AGENT_SAVED_OBJECT_TYPE } from '../constants';
|
||||
|
||||
|
|
|
@ -6,9 +6,10 @@
|
|||
*/
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { ChromeBreadcrumb } from 'src/core/public';
|
||||
import type { ChromeBreadcrumb } from 'src/core/public';
|
||||
|
||||
import { BASE_PATH, Page, DynamicPagePathValues, pagePathGetters } from '../constants';
|
||||
import type { Page, DynamicPagePathValues } from '../constants';
|
||||
import { BASE_PATH, pagePathGetters } from '../constants';
|
||||
|
||||
import { useStartServices } from './use_core';
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React, { useState, useContext, useEffect } from 'react';
|
||||
|
||||
import { GetFleetStatusResponse } from '../types';
|
||||
import type { GetFleetStatusResponse } from '../types';
|
||||
|
||||
import { useConfig } from './use_config';
|
||||
import { sendGetFleetStatus } from './use_request';
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
*/
|
||||
|
||||
import React, { memo, useContext, useMemo } from 'react';
|
||||
import { AppMountParameters } from 'kibana/public';
|
||||
import type { AppMountParameters } from 'kibana/public';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
import { AnyIntraAppRouteState } from '../types';
|
||||
import type { AnyIntraAppRouteState } from '../types';
|
||||
|
||||
interface IntraAppState<S extends AnyIntraAppRouteState = AnyIntraAppRouteState> {
|
||||
forRoute: string;
|
||||
|
|
|
@ -9,18 +9,18 @@ import { useState, useEffect } from 'react';
|
|||
import type { HttpSetup } from 'src/core/public';
|
||||
|
||||
import {
|
||||
UseRequestConfig as _UseRequestConfig,
|
||||
sendRequest as _sendRequest,
|
||||
useRequest as _useRequest,
|
||||
} from '../../../../../../../../src/plugins/es_ui_shared/public';
|
||||
import type {
|
||||
SendRequestConfig,
|
||||
SendRequestResponse,
|
||||
UseRequestConfig,
|
||||
} from '../../../../../../../../src/plugins/es_ui_shared/public';
|
||||
|
||||
let httpClient: HttpSetup;
|
||||
|
||||
export type UseRequestConfig = _UseRequestConfig;
|
||||
export type { UseRequestConfig } from '../../../../../../../../src/plugins/es_ui_shared/public';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { useState } from 'react';
|
||||
import { CriteriaWithPagination } from '@elastic/eui/src/components/basic_table/basic_table';
|
||||
import type { CriteriaWithPagination } from '@elastic/eui/src/components/basic_table/basic_table';
|
||||
|
||||
export function useSorting<T>(defaultSorting: CriteriaWithPagination<T>['sort']) {
|
||||
const [sorting, setSorting] = useState<CriteriaWithPagination<T>['sort']>(defaultSorting);
|
||||
|
|
|
@ -7,13 +7,14 @@
|
|||
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Redirect, Route, RouteProps } from 'react-router-dom';
|
||||
import { CoreStart, AppMountParameters } from 'src/core/public';
|
||||
import type { RouteProps } from 'react-router-dom';
|
||||
import { Redirect, Route } from 'react-router-dom';
|
||||
import type { CoreStart, AppMountParameters } from 'src/core/public';
|
||||
|
||||
import { FleetConfigType, FleetStartServices } from '../../plugin';
|
||||
import type { FleetConfigType, FleetStartServices } from '../../plugin';
|
||||
|
||||
import { licenseService } from './hooks';
|
||||
import { UIExtensionsStorage } from './types';
|
||||
import type { UIExtensionsStorage } from './types';
|
||||
import { AppRoutes, FleetAppContext, WithPermissionsAndSetup } from './app';
|
||||
|
||||
export interface ProtectedRouteProps extends RouteProps {
|
||||
|
|
|
@ -10,7 +10,7 @@ import styled from 'styled-components';
|
|||
import { EuiTabs, EuiTab, EuiFlexGroup, EuiFlexItem, EuiButtonEmpty } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { Section } from '../sections';
|
||||
import type { Section } from '../sections';
|
||||
import { AlphaMessaging, SettingFlyout } from '../components';
|
||||
import { useLink, useConfig } from '../hooks';
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
import React, { Fragment } from 'react';
|
||||
import { EuiPageBody, EuiSpacer } from '@elastic/eui';
|
||||
|
||||
import { Header, HeaderProps } from '../components';
|
||||
import type { HeaderProps } from '../components';
|
||||
import { Header } from '../components';
|
||||
|
||||
import { Page, ContentWrapper } from './without_header';
|
||||
|
||||
|
|
|
@ -5,19 +5,21 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { createMemoryHistory, History, createHashHistory } from 'history';
|
||||
import type { History } from 'history';
|
||||
import { createMemoryHistory, createHashHistory } from 'history';
|
||||
import React, { memo } from 'react';
|
||||
import { render as reactRender, RenderOptions, RenderResult, act } from '@testing-library/react';
|
||||
import type { RenderOptions, RenderResult } from '@testing-library/react';
|
||||
import { render as reactRender, act } from '@testing-library/react';
|
||||
|
||||
import { ScopedHistory } from '../../../../../../../src/core/public';
|
||||
import { FleetAppContext } from '../app';
|
||||
import { FleetConfigType } from '../../../plugin';
|
||||
import { UIExtensionsStorage } from '../types';
|
||||
import type { FleetConfigType } from '../../../plugin';
|
||||
import type { UIExtensionsStorage } from '../types';
|
||||
|
||||
import { createConfigurationMock } from './plugin_configuration';
|
||||
import { createStartMock } from './plugin_interfaces';
|
||||
import { createStartServices } from './fleet_start_services';
|
||||
import { MockedFleetStart, MockedFleetStartServices } from './types';
|
||||
import type { MockedFleetStart, MockedFleetStartServices } from './types';
|
||||
|
||||
type UiRender = (ui: React.ReactElement, options?: RenderOptions) => RenderResult;
|
||||
|
||||
|
|
|
@ -7,14 +7,15 @@
|
|||
|
||||
import React from 'react';
|
||||
import { I18nProvider } from '@kbn/i18n/react';
|
||||
import { MockedKeys } from '@kbn/utility-types/jest';
|
||||
import type { MockedKeys } from '@kbn/utility-types/jest';
|
||||
|
||||
import { coreMock } from '../../../../../../../src/core/public/mocks';
|
||||
import { IStorage, Storage } from '../../../../../../../src/plugins/kibana_utils/public';
|
||||
import type { IStorage } from '../../../../../../../src/plugins/kibana_utils/public';
|
||||
import { Storage } from '../../../../../../../src/plugins/kibana_utils/public';
|
||||
import { setHttpClient } from '../hooks/use_request';
|
||||
|
||||
import { createStartDepsMock } from './plugin_dependencies';
|
||||
import { MockedFleetStartServices } from './types';
|
||||
import type { MockedFleetStartServices } from './types';
|
||||
|
||||
// Taken from core. See: src/plugins/kibana_utils/public/storage/storage.test.ts
|
||||
const createMockStore = (): MockedKeys<IStorage> => {
|
||||
|
|
|
@ -9,7 +9,7 @@ import React, { memo, useState, useMemo } from 'react';
|
|||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { EuiContextMenuItem, EuiPortal } from '@elastic/eui';
|
||||
|
||||
import { AgentPolicy } from '../../../types';
|
||||
import type { AgentPolicy } from '../../../types';
|
||||
import { useCapabilities } from '../../../hooks';
|
||||
import { ContextMenuActions } from '../../../components';
|
||||
import { AgentEnrollmentFlyout } from '../../agents/components';
|
||||
|
|
|
@ -10,7 +10,7 @@ import { EuiConfirmModal, EuiFormRow, EuiFieldText } from '@elastic/eui';
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { AgentPolicy } from '../../../types';
|
||||
import type { AgentPolicy } from '../../../types';
|
||||
import { sendCopyAgentPolicy, useStartServices } from '../../../hooks';
|
||||
|
||||
interface Props {
|
||||
|
|
|
@ -26,7 +26,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import styled from 'styled-components';
|
||||
|
||||
import { dataTypes } from '../../../../../../common';
|
||||
import { NewAgentPolicy, AgentPolicy } from '../../../types';
|
||||
import type { NewAgentPolicy, AgentPolicy } from '../../../types';
|
||||
import { isValidNamespace } from '../../../services';
|
||||
|
||||
import { AgentPolicyDeleteProvider } from './agent_policy_delete_provider';
|
||||
|
|
|
@ -10,7 +10,7 @@ import { EuiCallOut, EuiConfirmModal, EuiSpacer } from '@elastic/eui';
|
|||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { AgentPolicy } from '../../../types';
|
||||
import type { AgentPolicy } from '../../../types';
|
||||
|
||||
export const ConfirmDeployAgentPolicyModal: React.FunctionComponent<{
|
||||
onConfirm: () => void;
|
||||
|
|
|
@ -12,7 +12,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
|
|||
|
||||
import { useStartServices, sendRequest, sendDeletePackagePolicy, useConfig } from '../../../hooks';
|
||||
import { AGENT_API_ROUTES, AGENT_SAVED_OBJECT_TYPE } from '../../../constants';
|
||||
import { AgentPolicy } from '../../../types';
|
||||
import type { AgentPolicy } from '../../../types';
|
||||
|
||||
interface Props {
|
||||
agentPolicy: AgentPolicy;
|
||||
|
|
|
@ -19,9 +19,9 @@ import {
|
|||
} from '@elastic/eui';
|
||||
|
||||
import { WithHeaderLayout } from '../../../../layouts';
|
||||
import { AgentPolicy, PackageInfo } from '../../../../types';
|
||||
import type { AgentPolicy, PackageInfo } from '../../../../types';
|
||||
import { PackageIcon } from '../../../../components/package_icon';
|
||||
import { CreatePackagePolicyFrom } from '../types';
|
||||
import type { CreatePackagePolicyFrom } from '../types';
|
||||
|
||||
export const CreatePackagePolicyPageLayout: React.FunctionComponent<{
|
||||
from: CreatePackagePolicyFrom;
|
||||
|
|
|
@ -17,12 +17,9 @@ import {
|
|||
EuiButtonEmpty,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { NewPackagePolicyInput, RegistryVarsEntry } from '../../../../types';
|
||||
import {
|
||||
isAdvancedVar,
|
||||
PackagePolicyConfigValidationResults,
|
||||
validationHasErrors,
|
||||
} from '../services';
|
||||
import type { NewPackagePolicyInput, RegistryVarsEntry } from '../../../../types';
|
||||
import type { PackagePolicyConfigValidationResults } from '../services';
|
||||
import { isAdvancedVar, validationHasErrors } from '../services';
|
||||
|
||||
import { PackagePolicyInputVarField } from './package_policy_input_var_field';
|
||||
|
||||
|
|
|
@ -19,17 +19,14 @@ import {
|
|||
EuiSpacer,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import {
|
||||
import type {
|
||||
NewPackagePolicyInput,
|
||||
PackagePolicyInputStream,
|
||||
RegistryInput,
|
||||
RegistryStream,
|
||||
} from '../../../../types';
|
||||
import {
|
||||
PackagePolicyInputValidationResults,
|
||||
hasInvalidButRequiredVar,
|
||||
countValidationErrors,
|
||||
} from '../services';
|
||||
import type { PackagePolicyInputValidationResults } from '../services';
|
||||
import { hasInvalidButRequiredVar, countValidationErrors } from '../services';
|
||||
|
||||
import { PackagePolicyInputConfig } from './package_policy_input_config';
|
||||
import { PackagePolicyInputStreamConfig } from './package_policy_input_stream';
|
||||
|
|
|
@ -19,12 +19,13 @@ import {
|
|||
EuiButtonEmpty,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { NewPackagePolicyInputStream, RegistryStream, RegistryVarsEntry } from '../../../../types';
|
||||
import {
|
||||
isAdvancedVar,
|
||||
PackagePolicyConfigValidationResults,
|
||||
validationHasErrors,
|
||||
} from '../services';
|
||||
import type {
|
||||
NewPackagePolicyInputStream,
|
||||
RegistryStream,
|
||||
RegistryVarsEntry,
|
||||
} from '../../../../types';
|
||||
import type { PackagePolicyConfigValidationResults } from '../services';
|
||||
import { isAdvancedVar, validationHasErrors } from '../services';
|
||||
|
||||
import { PackagePolicyInputVarField } from './package_policy_input_var_field';
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
EuiFieldPassword,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { RegistryVarsEntry } from '../../../../types';
|
||||
import type { RegistryVarsEntry } from '../../../../types';
|
||||
|
||||
import 'brace/mode/yaml';
|
||||
import 'brace/theme/textmate';
|
||||
|
|
|
@ -9,9 +9,10 @@ import { Route } from 'react-router-dom';
|
|||
import React from 'react';
|
||||
import { act } from 'react-test-renderer';
|
||||
|
||||
import { createTestRendererMock, MockedFleetStartServices, TestRenderer } from '../../../mock';
|
||||
import type { MockedFleetStartServices, TestRenderer } from '../../../mock';
|
||||
import { createTestRendererMock } from '../../../mock';
|
||||
import { PAGE_ROUTING_PATHS, pagePathGetters, PLUGIN_ID } from '../../../constants';
|
||||
import { CreatePackagePolicyRouteState } from '../../../types';
|
||||
import type { CreatePackagePolicyRouteState } from '../../../types';
|
||||
|
||||
import { CreatePackagePolicyPage } from './index';
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import React, { useState, useEffect, useMemo, useCallback, ReactEventHandler } from 'react';
|
||||
import type { ReactEventHandler } from 'react';
|
||||
import React, { useState, useEffect, useMemo, useCallback } from 'react';
|
||||
import { useRouteMatch, useHistory } from 'react-router-dom';
|
||||
import styled from 'styled-components';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
@ -19,10 +20,10 @@ import {
|
|||
EuiFlexItem,
|
||||
EuiSpacer,
|
||||
} from '@elastic/eui';
|
||||
import { EuiStepProps } from '@elastic/eui/src/components/steps/step';
|
||||
import { ApplicationStart } from 'kibana/public';
|
||||
import type { EuiStepProps } from '@elastic/eui/src/components/steps/step';
|
||||
import type { ApplicationStart } from 'kibana/public';
|
||||
|
||||
import {
|
||||
import type {
|
||||
AgentPolicy,
|
||||
PackageInfo,
|
||||
NewPackagePolicy,
|
||||
|
@ -41,17 +42,14 @@ import { ConfirmDeployAgentPolicyModal } from '../components';
|
|||
import { useIntraAppState } from '../../../hooks/use_intra_app_state';
|
||||
import { useUIExtension } from '../../../hooks/use_ui_extension';
|
||||
import { ExtensionWrapper } from '../../../components/extension_wrapper';
|
||||
import { PackagePolicyEditExtensionComponentProps } from '../../../types';
|
||||
import type { PackagePolicyEditExtensionComponentProps } from '../../../types';
|
||||
import { PLUGIN_ID } from '../../../../../../common/constants';
|
||||
import { pkgKeyFromPackageInfo } from '../../../services/pkg_key_from_package_info';
|
||||
|
||||
import { CreatePackagePolicyPageLayout } from './components';
|
||||
import { CreatePackagePolicyFrom, PackagePolicyFormState } from './types';
|
||||
import {
|
||||
PackagePolicyValidationResults,
|
||||
validatePackagePolicy,
|
||||
validationHasErrors,
|
||||
} from './services';
|
||||
import type { CreatePackagePolicyFrom, PackagePolicyFormState } from './types';
|
||||
import type { PackagePolicyValidationResults } from './services';
|
||||
import { validatePackagePolicy, validationHasErrors } from './services';
|
||||
import { StepSelectPackage } from './step_select_package';
|
||||
import { StepSelectAgentPolicy } from './step_select_agent_policy';
|
||||
import { StepConfigurePackagePolicy } from './step_configure_package';
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import {
|
||||
import type {
|
||||
PackageInfo,
|
||||
RegistryStream,
|
||||
NewPackagePolicy,
|
||||
|
@ -23,9 +23,9 @@ import {
|
|||
} from '../../../types';
|
||||
import { Loading } from '../../../components';
|
||||
|
||||
import { PackagePolicyValidationResults } from './services';
|
||||
import type { PackagePolicyValidationResults } from './services';
|
||||
import { PackagePolicyInputPanel } from './components';
|
||||
import { CreatePackagePolicyFrom } from './types';
|
||||
import type { CreatePackagePolicyFrom } from './types';
|
||||
|
||||
const findStreamsForInputType = (
|
||||
inputType: string,
|
||||
|
|
|
@ -19,12 +19,12 @@ import {
|
|||
EuiFlexItem,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { AgentPolicy, PackageInfo, PackagePolicy, NewPackagePolicy } from '../../../types';
|
||||
import type { AgentPolicy, PackageInfo, PackagePolicy, NewPackagePolicy } from '../../../types';
|
||||
import { packageToPackagePolicyInputs } from '../../../services';
|
||||
import { Loading } from '../../../components';
|
||||
import { pkgKeyFromPackageInfo } from '../../../services/pkg_key_from_package_info';
|
||||
|
||||
import { PackagePolicyValidationResults } from './services';
|
||||
import type { PackagePolicyValidationResults } from './services';
|
||||
|
||||
export const StepDefinePackagePolicy: React.FunctionComponent<{
|
||||
agentPolicy: AgentPolicy;
|
||||
|
|
|
@ -9,11 +9,11 @@ import React, { useEffect, useState, useMemo } from 'react';
|
|||
import styled from 'styled-components';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import type { EuiComboBoxOptionOption } from '@elastic/eui';
|
||||
import {
|
||||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
EuiComboBox,
|
||||
EuiComboBoxOptionOption,
|
||||
EuiTextColor,
|
||||
EuiPortal,
|
||||
EuiFormRow,
|
||||
|
@ -21,7 +21,7 @@ import {
|
|||
} from '@elastic/eui';
|
||||
|
||||
import { Error } from '../../../components';
|
||||
import { AgentPolicy, PackageInfo, GetAgentPoliciesResponseItem } from '../../../types';
|
||||
import type { AgentPolicy, PackageInfo, GetAgentPoliciesResponseItem } from '../../../types';
|
||||
import { isPackageLimited, doesAgentPolicyAlreadyIncludePackage } from '../../../services';
|
||||
import {
|
||||
useGetPackageInfoByKey,
|
||||
|
|
|
@ -11,7 +11,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
|
|||
import { EuiFlexGroup, EuiFlexItem, EuiSelectable, EuiSpacer } from '@elastic/eui';
|
||||
|
||||
import { Error } from '../../../components';
|
||||
import { AgentPolicy, PackageInfo, PackagePolicy, GetPackagesResponse } from '../../../types';
|
||||
import type { AgentPolicy, PackageInfo, PackagePolicy, GetPackagesResponse } from '../../../types';
|
||||
import {
|
||||
useGetOneAgentPolicy,
|
||||
useGetPackages,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React, { memo } from 'react';
|
||||
|
||||
import { AgentPolicy, PackagePolicy } from '../../../../../types';
|
||||
import type { AgentPolicy, PackagePolicy } from '../../../../../types';
|
||||
|
||||
import { NoPackagePolicies } from './no_package_policies';
|
||||
import { PackagePoliciesTable } from './package_policies_table';
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
import React, { useMemo } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import type { EuiInMemoryTableProps } from '@elastic/eui';
|
||||
import {
|
||||
EuiInMemoryTable,
|
||||
EuiInMemoryTableProps,
|
||||
EuiBadge,
|
||||
EuiContextMenuItem,
|
||||
EuiButton,
|
||||
|
@ -19,7 +19,7 @@ import {
|
|||
EuiText,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { AgentPolicy, PackagePolicy } from '../../../../../types';
|
||||
import type { AgentPolicy, PackagePolicy } from '../../../../../types';
|
||||
import { PackageIcon, ContextMenuActions } from '../../../../../components';
|
||||
import { PackagePolicyDeleteProvider, DangerEuiContextMenuItem } from '../../../components';
|
||||
import { useCapabilities, useLink } from '../../../../../hooks';
|
||||
|
|
|
@ -12,7 +12,7 @@ import { EuiBottomBar, EuiFlexGroup, EuiFlexItem, EuiButtonEmpty, EuiButton } fr
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { AgentPolicy } from '../../../../../types';
|
||||
import type { AgentPolicy } from '../../../../../types';
|
||||
import {
|
||||
useLink,
|
||||
useStartServices,
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
import React from 'react';
|
||||
|
||||
import { useRequest } from '../../../../hooks';
|
||||
import { GetAgentStatusResponse } from '../../../../types';
|
||||
import type { GetAgentStatusResponse } from '../../../../types';
|
||||
import { agentRouteService } from '../../../../services';
|
||||
import { UseRequestConfig } from '../../../../hooks/use_request/use_request';
|
||||
import type { UseRequestConfig } from '../../../../hooks/use_request/use_request';
|
||||
|
||||
type RequestOptions = Pick<Partial<UseRequestConfig>, 'pollIntervalMs'>;
|
||||
|
||||
|
|
|
@ -20,10 +20,10 @@ import {
|
|||
EuiDescriptionListTitle,
|
||||
EuiDescriptionListDescription,
|
||||
} from '@elastic/eui';
|
||||
import { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab';
|
||||
import type { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { AgentPolicy, AgentPolicyDetailsDeployAgentAction } from '../../../types';
|
||||
import type { AgentPolicy, AgentPolicyDetailsDeployAgentAction } from '../../../types';
|
||||
import { PAGE_ROUTING_PATHS } from '../../../constants';
|
||||
import {
|
||||
useGetOneAgentPolicy,
|
||||
|
|
|
@ -18,7 +18,7 @@ import {
|
|||
EuiSpacer,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { AgentPolicy, PackageInfo, UpdatePackagePolicy } from '../../../types';
|
||||
import type { AgentPolicy, PackageInfo, UpdatePackagePolicy } from '../../../types';
|
||||
import {
|
||||
useLink,
|
||||
useBreadcrumbs,
|
||||
|
@ -33,12 +33,9 @@ import {
|
|||
import { Loading, Error } from '../../../components';
|
||||
import { ConfirmDeployAgentPolicyModal } from '../components';
|
||||
import { CreatePackagePolicyPageLayout } from '../create_package_policy_page/components';
|
||||
import {
|
||||
PackagePolicyValidationResults,
|
||||
validatePackagePolicy,
|
||||
validationHasErrors,
|
||||
} from '../create_package_policy_page/services';
|
||||
import {
|
||||
import type { PackagePolicyValidationResults } from '../create_package_policy_page/services';
|
||||
import { validatePackagePolicy, validationHasErrors } from '../create_package_policy_page/services';
|
||||
import type {
|
||||
PackagePolicyFormState,
|
||||
CreatePackagePolicyFrom,
|
||||
} from '../create_package_policy_page/types';
|
||||
|
@ -46,8 +43,8 @@ import { StepConfigurePackagePolicy } from '../create_package_policy_page/step_c
|
|||
import { StepDefinePackagePolicy } from '../create_package_policy_page/step_define_package_policy';
|
||||
import { useUIExtension } from '../../../hooks/use_ui_extension';
|
||||
import { ExtensionWrapper } from '../../../components/extension_wrapper';
|
||||
import { GetOnePackagePolicyResponse } from '../../../../../../common/types/rest_spec';
|
||||
import { PackagePolicyEditExtensionComponentProps } from '../../../types';
|
||||
import type { GetOnePackagePolicyResponse } from '../../../../../../common/types/rest_spec';
|
||||
import type { PackagePolicyEditExtensionComponentProps } from '../../../types';
|
||||
import { pkgKeyFromPackageInfo } from '../../../services/pkg_key_from_package_info';
|
||||
|
||||
export const EditPackagePolicyPage = memo(() => {
|
||||
|
|
|
@ -9,6 +9,7 @@ import React, { useState } from 'react';
|
|||
import styled from 'styled-components';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import type { EuiFlyoutProps } from '@elastic/eui';
|
||||
import {
|
||||
EuiFlyout,
|
||||
EuiFlyoutHeader,
|
||||
|
@ -20,12 +21,11 @@ import {
|
|||
EuiButtonEmpty,
|
||||
EuiButton,
|
||||
EuiText,
|
||||
EuiFlyoutProps,
|
||||
EuiSpacer,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { dataTypes } from '../../../../../../../common';
|
||||
import { NewAgentPolicy, AgentPolicy } from '../../../../types';
|
||||
import type { NewAgentPolicy, AgentPolicy } from '../../../../types';
|
||||
import { useCapabilities, useStartServices, sendCreateAgentPolicy } from '../../../../hooks';
|
||||
import { AgentPolicyForm, agentPolicyFormValidation } from '../../components';
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import type { EuiTableActionsColumnType, EuiTableFieldDataColumnType } from '@elastic/eui';
|
||||
import {
|
||||
EuiSpacer,
|
||||
EuiText,
|
||||
|
@ -15,16 +16,14 @@ import {
|
|||
EuiEmptyPrompt,
|
||||
EuiBasicTable,
|
||||
EuiLink,
|
||||
EuiTableActionsColumnType,
|
||||
EuiTableFieldDataColumnType,
|
||||
EuiTextColor,
|
||||
} from '@elastic/eui';
|
||||
import { CriteriaWithPagination } from '@elastic/eui/src/components/basic_table/basic_table';
|
||||
import type { CriteriaWithPagination } from '@elastic/eui/src/components/basic_table/basic_table';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage, FormattedDate } from '@kbn/i18n/react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
|
||||
import { AgentPolicy } from '../../../types';
|
||||
import type { AgentPolicy } from '../../../types';
|
||||
import { AGENT_POLICY_SAVED_OBJECT_TYPE } from '../../../constants';
|
||||
import { WithHeaderLayout } from '../../../layouts';
|
||||
import {
|
||||
|
|
|
@ -9,7 +9,7 @@ import React, { memo, useState, useMemo } from 'react';
|
|||
import { EuiPortal, EuiContextMenuItem } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { Agent } from '../../../../types';
|
||||
import type { Agent } from '../../../../types';
|
||||
import { useCapabilities, useKibanaVersion } from '../../../../hooks';
|
||||
import { ContextMenuActions } from '../../../../components';
|
||||
import {
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
import React, { memo, useMemo } from 'react';
|
||||
import type { EuiBasicTableProps } from '@elastic/eui';
|
||||
import {
|
||||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
|
@ -16,12 +17,11 @@ import {
|
|||
EuiPanel,
|
||||
EuiButtonIcon,
|
||||
EuiBasicTable,
|
||||
EuiBasicTableProps,
|
||||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { Agent, AgentPolicy, PackagePolicy, PackagePolicyInput } from '../../../../../types';
|
||||
import type { Agent, AgentPolicy, PackagePolicy, PackagePolicyInput } from '../../../../../types';
|
||||
import { useLink } from '../../../../../hooks';
|
||||
import { PackageIcon } from '../../../../../components';
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import {
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { Agent, AgentPolicy } from '../../../../../types';
|
||||
import type { Agent, AgentPolicy } from '../../../../../types';
|
||||
import { useKibanaVersion, useLink } from '../../../../../hooks';
|
||||
import { isAgentUpgradeable } from '../../../../../services';
|
||||
import { AgentPolicyPackageBadges } from '../../../components/agent_policy_package_badges';
|
||||
|
|
|
@ -10,7 +10,7 @@ import styled from 'styled-components';
|
|||
import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiSpacer } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { Agent, AgentPolicy } from '../../../../../types';
|
||||
import type { Agent, AgentPolicy } from '../../../../../types';
|
||||
|
||||
import { AgentDetailsOverviewSection } from './agent_details_overview';
|
||||
import { AgentDetailsIntegrationsSection } from './agent_details_integrations';
|
||||
|
|
|
@ -28,9 +28,10 @@ import semverCoerce from 'semver/functions/coerce';
|
|||
|
||||
import { createStateContainerReactHelpers } from '../../../../../../../../../../../src/plugins/kibana_utils/public';
|
||||
import { RedirectAppLinks } from '../../../../../../../../../../../src/plugins/kibana_react/public';
|
||||
import { TimeRange, esKuery } from '../../../../../../../../../../../src/plugins/data/public';
|
||||
import type { TimeRange } from '../../../../../../../../../../../src/plugins/data/public';
|
||||
import { esKuery } from '../../../../../../../../../../../src/plugins/data/public';
|
||||
import { LogStream } from '../../../../../../../../../infra/public';
|
||||
import { Agent } from '../../../../../types';
|
||||
import type { Agent } from '../../../../../types';
|
||||
import { useStartServices } from '../../../../../hooks';
|
||||
|
||||
import { DEFAULT_DATE_RANGE } from './constants';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { AgentLogsState } from './agent_logs';
|
||||
import type { AgentLogsState } from './agent_logs';
|
||||
|
||||
export const AGENT_LOG_INDEX_PATTERN = 'logs-elastic_agent-*,logs-elastic_agent.*-*';
|
||||
export const AGENT_DATASET = 'elastic_agent';
|
||||
|
|
|
@ -7,17 +7,20 @@
|
|||
|
||||
import React, { memo, useEffect, useState, useMemo } from 'react';
|
||||
|
||||
import type {
|
||||
INullableBaseStateContainer,
|
||||
PureTransition,
|
||||
} from '../../../../../../../../../../../src/plugins/kibana_utils/public';
|
||||
import {
|
||||
createStateContainer,
|
||||
syncState,
|
||||
createKbnUrlStateStorage,
|
||||
INullableBaseStateContainer,
|
||||
PureTransition,
|
||||
getStateFromKbnUrl,
|
||||
} from '../../../../../../../../../../../src/plugins/kibana_utils/public';
|
||||
|
||||
import { DEFAULT_LOGS_STATE, STATE_STORAGE_KEY } from './constants';
|
||||
import { AgentLogsUI, AgentLogsProps, AgentLogsState, AgentLogsUrlStateHelper } from './agent_logs';
|
||||
import type { AgentLogsProps, AgentLogsState } from './agent_logs';
|
||||
import { AgentLogsUI, AgentLogsUrlStateHelper } from './agent_logs';
|
||||
|
||||
export const AgentLogs: React.FunctionComponent<Pick<AgentLogsProps, 'agent'>> = memo(
|
||||
({ agent }) => {
|
||||
|
|
|
@ -8,10 +8,8 @@
|
|||
import React, { memo, useState, useEffect } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import {
|
||||
QueryStringInput,
|
||||
IFieldType,
|
||||
} from '../../../../../../../../../../../src/plugins/data/public';
|
||||
import type { IFieldType } from '../../../../../../../../../../../src/plugins/data/public';
|
||||
import { QueryStringInput } from '../../../../../../../../../../../src/plugins/data/public';
|
||||
import { useStartServices } from '../../../../../hooks';
|
||||
|
||||
import {
|
||||
|
|
|
@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { EuiSelect, EuiFormLabel, EuiButtonEmpty, EuiFlexItem, EuiFlexGroup } from '@elastic/eui';
|
||||
|
||||
import { Agent } from '../../../../../types';
|
||||
import type { Agent } from '../../../../../types';
|
||||
import { sendPostAgentAction, useStartServices } from '../../../../../hooks';
|
||||
|
||||
import { AGENT_LOG_LEVELS, DEFAULT_LOG_LEVEL } from './constants';
|
||||
|
|
|
@ -17,12 +17,12 @@ import {
|
|||
EuiDescriptionListTitle,
|
||||
EuiDescriptionListDescription,
|
||||
} from '@elastic/eui';
|
||||
import { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab';
|
||||
import type { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab';
|
||||
import { FormattedMessage, FormattedRelative } from '@kbn/i18n/react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { EuiIconTip } from '@elastic/eui';
|
||||
|
||||
import { Agent, AgentPolicy, AgentDetailsReassignPolicyAction } from '../../../types';
|
||||
import type { Agent, AgentPolicy, AgentDetailsReassignPolicyAction } from '../../../types';
|
||||
import { PAGE_ROUTING_PATHS } from '../../../constants';
|
||||
import { Loading, Error } from '../../../components';
|
||||
import {
|
||||
|
|
|
@ -20,7 +20,7 @@ import {
|
|||
import { FormattedMessage, FormattedNumber } from '@kbn/i18n/react';
|
||||
|
||||
import { SO_SEARCH_LIMIT } from '../../../../constants';
|
||||
import { Agent } from '../../../../types';
|
||||
import type { Agent } from '../../../../types';
|
||||
import {
|
||||
AgentReassignAgentPolicyFlyout,
|
||||
AgentUnenrollAgentModal,
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { AgentPolicy } from '../../../../types';
|
||||
import type { AgentPolicy } from '../../../../types';
|
||||
import { SearchBar } from '../../../../components';
|
||||
import { AGENTS_INDEX } from '../../../../constants';
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
getColorForAgentStatus,
|
||||
getLabelForAgentStatus,
|
||||
} from '../../services/agent_status';
|
||||
import { SimplifiedAgentStatus } from '../../../../types';
|
||||
import type { SimplifiedAgentStatus } from '../../../../types';
|
||||
|
||||
export const AgentStatusBadges: React.FC<{
|
||||
showInactive?: boolean;
|
||||
|
|
|
@ -10,7 +10,7 @@ import { EuiColorPaletteDisplay } from '@elastic/eui';
|
|||
import React, { useMemo } from 'react';
|
||||
|
||||
import { AGENT_STATUSES, getColorForAgentStatus } from '../../services/agent_status';
|
||||
import { SimplifiedAgentStatus } from '../../../../types';
|
||||
import type { SimplifiedAgentStatus } from '../../../../types';
|
||||
|
||||
const StyledEuiColorPaletteDisplay = styled(EuiColorPaletteDisplay)`
|
||||
&.ingest-agent-status-bar {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React from 'react';
|
||||
import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
|
||||
|
||||
import { Agent, SimplifiedAgentStatus } from '../../../../types';
|
||||
import type { Agent, SimplifiedAgentStatus } from '../../../../types';
|
||||
|
||||
import { AgentStatusBar } from './status_bar';
|
||||
import { AgentBulkActions } from './bulk_actions';
|
||||
|
|
|
@ -23,7 +23,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { FormattedMessage, FormattedRelative } from '@kbn/i18n/react';
|
||||
|
||||
import { AgentEnrollmentFlyout } from '../components';
|
||||
import { Agent, AgentPolicy, SimplifiedAgentStatus } from '../../../types';
|
||||
import type { Agent, AgentPolicy, SimplifiedAgentStatus } from '../../../types';
|
||||
import {
|
||||
usePagination,
|
||||
useCapabilities,
|
||||
|
@ -48,7 +48,7 @@ import {
|
|||
} from '../components';
|
||||
|
||||
import { AgentTableHeader } from './components/table_header';
|
||||
import { SelectionMode } from './components/bulk_actions';
|
||||
import type { SelectionMode } from './components/bulk_actions';
|
||||
import { SearchAndFilterBar } from './components/search_and_filter_bar';
|
||||
|
||||
const REFRESH_INTERVAL_MS = 30000;
|
||||
|
|
|
@ -11,7 +11,7 @@ import { FormattedMessage } from '@kbn/i18n/react';
|
|||
import { EuiSelect, EuiSpacer, EuiText, EuiButtonEmpty } from '@elastic/eui';
|
||||
|
||||
import { SO_SEARCH_LIMIT } from '../../../../constants';
|
||||
import { AgentPolicy, GetEnrollmentAPIKeysResponse } from '../../../../types';
|
||||
import type { AgentPolicy, GetEnrollmentAPIKeysResponse } from '../../../../types';
|
||||
import { sendGetEnrollmentAPIKeys, useStartServices } from '../../../../hooks';
|
||||
import { AgentPolicyPackageBadges } from '../agent_policy_package_badges';
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import {
|
|||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { AgentPolicy } from '../../../../types';
|
||||
import type { AgentPolicy } from '../../../../types';
|
||||
|
||||
import { ManagedInstructions } from './managed_instructions';
|
||||
import { StandaloneInstructions } from './standalone_instructions';
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
|
||||
import React, { useState } from 'react';
|
||||
import { EuiSteps, EuiLink, EuiText, EuiSpacer } from '@elastic/eui';
|
||||
import { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps';
|
||||
import type { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { AgentPolicy } from '../../../../types';
|
||||
import type { AgentPolicy } from '../../../../types';
|
||||
import {
|
||||
useGetOneEnrollmentAPIKey,
|
||||
useStartServices,
|
||||
|
|
|
@ -18,11 +18,11 @@ import {
|
|||
EuiCopy,
|
||||
EuiLink,
|
||||
} from '@elastic/eui';
|
||||
import { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps';
|
||||
import type { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { AgentPolicy } from '../../../../types';
|
||||
import type { AgentPolicy } from '../../../../types';
|
||||
import { useStartServices, useLink, sendGetOneAgentPolicyFull } from '../../../../hooks';
|
||||
import { fullAgentPolicyToYaml, agentPolicyRouteService } from '../../../../services';
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ import { EuiText, EuiButton, EuiSpacer } from '@elastic/eui';
|
|||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { AgentPolicy } from '../../../../types';
|
||||
import type { AgentPolicy } from '../../../../types';
|
||||
|
||||
import { EnrollmentStepAgentPolicy } from './agent_policy_selection';
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ import React from 'react';
|
|||
import { FormattedMessage, FormattedRelative } from '@kbn/i18n/react';
|
||||
import { EuiBadge, EuiToolTip } from '@elastic/eui';
|
||||
|
||||
import { Agent } from '../../../types';
|
||||
import type { Agent } from '../../../types';
|
||||
|
||||
interface Props {
|
||||
agent: Agent;
|
||||
|
|
|
@ -9,7 +9,7 @@ import React, { useMemo } from 'react';
|
|||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { EuiSpacer, EuiText, EuiFlexGroup, EuiFlexItem, EuiBadge } from '@elastic/eui';
|
||||
|
||||
import { PackagePolicy, PackagePolicyPackage } from '../../../types';
|
||||
import type { PackagePolicy, PackagePolicyPackage } from '../../../types';
|
||||
import { useGetOneAgentPolicy } from '../../../hooks';
|
||||
import { PackageIcon } from '../../../components/package_icon';
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import {
|
|||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { Agent } from '../../../../types';
|
||||
import type { Agent } from '../../../../types';
|
||||
import {
|
||||
sendPutAgentReassign,
|
||||
sendPostBulkAgentReassign,
|
||||
|
|
|
@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { EuiConfirmModal, EuiFormFieldset, EuiCheckbox } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { Agent } from '../../../../types';
|
||||
import type { Agent } from '../../../../types';
|
||||
import {
|
||||
sendPostAgentUnenroll,
|
||||
sendPostBulkAgentUnenroll,
|
||||
|
|
|
@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n';
|
|||
import { EuiConfirmModal, EuiBetaBadge, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { Agent } from '../../../../types';
|
||||
import type { Agent } from '../../../../types';
|
||||
import {
|
||||
sendPostAgentUpgrade,
|
||||
sendPostBulkAgentUpgrade,
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React from 'react';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { EuiText, EuiFlexGroup, EuiFlexItem, EuiButton, EuiPortal } from '@elastic/eui';
|
||||
import { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab';
|
||||
import type { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab';
|
||||
import { useRouteMatch } from 'react-router-dom';
|
||||
|
||||
import { PAGE_ROUTING_PATHS } from '../../../constants';
|
||||
|
|
|
@ -9,7 +9,7 @@ import React from 'react';
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { EuiConfirmModal, EuiCallOut } from '@elastic/eui';
|
||||
|
||||
import { EnrollmentAPIKey } from '../../../../types';
|
||||
import type { EnrollmentAPIKey } from '../../../../types';
|
||||
|
||||
interface Props {
|
||||
onCancel: () => void;
|
||||
|
|
|
@ -24,7 +24,7 @@ import {
|
|||
} from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { AgentPolicy } from '../../../../types';
|
||||
import type { AgentPolicy } from '../../../../types';
|
||||
import { useInput, useStartServices, sendRequest } from '../../../../hooks';
|
||||
import { enrollmentAPIKeyRouteService } from '../../../../services';
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import React, { useState } from 'react';
|
||||
import type { HorizontalAlignment } from '@elastic/eui';
|
||||
import {
|
||||
EuiSpacer,
|
||||
EuiBasicTable,
|
||||
|
@ -17,7 +18,6 @@ import {
|
|||
EuiToolTip,
|
||||
EuiIcon,
|
||||
EuiText,
|
||||
HorizontalAlignment,
|
||||
} from '@elastic/eui';
|
||||
import { FormattedMessage, FormattedDate } from '@kbn/i18n/react';
|
||||
|
||||
|
@ -31,7 +31,7 @@ import {
|
|||
useStartServices,
|
||||
sendDeleteOneEnrollmentAPIKey,
|
||||
} from '../../../hooks';
|
||||
import { EnrollmentAPIKey } from '../../../types';
|
||||
import type { EnrollmentAPIKey } from '../../../types';
|
||||
import { SearchBar } from '../../../components/search_bar';
|
||||
|
||||
import { NewEnrollmentTokenFlyout } from './components/new_enrollment_key_flyout';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { euiPaletteColorBlindBehindText } from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { SimplifiedAgentStatus } from '../../../types';
|
||||
import type { SimplifiedAgentStatus } from '../../../types';
|
||||
|
||||
const visColors = euiPaletteColorBlindBehindText();
|
||||
const colorToHexMap = {
|
||||
|
|
|
@ -27,7 +27,7 @@ import {
|
|||
|
||||
import { useStartServices, sendPostFleetSetup } from '../../../hooks';
|
||||
import { WithoutHeaderLayout } from '../../../layouts';
|
||||
import { GetFleetStatusResponse } from '../../../types';
|
||||
import type { GetFleetStatusResponse } from '../../../types';
|
||||
|
||||
export const RequirementItem: React.FunctionComponent<{ isMissing: boolean }> = ({
|
||||
isMissing,
|
||||
|
|
|
@ -9,7 +9,7 @@ import React, { memo } from 'react';
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { DataStream } from '../../../../types';
|
||||
import type { DataStream } from '../../../../types';
|
||||
import { useKibanaLink } from '../../../../hooks';
|
||||
import { ContextMenuActions } from '../../../../components';
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
import React, { useMemo } from 'react';
|
||||
import type { EuiTableActionsColumnType, EuiTableFieldDataColumnType } from '@elastic/eui';
|
||||
import {
|
||||
EuiBadge,
|
||||
EuiButton,
|
||||
|
@ -14,13 +15,11 @@ import {
|
|||
EuiFlexItem,
|
||||
EuiEmptyPrompt,
|
||||
EuiInMemoryTable,
|
||||
EuiTableActionsColumnType,
|
||||
EuiTableFieldDataColumnType,
|
||||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage, FormattedDate } from '@kbn/i18n/react';
|
||||
|
||||
import { DataStream } from '../../../types';
|
||||
import type { DataStream } from '../../../types';
|
||||
import { WithHeaderLayout } from '../../../layouts';
|
||||
import { useGetDataStreams, useStartServices, usePagination, useBreadcrumbs } from '../../../hooks';
|
||||
import { PackageIcon } from '../../../components/package_icon';
|
||||
|
|
|
@ -19,12 +19,12 @@ import {
|
|||
import styled from 'styled-components';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import {
|
||||
import type {
|
||||
AssetsGroupedByServiceByType,
|
||||
AssetTypeToParts,
|
||||
KibanaAssetType,
|
||||
entries,
|
||||
} from '../../../types';
|
||||
import { entries } from '../../../types';
|
||||
import {
|
||||
AssetIcons,
|
||||
AssetTitleMap,
|
||||
|
|
|
@ -9,7 +9,8 @@ import React from 'react';
|
|||
import styled from 'styled-components';
|
||||
import { EuiIcon, EuiPanel } from '@elastic/eui';
|
||||
|
||||
import { usePackageIconType, UsePackageIconType } from '../../../hooks';
|
||||
import type { UsePackageIconType } from '../../../hooks';
|
||||
import { usePackageIconType } from '../../../hooks';
|
||||
import { Loading } from '../../../components';
|
||||
|
||||
const PanelWrapper = styled.div`
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { EuiIconTip, EuiIconProps } from '@elastic/eui';
|
||||
import type { EuiIconProps } from '@elastic/eui';
|
||||
import { EuiIconTip } from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
export const UpdateIcon = ({ size = 'm' }: { size?: EuiIconProps['size'] }) => (
|
||||
|
|
|
@ -9,7 +9,7 @@ import React from 'react';
|
|||
import styled from 'styled-components';
|
||||
import { EuiCard } from '@elastic/eui';
|
||||
|
||||
import { PackageInfo, PackageListItem } from '../../../types';
|
||||
import type { PackageInfo, PackageListItem } from '../../../types';
|
||||
import { useLink } from '../../../hooks';
|
||||
import { PackageIcon } from '../../../components/package_icon';
|
||||
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import React, { Fragment, ReactNode, useState } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import React, { Fragment, useState } from 'react';
|
||||
import type { Query } from '@elastic/eui';
|
||||
import {
|
||||
EuiFlexGrid,
|
||||
EuiFlexGroup,
|
||||
|
@ -15,13 +17,12 @@ import {
|
|||
// @ts-ignore
|
||||
EuiSearchBar,
|
||||
EuiText,
|
||||
Query,
|
||||
} from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
import { Loading } from '../../../components';
|
||||
import { PackageList } from '../../../types';
|
||||
import type { PackageList } from '../../../types';
|
||||
import { useLocalSearch, searchIdField } from '../hooks';
|
||||
import { pkgKeyFromPackageInfo } from '../../../services/pkg_key_from_package_info';
|
||||
|
||||
|
|
|
@ -9,7 +9,8 @@ import { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText, EuiTextColor, EuiTitle } f
|
|||
import React, { Fragment } from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { RequirementsByServiceName, ServiceName, entries } from '../../../types';
|
||||
import type { RequirementsByServiceName, ServiceName } from '../../../types';
|
||||
import { entries } from '../../../types';
|
||||
import { ServiceTitleMap } from '../constants';
|
||||
|
||||
import { Version } from './version';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { RequirementVersion } from '../../../types';
|
||||
import type { RequirementVersion } from '../../../types';
|
||||
|
||||
const CodeText = styled.span`
|
||||
font-family: ${(props) => props.theme.eui.euiCodeFontFamily};
|
||||
|
|
|
@ -5,9 +5,10 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { IconType } from '@elastic/eui';
|
||||
import type { IconType } from '@elastic/eui';
|
||||
|
||||
import { AssetType, ElasticsearchAssetType, KibanaAssetType, ServiceName } from '../../types';
|
||||
import type { AssetType, ServiceName } from '../../types';
|
||||
import { ElasticsearchAssetType, KibanaAssetType } from '../../types';
|
||||
|
||||
// only allow Kibana assets for the kibana key, ES asssets for elasticsearch, etc
|
||||
type ServiceNameToAssetTypes = Record<Extract<ServiceName, 'kibana'>, KibanaAssetType[]> &
|
||||
|
|
|
@ -8,7 +8,11 @@
|
|||
import { useStartServices } from '../../../hooks/use_core';
|
||||
import { PLUGIN_ID } from '../../../constants';
|
||||
import { epmRouteService } from '../../../services';
|
||||
import { PackageSpecIcon, PackageSpecScreenshot, RegistryImage } from '../../../../../../common';
|
||||
import type {
|
||||
PackageSpecIcon,
|
||||
PackageSpecScreenshot,
|
||||
RegistryImage,
|
||||
} from '../../../../../../common';
|
||||
|
||||
const removeRelativePath = (relativePath: string): string =>
|
||||
new URL(relativePath, 'http://example.com').pathname;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { Search as LocalSearch } from 'js-search';
|
||||
import { useEffect, useRef } from 'react';
|
||||
|
||||
import { PackageList, PackageListItem } from '../../../types';
|
||||
import type { PackageList, PackageListItem } from '../../../types';
|
||||
|
||||
export type SearchField = keyof PackageListItem;
|
||||
export const searchIdField: SearchField = 'name';
|
||||
|
|
|
@ -9,10 +9,10 @@ import createContainer from 'constate';
|
|||
import React, { useCallback, useState } from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
import { NotificationsStart } from 'src/core/public';
|
||||
import type { NotificationsStart } from 'src/core/public';
|
||||
|
||||
import { toMountPoint } from '../../../../../../../../../src/plugins/kibana_react/public';
|
||||
import { PackageInfo } from '../../../types';
|
||||
import type { PackageInfo } from '../../../types';
|
||||
import { sendInstallPackage, sendRemovePackage, useLink } from '../../../hooks';
|
||||
import { InstallStatus } from '../../../types';
|
||||
|
||||
|
|
|
@ -9,7 +9,8 @@ import React from 'react';
|
|||
import styled from 'styled-components';
|
||||
import { EuiIcon, EuiPanel } from '@elastic/eui';
|
||||
|
||||
import { usePackageIconType, UsePackageIconType } from '../../../../../hooks';
|
||||
import type { UsePackageIconType } from '../../../../../hooks';
|
||||
import { usePackageIconType } from '../../../../../hooks';
|
||||
import { Loading } from '../../../../../components';
|
||||
|
||||
const PanelWrapper = styled.div`
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { EuiIconTip, EuiIconProps } from '@elastic/eui';
|
||||
import type { EuiIconProps } from '@elastic/eui';
|
||||
import { EuiIconTip } from '@elastic/eui';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
export const UpdateIcon = ({ size = 'm' }: { size?: EuiIconProps['size'] }) => (
|
||||
|
|
|
@ -10,7 +10,7 @@ import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
|
|||
|
||||
import { useUIExtension } from '../../../../../hooks/use_ui_extension';
|
||||
import { useLink } from '../../../../../hooks';
|
||||
import { PackageInfo } from '../../../../../types';
|
||||
import type { PackageInfo } from '../../../../../types';
|
||||
import { pkgKeyFromPackageInfo } from '../../../../../services/pkg_key_from_package_info';
|
||||
import { ExtensionWrapper } from '../../../../../components/extension_wrapper';
|
||||
|
||||
|
|
|
@ -10,21 +10,25 @@ import { Route } from 'react-router-dom';
|
|||
import { act, cleanup } from '@testing-library/react';
|
||||
|
||||
import { PAGE_ROUTING_PATHS, pagePathGetters } from '../../../../constants';
|
||||
import {
|
||||
import type {
|
||||
GetAgentPoliciesResponse,
|
||||
GetFleetStatusResponse,
|
||||
GetInfoResponse,
|
||||
GetPackagePoliciesResponse,
|
||||
GetStatsResponse,
|
||||
} from '../../../../../../../common/types/rest_spec';
|
||||
import { DetailViewPanelName, KibanaAssetType } from '../../../../../../../common/types/models';
|
||||
import type {
|
||||
DetailViewPanelName,
|
||||
KibanaAssetType,
|
||||
} from '../../../../../../../common/types/models';
|
||||
import {
|
||||
agentPolicyRouteService,
|
||||
epmRouteService,
|
||||
fleetSetupRouteService,
|
||||
packagePolicyRouteService,
|
||||
} from '../../../../../../../common/services';
|
||||
import { createTestRendererMock, MockedFleetStartServices, TestRenderer } from '../../../../mock';
|
||||
import type { MockedFleetStartServices, TestRenderer } from '../../../../mock';
|
||||
import { createTestRendererMock } from '../../../../mock';
|
||||
|
||||
import { Detail } from './index';
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue