[Cases] Remove temporal public methods from the cases plugin (#127248)

This commit is contained in:
Esteban Beltran 2022-03-09 12:54:29 +01:00 committed by GitHub
parent b32f1daa86
commit b20a3642a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 15 deletions

View file

@ -13,10 +13,8 @@ export const mockCasesContract = (): jest.Mocked<CasesUiStart> => ({
getCases: jest.fn(),
getCasesContext: jest.fn().mockImplementation(() => mockCasesContext),
getAllCasesSelectorModal: jest.fn(),
getAllCasesSelectorModalNoProvider: jest.fn(),
getCreateCaseFlyout: jest.fn(),
getRecentCases: jest.fn(),
getCreateCaseFlyoutNoProvider: jest.fn(),
hooks: {
getUseCasesAddToNewCaseFlyout: jest.fn(),
getUseCasesAddToExistingCaseModal: jest.fn(),

View file

@ -14,8 +14,6 @@ import {
getAllCasesSelectorModalLazy,
getCreateCaseFlyoutLazy,
canUseCases,
getCreateCaseFlyoutLazyNoProvider,
getAllCasesSelectorModalNoProviderLazy,
} from './methods';
import { CasesUiConfigType } from '../common/ui/types';
import { APP_ID, APP_PATH } from '../common/constants';
@ -93,12 +91,10 @@ export class CasesUiPlugin
getCases: getCasesLazy,
getCasesContext: getCasesContextLazy,
getRecentCases: getRecentCasesLazy,
// @deprecated Please use the hook getUseCasesAddToNewCaseFlyout
getCreateCaseFlyout: getCreateCaseFlyoutLazy,
// @deprecated Please use the hook getUseCasesAddToExistingCaseModal
getAllCasesSelectorModal: getAllCasesSelectorModalLazy,
// Temporal methods to remove timelines and cases deep integration
// https://github.com/elastic/kibana/issues/123183
getCreateCaseFlyoutNoProvider: getCreateCaseFlyoutLazyNoProvider,
getAllCasesSelectorModalNoProvider: getAllCasesSelectorModalNoProviderLazy,
hooks: {
getUseCasesAddToNewCaseFlyout: useCasesAddToNewCaseFlyout,
getUseCasesAddToExistingCaseModal: useCasesAddToExistingCaseModal,

View file

@ -22,7 +22,6 @@ import type { SpacesPluginStart } from '../../spaces/public';
import type { TriggersAndActionsUIPublicPluginStart as TriggersActionsStart } from '../../triggers_actions_ui/public';
import { CommentRequestAlertType, CommentRequestUserType } from '../common/api';
import { UseCasesAddToExistingCaseModal } from './components/all_cases/selector_modal/use_cases_add_to_existing_case_modal';
import { CreateCaseFlyoutProps } from './components/create/flyout';
import { UseCasesAddToNewCaseFlyout } from './components/create/flyout/use_cases_add_to_new_case_flyout';
import type {
@ -97,18 +96,12 @@ export interface CasesUiStart {
getAllCasesSelectorModal: (
props: GetAllCasesSelectorModalProps
) => ReactElement<GetAllCasesSelectorModalProps>;
getAllCasesSelectorModalNoProvider: (
props: GetAllCasesSelectorModalProps
) => ReactElement<GetAllCasesSelectorModalProps>;
/**
* Flyout with the form to create a case for the owner
* @param props GetCreateCaseFlyoutProps
* @returns A react component that is a flyout for creating a case
*/
getCreateCaseFlyout: (props: GetCreateCaseFlyoutProps) => ReactElement<GetCreateCaseFlyoutProps>;
getCreateCaseFlyoutNoProvider: (
props: CreateCaseFlyoutProps
) => ReactElement<CreateCaseFlyoutProps>;
/**
* Get the recent cases component
* @param props GetRecentCasesProps