Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cases] Removing unnecessary mapping fields #151511

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ describe('checking migration metadata changes on all registered SO types', () =>
"canvas-element": "ec334dd45d14291db4d74197e0e42dfe06526868",
"canvas-workpad": "ab0525bd5aa4dbad2d6fdb30e6a51bb475254751",
"canvas-workpad-template": "c54f2a188a1d0bf18a6cebd9d6f28a7337d41bbf",
"cases": "74c00dfb25f4b109894971bd1090fce4a7c99490",
"cases-comments": "371662a8464e623f1f4f55a981cec78bec4a12f5",
"cases-configure": "25099c9e4bbb91e01e334848c605b4a5de5c9fce",
"cases-connector-mappings": "8de3b77dc6ae8ee62cce2b58a222471dfc3dbdad",
"cases": "1e86563e8364c69f86b77cb6f2933408dd5b827a",
"cases-comments": "69257ec55e8380fdb2ecbddc83e7c26d2ce2a351",
"cases-configure": "66d4c64d83b464f5166005b8ffa03b721fcaaf8b",
"cases-connector-mappings": "877bb4d52e9821e330622bd75fba799490ec6952",
"cases-telemetry": "fdeddcef28c75d8c66422475a829e75d37f0b668",
"cases-user-actions": "cfd388d2ca27b3abfd3955dc41428fb229989921",
"cases-user-actions": "8ad74294b71edffa58fad7a40eea2388209477c9",
"config": "97e16b8f5dc10c404fd3b201ef36bc6c3c63dc80",
"config-global": "d9791e8f73edee884630e1cb6e4954ae513ce75e",
"connector_token": "fb05ff5afdcb6e2f20c9c6513ff7a1ab12b66f36",
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/cases/server/saved_object_types/cases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const createCaseSavedObjectType = (
namespaceType: 'multiple-isolated',
convertToMultiNamespaceTypeVersion: '8.0.0',
mappings: {
dynamic: false,
properties: {
assignees: {
properties: {
Expand Down
82 changes: 1 addition & 81 deletions x-pack/plugins/cases/server/saved_object_types/comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const createCaseCommentSavedObjectType = ({
namespaceType: 'multiple-isolated',
convertToMultiNamespaceTypeVersion: '8.0.0',
mappings: {
dynamic: false,
properties: {
comment: {
type: 'text',
Expand All @@ -32,115 +33,34 @@ export const createCaseCommentSavedObjectType = ({
},
actions: {
properties: {
targets: {
type: 'nested',
properties: {
hostname: { type: 'keyword' },
endpointId: { type: 'keyword' },
},
},
type: { type: 'keyword' },
},
},
alertId: {
type: 'keyword',
},
index: {
type: 'keyword',
},
created_at: {
type: 'date',
},
created_by: {
properties: {
full_name: {
type: 'keyword',
},
username: {
type: 'keyword',
},
email: {
type: 'keyword',
},
profile_uid: {
type: 'keyword',
},
},
},
externalReferenceId: {
type: 'keyword',
},
externalReferenceStorage: {
dynamic: false,
properties: {
// externalReferenceStorage.type
type: {
type: 'keyword',
},
},
},
externalReferenceAttachmentTypeId: {
type: 'keyword',
},
externalReferenceMetadata: {
dynamic: false,
properties: {},
},
persistableStateAttachmentTypeId: {
type: 'keyword',
},
persistableStateAttachmentState: {
dynamic: false,
properties: {},
},
pushed_at: {
type: 'date',
},
pushed_by: {
properties: {
username: {
type: 'keyword',
},
full_name: {
type: 'keyword',
},
email: {
type: 'keyword',
},
profile_uid: {
type: 'keyword',
},
},
},
rule: {
properties: {
id: {
type: 'keyword',
},
name: {
type: 'keyword',
},
},
},
updated_at: {
type: 'date',
},
updated_by: {
properties: {
username: {
type: 'keyword',
},
full_name: {
type: 'keyword',
},
email: {
type: 'keyword',
},
profile_uid: {
type: 'keyword',
},
},
},
},
},
migrations: () => createCommentsMigrations(migrationDeps),
Expand Down
56 changes: 1 addition & 55 deletions x-pack/plugins/cases/server/saved_object_types/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,71 +15,17 @@ export const caseConfigureSavedObjectType: SavedObjectsType = {
namespaceType: 'multiple-isolated',
convertToMultiNamespaceTypeVersion: '8.0.0',
mappings: {
dynamic: false,
properties: {
created_at: {
type: 'date',
},
created_by: {
properties: {
email: {
type: 'keyword',
},
username: {
type: 'keyword',
},
full_name: {
type: 'keyword',
},
profile_uid: {
type: 'keyword',
},
},
},
connector: {
properties: {
name: {
type: 'text',
},
type: {
type: 'keyword',
},
fields: {
properties: {
key: {
type: 'text',
},
value: {
type: 'text',
},
},
},
},
},
closure_type: {
type: 'keyword',
},
owner: {
type: 'keyword',
},
updated_at: {
type: 'date',
},
updated_by: {
properties: {
email: {
type: 'keyword',
},
username: {
type: 'keyword',
},
full_name: {
type: 'keyword',
},
profile_uid: {
type: 'keyword',
},
},
},
},
},
migrations: configureMigrations,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,8 @@ export const caseConnectorMappingsSavedObjectType: SavedObjectsType = {
namespaceType: 'multiple-isolated',
convertToMultiNamespaceTypeVersion: '8.0.0',
mappings: {
dynamic: false,
properties: {
mappings: {
properties: {
source: {
type: 'keyword',
},
target: {
type: 'keyword',
},
action_type: {
type: 'keyword',
},
},
},
owner: {
type: 'keyword',
},
Expand Down
10 changes: 1 addition & 9 deletions x-pack/plugins/cases/server/saved_object_types/user_actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const createCaseUserActionSavedObjectType = (
namespaceType: 'multiple-isolated',
convertToMultiNamespaceTypeVersion: '8.0.0',
mappings: {
dynamic: false,
properties: {
action: {
type: 'keyword',
Expand All @@ -27,18 +28,9 @@ export const createCaseUserActionSavedObjectType = (
},
created_by: {
properties: {
email: {
type: 'keyword',
},
username: {
type: 'keyword',
},
full_name: {
type: 'keyword',
},
profile_uid: {
type: 'keyword',
},
},
},
payload: {
Expand Down