diff --git a/x-pack/plugins/cases/public/common/mock/test_providers.tsx b/x-pack/plugins/cases/public/common/mock/test_providers.tsx index 99ed0c274199c..b8c1b33507c3e 100644 --- a/x-pack/plugins/cases/public/common/mock/test_providers.tsx +++ b/x-pack/plugins/cases/public/common/mock/test_providers.tsx @@ -17,11 +17,11 @@ 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 type { ILicense } from '@kbn/licensing-plugin/public'; +import type { FieldHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { SECURITY_SOLUTION_OWNER } from '../../../common/constants'; import type { CasesFeatures, CasesPermissions } from '../../../common/ui/types'; import { CasesProvider } from '../../components/cases_context'; import { createStartServicesMock } from '../lib/kibana/kibana_react.mock'; -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'; diff --git a/x-pack/plugins/cases/public/common/shared_imports.ts b/x-pack/plugins/cases/public/common/shared_imports.ts deleted file mode 100644 index 84c34a6186fa8..0000000000000 --- a/x-pack/plugins/cases/public/common/shared_imports.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export type { - FieldHook, - FieldValidateResponse, - FormData, - FormHook, - FormSchema, - ValidationError, - ValidationFunc, - FieldConfig, - ValidationConfig, -} from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; -export { - getUseField, - getFieldValidityAndErrorMessage, - FIELD_TYPES, - Form, - FormDataProvider, - UseField, - UseMultiFields, - useForm, - useFormContext, - useFormData, - VALIDATION_TYPES, -} from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; -export { Field, SelectField } from '@kbn/es-ui-shared-plugin/static/forms/components'; -export { fieldValidators } from '@kbn/es-ui-shared-plugin/static/forms/helpers'; -export type { ERROR_CODE } from '@kbn/es-ui-shared-plugin/static/forms/helpers/field_validators/types'; diff --git a/x-pack/plugins/cases/public/components/add_comment/index.tsx b/x-pack/plugins/cases/public/components/add_comment/index.tsx index 84715324bee92..dc5c1c48cfd9b 100644 --- a/x-pack/plugins/cases/public/components/add_comment/index.tsx +++ b/x-pack/plugins/cases/public/components/add_comment/index.tsx @@ -17,12 +17,17 @@ import { EuiButton, EuiFlexItem, EuiFlexGroup, EuiLoadingSpinner } from '@elasti import styled from 'styled-components'; import { isEmpty } from 'lodash'; +import { + Form, + useForm, + UseField, + useFormData, +} from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { CommentType } from '../../../common/api'; import { useCreateAttachments } from '../../containers/use_create_attachments'; 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 type { AddCommentFormSchema } from './schema'; diff --git a/x-pack/plugins/cases/public/components/add_comment/schema.tsx b/x-pack/plugins/cases/public/components/add_comment/schema.tsx index 7f8da37aeedc6..5df5769ef62ab 100644 --- a/x-pack/plugins/cases/public/components/add_comment/schema.tsx +++ b/x-pack/plugins/cases/public/components/add_comment/schema.tsx @@ -5,9 +5,10 @@ * 2.0. */ +import type { FormSchema } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { FIELD_TYPES } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { fieldValidators } from '@kbn/es-ui-shared-plugin/static/forms/helpers'; 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; diff --git a/x-pack/plugins/cases/public/components/case_view/components/edit_tags.tsx b/x-pack/plugins/cases/public/components/case_view/components/edit_tags.tsx index 3a3a01cc49e94..2f8567d14f08d 100644 --- a/x-pack/plugins/cases/public/components/case_view/components/edit_tags.tsx +++ b/x-pack/plugins/cases/public/components/case_view/components/edit_tags.tsx @@ -18,15 +18,15 @@ import { } from '@elastic/eui'; 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 type { FormSchema } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { Form, FormDataProvider, useForm, getUseField, - Field, -} from '../../../common/shared_imports'; +} from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { Field } from '@kbn/es-ui-shared-plugin/static/forms/components'; +import * as i18n from '../../tags/translations'; import { useGetTags } from '../../../containers/use_get_tags'; import { Tags } from '../../tags/tags'; import { useCasesContext } from '../../cases_context/use_cases_context'; diff --git a/x-pack/plugins/cases/public/components/connector_selector/form.test.tsx b/x-pack/plugins/cases/public/components/connector_selector/form.test.tsx index 139d8c48692a0..8729c13be1487 100644 --- a/x-pack/plugins/cases/public/components/connector_selector/form.test.tsx +++ b/x-pack/plugins/cases/public/components/connector_selector/form.test.tsx @@ -7,8 +7,8 @@ import React from 'react'; import { mount } from 'enzyme'; -import type { FormHook } from '../../common/shared_imports'; -import { UseField, Form, useForm } from '../../common/shared_imports'; +import type { FormHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { UseField, Form, useForm } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { ConnectorSelector } from './form'; import { connectorsMock } from '../../containers/mock'; import { getFormMock } from '../__mock__/form'; diff --git a/x-pack/plugins/cases/public/components/connector_selector/form.tsx b/x-pack/plugins/cases/public/components/connector_selector/form.tsx index 6f9f416e69037..b588182050d6a 100644 --- a/x-pack/plugins/cases/public/components/connector_selector/form.tsx +++ b/x-pack/plugins/cases/public/components/connector_selector/form.tsx @@ -10,8 +10,8 @@ import { isEmpty } from 'lodash/fp'; import { EuiFormRow } from '@elastic/eui'; import styled from 'styled-components'; -import type { FieldHook } from '../../common/shared_imports'; -import { getFieldValidityAndErrorMessage } from '../../common/shared_imports'; +import type { FieldHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { getFieldValidityAndErrorMessage } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { ConnectorsDropdown } from '../configure_cases/connectors_dropdown'; import type { ActionConnector } from '../../../common/api'; diff --git a/x-pack/plugins/cases/public/components/connectors/swimlane/validator.ts b/x-pack/plugins/cases/public/components/connectors/swimlane/validator.ts index 8480350841b0e..eddac63223de8 100644 --- a/x-pack/plugins/cases/public/components/connectors/swimlane/validator.ts +++ b/x-pack/plugins/cases/public/components/connectors/swimlane/validator.ts @@ -5,8 +5,8 @@ * 2.0. */ +import type { ValidationConfig } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { SwimlaneConnectorType } from '../../../../common/api'; -import type { ValidationConfig } from '../../../common/shared_imports'; import type { CaseActionConnector } from '../../types'; const casesRequiredFields = [ diff --git a/x-pack/plugins/cases/public/components/create/assignees.test.tsx b/x-pack/plugins/cases/public/components/create/assignees.test.tsx index 97ee74ad76831..9a32ab5f1ffd9 100644 --- a/x-pack/plugins/cases/public/components/create/assignees.test.tsx +++ b/x-pack/plugins/cases/public/components/create/assignees.test.tsx @@ -10,8 +10,8 @@ import userEvent from '@testing-library/user-event'; import type { AppMockRenderer } from '../../common/mock'; import { createAppMockRenderer } from '../../common/mock'; -import type { FormHook } from '../../common/shared_imports'; -import { useForm, Form } from '../../common/shared_imports'; +import type { FormHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { useForm, Form } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { userProfiles } from '../../containers/user_profiles/api.mock'; import { Assignees } from './assignees'; import type { FormProps } from './schema'; diff --git a/x-pack/plugins/cases/public/components/create/assignees.tsx b/x-pack/plugins/cases/public/components/create/assignees.tsx index 1b5577bd87469..6066957722358 100644 --- a/x-pack/plugins/cases/public/components/create/assignees.tsx +++ b/x-pack/plugins/cases/public/components/create/assignees.tsx @@ -17,10 +17,13 @@ import { } from '@elastic/eui'; import type { UserProfileWithAvatar, UserProfile } from '@kbn/user-profile-components'; import { UserAvatar, getUserDisplayName } from '@kbn/user-profile-components'; +import type { FieldConfig, FieldHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { + UseField, + getFieldValidityAndErrorMessage, +} from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { MAX_ASSIGNEES_PER_CASE } from '../../../common/constants'; import type { CaseAssignees } from '../../../common/api'; -import type { FieldConfig, FieldHook } from '../../common/shared_imports'; -import { UseField, getFieldValidityAndErrorMessage } from '../../common/shared_imports'; import { useSuggestUserProfiles } from '../../containers/user_profiles/use_suggest_user_profiles'; import { useCasesContext } from '../cases_context/use_cases_context'; import { useGetCurrentUserProfile } from '../../containers/user_profiles/use_get_current_user_profile'; diff --git a/x-pack/plugins/cases/public/components/create/connector.test.tsx b/x-pack/plugins/cases/public/components/create/connector.test.tsx index 1fc99cf30ab75..037293802201f 100644 --- a/x-pack/plugins/cases/public/components/create/connector.test.tsx +++ b/x-pack/plugins/cases/public/components/create/connector.test.tsx @@ -11,8 +11,8 @@ import { act, waitFor } from '@testing-library/react'; import type { EuiComboBoxOptionOption } from '@elastic/eui'; import { EuiComboBox } from '@elastic/eui'; -import type { FormHook } from '../../common/shared_imports'; -import { useForm, Form } from '../../common/shared_imports'; +import type { FormHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { useForm, Form } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { connectorsMock } from '../../containers/mock'; import { Connector } from './connector'; import { useGetIncidentTypes } from '../connectors/resilient/use_get_incident_types'; diff --git a/x-pack/plugins/cases/public/components/create/connector.tsx b/x-pack/plugins/cases/public/components/create/connector.tsx index 102b8ec73d1b0..0431d31ced1e0 100644 --- a/x-pack/plugins/cases/public/components/create/connector.tsx +++ b/x-pack/plugins/cases/public/components/create/connector.tsx @@ -8,9 +8,13 @@ import React, { memo, useCallback, useMemo, useEffect } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import type { FieldHook, FieldConfig } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { + UseField, + useFormData, + useFormContext, +} from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import type { ActionConnector } from '../../../common/api'; -import type { FieldHook, FieldConfig } from '../../common/shared_imports'; -import { UseField, useFormData, useFormContext } from '../../common/shared_imports'; import { ConnectorSelector } from '../connector_selector/form'; import { ConnectorFieldsForm } from '../connectors/fields_form'; import type { FormProps } from './schema'; diff --git a/x-pack/plugins/cases/public/components/create/description.test.tsx b/x-pack/plugins/cases/public/components/create/description.test.tsx index d95fade009f3d..3e9adb8961cc2 100644 --- a/x-pack/plugins/cases/public/components/create/description.test.tsx +++ b/x-pack/plugins/cases/public/components/create/description.test.tsx @@ -9,8 +9,8 @@ import React from 'react'; import { waitFor } from '@testing-library/react'; import userEvent, { specialChars } from '@testing-library/user-event'; -import type { FormHook } from '../../common/shared_imports'; -import { useForm, Form } from '../../common/shared_imports'; +import type { FormHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { useForm, Form } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { Description } from './description'; import type { FormProps } from './schema'; import { schema } from './schema'; diff --git a/x-pack/plugins/cases/public/components/create/description.tsx b/x-pack/plugins/cases/public/components/create/description.tsx index 6c9792684a126..437ff5c3751c1 100644 --- a/x-pack/plugins/cases/public/components/create/description.tsx +++ b/x-pack/plugins/cases/public/components/create/description.tsx @@ -6,8 +6,12 @@ */ import React, { memo, useEffect, useRef } from 'react'; +import { + UseField, + useFormContext, + useFormData, +} from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { MarkdownEditorForm } from '../markdown_editor'; -import { UseField, useFormContext, useFormData } from '../../common/shared_imports'; import { useLensDraftComment } from '../markdown_editor/plugins/lens/use_lens_draft_comment'; import { ID as LensPluginId } from '../markdown_editor/plugins/lens/constants'; diff --git a/x-pack/plugins/cases/public/components/create/form.test.tsx b/x-pack/plugins/cases/public/components/create/form.test.tsx index 3316134f7762e..ddc65f443bdb3 100644 --- a/x-pack/plugins/cases/public/components/create/form.test.tsx +++ b/x-pack/plugins/cases/public/components/create/form.test.tsx @@ -11,8 +11,8 @@ import { act, render } from '@testing-library/react'; import { licensingMock } from '@kbn/licensing-plugin/public/mocks'; import { NONE_CONNECTOR_ID } from '../../../common/api'; -import type { FormHook } from '../../common/shared_imports'; -import { useForm, Form } from '../../common/shared_imports'; +import type { FormHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { useForm, Form } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { connectorsMock } from '../../containers/mock'; import type { FormProps } from './schema'; import { schema } from './schema'; diff --git a/x-pack/plugins/cases/public/components/create/form.tsx b/x-pack/plugins/cases/public/components/create/form.tsx index 32fff2048685d..e1a0c4f3b1cea 100644 --- a/x-pack/plugins/cases/public/components/create/form.tsx +++ b/x-pack/plugins/cases/public/components/create/form.tsx @@ -15,7 +15,7 @@ import { } from '@elastic/eui'; import styled, { css } from 'styled-components'; -import { useFormContext } from '../../common/shared_imports'; +import { useFormContext } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { Title } from './title'; import { Description, fieldName as descriptionFieldName } from './description'; diff --git a/x-pack/plugins/cases/public/components/create/form_context.tsx b/x-pack/plugins/cases/public/components/create/form_context.tsx index 1e6cfaafe4eeb..fdce32c38c880 100644 --- a/x-pack/plugins/cases/public/components/create/form_context.tsx +++ b/x-pack/plugins/cases/public/components/create/form_context.tsx @@ -6,9 +6,9 @@ */ import React, { useCallback, useMemo } from 'react'; +import { Form, useForm } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import type { FormProps } from './schema'; import { schema } from './schema'; -import { Form, useForm } from '../../common/shared_imports'; import { getNoneConnector, normalizeActionConnector } from '../configure_cases/utils'; import { usePostCase } from '../../containers/use_post_case'; import { usePostPushToService } from '../../containers/use_post_push_to_service'; diff --git a/x-pack/plugins/cases/public/components/create/index.tsx b/x-pack/plugins/cases/public/components/create/index.tsx index a1ffd7b3ebd6b..386b64f04bd1c 100644 --- a/x-pack/plugins/cases/public/components/create/index.tsx +++ b/x-pack/plugins/cases/public/components/create/index.tsx @@ -7,7 +7,8 @@ import React from 'react'; -import { Field, getUseField } from '../../common/shared_imports'; +import { Field } from '@kbn/es-ui-shared-plugin/static/forms/components'; +import { getUseField } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import * as i18n from './translations'; import type { CreateCaseFormProps } from './form'; import { CreateCaseForm } from './form'; diff --git a/x-pack/plugins/cases/public/components/create/owner_selector.test.tsx b/x-pack/plugins/cases/public/components/create/owner_selector.test.tsx index 25f0f9ba0faaa..cd9515edbd28c 100644 --- a/x-pack/plugins/cases/public/components/create/owner_selector.test.tsx +++ b/x-pack/plugins/cases/public/components/create/owner_selector.test.tsx @@ -11,8 +11,8 @@ import { act, waitFor } from '@testing-library/react'; import { SECURITY_SOLUTION_OWNER } from '../../../common'; import { OBSERVABILITY_OWNER } from '../../../common/constants'; -import type { FormHook } from '../../common/shared_imports'; -import { useForm, Form } from '../../common/shared_imports'; +import type { FormHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { useForm, Form } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { CreateCaseOwnerSelector } from './owner_selector'; import type { FormProps } from './schema'; import { schema } from './schema'; diff --git a/x-pack/plugins/cases/public/components/create/owner_selector.tsx b/x-pack/plugins/cases/public/components/create/owner_selector.tsx index e572e7c9f9ca5..440fcffcbb5d8 100644 --- a/x-pack/plugins/cases/public/components/create/owner_selector.tsx +++ b/x-pack/plugins/cases/public/components/create/owner_selector.tsx @@ -16,13 +16,15 @@ import { EuiKeyPadMenuItem, useGeneratedHtmlId, } from '@elastic/eui'; - +import type { FieldHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { + getFieldValidityAndErrorMessage, + UseField, +} from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { euiStyled } from '@kbn/kibana-react-plugin/common'; import { SECURITY_SOLUTION_OWNER } from '../../../common'; import { OWNER_INFO } from '../../../common/constants'; -import type { FieldHook } from '../../common/shared_imports'; -import { getFieldValidityAndErrorMessage, UseField } from '../../common/shared_imports'; import * as i18n from './translations'; interface OwnerSelectorProps { diff --git a/x-pack/plugins/cases/public/components/create/schema.tsx b/x-pack/plugins/cases/public/components/create/schema.tsx index 30dc762143ae3..f80c4e52945bb 100644 --- a/x-pack/plugins/cases/public/components/create/schema.tsx +++ b/x-pack/plugins/cases/public/components/create/schema.tsx @@ -5,11 +5,12 @@ * 2.0. */ +import type { FormSchema } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { FIELD_TYPES, VALIDATION_TYPES } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { fieldValidators } from '@kbn/es-ui-shared-plugin/static/forms/helpers'; import type { CasePostRequest, ConnectorTypeFields } from '../../../common/api'; import { isInvalidTag } from '../../../common/utils/validators'; import { MAX_TITLE_LENGTH } from '../../../common/constants'; -import type { FormSchema } from '../../common/shared_imports'; -import { FIELD_TYPES, fieldValidators, VALIDATION_TYPES } from '../../common/shared_imports'; import * as i18n from './translations'; import { OptionalFieldLabel } from './optional_field_label'; diff --git a/x-pack/plugins/cases/public/components/create/severity.test.tsx b/x-pack/plugins/cases/public/components/create/severity.test.tsx index 5d80028817a83..b8a5b446b89f8 100644 --- a/x-pack/plugins/cases/public/components/create/severity.test.tsx +++ b/x-pack/plugins/cases/public/components/create/severity.test.tsx @@ -9,8 +9,8 @@ import { CaseSeverity } from '../../../common/api'; import React from 'react'; import type { AppMockRenderer } from '../../common/mock'; import { createAppMockRenderer } from '../../common/mock'; -import type { FormHook } from '../../common/shared_imports'; -import { Form, useForm } from '../../common/shared_imports'; +import type { FormHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { Form, useForm } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { Severity } from './severity'; import type { FormProps } from './schema'; import { schema } from './schema'; diff --git a/x-pack/plugins/cases/public/components/create/severity.tsx b/x-pack/plugins/cases/public/components/create/severity.tsx index 730eab5d77ac6..3e090272162e8 100644 --- a/x-pack/plugins/cases/public/components/create/severity.tsx +++ b/x-pack/plugins/cases/public/components/create/severity.tsx @@ -7,8 +7,12 @@ import { EuiFormRow } from '@elastic/eui'; import React, { memo } from 'react'; +import { + UseField, + useFormContext, + useFormData, +} from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { CaseSeverity } from '../../../common/api'; -import { UseField, useFormContext, useFormData } from '../../common/shared_imports'; import { SeveritySelector } from '../severity/selector'; import { SEVERITY_TITLE } from '../severity/translations'; diff --git a/x-pack/plugins/cases/public/components/create/submit_button.test.tsx b/x-pack/plugins/cases/public/components/create/submit_button.test.tsx index b703eb703d720..95dc8d783ac3e 100644 --- a/x-pack/plugins/cases/public/components/create/submit_button.test.tsx +++ b/x-pack/plugins/cases/public/components/create/submit_button.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { mount } from 'enzyme'; import { waitFor } from '@testing-library/react'; -import { useForm, Form } from '../../common/shared_imports'; +import { useForm, Form } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { SubmitCaseButton } from './submit_button'; import type { FormProps } from './schema'; import { schema } from './schema'; diff --git a/x-pack/plugins/cases/public/components/create/submit_button.tsx b/x-pack/plugins/cases/public/components/create/submit_button.tsx index 9f984b236ca69..2c3ecd563df73 100644 --- a/x-pack/plugins/cases/public/components/create/submit_button.tsx +++ b/x-pack/plugins/cases/public/components/create/submit_button.tsx @@ -8,7 +8,7 @@ import React, { memo } from 'react'; import { EuiButton } from '@elastic/eui'; -import { useFormContext } from '../../common/shared_imports'; +import { useFormContext } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import * as i18n from './translations'; const SubmitCaseButtonComponent: React.FC = () => { diff --git a/x-pack/plugins/cases/public/components/create/sync_alerts_toggle.test.tsx b/x-pack/plugins/cases/public/components/create/sync_alerts_toggle.test.tsx index 28abe40607c72..aa5d80e82a34f 100644 --- a/x-pack/plugins/cases/public/components/create/sync_alerts_toggle.test.tsx +++ b/x-pack/plugins/cases/public/components/create/sync_alerts_toggle.test.tsx @@ -9,8 +9,8 @@ import React from 'react'; import { mount } from 'enzyme'; import { waitFor } from '@testing-library/react'; -import type { FormHook } from '../../common/shared_imports'; -import { useForm, Form } from '../../common/shared_imports'; +import type { FormHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { useForm, Form } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { SyncAlertsToggle } from './sync_alerts_toggle'; import type { FormProps } from './schema'; import { schema } from './schema'; diff --git a/x-pack/plugins/cases/public/components/create/sync_alerts_toggle.tsx b/x-pack/plugins/cases/public/components/create/sync_alerts_toggle.tsx index bed8e6d18f5e3..1a189de3e17ec 100644 --- a/x-pack/plugins/cases/public/components/create/sync_alerts_toggle.tsx +++ b/x-pack/plugins/cases/public/components/create/sync_alerts_toggle.tsx @@ -6,7 +6,8 @@ */ import React, { memo } from 'react'; -import { Field, getUseField, useFormData } from '../../common/shared_imports'; +import { getUseField, useFormData } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { Field } from '@kbn/es-ui-shared-plugin/static/forms/components'; import * as i18n from './translations'; const CommonUseField = getUseField({ component: Field }); diff --git a/x-pack/plugins/cases/public/components/create/tags.test.tsx b/x-pack/plugins/cases/public/components/create/tags.test.tsx index 9e84955c3a07e..653f32d09f600 100644 --- a/x-pack/plugins/cases/public/components/create/tags.test.tsx +++ b/x-pack/plugins/cases/public/components/create/tags.test.tsx @@ -11,8 +11,8 @@ import type { EuiComboBoxOptionOption } from '@elastic/eui'; import { EuiComboBox } from '@elastic/eui'; import { waitFor } from '@testing-library/react'; -import type { FormHook } from '../../common/shared_imports'; -import { useForm, Form } from '../../common/shared_imports'; +import type { FormHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { useForm, Form } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { Tags } from './tags'; import type { FormProps } from './schema'; import { schema } from './schema'; diff --git a/x-pack/plugins/cases/public/components/create/tags.tsx b/x-pack/plugins/cases/public/components/create/tags.tsx index 11dac39bba75b..6bae6015e769b 100644 --- a/x-pack/plugins/cases/public/components/create/tags.tsx +++ b/x-pack/plugins/cases/public/components/create/tags.tsx @@ -7,7 +7,8 @@ import React, { memo, useMemo } from 'react'; -import { Field, getUseField } from '../../common/shared_imports'; +import { getUseField } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { Field } from '@kbn/es-ui-shared-plugin/static/forms/components'; import { useGetTags } from '../../containers/use_get_tags'; const CommonUseField = getUseField({ component: Field }); diff --git a/x-pack/plugins/cases/public/components/create/title.test.tsx b/x-pack/plugins/cases/public/components/create/title.test.tsx index 37952ba530842..793a868f8a1cb 100644 --- a/x-pack/plugins/cases/public/components/create/title.test.tsx +++ b/x-pack/plugins/cases/public/components/create/title.test.tsx @@ -9,8 +9,8 @@ import React from 'react'; import { mount } from 'enzyme'; import { act } from '@testing-library/react'; -import type { FormHook } from '../../common/shared_imports'; -import { useForm, Form } from '../../common/shared_imports'; +import type { FormHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { useForm, Form } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { Title } from './title'; import type { FormProps } from './schema'; import { schema } from './schema'; diff --git a/x-pack/plugins/cases/public/components/create/title.tsx b/x-pack/plugins/cases/public/components/create/title.tsx index ae8f517173132..35de4c7a41ccb 100644 --- a/x-pack/plugins/cases/public/components/create/title.tsx +++ b/x-pack/plugins/cases/public/components/create/title.tsx @@ -6,8 +6,8 @@ */ import React, { memo } from 'react'; -import { Field, getUseField } from '../../common/shared_imports'; - +import { getUseField } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { Field } from '@kbn/es-ui-shared-plugin/static/forms/components'; const CommonUseField = getUseField({ component: Field }); interface Props { diff --git a/x-pack/plugins/cases/public/components/edit_connector/index.tsx b/x-pack/plugins/cases/public/components/edit_connector/index.tsx index 7be868fa5d625..7fa73395ba8a1 100644 --- a/x-pack/plugins/cases/public/components/edit_connector/index.tsx +++ b/x-pack/plugins/cases/public/components/edit_connector/index.tsx @@ -19,8 +19,8 @@ import { import styled from 'styled-components'; import { isEmpty, noop } from 'lodash/fp'; -import type { FieldConfig } from '../../common/shared_imports'; -import { Form, UseField, useForm } from '../../common/shared_imports'; +import type { FieldConfig } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { Form, UseField, useForm } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import type { Case } from '../../../common/ui/types'; import type { ActionConnector, ConnectorTypeFields } from '../../../common/api'; import { NONE_CONNECTOR_ID } from '../../../common/api'; diff --git a/x-pack/plugins/cases/public/components/edit_connector/schema.tsx b/x-pack/plugins/cases/public/components/edit_connector/schema.tsx index 0ff191fff5bda..27eecc485ea42 100644 --- a/x-pack/plugins/cases/public/components/edit_connector/schema.tsx +++ b/x-pack/plugins/cases/public/components/edit_connector/schema.tsx @@ -5,8 +5,8 @@ * 2.0. */ -import type { FormSchema } from '../../common/shared_imports'; -import { FIELD_TYPES } from '../../common/shared_imports'; +import type { FormSchema } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { FIELD_TYPES } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; export interface FormProps { connectorId: string; diff --git a/x-pack/plugins/cases/public/components/insert_timeline/index.test.tsx b/x-pack/plugins/cases/public/components/insert_timeline/index.test.tsx index 931cf3255c5a5..d616ae71bd826 100644 --- a/x-pack/plugins/cases/public/components/insert_timeline/index.test.tsx +++ b/x-pack/plugins/cases/public/components/insert_timeline/index.test.tsx @@ -10,8 +10,8 @@ import { mount } from 'enzyme'; import { waitFor } from '@testing-library/react'; import { TestProviders } from '../../common/mock'; -import type { FormHook } from '../../common/shared_imports'; -import { Form, useForm } from '../../common/shared_imports'; +import type { FormHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { Form, useForm } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { CasesTimelineIntegrationProvider } from '../timeline_context'; import { timelineIntegrationMock } from '../__mock__/timeline'; import { getFormMock } from '../__mock__/form'; diff --git a/x-pack/plugins/cases/public/components/insert_timeline/index.tsx b/x-pack/plugins/cases/public/components/insert_timeline/index.tsx index 62b8ad7155581..0a1e6c02b22e6 100644 --- a/x-pack/plugins/cases/public/components/insert_timeline/index.tsx +++ b/x-pack/plugins/cases/public/components/insert_timeline/index.tsx @@ -6,7 +6,7 @@ */ import { useCallback } from 'react'; -import { useFormContext } from '../../common/shared_imports'; +import { useFormContext } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { useTimelineContext } from '../timeline_context/use_timeline_context'; type InsertFields = 'comment' | 'description'; diff --git a/x-pack/plugins/cases/public/components/markdown_editor/eui_form.tsx b/x-pack/plugins/cases/public/components/markdown_editor/eui_form.tsx index 2884816a091a3..ff073f7eef08a 100644 --- a/x-pack/plugins/cases/public/components/markdown_editor/eui_form.tsx +++ b/x-pack/plugins/cases/public/components/markdown_editor/eui_form.tsx @@ -9,8 +9,8 @@ import React, { forwardRef, useMemo } from 'react'; import styled from 'styled-components'; import type { EuiMarkdownEditorProps } from '@elastic/eui'; import { EuiFormRow, EuiFlexItem, EuiFlexGroup } from '@elastic/eui'; -import type { FieldHook } from '../../common/shared_imports'; -import { getFieldValidityAndErrorMessage } from '../../common/shared_imports'; +import type { FieldHook } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { getFieldValidityAndErrorMessage } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import type { MarkdownEditorRef } from './editor'; import { MarkdownEditor } from './editor'; import { CommentEditorContext } from './context'; diff --git a/x-pack/plugins/cases/public/components/user_actions/markdown_form.tsx b/x-pack/plugins/cases/public/components/user_actions/markdown_form.tsx index 784e163fa963d..b2b7443e001e8 100644 --- a/x-pack/plugins/cases/public/components/user_actions/markdown_form.tsx +++ b/x-pack/plugins/cases/public/components/user_actions/markdown_form.tsx @@ -9,8 +9,8 @@ import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty, EuiButton } from '@elastic/e import React, { forwardRef, useCallback, useImperativeHandle, useMemo, useRef } from 'react'; import styled from 'styled-components'; +import { Form, useForm, UseField } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import * as i18n from '../case_view/translations'; -import { Form, useForm, UseField } from '../../common/shared_imports'; import type { Content } from './schema'; import { schema } from './schema'; import { MarkdownRenderer, MarkdownEditorForm } from '../markdown_editor'; diff --git a/x-pack/plugins/cases/public/components/user_actions/schema.ts b/x-pack/plugins/cases/public/components/user_actions/schema.ts index ecc1f981829b0..8c47b700adeb5 100644 --- a/x-pack/plugins/cases/public/components/user_actions/schema.ts +++ b/x-pack/plugins/cases/public/components/user_actions/schema.ts @@ -5,8 +5,9 @@ * 2.0. */ -import type { FormSchema } from '../../common/shared_imports'; -import { FIELD_TYPES, fieldValidators } from '../../common/shared_imports'; +import type { FormSchema } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { FIELD_TYPES } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; +import { fieldValidators } from '@kbn/es-ui-shared-plugin/static/forms/helpers'; import * as i18n from '../../common/translations'; const { emptyField } = fieldValidators; diff --git a/x-pack/plugins/cases/public/components/utils.ts b/x-pack/plugins/cases/public/components/utils.ts index 45b2247b7bcac..1a5f8134563ff 100644 --- a/x-pack/plugins/cases/public/components/utils.ts +++ b/x-pack/plugins/cases/public/components/utils.ts @@ -6,8 +6,11 @@ */ import type { IconType } from '@elastic/eui'; +import type { + FieldConfig, + ValidationConfig, +} from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib'; import { ConnectorTypes } from '../../common/api'; -import type { FieldConfig, ValidationConfig } from '../common/shared_imports'; import type { CasesPluginStart } from '../types'; import { connectorValidator as swimlaneConnectorValidator } from './connectors/swimlane/validator'; import type { CaseActionConnector } from './types';