From 1008c342830a5f6438e2e80dddeda835b203a1bb Mon Sep 17 00:00:00 2001 From: Jonathan Buttner Date: Thu, 11 Aug 2022 16:57:12 -0400 Subject: [PATCH] Removing type field --- .../cases/public/client/attachment_framework/types.ts | 1 - .../public/components/user_actions/comment/alert.tsx | 2 -- .../components/user_actions/comment/comment.test.tsx | 10 ++-------- .../user_actions/comment/registered_attachments.tsx | 1 - .../cases/public/components/user_actions/common.tsx | 1 - .../cases/public/components/user_actions/pushed.tsx | 2 -- x-pack/plugins/cases/public/containers/mock.ts | 2 -- .../cases/public/attachments/external_reference.tsx | 1 - .../cases/public/attachments/persistable_state.tsx | 1 - 9 files changed, 2 insertions(+), 19 deletions(-) diff --git a/x-pack/plugins/cases/public/client/attachment_framework/types.ts b/x-pack/plugins/cases/public/client/attachment_framework/types.ts index 9e62a00957aef..c838dd6f68eae 100644 --- a/x-pack/plugins/cases/public/client/attachment_framework/types.ts +++ b/x-pack/plugins/cases/public/client/attachment_framework/types.ts @@ -14,7 +14,6 @@ import { import { Case } from '../../containers/types'; export interface AttachmentViewObject { - type?: EuiCommentProps['type']; timelineIcon?: EuiCommentProps['timelineIcon']; actions?: EuiCommentProps['actions']; event?: EuiCommentProps['event']; diff --git a/x-pack/plugins/cases/public/components/user_actions/comment/alert.tsx b/x-pack/plugins/cases/public/components/user_actions/comment/alert.tsx index 2c9689960322a..6c97224c9c84f 100644 --- a/x-pack/plugins/cases/public/components/user_actions/comment/alert.tsx +++ b/x-pack/plugins/cases/public/components/user_actions/comment/alert.tsx @@ -59,7 +59,6 @@ const getSingleAlertUserAction = ({ /> ), className: 'comment-alert', - type: 'update', event: ( ), className: 'comment-alert', - type: 'update', event: ( { it('renders correctly an external reference', async () => { const externalReferenceAttachmentTypeRegistry = new ExternalReferenceAttachmentTypeRegistry(); - externalReferenceAttachmentTypeRegistry.register( - getExternalReferenceAttachment({ type: 'regular' }) - ); + externalReferenceAttachmentTypeRegistry.register(getExternalReferenceAttachment()); const userAction = getExternalReferenceUserAction(); const builder = createCommentUserActionBuilder({ @@ -242,7 +240,6 @@ describe('createCommentUserActionBuilder', () => { }; const attachment = getExternalReferenceAttachment({ - type: 'regular', actions: , }); @@ -277,9 +274,7 @@ describe('createCommentUserActionBuilder', () => { it('renders correctly a persistable state attachment', async () => { const persistableStateAttachmentTypeRegistry = new PersistableStateAttachmentTypeRegistry(); - persistableStateAttachmentTypeRegistry.register( - getPersistableStateAttachment({ type: 'regular' }) - ); + persistableStateAttachmentTypeRegistry.register(getPersistableStateAttachment()); const userAction = getPersistableStateUserAction(); const builder = createCommentUserActionBuilder({ @@ -329,7 +324,6 @@ describe('createCommentUserActionBuilder', () => { }; const attachment = getPersistableStateAttachment({ - type: 'regular', actions: , }); diff --git a/x-pack/plugins/cases/public/components/user_actions/comment/registered_attachments.tsx b/x-pack/plugins/cases/public/components/user_actions/comment/registered_attachments.tsx index 6a05f3c64a491..e654046061ea5 100644 --- a/x-pack/plugins/cases/public/components/user_actions/comment/registered_attachments.tsx +++ b/x-pack/plugins/cases/public/components/user_actions/comment/registered_attachments.tsx @@ -90,7 +90,6 @@ export const createRegisteredAttachmentUserActionBuilder = < fullName={comment.createdBy.fullName} /> ), - type: attachmentViewObject.type, className: `comment-${comment.type}-attachment-${attachmentTypeId}`, event: attachmentViewObject.event, 'data-test-subj': `comment-${comment.type}-${attachmentTypeId}`, diff --git a/x-pack/plugins/cases/public/components/user_actions/common.tsx b/x-pack/plugins/cases/public/components/user_actions/common.tsx index ba7ccabffb9c6..8cc450332af36 100644 --- a/x-pack/plugins/cases/public/components/user_actions/common.tsx +++ b/x-pack/plugins/cases/public/components/user_actions/common.tsx @@ -62,7 +62,6 @@ export const createCommonUpdateUserActionBuilder = ({ fullName={userAction.createdBy.fullName} /> ), - type: 'update' as const, event: label, 'data-test-subj': `${userAction.type}-${userAction.action}-action-${userAction.actionId}`, timestamp: , diff --git a/x-pack/plugins/cases/public/components/user_actions/pushed.tsx b/x-pack/plugins/cases/public/components/user_actions/pushed.tsx index e02bde992b651..4cf48a690f686 100644 --- a/x-pack/plugins/cases/public/components/user_actions/pushed.tsx +++ b/x-pack/plugins/cases/public/components/user_actions/pushed.tsx @@ -85,7 +85,6 @@ const getFooters = ({ ...footers, { username: '', - type: 'update', event: i18n.ALREADY_PUSHED_TO_SERVICE(`${connectorName}`), timelineIcon: 'sortUp', 'data-test-subj': 'top-footer', @@ -98,7 +97,6 @@ const getFooters = ({ ...footers, { username: '', - type: 'update', event: i18n.REQUIRED_UPDATE_TO_SERVICE(`${connectorName}`), timelineIcon: 'sortDown', 'data-test-subj': 'bottom-footer', diff --git a/x-pack/plugins/cases/public/containers/mock.ts b/x-pack/plugins/cases/public/containers/mock.ts index 0236175557adb..8f505dcf7dc29 100644 --- a/x-pack/plugins/cases/public/containers/mock.ts +++ b/x-pack/plugins/cases/public/containers/mock.ts @@ -861,7 +861,6 @@ export const getExternalReferenceAttachment = ( icon: 'casesApp', displayName: 'Test', getAttachmentViewObject: () => ({ - type: 'update', event: 'added a chart', timelineIcon: 'casesApp', ...viewObject, @@ -892,7 +891,6 @@ export const getPersistableStateAttachment = ( icon: 'casesApp', displayName: 'Test', getAttachmentViewObject: () => ({ - type: 'update', event: 'added an embeddable', timelineIcon: 'casesApp', ...viewObject, diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/attachments/external_reference.tsx b/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/attachments/external_reference.tsx index c0db98bfdf1a3..417a5a1b9b0f2 100644 --- a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/attachments/external_reference.tsx +++ b/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/attachments/external_reference.tsx @@ -27,7 +27,6 @@ export const getExternalReferenceAttachmentRegular = (): ExternalReferenceAttach icon: 'casesApp', displayName: 'Test', getAttachmentViewObject: () => ({ - type: 'regular', event: 'added a chart', timelineIcon: 'casesApp', actions: , diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/attachments/persistable_state.tsx b/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/attachments/persistable_state.tsx index f669406a2795a..b9c79a44a86c4 100644 --- a/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/attachments/persistable_state.tsx +++ b/x-pack/test/functional_with_es_ssl/fixtures/plugins/cases/public/attachments/persistable_state.tsx @@ -59,7 +59,6 @@ export const getPersistableStateAttachmentRegular = ( icon: 'casesApp', displayName: 'Test', getAttachmentViewObject: () => ({ - type: 'regular', event: 'added an embeddable', timelineIcon: 'casesApp', actions: ,