mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Cases] Enforce type imports (#142428)
* [Cases] enforce type imports ESLint's --fix did the heavy lifting here * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * fix remaining rule violation * fix remaining rule violation Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
9360a4e5dd
commit
e46da93553
381 changed files with 1070 additions and 942 deletions
|
@ -1111,7 +1111,10 @@ module.exports = {
|
|||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}'],
|
||||
files: [
|
||||
'x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}',
|
||||
'x-pack/plugins/cases/public/**/*.{js,mjs,ts,tsx}',
|
||||
],
|
||||
rules: {
|
||||
'@typescript-eslint/consistent-type-imports': 'error',
|
||||
},
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { CasesFindRequest, CasesMetricsRequest } from '../../../common/api';
|
||||
import { HTTPService } from '..';
|
||||
import type { CasesFindRequest, CasesMetricsRequest } from '../../../common/api';
|
||||
import type { HTTPService } from '..';
|
||||
import { casesMetrics, casesStatus } from '../../containers/mock';
|
||||
import { CasesMetrics, CasesStatus } from '../../containers/types';
|
||||
import type { CasesMetrics, CasesStatus } from '../../containers/types';
|
||||
|
||||
export const getCasesStatus = async ({
|
||||
http,
|
||||
|
|
|
@ -11,12 +11,14 @@ import { pipe } from 'fp-ts/lib/pipeable';
|
|||
|
||||
import { createToasterPlainError } from '../containers/utils';
|
||||
import { throwErrors } from '../../common';
|
||||
import {
|
||||
import type {
|
||||
CasesFindResponse,
|
||||
CasesFindResponseRt,
|
||||
CasesStatusResponse,
|
||||
CasesStatusResponseRt,
|
||||
CasesMetricsResponse,
|
||||
} from '../../common/api';
|
||||
import {
|
||||
CasesFindResponseRt,
|
||||
CasesStatusResponseRt,
|
||||
CasesMetricsResponseRt,
|
||||
} from '../../common/api';
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { HttpStart } from '@kbn/core/public';
|
||||
import { Cases, CasesStatus, CasesMetrics } from '../../common/ui';
|
||||
import type { HttpStart } from '@kbn/core/public';
|
||||
import type { Cases, CasesStatus, CasesMetrics } from '../../common/ui';
|
||||
import { CASE_FIND_URL, CASE_METRICS_URL, CASE_STATUS_URL } from '../../common/constants';
|
||||
import {
|
||||
import type {
|
||||
CasesFindRequest,
|
||||
CasesFindResponse,
|
||||
CasesMetricsRequest,
|
||||
|
|
|
@ -10,7 +10,7 @@ import {
|
|||
isCommentRequestTypeExternalReference,
|
||||
isCommentRequestTypePersistableState,
|
||||
} from '../../common/utils/attachments';
|
||||
import {
|
||||
import type {
|
||||
CasesFindResponse,
|
||||
CaseResponse,
|
||||
CaseUserActionsResponse,
|
||||
|
@ -20,7 +20,7 @@ import {
|
|||
CasesResponse,
|
||||
} from '../../common/api';
|
||||
import { isCommentUserAction } from '../../common/utils/user_actions';
|
||||
import { Cases, Case, Comment, ResolvedCase } from '../containers/types';
|
||||
import type { Cases, Case, Comment, ResolvedCase } from '../containers/types';
|
||||
|
||||
export const convertArrayToCamelCase = (arrayOfSnakes: unknown[]): unknown[] =>
|
||||
arrayOfSnakes.reduce((acc: unknown[], value) => {
|
||||
|
|
|
@ -17,10 +17,10 @@ import {
|
|||
useUiSetting$,
|
||||
} from '@kbn/kibana-react-plugin/public';
|
||||
import { EuiThemeProvider as StyledComponentsThemeProvider } from '@kbn/kibana-react-plugin/common';
|
||||
import { RenderAppProps } from './types';
|
||||
import type { RenderAppProps } from './types';
|
||||
import { CasesApp } from './components/app';
|
||||
import { ExternalReferenceAttachmentTypeRegistry } from './client/attachment_framework/external_reference_registry';
|
||||
import { PersistableStateAttachmentTypeRegistry } from './client/attachment_framework/persistable_state_registry';
|
||||
import type { ExternalReferenceAttachmentTypeRegistry } from './client/attachment_framework/external_reference_registry';
|
||||
import type { PersistableStateAttachmentTypeRegistry } from './client/attachment_framework/persistable_state_registry';
|
||||
|
||||
export const renderApp = (deps: RenderAppProps) => {
|
||||
const { mountParams } = deps;
|
||||
|
|
|
@ -5,18 +5,18 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { HttpStart } from '@kbn/core/public';
|
||||
import {
|
||||
import type { HttpStart } from '@kbn/core/public';
|
||||
import type {
|
||||
CasesByAlertId,
|
||||
CasesByAlertIDRequest,
|
||||
CasesFindRequest,
|
||||
getCasesFromAlertsUrl,
|
||||
CasesStatusRequest,
|
||||
CasesMetricsRequest,
|
||||
} from '../../../common/api';
|
||||
import { Cases, CasesStatus, CasesMetrics } from '../../../common/ui';
|
||||
import { getCasesFromAlertsUrl } from '../../../common/api';
|
||||
import type { Cases, CasesStatus, CasesMetrics } from '../../../common/ui';
|
||||
import { getCases, getCasesMetrics, getCasesStatus } from '../../api';
|
||||
import { CasesUiStart } from '../../types';
|
||||
import type { CasesUiStart } from '../../types';
|
||||
|
||||
export const createClientAPI = ({ http }: { http: HttpStart }): CasesUiStart['api'] => {
|
||||
return {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { AttachmentTypeRegistry } from '../../../common/registry';
|
||||
import { ExternalReferenceAttachmentType } from './types';
|
||||
import type { ExternalReferenceAttachmentType } from './types';
|
||||
|
||||
export class ExternalReferenceAttachmentTypeRegistry extends AttachmentTypeRegistry<ExternalReferenceAttachmentType> {
|
||||
constructor() {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { AttachmentTypeRegistry } from '../../../common/registry';
|
||||
import { PersistableStateAttachmentType } from './types';
|
||||
import type { PersistableStateAttachmentType } from './types';
|
||||
|
||||
export class PersistableStateAttachmentTypeRegistry extends AttachmentTypeRegistry<PersistableStateAttachmentType> {
|
||||
constructor() {
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
*/
|
||||
|
||||
import type React from 'react';
|
||||
import { EuiCommentProps, IconType } from '@elastic/eui';
|
||||
import {
|
||||
import type { EuiCommentProps, IconType } from '@elastic/eui';
|
||||
import type {
|
||||
CommentRequestExternalReferenceType,
|
||||
CommentRequestPersistableStateType,
|
||||
} from '../../../common/api';
|
||||
import { Case } from '../../containers/types';
|
||||
import type { Case } from '../../containers/types';
|
||||
|
||||
export interface AttachmentViewObject<Props = {}> {
|
||||
timelineAvatar?: EuiCommentProps['timelineAvatar'];
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
SECURITY_SOLUTION_OWNER,
|
||||
} from '../../../common/constants';
|
||||
import { getUICapabilities } from './capabilities';
|
||||
import { CasesPermissions } from '../../../common';
|
||||
import type { CasesPermissions } from '../../../common';
|
||||
|
||||
export type CasesOwners =
|
||||
| typeof SECURITY_SOLUTION_OWNER
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { CasesPermissions } from '../../../common';
|
||||
import type { CasesPermissions } from '../../../common';
|
||||
import {
|
||||
CREATE_CASES_CAPABILITY,
|
||||
DELETE_CASES_CAPABILITY,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { ALERT_RULE_NAME, ALERT_RULE_UUID } from '@kbn/rule-data-utils';
|
||||
import { get } from 'lodash/fp';
|
||||
import { Ecs } from '../../../common';
|
||||
import type { Ecs } from '../../../common';
|
||||
|
||||
type Maybe<T> = T | null;
|
||||
interface Event {
|
||||
|
|
|
@ -5,10 +5,11 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { CommentRequestAlertType } from '../../../common/api';
|
||||
import { CommentType, Ecs } from '../../../common';
|
||||
import type { CommentRequestAlertType } from '../../../common/api';
|
||||
import type { Ecs } from '../../../common';
|
||||
import { CommentType } from '../../../common';
|
||||
import { getRuleIdFromEvent } from './get_rule_id_from_event';
|
||||
import { CaseAttachmentsWithoutOwner } from '../../types';
|
||||
import type { CaseAttachmentsWithoutOwner } from '../../types';
|
||||
|
||||
type Maybe<T> = T | null;
|
||||
interface Event {
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
|
||||
import React, { lazy, Suspense } from 'react';
|
||||
import { EuiLoadingSpinner } from '@elastic/eui';
|
||||
import { AllCasesSelectorModalProps } from '../../components/all_cases/selector_modal';
|
||||
import { CasesProvider, CasesContextProps } from '../../components/cases_context';
|
||||
import type { AllCasesSelectorModalProps } from '../../components/all_cases/selector_modal';
|
||||
import type { CasesContextProps } from '../../components/cases_context';
|
||||
import { CasesProvider } from '../../components/cases_context';
|
||||
|
||||
type GetAllCasesSelectorModalPropsInternal = AllCasesSelectorModalProps & CasesContextProps;
|
||||
export type GetAllCasesSelectorModalProps = Omit<
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
import { EuiLoadingSpinner } from '@elastic/eui';
|
||||
import React, { lazy, Suspense } from 'react';
|
||||
import type { CasesProps } from '../../components/app';
|
||||
import { CasesProvider, CasesContextProps } from '../../components/cases_context';
|
||||
import type { CasesContextProps } from '../../components/cases_context';
|
||||
import { CasesProvider } from '../../components/cases_context';
|
||||
|
||||
type GetCasesPropsInternal = CasesProps & CasesContextProps;
|
||||
export type GetCasesProps = Omit<
|
||||
|
|
|
@ -6,8 +6,9 @@
|
|||
*/
|
||||
|
||||
import { EuiLoadingSpinner } from '@elastic/eui';
|
||||
import React, { lazy, ReactNode, Suspense } from 'react';
|
||||
import { CasesContextProps } from '../../components/cases_context';
|
||||
import type { ReactNode } from 'react';
|
||||
import React, { lazy, Suspense } from 'react';
|
||||
import type { CasesContextProps } from '../../components/cases_context';
|
||||
|
||||
export type GetCasesContextPropsInternal = CasesContextProps;
|
||||
export type GetCasesContextProps = Omit<
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
import React, { lazy, Suspense } from 'react';
|
||||
import { EuiLoadingSpinner } from '@elastic/eui';
|
||||
import type { CreateCaseFlyoutProps } from '../../components/create/flyout';
|
||||
import { CasesProvider, CasesContextProps } from '../../components/cases_context';
|
||||
import type { CasesContextProps } from '../../components/cases_context';
|
||||
import { CasesProvider } from '../../components/cases_context';
|
||||
|
||||
type GetCreateCaseFlyoutPropsInternal = CreateCaseFlyoutProps & CasesContextProps;
|
||||
export type GetCreateCaseFlyoutProps = Omit<
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
|
||||
import { EuiLoadingSpinner } from '@elastic/eui';
|
||||
import React, { lazy, Suspense } from 'react';
|
||||
import { CasesProvider, CasesContextProps } from '../../components/cases_context';
|
||||
import { RecentCasesProps } from '../../components/recent_cases';
|
||||
import type { CasesContextProps } from '../../components/cases_context';
|
||||
import { CasesProvider } from '../../components/cases_context';
|
||||
import type { RecentCasesProps } from '../../components/recent_cases';
|
||||
|
||||
type GetRecentCasesPropsInternal = RecentCasesProps & CasesContextProps;
|
||||
export type GetRecentCasesProps = Omit<
|
||||
|
|
|
@ -6,10 +6,12 @@
|
|||
*/
|
||||
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { CaseAttachmentsWithoutOwner } from '../../types';
|
||||
import {
|
||||
import type { CaseAttachmentsWithoutOwner } from '../../types';
|
||||
import type {
|
||||
StartAddAttachmentToExistingCaseTransaction,
|
||||
StartCreateCaseWithAttachmentsTransaction,
|
||||
} from './use_cases_transactions';
|
||||
import {
|
||||
useAddAttachmentToExistingCaseTransaction,
|
||||
useCreateCaseWithAttachmentsTransaction,
|
||||
} from './use_cases_transactions';
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { Transaction } from '@elastic/apm-rum';
|
||||
import type { Transaction } from '@elastic/apm-rum';
|
||||
import { useCallback } from 'react';
|
||||
import { CommentType } from '../../../common';
|
||||
import { CaseAttachmentsWithoutOwner } from '../../types';
|
||||
import type { CaseAttachmentsWithoutOwner } from '../../types';
|
||||
import { useStartTransaction } from './use_start_transaction';
|
||||
|
||||
const CREATE_CASE = 'createCase' as const;
|
||||
|
|
|
@ -10,8 +10,8 @@ import moment from 'moment-timezone';
|
|||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { AuthenticatedUser } from '@kbn/security-plugin/common/model';
|
||||
import { NavigateToAppOptions } from '@kbn/core/public';
|
||||
import type { AuthenticatedUser } from '@kbn/security-plugin/common/model';
|
||||
import type { NavigateToAppOptions } from '@kbn/core/public';
|
||||
import { getUICapabilities } from '../../../client/helpers/capabilities';
|
||||
import { convertToCamelCase } from '../../../api/utils';
|
||||
import {
|
||||
|
@ -19,8 +19,8 @@ import {
|
|||
DEFAULT_DATE_FORMAT,
|
||||
DEFAULT_DATE_FORMAT_TZ,
|
||||
} from '../../../../common/constants';
|
||||
import { CasesPermissions } from '../../../../common';
|
||||
import { StartServices } from '../../../types';
|
||||
import type { CasesPermissions } from '../../../../common';
|
||||
import type { StartServices } from '../../../types';
|
||||
import { useUiSetting, useKibana } from './kibana_react';
|
||||
|
||||
export const useDateFormat = (): string => useUiSetting<string>(DEFAULT_DATE_FORMAT);
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
import React from 'react';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
|
||||
import { PublicAppInfo } from '@kbn/core/public';
|
||||
import { RecursivePartial } from '@elastic/eui/src/components/common';
|
||||
import type { PublicAppInfo } from '@kbn/core/public';
|
||||
import type { RecursivePartial } from '@elastic/eui/src/components/common';
|
||||
import { coreMock } from '@kbn/core/public/mocks';
|
||||
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
|
||||
import { ILicense } from '@kbn/licensing-plugin/public';
|
||||
import { StartServices } from '../../../types';
|
||||
import { EuiTheme } from '@kbn/kibana-react-plugin/common';
|
||||
import type { ILicense } from '@kbn/licensing-plugin/public';
|
||||
import type { StartServices } from '../../../types';
|
||||
import type { EuiTheme } from '@kbn/kibana-react-plugin/common';
|
||||
import { securityMock } from '@kbn/security-plugin/public/mocks';
|
||||
import { spacesPluginMock } from '@kbn/spaces-plugin/public/mocks';
|
||||
import { triggersActionsUiMock } from '@kbn/triggers-actions-ui-plugin/public/mocks';
|
||||
|
|
|
@ -11,7 +11,7 @@ import {
|
|||
useUiSetting,
|
||||
useUiSetting$,
|
||||
} from '@kbn/kibana-react-plugin/public';
|
||||
import { StartServices } from '../../../types';
|
||||
import type { StartServices } from '../../../types';
|
||||
|
||||
const useTypedKibana = () => useKibana<StartServices>();
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { CoreStart } from '@kbn/core/public';
|
||||
import { CasesUiConfigType } from '../../../../common/ui/types';
|
||||
import type { CoreStart } from '@kbn/core/public';
|
||||
import type { CasesUiConfigType } from '../../../../common/ui/types';
|
||||
|
||||
type GlobalServices = Pick<CoreStart, 'http'>;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { ActionConnector, ActionTypeConnector } from '../../../common/api';
|
||||
import type { ActionConnector, ActionTypeConnector } from '../../../common/api';
|
||||
|
||||
export const connectorsMock: ActionConnector[] = [
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { CasesCapabilities, CasesPermissions } from '../../containers/types';
|
||||
import type { CasesCapabilities, CasesPermissions } from '../../containers/types';
|
||||
|
||||
export const allCasesPermissions = () => buildCasesPermissions();
|
||||
export const noCasesPermissions = () =>
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { TriggersAndActionsUIPublicPluginStart } from '@kbn/triggers-actions-ui-plugin/public';
|
||||
import type { TriggersAndActionsUIPublicPluginStart } from '@kbn/triggers-actions-ui-plugin/public';
|
||||
import { actionTypeRegistryMock } from '@kbn/triggers-actions-ui-plugin/public/application/action_type_registry.mock';
|
||||
import { CaseActionConnector } from '../../../common/ui/types';
|
||||
import type { CaseActionConnector } from '../../../common/ui/types';
|
||||
|
||||
const getUniqueActionTypeIds = (connectors: CaseActionConnector[]) =>
|
||||
new Set(connectors.map((connector) => connector.actionTypeId));
|
||||
|
|
|
@ -13,16 +13,17 @@ import { I18nProvider } from '@kbn/i18n-react';
|
|||
import { ThemeProvider } from 'styled-components';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
|
||||
import { render as reactRender, RenderOptions, RenderResult } from '@testing-library/react';
|
||||
import type { RenderOptions, RenderResult } from '@testing-library/react';
|
||||
import { render as reactRender } from '@testing-library/react';
|
||||
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
|
||||
import { ILicense } from '@kbn/licensing-plugin/public';
|
||||
import type { ILicense } from '@kbn/licensing-plugin/public';
|
||||
import { SECURITY_SOLUTION_OWNER } from '../../../common/constants';
|
||||
import { CasesFeatures, CasesPermissions } from '../../../common/ui/types';
|
||||
import type { CasesFeatures, CasesPermissions } from '../../../common/ui/types';
|
||||
import { CasesProvider } from '../../components/cases_context';
|
||||
import { createStartServicesMock } from '../lib/kibana/kibana_react.mock';
|
||||
import { FieldHook } from '../shared_imports';
|
||||
import { StartServices } from '../../types';
|
||||
import { ReleasePhase } from '../../components/types';
|
||||
import type { FieldHook } from '../shared_imports';
|
||||
import type { StartServices } from '../../types';
|
||||
import type { ReleasePhase } from '../../components/types';
|
||||
import { ExternalReferenceAttachmentTypeRegistry } from '../../client/attachment_framework/external_reference_registry';
|
||||
import { PersistableStateAttachmentTypeRegistry } from '../../client/attachment_framework/persistable_state_registry';
|
||||
import { allCasesPermissions } from './permissions';
|
||||
|
|
|
@ -12,8 +12,9 @@ import { parse, stringify } from 'query-string';
|
|||
import { APP_ID, CASES_CONFIGURE_PATH, CASES_CREATE_PATH } from '../../../common/constants';
|
||||
import { useNavigation } from '../lib/kibana';
|
||||
import { useCasesContext } from '../../components/cases_context/use_cases_context';
|
||||
import { ICasesDeepLinkId } from './deep_links';
|
||||
import { CaseViewPathParams, CaseViewPathSearchParams, generateCaseViewPath } from './paths';
|
||||
import type { ICasesDeepLinkId } from './deep_links';
|
||||
import type { CaseViewPathParams, CaseViewPathSearchParams } from './paths';
|
||||
import { generateCaseViewPath } from './paths';
|
||||
|
||||
export const useCaseViewParams = () => useParams<CaseViewPathParams>();
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
CASE_VIEW_COMMENT_PATH,
|
||||
CASE_VIEW_TAB_PATH,
|
||||
} from '../../../common/constants';
|
||||
import { CASE_VIEW_PAGE_TABS } from '../../../common/types';
|
||||
import type { CASE_VIEW_PAGE_TABS } from '../../../common/types';
|
||||
|
||||
export const DEFAULT_BASE_PATH = '/cases';
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { ReactWrapper } from 'enzyme';
|
||||
import type { ReactWrapper } from 'enzyme';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { MatcherFunction } from '@testing-library/react';
|
||||
import type { MatcherFunction } from '@testing-library/react';
|
||||
|
||||
/**
|
||||
* Convenience utility to remove text appended to links by EUI
|
||||
|
|
|
@ -8,10 +8,12 @@
|
|||
import React from 'react';
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { licensingMock } from '@kbn/licensing-plugin/public/mocks';
|
||||
import { CasesContextFeatures } from '../../common/ui';
|
||||
import { useCasesFeatures, UseCasesFeatures } from './use_cases_features';
|
||||
import type { CasesContextFeatures } from '../../common/ui';
|
||||
import type { UseCasesFeatures } from './use_cases_features';
|
||||
import { useCasesFeatures } from './use_cases_features';
|
||||
import { TestProviders } from './mock/test_providers';
|
||||
import { LicenseType, LICENSE_TYPE } from '@kbn/licensing-plugin/common/types';
|
||||
import type { LicenseType } from '@kbn/licensing-plugin/common/types';
|
||||
import { LICENSE_TYPE } from '@kbn/licensing-plugin/common/types';
|
||||
|
||||
describe('useCasesFeatures', () => {
|
||||
// isAlertsEnabled, isSyncAlertsEnabled, alerts
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { useMemo } from 'react';
|
||||
import { SingleCaseMetricsFeature } from '../../common/ui';
|
||||
import type { SingleCaseMetricsFeature } from '../../common/ui';
|
||||
import { useCasesContext } from '../components/cases_context/use_cases_context';
|
||||
import { useLicense } from './use_license';
|
||||
|
||||
|
|
|
@ -7,12 +7,13 @@
|
|||
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { useKibana, useToasts } from './lib/kibana';
|
||||
import { AppMockRenderer, createAppMockRenderer, TestProviders } from './mock';
|
||||
import type { AppMockRenderer } from './mock';
|
||||
import { createAppMockRenderer, TestProviders } from './mock';
|
||||
import { CaseToastSuccessContent, useCasesToast } from './use_cases_toast';
|
||||
import { alertComment, basicComment, mockCase } from '../containers/mock';
|
||||
import React from 'react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { SupportedCaseAttachment } from '../types';
|
||||
import type { SupportedCaseAttachment } from '../types';
|
||||
import { getByTestId } from '@testing-library/dom';
|
||||
import { OWNER_INFO } from '../../common/constants';
|
||||
|
||||
|
|
|
@ -11,10 +11,11 @@ import React from 'react';
|
|||
import styled from 'styled-components';
|
||||
import { toMountPoint } from '@kbn/kibana-react-plugin/public';
|
||||
import { isValidOwner } from '../../common/utils/owner';
|
||||
import { Case, CommentType } from '../../common';
|
||||
import type { Case } from '../../common';
|
||||
import { CommentType } from '../../common';
|
||||
import { useKibana, useToasts } from './lib/kibana';
|
||||
import { generateCaseViewPath } from './navigation';
|
||||
import { CaseAttachmentsWithoutOwner, ServerError } from '../types';
|
||||
import type { CaseAttachmentsWithoutOwner, ServerError } from '../types';
|
||||
import {
|
||||
CASE_ALERT_SUCCESS_SYNC_TEXT,
|
||||
CASE_ALERT_SUCCESS_TOAST,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { ILicense, LicenseType } from '@kbn/licensing-plugin/public';
|
||||
import type { ILicense, LicenseType } from '@kbn/licensing-plugin/public';
|
||||
import { useCallback } from 'react';
|
||||
import useObservable from 'react-use/lib/useObservable';
|
||||
import { Observable } from 'rxjs';
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../../common/mock';
|
||||
import type { AppMockRenderer } from '../../../common/mock';
|
||||
import { createAppMockRenderer } from '../../../common/mock';
|
||||
import { act, renderHook } from '@testing-library/react-hooks';
|
||||
import { useDeleteAction } from './use_delete_action';
|
||||
|
||||
|
|
|
@ -7,11 +7,11 @@
|
|||
|
||||
import React, { useCallback, useState } from 'react';
|
||||
import { EuiIcon, EuiTextColor, useEuiTheme } from '@elastic/eui';
|
||||
import { Case } from '../../../../common';
|
||||
import type { Case } from '../../../../common';
|
||||
import { useDeleteCases } from '../../../containers/use_delete_cases';
|
||||
|
||||
import * as i18n from './translations';
|
||||
import { UseActionProps } from '../types';
|
||||
import type { UseActionProps } from '../types';
|
||||
import { useCasesContext } from '../../cases_context/use_cases_context';
|
||||
|
||||
const getDeleteActionTitle = (totalCases: number): string =>
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../../common/mock';
|
||||
import type { AppMockRenderer } from '../../../common/mock';
|
||||
import { createAppMockRenderer } from '../../../common/mock';
|
||||
import { act, renderHook } from '@testing-library/react-hooks';
|
||||
import { useSeverityAction } from './use_severity_action';
|
||||
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
*/
|
||||
|
||||
import { useCallback } from 'react';
|
||||
import { EuiContextMenuPanelItemDescriptor } from '@elastic/eui';
|
||||
import type { EuiContextMenuPanelItemDescriptor } from '@elastic/eui';
|
||||
import { CaseSeverity } from '../../../../common/api';
|
||||
import { useUpdateCases } from '../../../containers/use_bulk_update_case';
|
||||
import { Case } from '../../../../common';
|
||||
import type { Case } from '../../../../common';
|
||||
|
||||
import * as i18n from './translations';
|
||||
import { UseActionProps } from '../types';
|
||||
import type { UseActionProps } from '../types';
|
||||
import { useCasesContext } from '../../cases_context/use_cases_context';
|
||||
import { severities } from '../../severity/config';
|
||||
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../../common/mock';
|
||||
import type { AppMockRenderer } from '../../../common/mock';
|
||||
import { createAppMockRenderer } from '../../../common/mock';
|
||||
import { act, renderHook } from '@testing-library/react-hooks';
|
||||
import { useStatusAction } from './use_status_action';
|
||||
|
||||
|
|
|
@ -6,12 +6,13 @@
|
|||
*/
|
||||
|
||||
import { useCallback } from 'react';
|
||||
import { EuiContextMenuPanelItemDescriptor } from '@elastic/eui';
|
||||
import type { EuiContextMenuPanelItemDescriptor } from '@elastic/eui';
|
||||
import { useUpdateCases } from '../../../containers/use_bulk_update_case';
|
||||
import { Case, CaseStatuses } from '../../../../common';
|
||||
import type { Case } from '../../../../common';
|
||||
import { CaseStatuses } from '../../../../common';
|
||||
|
||||
import * as i18n from './translations';
|
||||
import { UseActionProps } from '../types';
|
||||
import type { UseActionProps } from '../types';
|
||||
import { statuses } from '../../status';
|
||||
import { useCasesContext } from '../../cases_context/use_cases_context';
|
||||
|
||||
|
|
|
@ -15,10 +15,11 @@ import { noCreateCasesPermissions, TestProviders } from '../../common/mock';
|
|||
import { CommentType } from '../../../common/api';
|
||||
import { SECURITY_SOLUTION_OWNER } from '../../../common/constants';
|
||||
import { useCreateAttachments } from '../../containers/use_create_attachments';
|
||||
import { AddComment, AddCommentProps, AddCommentRefObject } from '.';
|
||||
import type { AddCommentProps, AddCommentRefObject } from '.';
|
||||
import { AddComment } from '.';
|
||||
import { CasesTimelineIntegrationProvider } from '../timeline_context';
|
||||
import { timelineIntegrationMock } from '../__mock__/timeline';
|
||||
import { CaseAttachmentWithoutOwner } from '../../types';
|
||||
import type { CaseAttachmentWithoutOwner } from '../../types';
|
||||
|
||||
jest.mock('../../containers/use_create_attachments');
|
||||
|
||||
|
|
|
@ -19,12 +19,14 @@ import { isEmpty } from 'lodash';
|
|||
|
||||
import { CommentType } from '../../../common/api';
|
||||
import { useCreateAttachments } from '../../containers/use_create_attachments';
|
||||
import { Case } from '../../containers/types';
|
||||
import { EuiMarkdownEditorRef, MarkdownEditorForm } from '../markdown_editor';
|
||||
import type { Case } from '../../containers/types';
|
||||
import type { EuiMarkdownEditorRef } from '../markdown_editor';
|
||||
import { MarkdownEditorForm } from '../markdown_editor';
|
||||
import { Form, useForm, UseField, useFormData } from '../../common/shared_imports';
|
||||
|
||||
import * as i18n from './translations';
|
||||
import { schema, AddCommentFormSchema } from './schema';
|
||||
import type { AddCommentFormSchema } from './schema';
|
||||
import { schema } from './schema';
|
||||
import { InsertTimeline } from '../insert_timeline';
|
||||
import { useCasesContext } from '../cases_context/use_cases_context';
|
||||
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { CommentRequestUserType } from '../../../common/api';
|
||||
import { FIELD_TYPES, fieldValidators, FormSchema } from '../../common/shared_imports';
|
||||
import type { CommentRequestUserType } from '../../../common/api';
|
||||
import type { FormSchema } from '../../common/shared_imports';
|
||||
import { FIELD_TYPES, fieldValidators } from '../../common/shared_imports';
|
||||
import * as i18n from './translations';
|
||||
|
||||
const { emptyField } = fieldValidators;
|
||||
|
|
|
@ -14,8 +14,8 @@ import userEvent from '@testing-library/user-event';
|
|||
import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl';
|
||||
|
||||
import '../../common/mock/match_media';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import {
|
||||
AppMockRenderer,
|
||||
createAppMockRenderer,
|
||||
noDeleteCasesPermissions,
|
||||
readCasesPermissions,
|
||||
|
@ -29,7 +29,8 @@ import { SECURITY_SOLUTION_OWNER } from '../../../common/constants';
|
|||
import { getEmptyTagValue } from '../empty_value';
|
||||
import { useKibana } from '../../common/lib/kibana';
|
||||
import { AllCasesList } from './all_cases_list';
|
||||
import { GetCasesColumn, useCasesColumns, UseCasesColumnsReturnValue } from './use_cases_columns';
|
||||
import type { GetCasesColumn, UseCasesColumnsReturnValue } from './use_cases_columns';
|
||||
import { useCasesColumns } from './use_cases_columns';
|
||||
import { triggersActionsUiMock } from '@kbn/triggers-actions-ui-plugin/public/mocks';
|
||||
import { registerConnectorsToMockActionRegistry } from '../../common/mock/register_connectors';
|
||||
import { createStartServicesMock } from '../../common/lib/kibana/kibana_react.mock';
|
||||
|
|
|
@ -6,24 +6,24 @@
|
|||
*/
|
||||
|
||||
import React, { useCallback, useMemo, useRef, useState } from 'react';
|
||||
import { EuiProgress, EuiBasicTable, EuiTableSelectionType } from '@elastic/eui';
|
||||
import type { EuiBasicTable, EuiTableSelectionType } from '@elastic/eui';
|
||||
import { EuiProgress } from '@elastic/eui';
|
||||
import { difference, head, isEmpty } from 'lodash/fp';
|
||||
import styled, { css } from 'styled-components';
|
||||
|
||||
import {
|
||||
import type {
|
||||
Case,
|
||||
CaseStatusWithAllStatus,
|
||||
FilterOptions,
|
||||
QueryParams,
|
||||
SortFieldCase,
|
||||
StatusAll,
|
||||
} from '../../../common/ui/types';
|
||||
import { SortFieldCase, StatusAll } from '../../../common/ui/types';
|
||||
import { CaseStatuses, caseStatuses } from '../../../common/api';
|
||||
|
||||
import { useAvailableCasesOwners } from '../app/use_available_owners';
|
||||
import { useCasesColumns } from './use_cases_columns';
|
||||
import { CasesTableFilters } from './table_filters';
|
||||
import { EuiBasicTableOnChange } from './types';
|
||||
import type { EuiBasicTableOnChange } from './types';
|
||||
|
||||
import { CasesTable } from './table';
|
||||
import { useCasesContext } from '../cases_context/use_cases_context';
|
||||
|
|
|
@ -8,8 +8,10 @@
|
|||
import React from 'react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { screen, fireEvent, waitFor, within } from '@testing-library/react';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../common/mock';
|
||||
import { AssigneesFilterPopover, AssigneesFilterPopoverProps } from './assignees_filter';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer } from '../../common/mock';
|
||||
import type { AssigneesFilterPopoverProps } from './assignees_filter';
|
||||
import { AssigneesFilterPopover } from './assignees_filter';
|
||||
import { userProfiles } from '../../containers/user_profiles/api.mock';
|
||||
import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl';
|
||||
|
||||
|
|
|
@ -6,13 +6,14 @@
|
|||
*/
|
||||
|
||||
import { EuiFilterButton } from '@elastic/eui';
|
||||
import { UserProfilesPopover, UserProfileWithAvatar } from '@kbn/user-profile-components';
|
||||
import type { UserProfileWithAvatar } from '@kbn/user-profile-components';
|
||||
import { UserProfilesPopover } from '@kbn/user-profile-components';
|
||||
import { isEmpty } from 'lodash';
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import { useSuggestUserProfiles } from '../../containers/user_profiles/use_suggest_user_profiles';
|
||||
import { useAvailableCasesOwners } from '../app/use_available_owners';
|
||||
import { useCasesContext } from '../cases_context/use_cases_context';
|
||||
import { CurrentUserProfile } from '../types';
|
||||
import type { CurrentUserProfile } from '../types';
|
||||
import { EmptyMessage } from '../user_profiles/empty_message';
|
||||
import { NoMatches } from '../user_profiles/no_matches';
|
||||
import { SelectedStatusMessage } from '../user_profiles/selected_status_message';
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
import { waitFor, within } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../common/mock';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer } from '../../common/mock';
|
||||
import { CasesMetrics } from './cases_metrics';
|
||||
|
||||
jest.mock('../../api');
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
import React from 'react';
|
||||
|
||||
import { AppMockRenderer, buildCasesPermissions, createAppMockRenderer } from '../../common/mock';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { buildCasesPermissions, createAppMockRenderer } from '../../common/mock';
|
||||
import { CasesTableHeader } from './header';
|
||||
|
||||
describe('CasesTableHeader', () => {
|
||||
|
|
|
@ -5,11 +5,12 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import React, { FunctionComponent } from 'react';
|
||||
import type { FunctionComponent } from 'react';
|
||||
import React from 'react';
|
||||
import { EuiFlexGroup } from '@elastic/eui';
|
||||
import { HeaderPage } from '../header_page';
|
||||
import * as i18n from './translations';
|
||||
import { ErrorMessage } from '../use_push_to_service/callout/types';
|
||||
import type { ErrorMessage } from '../use_push_to_service/callout/types';
|
||||
import { NavButtons } from './nav_buttons';
|
||||
|
||||
interface OwnProps {
|
||||
|
|
|
@ -9,11 +9,8 @@ import React from 'react';
|
|||
import { waitFor } from '@testing-library/react';
|
||||
|
||||
import { AllCases } from '.';
|
||||
import {
|
||||
AppMockRenderer,
|
||||
createAppMockRenderer,
|
||||
noCreateCasesPermissions,
|
||||
} from '../../common/mock';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer, noCreateCasesPermissions } from '../../common/mock';
|
||||
import { useGetActionLicense } from '../../containers/use_get_action_license';
|
||||
import { connectorsMock, useGetCasesMockState } from '../../containers/mock';
|
||||
import { useGetConnectors } from '../../containers/configure/use_connectors';
|
||||
|
|
|
@ -5,13 +5,14 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import React, { FunctionComponent, useCallback } from 'react';
|
||||
import type { FunctionComponent } from 'react';
|
||||
import React, { useCallback } from 'react';
|
||||
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
|
||||
import { isEmpty } from 'lodash/fp';
|
||||
import styled, { css } from 'styled-components';
|
||||
import * as i18n from './translations';
|
||||
import { ConfigureCaseButton, LinkButton } from '../links';
|
||||
import { ErrorMessage } from '../use_push_to_service/callout/types';
|
||||
import type { ErrorMessage } from '../use_push_to_service/callout/types';
|
||||
import { useCreateCaseNavigation } from '../../common/navigation';
|
||||
import { useCasesContext } from '../cases_context/use_cases_context';
|
||||
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
import React from 'react';
|
||||
|
||||
import { AllCasesSelectorModal } from '.';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../../common/mock';
|
||||
import type { AppMockRenderer } from '../../../common/mock';
|
||||
import { createAppMockRenderer } from '../../../common/mock';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { act, waitFor } from '@testing-library/react';
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
} from '@elastic/eui';
|
||||
import styled from 'styled-components';
|
||||
import { QueryClientProvider } from '@tanstack/react-query';
|
||||
import { Case, CaseStatusWithAllStatus } from '../../../../common/ui/types';
|
||||
import type { Case, CaseStatusWithAllStatus } from '../../../../common/ui/types';
|
||||
import * as i18n from '../../../common/translations';
|
||||
import { AllCasesList } from '../all_cases_list';
|
||||
import { casesQueryClient } from '../../cases_context/query_client';
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
* 2.0; you may not use this file except in compliance with the Elastic License
|
||||
* 2.0.
|
||||
*/
|
||||
import { AllCasesSelectorModal, AllCasesSelectorModalProps } from './all_cases_selector_modal';
|
||||
import type { AllCasesSelectorModalProps } from './all_cases_selector_modal';
|
||||
import { AllCasesSelectorModal } from './all_cases_selector_modal';
|
||||
|
||||
export type { AllCasesSelectorModalProps };
|
||||
export { AllCasesSelectorModal };
|
||||
|
|
|
@ -10,8 +10,10 @@ import { act, renderHook } from '@testing-library/react-hooks';
|
|||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
import AllCasesSelectorModal from '.';
|
||||
import { Case, CaseStatuses, StatusAll } from '../../../../common';
|
||||
import { allCasesPermissions, AppMockRenderer, createAppMockRenderer } from '../../../common/mock';
|
||||
import type { Case } from '../../../../common';
|
||||
import { CaseStatuses, StatusAll } from '../../../../common';
|
||||
import type { AppMockRenderer } from '../../../common/mock';
|
||||
import { allCasesPermissions, createAppMockRenderer } from '../../../common/mock';
|
||||
import { useCasesToast } from '../../../common/use_cases_toast';
|
||||
import { alertComment } from '../../../containers/mock';
|
||||
import { useCreateAttachments } from '../../../containers/use_create_attachments';
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
import { useCallback } from 'react';
|
||||
import { CaseStatuses, StatusAll } from '../../../../common';
|
||||
import { AllCasesSelectorModalProps } from '.';
|
||||
import type { AllCasesSelectorModalProps } from '.';
|
||||
import { useCasesToast } from '../../../common/use_cases_toast';
|
||||
import { Case } from '../../../containers/types';
|
||||
import type { Case } from '../../../containers/types';
|
||||
import { CasesContextStoreActionsList } from '../../cases_context/cases_context_reducer';
|
||||
import { useCasesContext } from '../../cases_context/use_cases_context';
|
||||
import { useCasesAddToNewCaseFlyout } from '../../create/flyout/use_cases_add_to_new_case_flyout';
|
||||
import { CaseAttachmentsWithoutOwner } from '../../../types';
|
||||
import type { CaseAttachmentsWithoutOwner } from '../../../types';
|
||||
import { useCreateAttachments } from '../../../containers/use_create_attachments';
|
||||
import { useAddAttachmentToExistingCaseTransaction } from '../../../common/apm/use_cases_transactions';
|
||||
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
import { CaseSeverity } from '../../../common/api';
|
||||
import React from 'react';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../common/mock';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer } from '../../common/mock';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl';
|
||||
|
|
|
@ -5,16 +5,11 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import {
|
||||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
EuiHealth,
|
||||
EuiSuperSelect,
|
||||
EuiSuperSelectOption,
|
||||
EuiText,
|
||||
} from '@elastic/eui';
|
||||
import type { EuiSuperSelectOption } from '@elastic/eui';
|
||||
import { EuiFlexGroup, EuiFlexItem, EuiHealth, EuiSuperSelect, EuiText } from '@elastic/eui';
|
||||
import React from 'react';
|
||||
import { CaseSeverityWithAll, SeverityAll } from '../../containers/types';
|
||||
import type { CaseSeverityWithAll } from '../../containers/types';
|
||||
import { SeverityAll } from '../../containers/types';
|
||||
import { severitiesWithAll } from '../severity/config';
|
||||
|
||||
interface Props {
|
||||
|
|
|
@ -6,16 +6,12 @@
|
|||
*/
|
||||
|
||||
import React, { memo } from 'react';
|
||||
import {
|
||||
EuiSuperSelect,
|
||||
EuiSuperSelectOption,
|
||||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
EuiBadge,
|
||||
} from '@elastic/eui';
|
||||
import type { EuiSuperSelectOption } from '@elastic/eui';
|
||||
import { EuiSuperSelect, EuiFlexGroup, EuiFlexItem, EuiBadge } from '@elastic/eui';
|
||||
import { Status } from '@kbn/cases-components';
|
||||
import { allCaseStatus, statuses } from '../status';
|
||||
import { CaseStatusWithAllStatus, StatusAll } from '../../../common/ui/types';
|
||||
import type { CaseStatusWithAllStatus } from '../../../common/ui/types';
|
||||
import { StatusAll } from '../../../common/ui/types';
|
||||
|
||||
interface Props {
|
||||
stats: Record<CaseStatusWithAllStatus, number | null>;
|
||||
|
|
|
@ -5,21 +5,16 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import React, { FunctionComponent, MutableRefObject, useCallback } from 'react';
|
||||
import {
|
||||
EuiEmptyPrompt,
|
||||
EuiLoadingContent,
|
||||
EuiTableSelectionType,
|
||||
EuiBasicTable,
|
||||
EuiBasicTableProps,
|
||||
Pagination,
|
||||
} from '@elastic/eui';
|
||||
import type { FunctionComponent, MutableRefObject } from 'react';
|
||||
import React, { useCallback } from 'react';
|
||||
import type { EuiTableSelectionType, EuiBasicTableProps, Pagination } from '@elastic/eui';
|
||||
import { EuiEmptyPrompt, EuiLoadingContent, EuiBasicTable } from '@elastic/eui';
|
||||
import classnames from 'classnames';
|
||||
import styled from 'styled-components';
|
||||
|
||||
import { CasesTableUtilityBar } from './utility_bar';
|
||||
import { LinkButton } from '../links';
|
||||
import { Cases, Case } from '../../../common/ui/types';
|
||||
import type { Cases, Case } from '../../../common/ui/types';
|
||||
import * as i18n from './translations';
|
||||
import { useCreateCaseNavigation } from '../../common/navigation';
|
||||
import { useCasesContext } from '../cases_context/use_cases_context';
|
||||
|
|
|
@ -14,7 +14,8 @@ import { licensingMock } from '@kbn/licensing-plugin/public/mocks';
|
|||
|
||||
import { CaseStatuses } from '../../../common/api';
|
||||
import { OBSERVABILITY_OWNER, SECURITY_SOLUTION_OWNER } from '../../../common/constants';
|
||||
import { AppMockRenderer, createAppMockRenderer, TestProviders } from '../../common/mock';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer, TestProviders } from '../../common/mock';
|
||||
import { DEFAULT_FILTER_OPTIONS } from '../../containers/use_get_cases';
|
||||
import { CasesTableFilters } from './table_filters';
|
||||
import { useGetTags } from '../../containers/use_get_tags';
|
||||
|
|
|
@ -10,10 +10,11 @@ import { isEqual } from 'lodash/fp';
|
|||
import styled from 'styled-components';
|
||||
import { EuiFlexGroup, EuiFlexItem, EuiFieldSearch, EuiFilterGroup, EuiButton } from '@elastic/eui';
|
||||
|
||||
import { UserProfileWithAvatar } from '@kbn/user-profile-components';
|
||||
import { StatusAll, CaseStatusWithAllStatus, CaseSeverityWithAll } from '../../../common/ui/types';
|
||||
import type { UserProfileWithAvatar } from '@kbn/user-profile-components';
|
||||
import type { CaseStatusWithAllStatus, CaseSeverityWithAll } from '../../../common/ui/types';
|
||||
import { StatusAll } from '../../../common/ui/types';
|
||||
import { CaseStatuses } from '../../../common/api';
|
||||
import { FilterOptions } from '../../containers/types';
|
||||
import type { FilterOptions } from '../../containers/types';
|
||||
import { FilterPopover } from '../filter_popover';
|
||||
import { StatusFilter } from './status_filter';
|
||||
import * as i18n from './translations';
|
||||
|
@ -21,7 +22,7 @@ import { SeverityFilter } from './severity_filter';
|
|||
import { useGetTags } from '../../containers/use_get_tags';
|
||||
import { DEFAULT_FILTER_OPTIONS } from '../../containers/use_get_cases';
|
||||
import { AssigneesFilterPopover } from './assignees_filter';
|
||||
import { CurrentUserProfile } from '../types';
|
||||
import type { CurrentUserProfile } from '../types';
|
||||
import { useCasesFeatures } from '../../common/use_cases_features';
|
||||
|
||||
interface CasesTableFiltersProps {
|
||||
|
|
|
@ -12,8 +12,8 @@ import { act, renderHook } from '@testing-library/react-hooks';
|
|||
import { useActions } from './use_actions';
|
||||
import { basicCase } from '../../containers/mock';
|
||||
import * as api from '../../containers/api';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import {
|
||||
AppMockRenderer,
|
||||
createAppMockRenderer,
|
||||
noDeleteCasesPermissions,
|
||||
onlyDeleteCasesPermission,
|
||||
|
|
|
@ -6,16 +6,14 @@
|
|||
*/
|
||||
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import {
|
||||
EuiButtonIcon,
|
||||
EuiContextMenu,
|
||||
import type {
|
||||
EuiContextMenuPanelDescriptor,
|
||||
EuiContextMenuPanelItemDescriptor,
|
||||
EuiPopover,
|
||||
EuiTableComputedColumnType,
|
||||
} from '@elastic/eui';
|
||||
import { EuiButtonIcon, EuiContextMenu, EuiPopover } from '@elastic/eui';
|
||||
import { FormattedMessage } from '@kbn/i18n-react';
|
||||
import { Case } from '../../containers/types';
|
||||
import type { Case } from '../../containers/types';
|
||||
import { useDeleteAction } from '../actions/delete/use_delete_action';
|
||||
import { ConfirmDeleteCaseModal } from '../confirm_delete_case';
|
||||
import { useStatusAction } from '../actions/status/use_status_action';
|
||||
|
|
|
@ -11,9 +11,9 @@ import userEvent from '@testing-library/user-event';
|
|||
import { waitFor } from '@testing-library/react';
|
||||
import { act, renderHook } from '@testing-library/react-hooks';
|
||||
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import {
|
||||
allCasesPermissions,
|
||||
AppMockRenderer,
|
||||
createAppMockRenderer,
|
||||
noDeleteCasesPermissions,
|
||||
onlyDeleteCasesPermission,
|
||||
|
|
|
@ -5,10 +5,13 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { EuiContextMenuPanelDescriptor, EuiContextMenuPanelItemDescriptor } from '@elastic/eui';
|
||||
import type {
|
||||
EuiContextMenuPanelDescriptor,
|
||||
EuiContextMenuPanelItemDescriptor,
|
||||
} from '@elastic/eui';
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
import { Case } from '../../containers/types';
|
||||
import type { Case } from '../../containers/types';
|
||||
import { useDeleteAction } from '../actions/delete/use_delete_action';
|
||||
import { useSeverityAction } from '../actions/severity/use_severity_action';
|
||||
import { useStatusAction } from '../actions/status/use_status_action';
|
||||
|
|
|
@ -10,15 +10,12 @@ import { mount } from 'enzyme';
|
|||
import { licensingMock } from '@kbn/licensing-plugin/public/mocks';
|
||||
|
||||
import '../../common/mock/match_media';
|
||||
import { ExternalServiceColumn, GetCasesColumn, useCasesColumns } from './use_cases_columns';
|
||||
import type { GetCasesColumn } from './use_cases_columns';
|
||||
import { ExternalServiceColumn, useCasesColumns } from './use_cases_columns';
|
||||
import { useGetCasesMockState } from '../../containers/mock';
|
||||
import { connectors } from '../configure_cases/__mock__';
|
||||
import {
|
||||
AppMockRenderer,
|
||||
createAppMockRenderer,
|
||||
readCasesPermissions,
|
||||
TestProviders,
|
||||
} from '../../common/mock';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer, readCasesPermissions, TestProviders } from '../../common/mock';
|
||||
import { renderHook } from '@testing-library/react-hooks';
|
||||
import { CaseStatuses } from '../../../common';
|
||||
import { userProfilesMap, userProfiles } from '../../containers/user_profiles/api.mock';
|
||||
|
|
|
@ -6,14 +6,16 @@
|
|||
*/
|
||||
|
||||
import React, { useCallback } from 'react';
|
||||
import type {
|
||||
EuiTableActionsColumnType,
|
||||
EuiTableComputedColumnType,
|
||||
EuiTableFieldDataColumnType,
|
||||
} from '@elastic/eui';
|
||||
import {
|
||||
EuiBadgeGroup,
|
||||
EuiBadge,
|
||||
EuiButton,
|
||||
EuiLink,
|
||||
EuiTableActionsColumnType,
|
||||
EuiTableComputedColumnType,
|
||||
EuiTableFieldDataColumnType,
|
||||
EuiFlexGroup,
|
||||
EuiFlexItem,
|
||||
EuiIcon,
|
||||
|
@ -23,10 +25,11 @@ import {
|
|||
import { RIGHT_ALIGNMENT } from '@elastic/eui/lib/services';
|
||||
import styled from 'styled-components';
|
||||
import { Status } from '@kbn/cases-components';
|
||||
import { UserProfileWithAvatar } from '@kbn/user-profile-components';
|
||||
import type { UserProfileWithAvatar } from '@kbn/user-profile-components';
|
||||
|
||||
import { Case } from '../../../common/ui/types';
|
||||
import { CaseStatuses, ActionConnector, CaseSeverity } from '../../../common/api';
|
||||
import type { Case } from '../../../common/ui/types';
|
||||
import type { ActionConnector } from '../../../common/api';
|
||||
import { CaseStatuses, CaseSeverity } from '../../../common/api';
|
||||
import { OWNER_INFO } from '../../../common/constants';
|
||||
import { getEmptyTagValue } from '../empty_value';
|
||||
import { FormattedRelativePreferenceDate } from '../formatted_date';
|
||||
|
@ -42,7 +45,7 @@ import { severities } from '../severity/config';
|
|||
import { UserToolTip } from '../user_profiles/user_tooltip';
|
||||
import { useAssignees } from '../../containers/user_profiles/use_assignees';
|
||||
import { getUsernameDataTestSubj } from '../user_profiles/data_test_subject';
|
||||
import { CurrentUserProfile } from '../types';
|
||||
import type { CurrentUserProfile } from '../types';
|
||||
import { SmallUserAvatar } from '../user_profiles/small_user_avatar';
|
||||
import { useCasesFeatures } from '../../common/use_cases_features';
|
||||
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
*/
|
||||
|
||||
import { act, renderHook } from '@testing-library/react-hooks';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../common/mock';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer } from '../../common/mock';
|
||||
import { casesQueriesKeys } from '../../containers/constants';
|
||||
import { useRefreshCases } from './use_on_refresh_cases';
|
||||
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
import { act, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import React from 'react';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import {
|
||||
noCasesPermissions,
|
||||
onlyDeleteCasesPermission,
|
||||
AppMockRenderer,
|
||||
createAppMockRenderer,
|
||||
writeCasesPermissions,
|
||||
} from '../../common/mock';
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import React, { FunctionComponent, useCallback, useState } from 'react';
|
||||
import type { FunctionComponent } from 'react';
|
||||
import React, { useCallback, useState } from 'react';
|
||||
import {
|
||||
EuiButtonEmpty,
|
||||
EuiContextMenu,
|
||||
|
@ -16,7 +17,7 @@ import {
|
|||
useEuiTheme,
|
||||
} from '@elastic/eui';
|
||||
import * as i18n from './translations';
|
||||
import { Case } from '../../../common/ui/types';
|
||||
import type { Case } from '../../../common/ui/types';
|
||||
import { useRefreshCases } from './use_on_refresh_cases';
|
||||
import { useBulkActions } from './use_bulk_actions';
|
||||
import { useCasesContext } from '../cases_context/use_cases_context';
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
import React from 'react';
|
||||
import { APP_OWNER } from '../../../common/constants';
|
||||
import { ExternalReferenceAttachmentTypeRegistry } from '../../client/attachment_framework/external_reference_registry';
|
||||
import { PersistableStateAttachmentTypeRegistry } from '../../client/attachment_framework/persistable_state_registry';
|
||||
import type { ExternalReferenceAttachmentTypeRegistry } from '../../client/attachment_framework/external_reference_registry';
|
||||
import type { PersistableStateAttachmentTypeRegistry } from '../../client/attachment_framework/persistable_state_registry';
|
||||
import { getCasesLazy } from '../../client/ui/get_cases';
|
||||
import { useApplicationCapabilities } from '../../common/lib/kibana';
|
||||
|
||||
import { Wrapper } from '../wrappers';
|
||||
import { CasesRoutesProps } from './types';
|
||||
import type { CasesRoutesProps } from './types';
|
||||
|
||||
export type CasesProps = CasesRoutesProps;
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
// eslint-disable-next-line @kbn/eslint/module_migration
|
||||
import { MemoryRouterProps } from 'react-router';
|
||||
import type { MemoryRouterProps } from 'react-router';
|
||||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import {
|
||||
|
@ -17,7 +17,7 @@ import {
|
|||
TestProviders,
|
||||
} from '../../common/mock';
|
||||
import { CasesRoutes } from './routes';
|
||||
import { CasesPermissions } from '../../../common';
|
||||
import type { CasesPermissions } from '../../../common';
|
||||
|
||||
jest.mock('../all_cases', () => ({
|
||||
AllCases: () => <div>{'All cases'}</div>,
|
||||
|
|
|
@ -13,7 +13,7 @@ import { EuiLoadingSpinner } from '@elastic/eui';
|
|||
import { AllCases } from '../all_cases';
|
||||
import { CreateCase } from '../create';
|
||||
import { ConfigureCases } from '../configure_cases';
|
||||
import { CasesRoutesProps } from './types';
|
||||
import type { CasesRoutesProps } from './types';
|
||||
import { useCasesContext } from '../cases_context/use_cases_context';
|
||||
import {
|
||||
getCasesConfigurePath,
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { MutableRefObject } from 'react';
|
||||
import { CaseViewRefreshPropInterface, UseFetchAlertData } from '../../../common/ui/types';
|
||||
import { CasesNavigation } from '../links';
|
||||
import { CasesTimelineIntegration } from '../timeline_context';
|
||||
import type { MutableRefObject } from 'react';
|
||||
import type { CaseViewRefreshPropInterface, UseFetchAlertData } from '../../../common/ui/types';
|
||||
import type { CasesNavigation } from '../links';
|
||||
import type { CasesTimelineIntegration } from '../timeline_context';
|
||||
|
||||
export interface CasesRoutesProps {
|
||||
onComponentInitialized?: () => void;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { APP_ID, FEATURE_ID } from '../../../common/constants';
|
||||
import { useKibana } from '../../common/lib/kibana';
|
||||
import { CasesPermissions } from '../../containers/types';
|
||||
import type { CasesPermissions } from '../../containers/types';
|
||||
import { allCasePermissions } from '../../utils/permissions';
|
||||
|
||||
type Capability = Exclude<keyof CasesPermissions, 'all'>;
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
|
||||
import React from 'react';
|
||||
import { licensingMock } from '@kbn/licensing-plugin/public/mocks';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../common/mock';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer } from '../../common/mock';
|
||||
import { CaseCallouts } from './case_callouts';
|
||||
|
||||
describe('CaseCallouts ', () => {
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../common/mock';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer } from '../../common/mock';
|
||||
import { PlatinumLicenseCallout } from './platinum_callout';
|
||||
|
||||
describe('PlatinumLicenseCallout ', () => {
|
||||
|
|
|
@ -12,8 +12,8 @@ import * as i18n from '../case_view/translations';
|
|||
import { useDeleteCases } from '../../containers/use_delete_cases';
|
||||
import { ConfirmDeleteCaseModal } from '../confirm_delete_case';
|
||||
import { PropertyActions } from '../property_actions';
|
||||
import { Case } from '../../../common/ui/types';
|
||||
import { CaseService } from '../../containers/use_get_case_user_actions';
|
||||
import type { Case } from '../../../common/ui/types';
|
||||
import type { CaseService } from '../../containers/use_get_case_user_actions';
|
||||
import { useAllCasesNavigation } from '../../common/navigation';
|
||||
import { useCasesContext } from '../cases_context/use_cases_context';
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { CaseStatuses } from '../../../common/api';
|
||||
import { Case } from '../../containers/types';
|
||||
import type { Case } from '../../containers/types';
|
||||
import { statuses } from '../status';
|
||||
|
||||
export const getStatusDate = (theCase: Case): string | null => {
|
||||
|
|
|
@ -11,7 +11,8 @@ import { render, screen } from '@testing-library/react';
|
|||
import userEvent from '@testing-library/user-event';
|
||||
|
||||
import { basicCase, caseUserActions, getAlertUserAction } from '../../containers/mock';
|
||||
import { CaseActionBar, CaseActionBarProps } from '.';
|
||||
import type { CaseActionBarProps } from '.';
|
||||
import { CaseActionBar } from '.';
|
||||
import {
|
||||
allCasesPermissions,
|
||||
noDeleteCasesPermissions,
|
||||
|
|
|
@ -17,8 +17,8 @@ import {
|
|||
EuiIconTip,
|
||||
EuiLoadingSpinner,
|
||||
} from '@elastic/eui';
|
||||
import { Case } from '../../../common/ui/types';
|
||||
import { CaseStatuses } from '../../../common/api';
|
||||
import type { Case } from '../../../common/ui/types';
|
||||
import type { CaseStatuses } from '../../../common/api';
|
||||
import * as i18n from '../case_view/translations';
|
||||
import { Actions } from './actions';
|
||||
import { useGetCaseUserActions } from '../../containers/use_get_case_user_actions';
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
import React, { memo, useCallback, useMemo, useState } from 'react';
|
||||
import { EuiPopover, EuiContextMenuPanel, EuiContextMenuItem } from '@elastic/eui';
|
||||
import { Status } from '@kbn/cases-components';
|
||||
import { caseStatuses, CaseStatuses } from '../../../common/api';
|
||||
import type { CaseStatuses } from '../../../common/api';
|
||||
import { caseStatuses } from '../../../common/api';
|
||||
import { StatusPopoverButton } from '../status';
|
||||
import { CHANGE_STATUS } from '../all_cases/translations';
|
||||
|
||||
|
|
|
@ -10,12 +10,14 @@ import { act, waitFor, within } from '@testing-library/react';
|
|||
import userEvent from '@testing-library/user-event';
|
||||
import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl';
|
||||
import { ConnectorTypes } from '../../../common/api';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../common/mock';
|
||||
import type { AppMockRenderer } from '../../common/mock';
|
||||
import { createAppMockRenderer } from '../../common/mock';
|
||||
import '../../common/mock/match_media';
|
||||
import { useCaseViewNavigation, useUrlParams } from '../../common/navigation/hooks';
|
||||
import { useGetConnectors } from '../../containers/configure/use_connectors';
|
||||
import { basicCaseClosed, connectorsMock } from '../../containers/mock';
|
||||
import { useGetCase, UseGetCase } from '../../containers/use_get_case';
|
||||
import type { UseGetCase } from '../../containers/use_get_case';
|
||||
import { useGetCase } from '../../containers/use_get_case';
|
||||
import { useGetCaseMetrics } from '../../containers/use_get_case_metrics';
|
||||
import { useGetCaseUserActions } from '../../containers/use_get_case_user_actions';
|
||||
import { useGetTags } from '../../containers/use_get_tags';
|
||||
|
@ -31,7 +33,7 @@ import {
|
|||
defaultUpdateCaseState,
|
||||
defaultUseGetCaseUserActions,
|
||||
} from './mocks';
|
||||
import { CaseViewPageProps } from './types';
|
||||
import type { CaseViewPageProps } from './types';
|
||||
import { userProfiles } from '../../containers/user_profiles/api.mock';
|
||||
import { licensingMock } from '@kbn/licensing-plugin/public/mocks';
|
||||
import { CASE_VIEW_PAGE_TABS } from '../../../common/types';
|
||||
|
|
|
@ -22,7 +22,7 @@ import { CaseViewActivity } from './components/case_view_activity';
|
|||
import { CaseViewAlerts } from './components/case_view_alerts';
|
||||
import { CaseViewMetrics } from './metrics';
|
||||
import { ACTIVITY_TAB, ALERTS_TAB } from './translations';
|
||||
import { CaseViewPageProps } from './types';
|
||||
import type { CaseViewPageProps } from './types';
|
||||
import { useRefreshCaseViewPage } from './use_on_refresh_case_view_page';
|
||||
import { useOnUpdateField } from './use_on_update_field';
|
||||
|
||||
|
|
|
@ -10,12 +10,10 @@ import { useGetCurrentUserProfile } from '../../../containers/user_profiles/use_
|
|||
import { userProfiles, userProfilesMap } from '../../../containers/user_profiles/api.mock';
|
||||
import { fireEvent, screen, waitFor } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import {
|
||||
AppMockRenderer,
|
||||
createAppMockRenderer,
|
||||
noUpdateCasesPermissions,
|
||||
} from '../../../common/mock';
|
||||
import { AssignUsers, AssignUsersProps } from './assign_users';
|
||||
import type { AppMockRenderer } from '../../../common/mock';
|
||||
import { createAppMockRenderer, noUpdateCasesPermissions } from '../../../common/mock';
|
||||
import type { AssignUsersProps } from './assign_users';
|
||||
import { AssignUsers } from './assign_users';
|
||||
import { waitForEuiPopoverClose, waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl';
|
||||
|
||||
jest.mock('../../../containers/user_profiles/use_suggest_user_profiles');
|
||||
|
|
|
@ -15,17 +15,17 @@ import {
|
|||
EuiHorizontalRule,
|
||||
} from '@elastic/eui';
|
||||
|
||||
import { UserProfileWithAvatar } from '@kbn/user-profile-components';
|
||||
import { CasesPermissions } from '../../../../common';
|
||||
import type { UserProfileWithAvatar } from '@kbn/user-profile-components';
|
||||
import type { CasesPermissions } from '../../../../common';
|
||||
import { useAssignees } from '../../../containers/user_profiles/use_assignees';
|
||||
import { CaseAssignees } from '../../../../common/api/cases/assignee';
|
||||
import type { CaseAssignees } from '../../../../common/api/cases/assignee';
|
||||
import * as i18n from '../translations';
|
||||
import { SidebarTitle } from './sidebar_title';
|
||||
import { RemovableUser } from '../../user_profiles/removable_user';
|
||||
import { useCasesContext } from '../../cases_context/use_cases_context';
|
||||
import { Assignee } from '../../user_profiles/types';
|
||||
import type { Assignee } from '../../user_profiles/types';
|
||||
import { SuggestUsersPopover } from './suggest_users_popover';
|
||||
import { CurrentUserProfile } from '../../types';
|
||||
import type { CurrentUserProfile } from '../../types';
|
||||
|
||||
interface AssigneesListProps {
|
||||
assignees: Assignee[];
|
||||
|
|
|
@ -13,15 +13,12 @@ import {
|
|||
getAlertUserAction,
|
||||
} from '../../../containers/mock';
|
||||
import React from 'react';
|
||||
import {
|
||||
AppMockRenderer,
|
||||
createAppMockRenderer,
|
||||
noUpdateCasesPermissions,
|
||||
} from '../../../common/mock';
|
||||
import type { AppMockRenderer } from '../../../common/mock';
|
||||
import { createAppMockRenderer, noUpdateCasesPermissions } from '../../../common/mock';
|
||||
import { CaseViewActivity } from './case_view_activity';
|
||||
import { ConnectorTypes } from '../../../../common/api/connectors';
|
||||
import { Case } from '../../../../common';
|
||||
import { CaseViewProps } from '../types';
|
||||
import type { Case } from '../../../../common';
|
||||
import type { CaseViewProps } from '../types';
|
||||
import { useGetCaseUserActions } from '../../../containers/use_get_case_user_actions';
|
||||
import { usePostPushToService } from '../../../containers/use_post_push_to_service';
|
||||
import { useGetConnectors } from '../../../containers/configure/use_connectors';
|
||||
|
|
|
@ -14,12 +14,12 @@ import { useCasesFeatures } from '../../../common/use_cases_features';
|
|||
import { useGetCurrentUserProfile } from '../../../containers/user_profiles/use_get_current_user_profile';
|
||||
import { useBulkGetUserProfiles } from '../../../containers/user_profiles/use_bulk_get_user_profiles';
|
||||
import { useGetConnectors } from '../../../containers/configure/use_connectors';
|
||||
import { CaseSeverity } from '../../../../common/api';
|
||||
import type { CaseSeverity } from '../../../../common/api';
|
||||
import { useCaseViewNavigation } from '../../../common/navigation';
|
||||
import { UseFetchAlertData } from '../../../../common/ui/types';
|
||||
import { Case, CaseStatuses } from '../../../../common';
|
||||
import type { UseFetchAlertData } from '../../../../common/ui/types';
|
||||
import type { Case, CaseStatuses } from '../../../../common';
|
||||
import { EditConnector } from '../../edit_connector';
|
||||
import { CasesNavigation } from '../../links';
|
||||
import type { CasesNavigation } from '../../links';
|
||||
import { StatusActionButton } from '../../status/button';
|
||||
import { EditTags } from './edit_tags';
|
||||
import { UserActions } from '../../user_actions';
|
||||
|
@ -32,7 +32,7 @@ import { getConnectorById } from '../../utils';
|
|||
import { SeveritySidebarSelector } from '../../severity/sidebar_selector';
|
||||
import { useGetCaseUserActions } from '../../../containers/use_get_case_user_actions';
|
||||
import { AssignUsers } from './assign_users';
|
||||
import { Assignee } from '../../user_profiles/types';
|
||||
import type { Assignee } from '../../user_profiles/types';
|
||||
|
||||
export const CaseViewActivity = ({
|
||||
ruleDetailsNavigation,
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
import React from 'react';
|
||||
import { waitFor } from '@testing-library/dom';
|
||||
import { alertCommentWithIndices, basicCase } from '../../../containers/mock';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../../common/mock';
|
||||
import { Case } from '../../../../common';
|
||||
import type { AppMockRenderer } from '../../../common/mock';
|
||||
import { createAppMockRenderer } from '../../../common/mock';
|
||||
import type { Case } from '../../../../common';
|
||||
import { CaseViewAlerts } from './case_view_alerts';
|
||||
import * as api from '../../../containers/api';
|
||||
|
||||
|
|
|
@ -7,8 +7,9 @@
|
|||
|
||||
import React, { useMemo } from 'react';
|
||||
|
||||
import { EuiFlexItem, EuiFlexGroup, EuiProgress, EuiFlyoutSize } from '@elastic/eui';
|
||||
import { Case } from '../../../../common';
|
||||
import type { EuiFlyoutSize } from '@elastic/eui';
|
||||
import { EuiFlexItem, EuiFlexGroup, EuiProgress } from '@elastic/eui';
|
||||
import type { Case } from '../../../../common';
|
||||
import { useKibana } from '../../../common/lib/kibana';
|
||||
import { getManualAlertIds, getRegistrationContextFromAlerts } from './helpers';
|
||||
import { useGetFeatureIds } from '../../../containers/use_get_feature_ids';
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
|
||||
import { EditTags, EditTagsProps } from './edit_tags';
|
||||
import type { EditTagsProps } from './edit_tags';
|
||||
import { EditTags } from './edit_tags';
|
||||
import { getFormMock } from '../../__mock__/form';
|
||||
import { readCasesPermissions, TestProviders } from '../../../common/mock';
|
||||
import { waitFor } from '@testing-library/react';
|
||||
|
|
|
@ -19,13 +19,13 @@ import {
|
|||
import styled, { css } from 'styled-components';
|
||||
import { isEqual } from 'lodash/fp';
|
||||
import * as i18n from '../../tags/translations';
|
||||
import type { FormSchema } from '../../../common/shared_imports';
|
||||
import {
|
||||
Form,
|
||||
FormDataProvider,
|
||||
useForm,
|
||||
getUseField,
|
||||
Field,
|
||||
FormSchema,
|
||||
} from '../../../common/shared_imports';
|
||||
import { useGetTags } from '../../../containers/use_get_tags';
|
||||
import { Tags } from '../../tags/tags';
|
||||
|
|
|
@ -6,13 +6,15 @@
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { AppMockRenderer, createAppMockRenderer } from '../../../common/mock';
|
||||
import type { AppMockRenderer } from '../../../common/mock';
|
||||
import { createAppMockRenderer } from '../../../common/mock';
|
||||
import { screen, fireEvent, waitFor } from '@testing-library/react';
|
||||
import { SuggestUsersPopoverProps, SuggestUsersPopover } from './suggest_users_popover';
|
||||
import type { SuggestUsersPopoverProps } from './suggest_users_popover';
|
||||
import { SuggestUsersPopover } from './suggest_users_popover';
|
||||
import { userProfiles } from '../../../containers/user_profiles/api.mock';
|
||||
import { waitForEuiPopoverOpen } from '@elastic/eui/lib/test/rtl';
|
||||
import { UserProfileWithAvatar } from '@kbn/user-profile-components';
|
||||
import { AssigneeWithProfile } from '../../user_profiles/types';
|
||||
import type { UserProfileWithAvatar } from '@kbn/user-profile-components';
|
||||
import type { AssigneeWithProfile } from '../../user_profiles/types';
|
||||
|
||||
jest.mock('../../../containers/user_profiles/api');
|
||||
|
||||
|
|
|
@ -6,19 +6,20 @@
|
|||
*/
|
||||
|
||||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import { UserProfilesPopover, UserProfileWithAvatar } from '@kbn/user-profile-components';
|
||||
import type { UserProfileWithAvatar } from '@kbn/user-profile-components';
|
||||
import { UserProfilesPopover } from '@kbn/user-profile-components';
|
||||
|
||||
import { EuiButtonIcon, EuiToolTip } from '@elastic/eui';
|
||||
import { isEmpty } from 'lodash';
|
||||
import { useSuggestUserProfiles } from '../../../containers/user_profiles/use_suggest_user_profiles';
|
||||
import { useCasesContext } from '../../cases_context/use_cases_context';
|
||||
import { AssigneeWithProfile } from '../../user_profiles/types';
|
||||
import type { AssigneeWithProfile } from '../../user_profiles/types';
|
||||
import * as i18n from '../translations';
|
||||
import { bringCurrentUserToFrontAndSort } from '../../user_profiles/sort';
|
||||
import { SelectedStatusMessage } from '../../user_profiles/selected_status_message';
|
||||
import { EmptyMessage } from '../../user_profiles/empty_message';
|
||||
import { NoMatches } from '../../user_profiles/no_matches';
|
||||
import { CurrentUserProfile } from '../../types';
|
||||
import type { CurrentUserProfile } from '../../types';
|
||||
|
||||
const PopoverButton: React.FC<{ togglePopover: () => void; isDisabled: boolean }> = ({
|
||||
togglePopover,
|
||||
|
|
|
@ -19,10 +19,10 @@ import {
|
|||
|
||||
import styled, { css } from 'styled-components';
|
||||
|
||||
import { UserProfileWithAvatar } from '@kbn/user-profile-components';
|
||||
import { ElasticUser } from '../../../containers/types';
|
||||
import type { UserProfileWithAvatar } from '@kbn/user-profile-components';
|
||||
import type { ElasticUser } from '../../../containers/types';
|
||||
import * as i18n from '../translations';
|
||||
import { UserInfoWithAvatar } from '../../user_profiles/types';
|
||||
import type { UserInfoWithAvatar } from '../../user_profiles/types';
|
||||
import { HoverableUserWithAvatar } from '../../user_profiles/hoverable_user_with_avatar';
|
||||
import { convertToUserInfo } from '../../user_profiles/user_converter';
|
||||
|
||||
|
|
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