Skip to content

Commit 7089b00

Browse files
kibanamachinegeorgianaonoleata1904elasticmachine
authored
[9.2] [ResponseOps][Maintenance Window] Fix disabled MW status in the UI (elastic#242876) (elastic#243814)
# Backport This will backport the following commits from `main` to `9.2`: - [[ResponseOps][Maintenance Window] Fix disabled MW status in the UI (elastic#242876)](elastic#242876) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Georgiana-Andreea Onoleață","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-11-21T13:36:52Z","message":"[ResponseOps][Maintenance Window] Fix disabled MW status in the UI (elastic#242876)\n\nCloses https://github.com/elastic/kibana/issues/218109\n\n## Summary\n\nThis PR adds support for the `disabled` state of Maintenance Windows \n\nChanges: \n- extended `MaintenanceWindowStatus` to include `Disabled`\n- updated all helpers and schemas to handle the disabled state:\n- `getMaintenanceWindowDateAndStatus` now returns status `Disabled` when\nenabled = false\n \n- UI changes:\n - MW with enabled = false prop are now displayed as Disabled \n- updated the table action for disabled mw: only `copy id` and `delete`\noptions are available\n \n- Integration tests: \n - added/updated tests for creating disabled mw \n - added tests for deleting disabled mw \n - added tests for getting disabled mw\n\n<details>\n<summary>How to test </summary>\n\n1. create a disabled MW via Postman using this request body:\n```\n{\n \"title\": \"Disabled MW\",\n \"enabled\": false,\n \"schedule\": {\n \"custom\": {\n \"duration\": \"2d\",\n \"start\": \"2025-11-18T10:10:17.579Z\"\n }\n },\n \"scope\": {\n \"alerting\": {\n \"query\": {\n \"kql\": \"_id: '1234'\"\n }\n }\n }\n}\n```\n2. check in the ui if the status is `disabled` (instead of `running`)\n</details>\n\n---------\n\nCo-authored-by: kibanamachine <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>","sha":"679489bfbc279873835daf5a6c593a29a786a1a6","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","backport:version","v9.3.0","v9.2.2"],"title":"[ResponseOps][Maintenance Window] Fix disabled MW status in the UI","number":242876,"url":"https://github.com/elastic/kibana/pull/242876","mergeCommit":{"message":"[ResponseOps][Maintenance Window] Fix disabled MW status in the UI (elastic#242876)\n\nCloses https://github.com/elastic/kibana/issues/218109\n\n## Summary\n\nThis PR adds support for the `disabled` state of Maintenance Windows \n\nChanges: \n- extended `MaintenanceWindowStatus` to include `Disabled`\n- updated all helpers and schemas to handle the disabled state:\n- `getMaintenanceWindowDateAndStatus` now returns status `Disabled` when\nenabled = false\n \n- UI changes:\n - MW with enabled = false prop are now displayed as Disabled \n- updated the table action for disabled mw: only `copy id` and `delete`\noptions are available\n \n- Integration tests: \n - added/updated tests for creating disabled mw \n - added tests for deleting disabled mw \n - added tests for getting disabled mw\n\n<details>\n<summary>How to test </summary>\n\n1. create a disabled MW via Postman using this request body:\n```\n{\n \"title\": \"Disabled MW\",\n \"enabled\": false,\n \"schedule\": {\n \"custom\": {\n \"duration\": \"2d\",\n \"start\": \"2025-11-18T10:10:17.579Z\"\n }\n },\n \"scope\": {\n \"alerting\": {\n \"query\": {\n \"kql\": \"_id: '1234'\"\n }\n }\n }\n}\n```\n2. check in the ui if the status is `disabled` (instead of `running`)\n</details>\n\n---------\n\nCo-authored-by: kibanamachine <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>","sha":"679489bfbc279873835daf5a6c593a29a786a1a6"}},"sourceBranch":"main","suggestedTargetBranches":["9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/242876","number":242876,"mergeCommit":{"message":"[ResponseOps][Maintenance Window] Fix disabled MW status in the UI (elastic#242876)\n\nCloses https://github.com/elastic/kibana/issues/218109\n\n## Summary\n\nThis PR adds support for the `disabled` state of Maintenance Windows \n\nChanges: \n- extended `MaintenanceWindowStatus` to include `Disabled`\n- updated all helpers and schemas to handle the disabled state:\n- `getMaintenanceWindowDateAndStatus` now returns status `Disabled` when\nenabled = false\n \n- UI changes:\n - MW with enabled = false prop are now displayed as Disabled \n- updated the table action for disabled mw: only `copy id` and `delete`\noptions are available\n \n- Integration tests: \n - added/updated tests for creating disabled mw \n - added tests for deleting disabled mw \n - added tests for getting disabled mw\n\n<details>\n<summary>How to test </summary>\n\n1. create a disabled MW via Postman using this request body:\n```\n{\n \"title\": \"Disabled MW\",\n \"enabled\": false,\n \"schedule\": {\n \"custom\": {\n \"duration\": \"2d\",\n \"start\": \"2025-11-18T10:10:17.579Z\"\n }\n },\n \"scope\": {\n \"alerting\": {\n \"query\": {\n \"kql\": \"_id: '1234'\"\n }\n }\n }\n}\n```\n2. check in the ui if the status is `disabled` (instead of `running`)\n</details>\n\n---------\n\nCo-authored-by: kibanamachine <[email protected]>\nCo-authored-by: Elastic Machine <[email protected]>","sha":"679489bfbc279873835daf5a6c593a29a786a1a6"}},{"branch":"9.2","label":"v9.2.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Georgiana-Andreea Onoleață <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
1 parent 4cf9b0a commit 7089b00

File tree

30 files changed

+233
-28
lines changed

30 files changed

+233
-28
lines changed

oas_docs/bundle.json

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47449,7 +47449,8 @@
4744947449
"running",
4745047450
"upcoming",
4745147451
"finished",
47452-
"archived"
47452+
"archived",
47453+
"disabled"
4745347454
],
4745447455
"type": "string"
4745547456
},
@@ -47522,7 +47523,7 @@
4752247523
}
4752347524
},
4752447525
{
47525-
"description": "The status of the maintenance window. One of \"running\", \"upcoming\", \"finished\" or \"archived\".",
47526+
"description": "The status of the maintenance window. One of \"running\", \"upcoming\", \"finished\", \"archived\", or \"disabled\".",
4752647527
"in": "query",
4752747528
"name": "status",
4752847529
"required": false,
@@ -47533,7 +47534,8 @@
4753347534
"running",
4753447535
"finished",
4753547536
"upcoming",
47536-
"archived"
47537+
"archived",
47538+
"disabled"
4753747539
],
4753847540
"type": "string"
4753947541
},
@@ -47543,7 +47545,8 @@
4754347545
"running",
4754447546
"finished",
4754547547
"upcoming",
47546-
"archived"
47548+
"archived",
47549+
"disabled"
4754747550
],
4754847551
"type": "string"
4754947552
},
@@ -47712,7 +47715,8 @@
4771247715
"running",
4771347716
"upcoming",
4771447717
"finished",
47715-
"archived"
47718+
"archived",
47719+
"disabled"
4771647720
],
4771747721
"type": "string"
4771847722
},
@@ -47971,7 +47975,8 @@
4797147975
"running",
4797247976
"upcoming",
4797347977
"finished",
47974-
"archived"
47978+
"archived",
47979+
"disabled"
4797547980
],
4797647981
"type": "string"
4797747982
},
@@ -48305,7 +48310,8 @@
4830548310
"running",
4830648311
"upcoming",
4830748312
"finished",
48308-
"archived"
48313+
"archived",
48314+
"disabled"
4830948315
],
4831048316
"type": "string"
4831148317
},
@@ -48516,7 +48522,8 @@
4851648522
"running",
4851748523
"upcoming",
4851848524
"finished",
48519-
"archived"
48525+
"archived",
48526+
"disabled"
4852048527
],
4852148528
"type": "string"
4852248529
},
@@ -48724,7 +48731,8 @@
4872448731
"running",
4872548732
"upcoming",
4872648733
"finished",
48727-
"archived"
48734+
"archived",
48735+
"disabled"
4872848736
],
4872948737
"type": "string"
4873048738
},

