Skip to content

Commit

Permalink
Use TS organize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz committed Feb 26, 2021
1 parent 993ac50 commit d92a1a0
Show file tree
Hide file tree
Showing 301 changed files with 1,483 additions and 1,509 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/common/constants/agent_policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import { defaultPackages } from './epm';
import { AgentPolicy } from '../types';
import { defaultPackages } from './epm';
export const AGENT_POLICY_SAVED_OBJECT_TYPE = 'ingest-agent-policies';
export const AGENT_POLICY_INDEX = '.fleet-policies';
export const agentPolicyStatuses = {
Expand Down
9 changes: 4 additions & 5 deletions x-pack/plugins/fleet/common/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
* 2.0.
*/

export * from './plugin';
export * from './routes';

export * from './agent';
export * from './agent_policy';
export * from './package_policy';
export * from './enrollment_api_key';
export * from './epm';
export * from './output';
export * from './enrollment_api_key';
export * from './package_policy';
export * from './plugin';
export * from './routes';
export * from './settings';

// TODO: This is the default `index.max_result_window` ES setting, which dictates
Expand Down
14 changes: 7 additions & 7 deletions x-pack/plugins/fleet/common/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
* 2.0.
*/

export * from './routes';
export * as AgentStatusKueryHelper from './agent_status';
export { packageToPackagePolicyInputs, packageToPackagePolicy } from './package_to_package_policy';
export { storedPackagePoliciesToAgentInputs } from './package_policies_to_agent_inputs';
export { fullAgentPolicyToYaml } from './full_agent_policy_to_yaml';
export { isPackageLimited, doesAgentPolicyAlreadyIncludePackage } from './limited_package';
export { decodeCloudId } from './decode_cloud_id';
export { isValidNamespace } from './is_valid_namespace';
export { fullAgentPolicyToYaml } from './full_agent_policy_to_yaml';
export { isAgentUpgradeable } from './is_agent_upgradeable';
export { isDiffPathProtocol } from './is_diff_path_protocol';
export { isValidNamespace } from './is_valid_namespace';
export { LicenseService } from './license';
export { isAgentUpgradeable } from './is_agent_upgradeable';
export { doesAgentPolicyAlreadyIncludePackage, isPackageLimited } from './limited_package';
export { storedPackagePoliciesToAgentInputs } from './package_policies_to_agent_inputs';
export { packageToPackagePolicy, packageToPackagePolicyInputs } from './package_to_package_policy';
export * from './routes';
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import { isAgentUpgradeable } from './is_agent_upgradeable';
import { Agent } from '../types/models/agent';
import { isAgentUpgradeable } from './is_agent_upgradeable';

const getAgent = ({
version,
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/common/services/limited_package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { PackageInfo, AgentPolicy, PackagePolicy } from '../types';
import { AgentPolicy, PackageInfo, PackagePolicy } from '../types';

// Assume packages only ever include 1 config template for now
export const isPackageLimited = (packageInfo: PackageInfo): boolean => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import { PackagePolicy, FullAgentPolicyInput, FullAgentPolicyInputStream } from '../types';
import { DEFAULT_OUTPUT } from '../constants';
import { FullAgentPolicyInput, FullAgentPolicyInputStream, PackagePolicy } from '../types';

export const storedPackagePoliciesToAgentInputs = (
packagePolicies: PackagePolicy[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
*/

import {
NewPackagePolicy,
NewPackagePolicyInput,
NewPackagePolicyInputStream,
PackageInfo,
RegistryPolicyTemplate,
RegistryVarsEntry,
RegistryStream,
PackagePolicyConfigRecord,
PackagePolicyConfigRecordEntry,
NewPackagePolicyInput,
NewPackagePolicyInputStream,
NewPackagePolicy,
RegistryPolicyTemplate,
RegistryStream,
RegistryVarsEntry,
} from '../types';

const getStreamsForInputType = (
Expand Down
14 changes: 7 additions & 7 deletions x-pack/plugins/fleet/common/services/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
*/

import {
EPM_API_ROOT,
EPM_API_ROUTES,
PACKAGE_POLICY_API_ROUTES,
AGENT_POLICY_API_ROUTES,
DATA_STREAM_API_ROUTES,
AGENTS_SETUP_API_ROUTES,
AGENT_API_ROUTES,
AGENT_POLICY_API_ROUTES,
APP_API_ROUTES,
DATA_STREAM_API_ROUTES,
ENROLLMENT_API_KEY_ROUTES,
SETUP_API_ROUTE,
EPM_API_ROOT,
EPM_API_ROUTES,
OUTPUT_API_ROUTES,
PACKAGE_POLICY_API_ROUTES,
SETTINGS_API_ROUTES,
APP_API_ROUTES,
SETUP_API_ROUTE,
} from '../constants';

export const epmRouteService = {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/common/types/models/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import { FullAgentPolicy } from './agent_policy';
import { AGENT_TYPE_EPHEMERAL, AGENT_TYPE_PERMANENT, AGENT_TYPE_TEMPORARY } from '../../constants';
import { FullAgentPolicy } from './agent_policy';

export type AgentType =
| typeof AGENT_TYPE_EPHEMERAL
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/common/types/models/agent_policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import { agentPolicyStatuses } from '../../constants';
import { DataType, ValueOf } from '../../types';
import { PackagePolicy, PackagePolicyPackage } from './package_policy';
import { Output } from './output';
import { PackagePolicy, PackagePolicyPackage } from './package_policy';

export type AgentPolicyStatus = typeof agentPolicyStatuses;

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/common/types/models/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
// TODO: Update when https://github.com/elastic/kibana/issues/53021 is closed
import { SavedObject, SavedObjectAttributes, SavedObjectReference } from 'src/core/public';
import {
ASSETS_SAVED_OBJECT_TYPE,
agentAssetTypes,
ASSETS_SAVED_OBJECT_TYPE,
dataTypes,
defaultPackages,
installationStatuses,
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/fleet/common/types/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

export * from './agent';
export * from './agent_policy';
export * from './package_policy';
export * from './data_stream';
export * from './output';
export * from './enrollment_api_key';
export * from './epm';
export * from './output';
export * from './package_policy';
export * from './package_spec';
export * from './enrollment_api_key';
export * from './settings';
4 changes: 2 additions & 2 deletions x-pack/plugins/fleet/common/types/rest_spec/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import {
Agent,
AgentAction,
NewAgentAction,
NewAgentEvent,
AgentEvent,
AgentStatus,
AgentType,
NewAgentAction,
NewAgentEvent,
} from '../models';

export interface GetAgentsRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { AgentPolicy, NewAgentPolicy, FullAgentPolicy } from '../models';
import { AgentPolicy, FullAgentPolicy, NewAgentPolicy } from '../models';
import { ListWithKuery } from './common';

export interface GetAgentPoliciesRequest {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/fleet/common/types/rest_spec/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import {
AssetReference,
CategorySummaryList,
Installable,
RegistrySearchResult,
PackageInfo,
PackageUsageStats,
RegistrySearchResult,
} from '../models/epm';

export interface GetCategoriesRequest {
Expand Down
14 changes: 7 additions & 7 deletions x-pack/plugins/fleet/common/types/rest_spec/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
* 2.0.
*/

export * from './common';
export * from './package_policy';
export * from './data_stream';
export * from './agent';
export * from './agent_policy';
export * from './fleet_setup';
export * from './epm';
export * from './app';
export * from './common';
export * from './data_stream';
export * from './enrollment_api_key';
export * from './install_script';
export * from './epm';
export * from './fleet_setup';
export * from './ingest_setup';
export * from './install_script';
export * from './output';
export * from './package_policy';
export * from './settings';
export * from './app';
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { PackagePolicy, NewPackagePolicy, UpdatePackagePolicy } from '../models';
import { NewPackagePolicy, PackagePolicy, UpdatePackagePolicy } from '../models';

export interface GetPackagePoliciesRequest {
query: {
Expand Down
32 changes: 16 additions & 16 deletions x-pack/plugins/fleet/public/applications/fleet/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@
* 2.0.
*/

import React, { memo, useEffect, useState } from 'react';
import { AppMountParameters } from 'kibana/public';
import { EuiCode, EuiEmptyPrompt, EuiErrorBoundary, EuiPanel } from '@elastic/eui';
import { createHashHistory, History } 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 { FormattedMessage } from '@kbn/i18n/react';
import { createHashHistory, History } from 'history';
import { AppMountParameters } from 'kibana/public';
import React, { memo, useEffect, useState } from 'react';
import { Redirect, Route, Router, Switch } from 'react-router-dom';
import useObservable from 'react-use/lib/useObservable';
import styled from 'styled-components';
import { EuiThemeProvider } from '../../../../../../src/plugins/kibana_react/common';
import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public';
import { FleetConfigType, FleetStartServices } from '../../plugin';
import { Error, Loading } from './components';
import { PAGE_ROUTING_PATHS } from './constants';
import {
ConfigContext,
FleetStatusProvider,
Expand All @@ -23,22 +28,17 @@ import {
useBreadcrumbs,
useConfig,
} from './hooks';
import { Error, Loading } from './components';
import { IntraAppStateProvider } from './hooks/use_intra_app_state';
import { PackageInstallProvider } from './sections/epm/hooks';
import { PAGE_ROUTING_PATHS } from './constants';
import { UIExtensionsContext } from './hooks/use_ui_extension';
import { ProtectedRoute } from './index';
import { DefaultLayout, WithoutHeaderLayout } from './layouts';
import { EPMApp } from './sections/epm';
import { FleetApp } from './sections/agents';
import { AgentPolicyApp } from './sections/agent_policy';
import { DataStreamApp } from './sections/data_stream';
import { FleetApp } from './sections/agents';
import { EPMApp } from './sections/epm';
import { PackageInstallProvider } from './sections/epm/hooks';
import { IngestManagerOverview } from './sections/overview';
import { ProtectedRoute } from './index';
import { FleetConfigType, FleetStartServices } from '../../plugin';
import { UIExtensionsStorage } from './types';
import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public';
import { EuiThemeProvider } from '../../../../../../src/plugins/kibana_react/common';
import { UIExtensionsContext } from './hooks/use_ui_extension';

const ErrorLayout = ({ children }: { children: JSX.Element }) => (
<EuiErrorBoundary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
* 2.0.
*/

import React from 'react';
import {
EuiButtonEmpty,
EuiFlyout,
EuiFlyoutBody,
EuiFlyoutHeader,
EuiFlyoutFooter,
EuiFlyoutHeader,
EuiLink,
EuiText,
EuiTitle,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import React from 'react';

interface Props {
onClose: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* 2.0.
*/

import { EuiLink, EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import React, { useState } from 'react';
import styled from 'styled-components';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiText, EuiLink } from '@elastic/eui';
import { AlphaFlyout } from './alpha_flyout';

const Message = styled(EuiText).attrs((props) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
* 2.0.
*/

import React, { useCallback, useState } from 'react';
import { i18n } from '@kbn/i18n';
import {
EuiButton,
EuiButtonIcon,
EuiContextMenu,
EuiContextMenuPanel,
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 { i18n } from '@kbn/i18n';
import React, { useCallback, useState } from 'react';

type Props = {
button?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* 2.0.
*/

import { EuiCodeBlock, EuiLink, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import React from 'react';
import styled from 'styled-components';
import { EuiText, EuiSpacer, EuiLink, EuiTitle, EuiCodeBlock } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { EnrollmentAPIKey } from '../../../types';

interface Props {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import React from 'react';
import { EuiCallOut } from '@elastic/eui';
import React from 'react';

export const Error: React.FunctionComponent<{
title: JSX.Element;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import React, { memo, ReactNode, Suspense } from 'react';
import { EuiErrorBoundary } from '@elastic/eui';
import React, { memo, ReactNode, Suspense } from 'react';
import { Loading } from './loading';

export const ExtensionWrapper = memo<{ children: ReactNode }>(({ children }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* 2.0.
*/

import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTab, EuiTabs } from '@elastic/eui';
import { EuiFlexItemProps } from '@elastic/eui/src/components/flex/flex_item';
import { Props as EuiTabProps } from '@elastic/eui/src/components/tabs/tab';
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';

const Container = styled.div`
border-bottom: ${(props) => props.theme.eui.euiBorderThin};
Expand Down
Loading

0 comments on commit d92a1a0

Please sign in to comment.