[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(), getCases: jest.fn(),
getCasesContext: jest.fn().mockImplementation(() => mockCasesContext), getCasesContext: jest.fn().mockImplementation(() => mockCasesContext),
getAllCasesSelectorModal: jest.fn(), getAllCasesSelectorModal: jest.fn(),
getAllCasesSelectorModalNoProvider: jest.fn(),
getCreateCaseFlyout: jest.fn(), getCreateCaseFlyout: jest.fn(),
getRecentCases: jest.fn(), getRecentCases: jest.fn(),
getCreateCaseFlyoutNoProvider: jest.fn(),
hooks: { hooks: {
getUseCasesAddToNewCaseFlyout: jest.fn(), getUseCasesAddToNewCaseFlyout: jest.fn(),
getUseCasesAddToExistingCaseModal: jest.fn(), getUseCasesAddToExistingCaseModal: jest.fn(),

View file

@ -14,8 +14,6 @@ import {
getAllCasesSelectorModalLazy, getAllCasesSelectorModalLazy,
getCreateCaseFlyoutLazy, getCreateCaseFlyoutLazy,
canUseCases, canUseCases,
getCreateCaseFlyoutLazyNoProvider,
getAllCasesSelectorModalNoProviderLazy,
} from './methods'; } from './methods';
import { CasesUiConfigType } from '../common/ui/types'; import { CasesUiConfigType } from '../common/ui/types';
import { APP_ID, APP_PATH } from '../common/constants'; import { APP_ID, APP_PATH } from '../common/constants';
@ -93,12 +91,10 @@ export class CasesUiPlugin
getCases: getCasesLazy, getCases: getCasesLazy,
getCasesContext: getCasesContextLazy, getCasesContext: getCasesContextLazy,
getRecentCases: getRecentCasesLazy, getRecentCases: getRecentCasesLazy,
// @deprecated Please use the hook getUseCasesAddToNewCaseFlyout
getCreateCaseFlyout: getCreateCaseFlyoutLazy, getCreateCaseFlyout: getCreateCaseFlyoutLazy,
// @deprecated Please use the hook getUseCasesAddToExistingCaseModal
getAllCasesSelectorModal: getAllCasesSelectorModalLazy, getAllCasesSelectorModal: getAllCasesSelectorModalLazy,
// Temporal methods to remove timelines and cases deep integration
// https://github.com/elastic/kibana/issues/123183
getCreateCaseFlyoutNoProvider: getCreateCaseFlyoutLazyNoProvider,
getAllCasesSelectorModalNoProvider: getAllCasesSelectorModalNoProviderLazy,
hooks: { hooks: {
getUseCasesAddToNewCaseFlyout: useCasesAddToNewCaseFlyout, getUseCasesAddToNewCaseFlyout: useCasesAddToNewCaseFlyout,
getUseCasesAddToExistingCaseModal: useCasesAddToExistingCaseModal, 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 type { TriggersAndActionsUIPublicPluginStart as TriggersActionsStart } from '../../triggers_actions_ui/public';
import { CommentRequestAlertType, CommentRequestUserType } from '../common/api'; import { CommentRequestAlertType, CommentRequestUserType } from '../common/api';
import { UseCasesAddToExistingCaseModal } from './components/all_cases/selector_modal/use_cases_add_to_existing_case_modal'; 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 { UseCasesAddToNewCaseFlyout } from './components/create/flyout/use_cases_add_to_new_case_flyout';
import type { import type {
@ -97,18 +96,12 @@ export interface CasesUiStart {
getAllCasesSelectorModal: ( getAllCasesSelectorModal: (
props: GetAllCasesSelectorModalProps props: GetAllCasesSelectorModalProps
) => ReactElement<GetAllCasesSelectorModalProps>; ) => ReactElement<GetAllCasesSelectorModalProps>;
getAllCasesSelectorModalNoProvider: (
props: GetAllCasesSelectorModalProps
) => ReactElement<GetAllCasesSelectorModalProps>;
/** /**
* Flyout with the form to create a case for the owner * Flyout with the form to create a case for the owner
* @param props GetCreateCaseFlyoutProps * @param props GetCreateCaseFlyoutProps
* @returns A react component that is a flyout for creating a case * @returns A react component that is a flyout for creating a case
*/ */
getCreateCaseFlyout: (props: GetCreateCaseFlyoutProps) => ReactElement<GetCreateCaseFlyoutProps>; getCreateCaseFlyout: (props: GetCreateCaseFlyoutProps) => ReactElement<GetCreateCaseFlyoutProps>;
getCreateCaseFlyoutNoProvider: (
props: CreateCaseFlyoutProps
) => ReactElement<CreateCaseFlyoutProps>;
/** /**
* Get the recent cases component * Get the recent cases component
* @param props GetRecentCasesProps * @param props GetRecentCasesProps