oas_docs/bundle.serverless.json

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46720,7 +46720,8 @@
4672046720
"running",
4672146721
"upcoming",
4672246722
"finished",
46723-
"archived"
46723+
"archived",
46724+
"disabled"
4672446725
],
4672546726
"type": "string"
4672646727
},
@@ -46793,7 +46794,7 @@
4679346794
}
4679446795
},
4679546796
{
46796-
"description": "The status of the maintenance window. One of \"running\", \"upcoming\", \"finished\" or \"archived\".",
46797+
"description": "The status of the maintenance window. One of \"running\", \"upcoming\", \"finished\", \"archived\", or \"disabled\".",
4679746798
"in": "query",
4679846799
"name": "status",
4679946800
"required": false,
@@ -46804,7 +46805,8 @@
4680446805
"running",
4680546806
"finished",
4680646807
"upcoming",
46807-
"archived"
46808+
"archived",
46809+
"disabled"
4680846810
],
4680946811
"type": "string"
4681046812
},
@@ -46814,7 +46816,8 @@
4681446816
"running",
4681546817
"finished",
4681646818
"upcoming",
46817-
"archived"
46819+
"archived",
46820+
"disabled"
4681846821
],
4681946822
"type": "string"
4682046823
},
@@ -46983,7 +46986,8 @@
4698346986
"running",
4698446987
"upcoming",
4698546988
"finished",
46986-
"archived"
46989+
"archived",
46990+
"disabled"
4698746991
],
4698846992
"type": "string"
4698946993
},
@@ -47242,7 +47246,8 @@
4724247246
"running",
4724347247
"upcoming",
4724447248
"finished",
47245-
"archived"
47249+
"archived",
47250+
"disabled"
4724647251
],
4724747252
"type": "string"
4724847253
},
@@ -47576,7 +47581,8 @@
4757647581
"running",
4757747582
"upcoming",
4757847583
"finished",
47579-
"archived"
47584+
"archived",
47585+
"disabled"
4758047586
],
4758147587
"type": "string"
4758247588
},
@@ -47787,7 +47793,8 @@
4778747793
"running",
4778847794
"upcoming",
4778947795
"finished",
47790-
"archived"
47796+
"archived",
47797+
"disabled"
4779147798
],
4779247799
"type": "string"
4779347800
},
@@ -47995,7 +48002,8 @@
4799548002
"running",
4799648003
"upcoming",
4799748004
"finished",
47998-
"archived"
48005+
"archived",
48006+
"disabled"
4799948007
],
4800048008
"type": "string"
4800148009
},

