From ce009de76c2a04abe5475b8871489e601f67f71e Mon Sep 17 00:00:00 2001 From: Christos Nasikas Date: Sun, 17 Nov 2024 15:47:06 +0200 Subject: [PATCH 1/2] Remove deprecated date format --- x-pack/plugins/cases/server/telemetry/queries/alerts.test.ts | 1 - x-pack/plugins/cases/server/telemetry/queries/cases.test.ts | 4 ---- .../plugins/cases/server/telemetry/queries/comments.test.ts | 1 - .../cases/server/telemetry/queries/user_actions.test.ts | 1 - x-pack/plugins/cases/server/telemetry/queries/utils.test.ts | 3 --- x-pack/plugins/cases/server/telemetry/queries/utils.ts | 2 -- .../security_and_spaces/tests/common/telemetry.ts | 2 +- 7 files changed, 1 insertion(+), 13 deletions(-) diff --git a/x-pack/plugins/cases/server/telemetry/queries/alerts.test.ts b/x-pack/plugins/cases/server/telemetry/queries/alerts.test.ts index fd00aea939dc8..d1bb0605a80e2 100644 --- a/x-pack/plugins/cases/server/telemetry/queries/alerts.test.ts +++ b/x-pack/plugins/cases/server/telemetry/queries/alerts.test.ts @@ -62,7 +62,6 @@ describe('alerts', () => { counts: { date_range: { field: 'cases-comments.attributes.created_at', - format: 'dd/MM/YYYY', ranges: [ { from: 'now-1d', diff --git a/x-pack/plugins/cases/server/telemetry/queries/cases.test.ts b/x-pack/plugins/cases/server/telemetry/queries/cases.test.ts index fdfe39f940e9b..3699f37387687 100644 --- a/x-pack/plugins/cases/server/telemetry/queries/cases.test.ts +++ b/x-pack/plugins/cases/server/telemetry/queries/cases.test.ts @@ -469,7 +469,6 @@ describe('getCasesTelemetryData', () => { "counts": Object { "date_range": Object { "field": "cases.attributes.created_at", - "format": "dd/MM/YYYY", "ranges": Array [ Object { "from": "now-1d", @@ -501,7 +500,6 @@ describe('getCasesTelemetryData', () => { "counts": Object { "date_range": Object { "field": "cases.attributes.created_at", - "format": "dd/MM/YYYY", "ranges": Array [ Object { "from": "now-1d", @@ -547,7 +545,6 @@ describe('getCasesTelemetryData', () => { "counts": Object { "date_range": Object { "field": "cases.attributes.created_at", - "format": "dd/MM/YYYY", "ranges": Array [ Object { "from": "now-1d", @@ -605,7 +602,6 @@ describe('getCasesTelemetryData', () => { "counts": Object { "date_range": Object { "field": "cases.attributes.created_at", - "format": "dd/MM/YYYY", "ranges": Array [ Object { "from": "now-1d", diff --git a/x-pack/plugins/cases/server/telemetry/queries/comments.test.ts b/x-pack/plugins/cases/server/telemetry/queries/comments.test.ts index d3104bd9a79ad..1db3ed0c11c0c 100644 --- a/x-pack/plugins/cases/server/telemetry/queries/comments.test.ts +++ b/x-pack/plugins/cases/server/telemetry/queries/comments.test.ts @@ -62,7 +62,6 @@ describe('comments', () => { counts: { date_range: { field: 'cases-comments.attributes.created_at', - format: 'dd/MM/YYYY', ranges: [ { from: 'now-1d', diff --git a/x-pack/plugins/cases/server/telemetry/queries/user_actions.test.ts b/x-pack/plugins/cases/server/telemetry/queries/user_actions.test.ts index b6c45d8da3efc..e3f3644e14d87 100644 --- a/x-pack/plugins/cases/server/telemetry/queries/user_actions.test.ts +++ b/x-pack/plugins/cases/server/telemetry/queries/user_actions.test.ts @@ -62,7 +62,6 @@ describe('user_actions', () => { counts: { date_range: { field: 'cases-user-actions.attributes.created_at', - format: 'dd/MM/YYYY', ranges: [ { from: 'now-1d', diff --git a/x-pack/plugins/cases/server/telemetry/queries/utils.test.ts b/x-pack/plugins/cases/server/telemetry/queries/utils.test.ts index b4b18f231eb6a..e8fca619c1e2f 100644 --- a/x-pack/plugins/cases/server/telemetry/queries/utils.test.ts +++ b/x-pack/plugins/cases/server/telemetry/queries/utils.test.ts @@ -817,7 +817,6 @@ describe('utils', () => { counts: { date_range: { field: 'test.attributes.created_at', - format: 'dd/MM/YYYY', ranges: [ { from: 'now-1d', to: 'now' }, { from: 'now-1w', to: 'now' }, @@ -1132,7 +1131,6 @@ describe('utils', () => { counts: { date_range: { field: 'test.attributes.created_at', - format: 'dd/MM/YYYY', ranges: [ { from: 'now-1d', @@ -1261,7 +1259,6 @@ describe('utils', () => { counts: { date_range: { field: 'cases-comments.attributes.created_at', - format: 'dd/MM/YYYY', ranges: [ { from: 'now-1d', diff --git a/x-pack/plugins/cases/server/telemetry/queries/utils.ts b/x-pack/plugins/cases/server/telemetry/queries/utils.ts index 6992ed8f7ac06..c5795a6e8c773 100644 --- a/x-pack/plugins/cases/server/telemetry/queries/utils.ts +++ b/x-pack/plugins/cases/server/telemetry/queries/utils.ts @@ -38,7 +38,6 @@ export const getCountsAggregationQuery = (savedObjectType: string) => ({ counts: { date_range: { field: `${savedObjectType}.attributes.created_at`, - format: 'dd/MM/YYYY', ranges: [ { from: 'now-1d', to: 'now' }, { from: 'now-1w', to: 'now' }, @@ -52,7 +51,6 @@ export const getAlertsCountsAggregationQuery = () => ({ counts: { date_range: { field: `${CASE_COMMENT_SAVED_OBJECT}.attributes.created_at`, - format: 'dd/MM/YYYY', ranges: [ { from: 'now-1d', to: 'now' }, { from: 'now-1w', to: 'now' }, diff --git a/x-pack/test/cases_api_integration/security_and_spaces/tests/common/telemetry.ts b/x-pack/test/cases_api_integration/security_and_spaces/tests/common/telemetry.ts index c83210e51e5d5..10dc3d617c582 100644 --- a/x-pack/test/cases_api_integration/security_and_spaces/tests/common/telemetry.ts +++ b/x-pack/test/cases_api_integration/security_and_spaces/tests/common/telemetry.ts @@ -52,7 +52,7 @@ export default ({ getService }: FtrProviderContext): void => { }); }); - it('should return the corect total number of alerts attached to cases', async () => { + it('should return the correct total number of alerts attached to cases', async () => { const firstCase = await createCase(supertest, getPostCaseRequest()); const secondCase = await createCase(supertest, getPostCaseRequest()); From 69b5dab628310ebffcf9f00c941f0a76e2181c6e Mon Sep 17 00:00:00 2001 From: Christos Nasikas Date: Mon, 18 Nov 2024 11:03:46 +0200 Subject: [PATCH 2/2] Change deprecated years format --- x-pack/plugins/cases/server/telemetry/queries/alerts.test.ts | 1 + x-pack/plugins/cases/server/telemetry/queries/cases.test.ts | 4 ++++ .../plugins/cases/server/telemetry/queries/comments.test.ts | 1 + .../cases/server/telemetry/queries/user_actions.test.ts | 1 + x-pack/plugins/cases/server/telemetry/queries/utils.test.ts | 3 +++ x-pack/plugins/cases/server/telemetry/queries/utils.ts | 2 ++ 6 files changed, 12 insertions(+) diff --git a/x-pack/plugins/cases/server/telemetry/queries/alerts.test.ts b/x-pack/plugins/cases/server/telemetry/queries/alerts.test.ts index d1bb0605a80e2..af300cb80ad54 100644 --- a/x-pack/plugins/cases/server/telemetry/queries/alerts.test.ts +++ b/x-pack/plugins/cases/server/telemetry/queries/alerts.test.ts @@ -62,6 +62,7 @@ describe('alerts', () => { counts: { date_range: { field: 'cases-comments.attributes.created_at', + format: 'dd/MM/yyyy', ranges: [ { from: 'now-1d', diff --git a/x-pack/plugins/cases/server/telemetry/queries/cases.test.ts b/x-pack/plugins/cases/server/telemetry/queries/cases.test.ts index 3699f37387687..b33b588fd951b 100644 --- a/x-pack/plugins/cases/server/telemetry/queries/cases.test.ts +++ b/x-pack/plugins/cases/server/telemetry/queries/cases.test.ts @@ -469,6 +469,7 @@ describe('getCasesTelemetryData', () => { "counts": Object { "date_range": Object { "field": "cases.attributes.created_at", + "format": "dd/MM/yyyy", "ranges": Array [ Object { "from": "now-1d", @@ -500,6 +501,7 @@ describe('getCasesTelemetryData', () => { "counts": Object { "date_range": Object { "field": "cases.attributes.created_at", + "format": "dd/MM/yyyy", "ranges": Array [ Object { "from": "now-1d", @@ -545,6 +547,7 @@ describe('getCasesTelemetryData', () => { "counts": Object { "date_range": Object { "field": "cases.attributes.created_at", + "format": "dd/MM/yyyy", "ranges": Array [ Object { "from": "now-1d", @@ -602,6 +605,7 @@ describe('getCasesTelemetryData', () => { "counts": Object { "date_range": Object { "field": "cases.attributes.created_at", + "format": "dd/MM/yyyy", "ranges": Array [ Object { "from": "now-1d", diff --git a/x-pack/plugins/cases/server/telemetry/queries/comments.test.ts b/x-pack/plugins/cases/server/telemetry/queries/comments.test.ts index 1db3ed0c11c0c..71ee6af56194a 100644 --- a/x-pack/plugins/cases/server/telemetry/queries/comments.test.ts +++ b/x-pack/plugins/cases/server/telemetry/queries/comments.test.ts @@ -62,6 +62,7 @@ describe('comments', () => { counts: { date_range: { field: 'cases-comments.attributes.created_at', + format: 'dd/MM/yyyy', ranges: [ { from: 'now-1d', diff --git a/x-pack/plugins/cases/server/telemetry/queries/user_actions.test.ts b/x-pack/plugins/cases/server/telemetry/queries/user_actions.test.ts index e3f3644e14d87..a749dadb8ccd2 100644 --- a/x-pack/plugins/cases/server/telemetry/queries/user_actions.test.ts +++ b/x-pack/plugins/cases/server/telemetry/queries/user_actions.test.ts @@ -62,6 +62,7 @@ describe('user_actions', () => { counts: { date_range: { field: 'cases-user-actions.attributes.created_at', + format: 'dd/MM/yyyy', ranges: [ { from: 'now-1d', diff --git a/x-pack/plugins/cases/server/telemetry/queries/utils.test.ts b/x-pack/plugins/cases/server/telemetry/queries/utils.test.ts index e8fca619c1e2f..5aa5ac5b39ce3 100644 --- a/x-pack/plugins/cases/server/telemetry/queries/utils.test.ts +++ b/x-pack/plugins/cases/server/telemetry/queries/utils.test.ts @@ -817,6 +817,7 @@ describe('utils', () => { counts: { date_range: { field: 'test.attributes.created_at', + format: 'dd/MM/yyyy', ranges: [ { from: 'now-1d', to: 'now' }, { from: 'now-1w', to: 'now' }, @@ -1131,6 +1132,7 @@ describe('utils', () => { counts: { date_range: { field: 'test.attributes.created_at', + format: 'dd/MM/yyyy', ranges: [ { from: 'now-1d', @@ -1259,6 +1261,7 @@ describe('utils', () => { counts: { date_range: { field: 'cases-comments.attributes.created_at', + format: 'dd/MM/yyyy', ranges: [ { from: 'now-1d', diff --git a/x-pack/plugins/cases/server/telemetry/queries/utils.ts b/x-pack/plugins/cases/server/telemetry/queries/utils.ts index c5795a6e8c773..fdff93bd24154 100644 --- a/x-pack/plugins/cases/server/telemetry/queries/utils.ts +++ b/x-pack/plugins/cases/server/telemetry/queries/utils.ts @@ -38,6 +38,7 @@ export const getCountsAggregationQuery = (savedObjectType: string) => ({ counts: { date_range: { field: `${savedObjectType}.attributes.created_at`, + format: 'dd/MM/yyyy', ranges: [ { from: 'now-1d', to: 'now' }, { from: 'now-1w', to: 'now' }, @@ -51,6 +52,7 @@ export const getAlertsCountsAggregationQuery = () => ({ counts: { date_range: { field: `${CASE_COMMENT_SAVED_OBJECT}.attributes.created_at`, + format: 'dd/MM/yyyy', ranges: [ { from: 'now-1d', to: 'now' }, { from: 'now-1w', to: 'now' },