From 98fdf7fb847bbcb5e3c14237bd0aecfc910a217b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 7 Apr 2021 10:59:54 +0200 Subject: [PATCH 1/3] Update dependency @elastic/charts to v28.0.1 (#96356) Co-authored-by: Renovate Bot --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d79df127a7d31..bb383e986e721 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "dependencies": { "@elastic/apm-rum": "^5.6.1", "@elastic/apm-rum-react": "^1.2.5", - "@elastic/charts": "28.0.0", + "@elastic/charts": "28.0.1", "@elastic/datemath": "link:bazel-bin/packages/elastic-datemath/npm_module", "@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.4", "@elastic/ems-client": "7.12.0", diff --git a/yarn.lock b/yarn.lock index 1a555fae61029..4fba8dc85a09e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1359,10 +1359,10 @@ dependencies: object-hash "^1.3.0" -"@elastic/charts@28.0.0": - version "28.0.0" - resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-28.0.0.tgz#496a5b4041197b9d4750ca1d4ac3f6e3ff5756f6" - integrity sha512-aFO0J9BLUis5vD7g/m/Sb0Twj48yvm4f3bvmqk5d8RI+++VLW5qzyvyjiijMcHYHys6EuAs3vU3GaGlzx6TXig== +"@elastic/charts@28.0.1": + version "28.0.1" + resolved "https://registry.yarnpkg.com/@elastic/charts/-/charts-28.0.1.tgz#615f393dc620304fb6cdbc3f6eaf2d6c53e39236" + integrity sha512-uuo7mWTYU4/rdg1a7hxRnNJz7Zjt/u18YwNV4D2SPvBqCDsNxtdRpiF+nLWFDIvBGoAFIGmHIv3cn88Y9dKqdg== dependencies: "@popperjs/core" "^2.4.0" chroma-js "^2.1.0" From 011b234d15d07d2a1ce04ac63ead888be6a819fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yulia=20=C4=8Cech?= <6585477+yuliacech@users.noreply.github.com> Date: Wed, 7 Apr 2021 11:16:12 +0200 Subject: [PATCH 2/3] Added readonly action in cold phase (#96036) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../edit_policy/edit_policy.helpers.tsx | 1 + .../edit_policy/features/searchable_snapshots.test.ts | 6 +++++- .../serialization/policy_serialization.test.ts | 2 ++ .../index_lifecycle_management/common/types/policies.ts | 1 + .../components/phases/cold_phase/cold_phase.tsx | 4 ++++ .../components/phases/shared_fields/readonly_field.tsx | 2 +- .../searchable_snapshot_field.tsx | 2 +- .../components/phases/warm_phase/warm_phase.tsx | 2 +- .../sections/edit_policy/form/deserializer.ts | 1 + .../edit_policy/form/deserializer_and_serializer.test.ts | 9 +++++++++ .../application/sections/edit_policy/form/schema.ts | 4 ++++ .../sections/edit_policy/form/serializer/serializer.ts | 9 +++++++++ .../public/application/sections/edit_policy/types.ts | 1 + 13 files changed, 40 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.helpers.tsx b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.helpers.tsx index 122fb83edab45..12de34b79ee12 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.helpers.tsx +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.helpers.tsx @@ -380,6 +380,7 @@ export const setup = async (arg?: { setReplicas: setReplicas('cold'), setFreeze: createSetFreeze('cold'), freezeExists: createFreezeExists('cold'), + ...createReadonlyActions('cold'), hasErrorIndicator: () => exists('phaseErrorIndicator-cold'), ...createIndexPriorityActions('cold'), ...createSearchableSnapshotActions('cold'), diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/searchable_snapshots.test.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/searchable_snapshots.test.ts index a570c817cfe1b..e21793e650683 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/searchable_snapshots.test.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/features/searchable_snapshots.test.ts @@ -36,7 +36,7 @@ describe(' searchable snapshots', () => { component.update(); }); - test('enabling searchable snapshot should hide force merge, freeze and shrink in subsequent phases', async () => { + test('enabling searchable snapshot should hide force merge, freeze, readonly and shrink in subsequent phases', async () => { const { actions } = testBed; await actions.warm.enable(true); @@ -44,16 +44,20 @@ describe(' searchable snapshots', () => { expect(actions.warm.forceMergeFieldExists()).toBeTruthy(); expect(actions.warm.shrinkExists()).toBeTruthy(); + expect(actions.warm.readonlyExists()).toBeTruthy(); expect(actions.cold.searchableSnapshotsExists()).toBeTruthy(); expect(actions.cold.freezeExists()).toBeTruthy(); + expect(actions.cold.readonlyExists()).toBeTruthy(); await actions.hot.setSearchableSnapshot('my-repo'); expect(actions.warm.forceMergeFieldExists()).toBeFalsy(); expect(actions.warm.shrinkExists()).toBeFalsy(); + expect(actions.warm.readonlyExists()).toBeFalsy(); // searchable snapshot in cold is still visible expect(actions.cold.searchableSnapshotsExists()).toBeTruthy(); expect(actions.cold.freezeExists()).toBeFalsy(); + expect(actions.cold.readonlyExists()).toBeFalsy(); }); test('disabling rollover toggle, but enabling default rollover', async () => { diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/serialization/policy_serialization.test.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/serialization/policy_serialization.test.ts index 17dadb1c6b47e..846e20b48ddca 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/serialization/policy_serialization.test.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/serialization/policy_serialization.test.ts @@ -426,6 +426,7 @@ describe(' serialization', () => { await actions.cold.setSelectedNodeAttribute('test:123'); await actions.cold.setReplicas('123'); await actions.cold.setFreeze(true); + await actions.cold.toggleReadonly(true); await actions.cold.setIndexPriority('123'); await actions.savePolicy(); @@ -445,6 +446,7 @@ describe(' serialization', () => { }, }, "freeze": Object {}, + "readonly": Object {}, "set_priority": Object { "priority": 123, }, diff --git a/x-pack/plugins/index_lifecycle_management/common/types/policies.ts b/x-pack/plugins/index_lifecycle_management/common/types/policies.ts index d3fec300d2d5f..f4ff69f9b5c10 100644 --- a/x-pack/plugins/index_lifecycle_management/common/types/policies.ts +++ b/x-pack/plugins/index_lifecycle_management/common/types/policies.ts @@ -108,6 +108,7 @@ export interface SerializedWarmPhase extends SerializedPhase { export interface SerializedColdPhase extends SerializedPhase { actions: { freeze?: {}; + readonly?: {}; allocate?: AllocateAction; set_priority?: { priority: number | null; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/cold_phase/cold_phase.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/cold_phase/cold_phase.tsx index 72651778f403e..648aebf8118de 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/cold_phase/cold_phase.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/cold_phase/cold_phase.tsx @@ -15,6 +15,7 @@ import { IndexPriorityField, ReplicasField, FreezeField, + ReadonlyField, } from '../shared_fields'; import { Phase } from '../phase'; @@ -38,6 +39,9 @@ export const ColdPhase: FunctionComponent = () => { {/* Freeze section */} {!isUsingSearchableSnapshotInHotPhase && } + {/* Readonly section */} + {!isUsingSearchableSnapshotInHotPhase && } + {/* Data tier allocation section */} = ({ phase }) => { diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/searchable_snapshot_field/searchable_snapshot_field.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/searchable_snapshot_field/searchable_snapshot_field.tsx index 4cef7615a2d8d..50663d936617b 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/searchable_snapshot_field/searchable_snapshot_field.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/searchable_snapshot_field/searchable_snapshot_field.tsx @@ -228,7 +228,7 @@ export const SearchableSnapshotField: FunctionComponent = ({ 'xpack.indexLifecycleMgmt.editPolicy.searchableSnapshotCalloutBody', { defaultMessage: - 'Force merge, shrink and freeze actions are not allowed when searchable snapshots are enabled in this phase.', + 'Force merge, shrink, read only and freeze actions are not allowed when searchable snapshots are enabled in this phase.', } )} data-test-subj="searchableSnapshotFieldsDisabledCallout" diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/warm_phase/warm_phase.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/warm_phase/warm_phase.tsx index d082489c4b918..29445ac8e4715 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/warm_phase/warm_phase.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/warm_phase/warm_phase.tsx @@ -40,7 +40,7 @@ export const WarmPhase: FunctionComponent = () => { {!isUsingSearchableSnapshotInHotPhase && } - + {!isUsingSearchableSnapshotInHotPhase && } {/* Data tier allocation section */} ( enabled: Boolean(cold), dataTierAllocationType: determineDataTierAllocationType(cold?.actions), freezeEnabled: Boolean(cold?.actions?.freeze), + readonlyEnabled: Boolean(cold?.actions?.readonly), }, frozen: { enabled: Boolean(frozen), diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/deserializer_and_serializer.test.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/deserializer_and_serializer.test.ts index bdb915ba62d44..7cc48b3fcd90e 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/deserializer_and_serializer.test.ts +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/deserializer_and_serializer.test.ts @@ -85,6 +85,7 @@ const originalPolicy: SerializedPolicy = { exclude: { test: 'my_value' }, }, freeze: {}, + readonly: {}, set_priority: { priority: 12, }, @@ -206,6 +207,14 @@ describe('deserializer and serializer', () => { expect(result.phases.warm!.actions.readonly).toBeUndefined(); }); + it('removes the readonly action if it is disabled in cold', () => { + formInternal._meta.cold.readonlyEnabled = false; + + const result = serializer(formInternal); + + expect(result.phases.cold!.actions.readonly).toBeUndefined(); + }); + it('allows force merge and readonly actions to be configured in hot with default rollover enabled', () => { formInternal._meta.hot.isUsingDefaultRollover = true; formInternal._meta.hot.bestCompression = false; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/schema.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/schema.ts index 2b90d75fa6da0..ce7b36d69a32e 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/schema.ts +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/schema.ts @@ -201,6 +201,10 @@ export const getSchema = (isCloudEnabled: boolean): FormSchema => ({ defaultMessage: 'Freeze index', }), }, + readonlyEnabled: { + defaultValue: false, + label: i18nTexts.editPolicy.readonlyEnabledFieldLabel, + }, minAgeUnit: { defaultValue: 'd', }, diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/serializer/serializer.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/serializer/serializer.ts index b10e3294f75c7..24dafa6cca237 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/serializer/serializer.ts +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/serializer/serializer.ts @@ -229,6 +229,15 @@ export const createSerializer = (originalPolicy?: SerializedPolicy) => ( delete coldPhase.actions.freeze; } + /** + * COLD PHASE READ ONLY + */ + if (_meta.cold.readonlyEnabled) { + coldPhase.actions.readonly = coldPhase.actions.readonly ?? {}; + } else { + delete coldPhase.actions.readonly; + } + /** * COLD PHASE SET PRIORITY */ diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/types.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/types.ts index 977554f12da42..5cc631c5d95c0 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/types.ts +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/types.ts @@ -50,6 +50,7 @@ interface WarmPhaseMetaFields extends DataAllocationMetaFields, MinAgeField, For interface ColdPhaseMetaFields extends DataAllocationMetaFields, MinAgeField { enabled: boolean; freezeEnabled: boolean; + readonlyEnabled: boolean; } interface FrozenPhaseMetaFields extends DataAllocationMetaFields, MinAgeField { From d8154039531d2c0fd0f88cfb7ae7c23d24889bdf Mon Sep 17 00:00:00 2001 From: Shahzad Date: Wed, 7 Apr 2021 11:21:49 +0200 Subject: [PATCH 3/3] [Uptime] Fixed pagination styling (#95940) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../monitor_list/__snapshots__/monitor_list.test.tsx.snap | 6 +++--- .../components/overview/monitor_list/overview_page_link.tsx | 4 ++-- .../uptime/server/lib/requests/search/query_context.ts | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/__snapshots__/monitor_list.test.tsx.snap b/x-pack/plugins/uptime/public/components/overview/monitor_list/__snapshots__/monitor_list.test.tsx.snap index 779b513915ea8..dc125ec4b8466 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/__snapshots__/monitor_list.test.tsx.snap +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/__snapshots__/monitor_list.test.tsx.snap @@ -831,7 +831,7 @@ exports[`MonitorList component renders the monitor list 1`] = ` } .c3 { - padding-top: 12px; + margin-top: 12px; } .c0 { @@ -1652,7 +1652,7 @@ exports[`MonitorList component renders the monitor list 1`] = ` >