oas_docs/output/kibana.serverless.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48464,6 +48464,7 @@ paths:
4846448464
- upcoming
4846548465
- finished
4846648466
- archived
48467+
- disabled
4846748468
type: string
4846848469
title:
4846948470
description: The name of the maintenance window.
@@ -48521,7 +48522,7 @@ paths:
4852148522
required: false
4852248523
schema:
4852348524
type: string
48524-
- description: The status of the maintenance window. One of "running", "upcoming", "finished" or "archived".
48525+
- description: The status of the maintenance window. One of "running", "upcoming", "finished", "archived", or "disabled".
4852548526
in: query
4852648527
name: status
4852748528
required: false
@@ -48532,13 +48533,15 @@ paths:
4853248533
- finished
4853348534
- upcoming
4853448535
- archived
48536+
- disabled
4853548537
type: string
4853648538
- items:
4853748539
enum:
4853848540
- running
4853948541
- finished
4854048542
- upcoming
4854148543
- archived
48544+
- disabled
4854248545
type: string
4854348546
type: array
4854448547
- description: The page number to return.
@@ -48663,6 +48666,7 @@ paths:
4866348666
- upcoming
4866448667
- finished
4866548668
- archived
48669+
- disabled
4866648670
type: string
4866748671
title:
4866848672
description: The name of the maintenance window.
@@ -48865,6 +48869,7 @@ paths:
4886548869
- upcoming
4886648870
- finished
4886748871
- archived
48872+
- disabled
4886848873
type: string
4886948874
title:
4887048875
description: The name of the maintenance window.
@@ -49114,6 +49119,7 @@ paths:
4911449119
- upcoming
4911549120
- finished
4911649121
- archived
49122+
- disabled
4911749123
type: string
4911849124
title:
4911949125
description: The name of the maintenance window.
@@ -49275,6 +49281,7 @@ paths:
4927549281
- upcoming
4927649282
- finished
4927749283
- archived
49284+
- disabled
4927849285
type: string
4927949286
title:
4928049287
description: The name of the maintenance window.
@@ -49434,6 +49441,7 @@ paths:
4943449441
- upcoming
4943549442
- finished
4943649443
- archived
49444+
- disabled
4943749445
type: string
4943849446
title:
4943949447
description: The name of the maintenance window.

