From 71ab5a0fa316ccee3e1564aeb2d05e5e915c1c86 Mon Sep 17 00:00:00 2001 From: John Schulz Date: Mon, 9 Dec 2019 15:40:08 -0500 Subject: [PATCH] Restore import sort order from #52234 (#52548) Many of the changes from #52234 were lost. Presumably due to PR(s) merging which were based on branches which had the previous unsorted order. --- .../plugins/epm/public/components/nav_button_back.tsx | 2 +- .../legacy/plugins/epm/public/components/package_card.tsx | 4 ++-- x-pack/legacy/plugins/epm/public/hooks/use_links.tsx | 2 +- .../plugins/epm/public/hooks/use_package_install.tsx | 6 +++--- x-pack/legacy/plugins/epm/public/routes.tsx | 4 ++-- .../screens/add_data_source/add_data_source_steps.tsx | 8 ++++---- .../plugins/epm/public/screens/add_data_source/index.tsx | 8 ++++---- .../epm/public/screens/add_data_source/step_one.tsx | 8 ++++---- .../legacy/plugins/epm/public/screens/detail/header.tsx | 2 +- x-pack/legacy/plugins/epm/server/datasources/create.ts | 4 ++-- x-pack/legacy/plugins/epm/server/datasources/handlers.ts | 2 +- .../server/lib/elasticsearch/template/template.test.ts | 2 +- x-pack/legacy/plugins/epm/server/lib/fields/field.test.ts | 4 ++-- x-pack/legacy/plugins/epm/server/packages/assets.ts | 2 +- x-pack/legacy/plugins/epm/server/packages/install.ts | 2 +- x-pack/legacy/plugins/epm/server/registry/index.ts | 2 +- 16 files changed, 31 insertions(+), 31 deletions(-) diff --git a/x-pack/legacy/plugins/epm/public/components/nav_button_back.tsx b/x-pack/legacy/plugins/epm/public/components/nav_button_back.tsx index 7f2d85ccd938c..d1d0f5b321809 100644 --- a/x-pack/legacy/plugins/epm/public/components/nav_button_back.tsx +++ b/x-pack/legacy/plugins/epm/public/components/nav_button_back.tsx @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ import { EuiButtonEmpty } from '@elastic/eui'; -import styled from 'styled-components'; import React from 'react'; +import styled from 'styled-components'; import { useCore } from '../hooks'; export function NavButtonBack({ href, text }: { href: string; text: string }) { diff --git a/x-pack/legacy/plugins/epm/public/components/package_card.tsx b/x-pack/legacy/plugins/epm/public/components/package_card.tsx index ce08b816d7fb8..6772a1cf6c101 100644 --- a/x-pack/legacy/plugins/epm/public/components/package_card.tsx +++ b/x-pack/legacy/plugins/epm/public/components/package_card.tsx @@ -3,11 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React from 'react'; import { EuiCard, EuiIcon, ICON_TYPES } from '@elastic/eui'; +import React from 'react'; import styled from 'styled-components'; +import { PackageInfo, PackageListItem } from '../../common/types'; import { useLinks } from '../hooks'; -import { PackageListItem, PackageInfo } from '../../common/types'; export interface BadgeProps { showInstalledBadge?: boolean; diff --git a/x-pack/legacy/plugins/epm/public/hooks/use_links.tsx b/x-pack/legacy/plugins/epm/public/hooks/use_links.tsx index 5ab57691ba88c..fe1e03275d9a7 100644 --- a/x-pack/legacy/plugins/epm/public/hooks/use_links.tsx +++ b/x-pack/legacy/plugins/epm/public/hooks/use_links.tsx @@ -5,10 +5,10 @@ */ import { generatePath } from 'react-router-dom'; +import { useCore } from '.'; import { PLUGIN } from '../../common/constants'; import { getFilePath, getInfoPath } from '../../common/routes'; import { patterns } from '../routes'; -import { useCore } from '.'; import { DetailViewPanelName } from '..'; // TODO: get this from server/packages/handlers.ts (move elsewhere?) diff --git a/x-pack/legacy/plugins/epm/public/hooks/use_package_install.tsx b/x-pack/legacy/plugins/epm/public/hooks/use_package_install.tsx index 07d44e9de6d23..b51ac874ff5e1 100644 --- a/x-pack/legacy/plugins/epm/public/hooks/use_package_install.tsx +++ b/x-pack/legacy/plugins/epm/public/hooks/use_package_install.tsx @@ -4,15 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { useCallback, useState, Fragment } from 'react'; +import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import createContainer from 'constate'; -import { EuiFlexGroup, EuiFlexItem, EuiButton } from '@elastic/eui'; +import React, { Fragment, useCallback, useState } from 'react'; import { NotificationsStart } from 'src/core/public'; +import { useLinks } from '.'; import { toMountPoint } from '../../../../../../src/plugins/kibana_react/public'; import { PackageInfo } from '../../common/types'; import { installPackage as fetchInstallPackage, removePackage } from '../data'; import { InstallStatus } from '../types'; -import { useLinks } from '.'; interface PackagesInstall { [key: string]: PackageInstallItem; diff --git a/x-pack/legacy/plugins/epm/public/routes.tsx b/x-pack/legacy/plugins/epm/public/routes.tsx index abf509bab393a..62b4237df0d01 100644 --- a/x-pack/legacy/plugins/epm/public/routes.tsx +++ b/x-pack/legacy/plugins/epm/public/routes.tsx @@ -6,10 +6,10 @@ import React from 'react'; import { Route } from 'react-router-dom'; -import { Detail, DetailProps } from './screens/detail'; +import { PLUGIN } from '../common/constants'; import { AddDataSource, AddDataSourceProps } from './screens/add_data_source'; +import { Detail, DetailProps } from './screens/detail'; import { Home } from './screens/home'; -import { PLUGIN } from '../common/constants'; // patterns are used by React Router and are relative to `APP_ROOT` export const patterns = { diff --git a/x-pack/legacy/plugins/epm/public/screens/add_data_source/add_data_source_steps.tsx b/x-pack/legacy/plugins/epm/public/screens/add_data_source/add_data_source_steps.tsx index 50c41946c65e1..2c0ee308ab9d0 100644 --- a/x-pack/legacy/plugins/epm/public/screens/add_data_source/add_data_source_steps.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/add_data_source/add_data_source_steps.tsx @@ -3,13 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React, { useState, Fragment, useCallback } from 'react'; -import styled from 'styled-components'; -import { EuiPanel, EuiSteps, EuiButton, EuiHorizontalRule } from '@elastic/eui'; +import { EuiButton, EuiHorizontalRule, EuiPanel, EuiSteps } from '@elastic/eui'; +import React, { Fragment, useCallback, useState } from 'react'; import { Redirect } from 'react-router-dom'; -import { StepOneTemplate } from './step_one'; +import styled from 'styled-components'; import { installDatasource } from '../../data'; import { useCore, useLinks } from '../../hooks'; +import { StepOneTemplate } from './step_one'; const StyledSteps = styled.div` .euiStep__titleWrapper { diff --git a/x-pack/legacy/plugins/epm/public/screens/add_data_source/index.tsx b/x-pack/legacy/plugins/epm/public/screens/add_data_source/index.tsx index 0f0b2a7f5463c..58cfe2985762c 100644 --- a/x-pack/legacy/plugins/epm/public/screens/add_data_source/index.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/add_data_source/index.tsx @@ -3,13 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import React, { useState, useEffect } from 'react'; -import { ICON_TYPES, EuiPageHeader, EuiTitle, EuiFlexGroup, EuiIcon, EuiPanel } from '@elastic/eui'; +import { EuiFlexGroup, EuiIcon, EuiPageHeader, EuiPanel, EuiTitle, ICON_TYPES } from '@elastic/eui'; +import React, { useEffect, useState } from 'react'; import styled from 'styled-components'; -import { NavButtonBack } from '../../components/nav_button_back'; -import { useLinks } from '../../hooks'; import { PackageInfo } from '../../../common/types'; +import { NavButtonBack } from '../../components/nav_button_back'; import { getPackageInfoByKey } from '../../data'; +import { useLinks } from '../../hooks'; import { AddDataSourceSteps } from './add_data_source_steps'; export interface AddDataSourceProps { diff --git a/x-pack/legacy/plugins/epm/public/screens/add_data_source/step_one.tsx b/x-pack/legacy/plugins/epm/public/screens/add_data_source/step_one.tsx index f9181cc95781d..ce56f0ddff49e 100644 --- a/x-pack/legacy/plugins/epm/public/screens/add_data_source/step_one.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/add_data_source/step_one.tsx @@ -4,16 +4,16 @@ * you may not use this file except in compliance with the Elastic License. */ -import React, { Fragment } from 'react'; import { - EuiForm, EuiDescribedFormGroup, - EuiFormRow, EuiFieldText, + EuiForm, + EuiFormRow, EuiHorizontalRule, - EuiSwitch, EuiSpacer, + EuiSwitch, } from '@elastic/eui'; +import React, { Fragment } from 'react'; export const StepOneTemplate = () => { return ( diff --git a/x-pack/legacy/plugins/epm/public/screens/detail/header.tsx b/x-pack/legacy/plugins/epm/public/screens/detail/header.tsx index 68034ab514f33..d4f62e6bf85d3 100644 --- a/x-pack/legacy/plugins/epm/public/screens/detail/header.tsx +++ b/x-pack/legacy/plugins/epm/public/screens/detail/header.tsx @@ -9,11 +9,11 @@ import styled from 'styled-components'; import { PLUGIN } from '../../../common/constants'; import { PackageInfo } from '../../../common/types'; import { IconPanel } from '../../components/icon_panel'; +import { NavButtonBack } from '../../components/nav_button_back'; import { Version } from '../../components/version'; import { useBreadcrumbs, useLinks } from '../../hooks'; import { InstallationButton } from './installation_button'; import { CenterColumn, LeftColumn, RightColumn } from './layout'; -import { NavButtonBack } from '../../components/nav_button_back'; const FullWidthNavRow = styled(EuiPage)` /* no left padding so link is against column left edge */ diff --git a/x-pack/legacy/plugins/epm/server/datasources/create.ts b/x-pack/legacy/plugins/epm/server/datasources/create.ts index 30619ad36dd80..c34b0e1cfac78 100644 --- a/x-pack/legacy/plugins/epm/server/datasources/create.ts +++ b/x-pack/legacy/plugins/epm/server/datasources/create.ts @@ -7,13 +7,13 @@ import { SavedObjectsClientContract } from 'src/core/server/'; import { Asset, Datasource, InputType } from '../../../ingest/server/libs/types'; import { SAVED_OBJECT_TYPE_DATASOURCES } from '../../common/constants'; +import { AssetReference, InstallationStatus, RegistryPackage } from '../../common/types'; import { CallESAsCurrentUser } from '../lib/cluster_access'; +import { installILMPolicy, policyExists } from '../lib/elasticsearch/ilm/install'; import { installPipelines } from '../lib/elasticsearch/ingest_pipeline/ingest_pipelines'; import { installTemplates } from '../lib/elasticsearch/template/install'; -import { AssetReference, InstallationStatus, RegistryPackage } from '../../common/types'; import { getPackageInfo } from '../packages'; import * as Registry from '../registry'; -import { installILMPolicy, policyExists } from '../lib/elasticsearch/ilm/install'; const pkgToPkgKey = ({ name, version }: RegistryPackage) => `${name}-${version}`; export class PackageNotInstalledError extends Error { diff --git a/x-pack/legacy/plugins/epm/server/datasources/handlers.ts b/x-pack/legacy/plugins/epm/server/datasources/handlers.ts index f060d852edc1b..5eba8c429d565 100644 --- a/x-pack/legacy/plugins/epm/server/datasources/handlers.ts +++ b/x-pack/legacy/plugins/epm/server/datasources/handlers.ts @@ -5,11 +5,11 @@ */ import Boom from 'boom'; -import { createDatasource, PackageNotInstalledError } from './index'; import { getClusterAccessor } from '../lib/cluster_access'; import { PluginContext } from '../plugin'; import { getClient } from '../saved_objects'; import { Request, ResponseToolkit } from '../types'; +import { createDatasource, PackageNotInstalledError } from './index'; // TODO: duplicated from packages/handlers.ts. unduplicate. interface Extra extends ResponseToolkit { diff --git a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/template.test.ts b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/template.test.ts index a07b0febd7b0a..c87ccfc6bc0c7 100644 --- a/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/template.test.ts +++ b/x-pack/legacy/plugins/epm/server/lib/elasticsearch/template/template.test.ts @@ -5,8 +5,8 @@ */ import { readFileSync } from 'fs'; -import path from 'path'; import { safeLoad } from 'js-yaml'; +import path from 'path'; import { Field, processFields } from '../../fields/field'; import { generateMappings, getTemplate } from './template'; diff --git a/x-pack/legacy/plugins/epm/server/lib/fields/field.test.ts b/x-pack/legacy/plugins/epm/server/lib/fields/field.test.ts index f546a09beed8b..3cdf011d9d0e3 100644 --- a/x-pack/legacy/plugins/epm/server/lib/fields/field.test.ts +++ b/x-pack/legacy/plugins/epm/server/lib/fields/field.test.ts @@ -5,10 +5,10 @@ */ import { readFileSync } from 'fs'; -import path from 'path'; +import glob from 'glob'; import { safeLoad } from 'js-yaml'; +import path from 'path'; import { Field, processFields } from './field'; -import glob from 'glob'; // Add our own serialiser to just do JSON.stringify expect.addSnapshotSerializer({ diff --git a/x-pack/legacy/plugins/epm/server/packages/assets.ts b/x-pack/legacy/plugins/epm/server/packages/assets.ts index 8da134fdd2bb2..386cf25fa827f 100644 --- a/x-pack/legacy/plugins/epm/server/packages/assets.ts +++ b/x-pack/legacy/plugins/epm/server/packages/assets.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ +import { RegistryPackage } from '../../common/types'; import * as Registry from '../registry'; import { cacheHas } from '../registry/cache'; -import { RegistryPackage } from '../../common/types'; // paths from RegistryPackage are routes to the assets on EPR // paths for ArchiveEntry are routes to the assets in the archive diff --git a/x-pack/legacy/plugins/epm/server/packages/install.ts b/x-pack/legacy/plugins/epm/server/packages/install.ts index 4db442c8442b9..5159afa0ff816 100644 --- a/x-pack/legacy/plugins/epm/server/packages/install.ts +++ b/x-pack/legacy/plugins/epm/server/packages/install.ts @@ -7,10 +7,10 @@ import { SavedObject, SavedObjectsClientContract } from 'src/core/server/'; import { SAVED_OBJECT_TYPE_PACKAGES } from '../../common/constants'; import { AssetReference, InstallationAttributes, KibanaAssetType } from '../../common/types'; +import { installIndexPattern } from '../lib/kibana/index_pattern/install'; import * as Registry from '../registry'; import { getObject } from './get_objects'; import { getInstallationObject } from './index'; -import { installIndexPattern } from '../lib/kibana/index_pattern/install'; export async function installPackage(options: { savedObjectsClient: SavedObjectsClientContract; diff --git a/x-pack/legacy/plugins/epm/server/registry/index.ts b/x-pack/legacy/plugins/epm/server/registry/index.ts index 660503b0798d7..d6a301f318e89 100644 --- a/x-pack/legacy/plugins/epm/server/registry/index.ts +++ b/x-pack/legacy/plugins/epm/server/registry/index.ts @@ -12,8 +12,8 @@ import { CategoryId, CategorySummaryList, KibanaAssetType, - RegistrySearchResults, RegistryPackage, + RegistrySearchResults, } from '../../common/types'; import { epmConfigStore } from '../config'; import { cacheGet, cacheSet } from './cache';