Skip to content

Commit 7fc4a1f

Browse files
authored
Add kibana.yml configuration for cases (#100583)
Make it so `xpack.observability.unsafe.alertingExperience.enabled` only shows and hides the Alerts page, and `xpack.observability.unsafe.cases.enabled` show and hides the Cases page.
1 parent 806566c commit 7fc4a1f

11 files changed

Lines changed: 23 additions & 11 deletions

File tree

src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ kibana_vars=(
231231
xpack.maps.showMapVisualizationTypes
232232
xpack.ml.enabled
233233
xpack.observability.unsafe.alertingExperience.enabled
234+
xpack.observability.unsafe.cases.enabled
234235
xpack.reporting.capture.browser.autoDownload
235236
xpack.reporting.capture.browser.chromium.disableSandbox
236237
xpack.reporting.capture.browser.chromium.inspect

x-pack/plugins/observability/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,21 @@ case management.
99

1010
If you have:
1111

12+
```yaml
13+
xpack.observability.unsafe.cases.enabled: true
14+
```
15+
16+
In your Kibana configuration, the Cases page will be available.
17+
18+
If you have:
19+
1220
```yaml
1321
xpack.observability.unsafe.alertingExperience.enabled: true
1422
```
1523
16-
In your Kibana configuration, the Alerts and Cases pages will be available.
24+
In your Kibana configuration, the Alerts page will be available.
1725
18-
This will only enable the UI for these pages. In order to have alert data indexed
26+
This will only enable the UI for this page when. In order to have alert data indexed
1927
you'll need to enable writing in the [Rule Registry plugin](../rule_registry/README.md):
2028
2129
```yaml

x-pack/plugins/observability/public/application/application.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('renderApp', () => {
4545
uiSettings: { get: () => false },
4646
http: { basePath: { prepend: (path: string) => path } },
4747
} as unknown) as CoreStart;
48-
const config = { unsafe: { alertingExperience: { enabled: true } } };
48+
const config = { unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } } };
4949
const params = ({
5050
element: window.document.createElement('div'),
5151
history: createMemoryHistory(),

x-pack/plugins/observability/public/components/app/section/apm/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('APMSection', () => {
4141
http: { basePath: { prepend: jest.fn() } },
4242
} as unknown) as CoreStart,
4343
appMountParameters: {} as AppMountParameters,
44-
config: { unsafe: { alertingExperience: { enabled: true } } },
44+
config: { unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } } },
4545
observabilityRuleTypeRegistry: createObservabilityRuleTypeRegistryMock(),
4646
plugins: ({
4747
data: {

x-pack/plugins/observability/public/components/app/section/ux/index.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe('UXSection', () => {
4040
http: { basePath: { prepend: jest.fn() } },
4141
} as unknown) as CoreStart,
4242
appMountParameters: {} as AppMountParameters,
43-
config: { unsafe: { alertingExperience: { enabled: true } } },
43+
config: { unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } } },
4444
plugins: ({
4545
data: {
4646
query: {

x-pack/plugins/observability/public/hooks/use_time_range.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe('useTimeRange', () => {
2424
jest.spyOn(pluginContext, 'usePluginContext').mockImplementation(() => ({
2525
core: {} as CoreStart,
2626
appMountParameters: {} as AppMountParameters,
27-
config: { unsafe: { alertingExperience: { enabled: true } } },
27+
config: { unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } } },
2828
plugins: ({
2929
data: {
3030
query: {
@@ -66,7 +66,7 @@ describe('useTimeRange', () => {
6666
jest.spyOn(pluginContext, 'usePluginContext').mockImplementation(() => ({
6767
core: {} as CoreStart,
6868
appMountParameters: {} as AppMountParameters,
69-
config: { unsafe: { alertingExperience: { enabled: true } } },
69+
config: { unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } } },
7070
plugins: ({
7171
data: {
7272
query: {

x-pack/plugins/observability/public/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export type {
2222
export { enableInspectEsQueries } from '../common/ui_settings_keys';
2323

2424
export interface ConfigSchema {
25-
unsafe: { alertingExperience: { enabled: boolean } };
25+
unsafe: { alertingExperience: { enabled: boolean }; cases: { enabled: boolean } };
2626
}
2727

2828
export const plugin: PluginInitializer<

x-pack/plugins/observability/public/pages/overview/overview.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const withCore = makeDecorator({
4545
appMountParameters: ({
4646
setHeaderActionMenu: () => {},
4747
} as unknown) as AppMountParameters,
48-
config: { unsafe: { alertingExperience: { enabled: true } } },
48+
config: { unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } } },
4949
core: options as CoreStart,
5050
plugins: ({
5151
data: {

x-pack/plugins/observability/public/plugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ export class Plugin
119119
mount,
120120
updater$,
121121
});
122+
}
122123

124+
if (config.unsafe.cases.enabled) {
123125
coreSetup.application.register({
124126
id: 'observability-cases',
125127
title: 'Cases',

x-pack/plugins/observability/public/utils/test_helper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const core = ({
3131
},
3232
} as unknown) as CoreStart;
3333

34-
const config = { unsafe: { alertingExperience: { enabled: true } } };
34+
const config = { unsafe: { alertingExperience: { enabled: true }, cases: { enabled: true } } };
3535

3636
const plugins = ({
3737
data: { query: { timefilter: { timefilter: { setTime: jest.fn() } } } },

0 commit comments

Comments
 (0)