oas_docs/output/kibana.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51770,6 +51770,7 @@ paths:
5177051770
- upcoming
5177151771
- finished
5177251772
- archived
51773+
- disabled
5177351774
type: string
5177451775
title:
5177551776
description: The name of the maintenance window.
@@ -51827,7 +51828,7 @@ paths:
5182751828
required: false
5182851829
schema:
5182951830
type: string
51830-
- description: The status of the maintenance window. One of "running", "upcoming", "finished" or "archived".
51831+
- description: The status of the maintenance window. One of "running", "upcoming", "finished", "archived", or "disabled".
5183151832
in: query
5183251833
name: status
5183351834
required: false
@@ -51838,13 +51839,15 @@ paths:
5183851839
- finished
5183951840
- upcoming
5184051841
- archived
51842+
- disabled
5184151843
type: string
5184251844
- items:
5184351845
enum:
5184451846
- running
5184551847
- finished
5184651848
- upcoming
5184751849
- archived
51850+
- disabled
5184851851
type: string
5184951852
type: array
5185051853
- description: The page number to return.
@@ -51969,6 +51972,7 @@ paths:
5196951972
- upcoming
5197051973
- finished
5197151974
- archived
51975+
- disabled
5197251976
type: string
5197351977
title:
5197451978
description: The name of the maintenance window.
@@ -52171,6 +52175,7 @@ paths:
5217152175
- upcoming
5217252176
- finished
5217352177
- archived
52178+
- disabled
5217452179
type: string
5217552180
title:
5217652181
description: The name of the maintenance window.
@@ -52420,6 +52425,7 @@ paths:
5242052425
- upcoming
5242152426
- finished
5242252427
- archived
52428+
- disabled
5242352429
type: string
5242452430
title:
5242552431
description: The name of the maintenance window.
@@ -52581,6 +52587,7 @@ paths:
5258152587
- upcoming
5258252588
- finished
5258352589
- archived
52590+
- disabled
5258452591
type: string
5258552592
title:
5258652593
description: The name of the maintenance window.
@@ -52740,6 +52747,7 @@ paths:
5274052747
- upcoming
5274152748
- finished
5274252749
- archived
52750+
- disabled
5274352751
type: string
5274452752
title:
5274552753
description: The name of the maintenance window.

x-pack/platform/plugins/shared/alerting/common/maintenance_window.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export enum MaintenanceWindowStatus {
1313
Upcoming = 'upcoming',
1414
Finished = 'finished',
1515
Archived = 'archived',
16+
Disabled = 'disabled',
1617
}
1718
export interface MaintenanceWindowModificationMetadata {
1819
createdBy: string | null;

x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/external/apis/find/schemas/v1.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const findMaintenanceWindowsQuerySchema = schema.object(
3434
schema.oneOf([maintenanceWindowStatusSchema, schema.arrayOf(maintenanceWindowStatusSchema)], {
3535
meta: {
3636
description:
37-
'The status of the maintenance window. One of "running", "upcoming", "finished" or "archived".',
37+
'The status of the maintenance window. One of "running", "upcoming", "finished", "archived", or "disabled".',
3838
},
3939
})
4040
),

x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/external/response/constants/v1.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const maintenanceWindowStatus = {
1010
UPCOMING: 'upcoming',
1111
FINISHED: 'finished',
1212
ARCHIVED: 'archived',
13+
DISABLED: 'disabled',
1314
} as const;
1415

1516
export type MaintenanceWindowStatus =

x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/external/response/schemas/v1.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export const maintenanceWindowResponseSchema = schema.object({
5757
schema.literal(maintenanceWindowStatusV1.UPCOMING),
5858
schema.literal(maintenanceWindowStatusV1.FINISHED),
5959
schema.literal(maintenanceWindowStatusV1.ARCHIVED),
60+
schema.literal(maintenanceWindowStatusV1.DISABLED),
6061
],
6162
{
6263
meta: {

x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/internal/response/constants/v1.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const maintenanceWindowStatus = {
1010
UPCOMING: 'upcoming',
1111
FINISHED: 'finished',
1212
ARCHIVED: 'archived',
13+
DISABLED: 'disabled',
1314
} as const;
1415

1516
export type MaintenanceWindowStatus =

x-pack/platform/plugins/shared/alerting/common/routes/maintenance_window/internal/response/schemas/v1.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const maintenanceWindowResponseSchema = schema.object({
3535
schema.literal(maintenanceWindowStatusV1.UPCOMING),
3636
schema.literal(maintenanceWindowStatusV1.FINISHED),
3737
schema.literal(maintenanceWindowStatusV1.ARCHIVED),
38+
schema.literal(maintenanceWindowStatusV1.DISABLED),
3839
]),
3940
category_ids: maintenanceWindowCategoryIdsSchemaV1,
4041
scoped_query: schema.maybe(schema.nullable(alertsFilterQuerySchemaV1)),

0 commit comments

Comments
 (0)