Skip to content

Commit e445280

Browse files
authored
[User Experience App] Move UX public code out of apm (elastic#88645)
1 parent 8989ead commit e445280

File tree

138 files changed

+2925
-970
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+2925
-970
lines changed

.eslintrc.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -853,12 +853,13 @@ module.exports = {
853853
},
854854

855855
/**
856-
* APM and Observability overrides
856+
* APM, UX and Observability overrides
857857
*/
858858
{
859859
files: [
860860
'x-pack/plugins/apm/**/*.{js,mjs,ts,tsx}',
861861
'x-pack/plugins/observability/**/*.{js,mjs,ts,tsx}',
862+
'x-pack/plugins/ux/**/*.{js,mjs,ts,tsx}',
862863
],
863864
rules: {
864865
'no-console': ['warn', { allow: ['error'] }],

.github/CODEOWNERS

+3
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696

9797
# Observability Shared
9898
/x-pack/plugins/observability/ @elastic/observability-ui
99+
/x-pack/plugins/observability/public/components/shared/date_picker/ @elastic/uptime
99100

100101
# Unified Observability
101102
/x-pack/plugins/observability/public/components/shared/exploratory_view @elastic/unified-observability
@@ -136,6 +137,8 @@
136137

137138
# Uptime
138139
/x-pack/plugins/uptime @elastic/uptime
140+
/x-pack/plugins/ux @elastic/uptime
141+
/x-pack/plugins/observability/public/components/shared/exploratory_view @elastic/uptime
139142
/x-pack/test/functional_with_es_ssl/apps/uptime @elastic/uptime
140143
/x-pack/test/functional/apps/uptime @elastic/uptime
141144
/x-pack/test/functional/es_archives/uptime @elastic/uptime

docs/developer/plugin-list.asciidoc

+4
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,10 @@ in their infrastructure.
635635
|NOTE: This plugin contains implementation of URL drilldown. For drilldowns infrastructure code refer to ui_actions_enhanced plugin.
636636
637637
638+
|{kib-repo}blob/{branch}/x-pack/plugins/ux/readme.md[ux]
639+
|https://docs.elastic.dev/kibana-dev-docs/welcome
640+
641+
638642
|{kib-repo}blob/{branch}/x-pack/plugins/watcher/README.md[watcher]
639643
|This plugins adopts some conventions in addition to or in place of conventions in Kibana (at the time of the plugin's creation):
640644

packages/kbn-babel-preset/styled_components_files.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
USES_STYLED_COMPONENTS: [
1515
/packages[\/\\]kbn-ui-shared-deps-(npm|src)[\/\\]/,
1616
/src[\/\\]plugins[\/\\](data|kibana_react)[\/\\]/,
17-
/x-pack[\/\\]plugins[\/\\](apm|beats_management|cases|fleet|infra|lists|observability|osquery|security_solution|timelines|uptime)[\/\\]/,
17+
/x-pack[\/\\]plugins[\/\\](apm|beats_management|cases|fleet|infra|lists|observability|osquery|security_solution|timelines|uptime|ux)[\/\\]/,
1818
/x-pack[\/\\]test[\/\\]plugin_functional[\/\\]plugins[\/\\]resolver_test[\/\\]/,
1919
],
2020
};

packages/kbn-optimizer/limits.yml

+1
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,4 @@ pageLoadAssetSize:
121121
controls: 34788
122122
expressionPie: 26338
123123
sharedUX: 16225
124+
ux: 20784

x-pack/.i18nrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
"xpack.triggersActionsUI": "plugins/triggers_actions_ui",
6161
"xpack.upgradeAssistant": "plugins/upgrade_assistant",
6262
"xpack.uptime": ["plugins/uptime"],
63+
"xpack.ux": ["plugins/ux"],
6364
"xpack.urlDrilldown": "plugins/drilldowns/url_drilldown",
6465
"xpack.watcher": "plugins/watcher",
6566
"xpack.observability": "plugins/observability",

x-pack/plugins/apm/common/ux_ui_filter.ts

+6
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,9 @@ export const uxLocalUIFilters = uxLocalUIFilterNames.reduce((acc, key) => {
118118
},
119119
};
120120
}, {} as UxLocalUIFilterMap);
121+
122+
export type UxUIFilters = {
123+
environment?: string;
124+
} & {
125+
[key in UxLocalUIFilterName]?: string[];
126+
};

x-pack/plugins/apm/kibana.json

-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"cloud",
2525
"fleet",
2626
"home",
27-
"maps",
2827
"ml",
2928
"security",
3029
"spaces",
@@ -39,7 +38,6 @@
3938
"home",
4039
"kibanaReact",
4140
"kibanaUtils",
42-
"maps",
4341
"ml",
4442
"observability"
4543
]

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

-26
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,21 @@
77

88
import React from 'react';
99
import { act } from '@testing-library/react';
10-
import { EuiErrorBoundary } from '@elastic/eui';
11-
import { mount } from 'enzyme';
1210
import { createMemoryHistory } from 'history';
1311
import { Observable } from 'rxjs';
1412
import { AppMountParameters, DocLinksStart, HttpStart } from 'src/core/public';
1513
import { mockApmPluginContextValue } from '../context/apm_plugin/mock_apm_plugin_context';
1614
import { createCallApmApi } from '../services/rest/create_call_apm_api';
1715
import { renderApp as renderApmApp } from './';
18-
import { UXAppRoot } from './ux_app';
1916
import { disableConsoleWarning } from '../utils/test_helpers';
2017
import { dataPluginMock } from 'src/plugins/data/public/mocks';
2118
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
2219
import { ApmPluginSetupDeps, ApmPluginStartDeps } from '../plugin';
23-
import { RumHome } from '../components/app/rum_dashboard/rum_home';
2420

2521
jest.mock('../services/rest/data_view', () => ({
2622
createStaticDataView: () => Promise.resolve(undefined),
2723
}));
2824

29-
jest.mock('../components/app/rum_dashboard/rum_home', () => ({
30-
RumHome: () => <p>Home Mock</p>,
31-
}));
32-
3325
describe('renderApp (APM)', () => {
3426
let mockConsole: jest.SpyInstance;
3527
beforeAll(() => {
@@ -148,21 +140,3 @@ describe('renderApp (APM)', () => {
148140
}).not.toThrowError();
149141
});
150142
});
151-
152-
describe('renderUxApp', () => {
153-
it('has an error boundary for the UXAppRoot', async () => {
154-
const uxMountProps = mockApmPluginContextValue;
155-
156-
const wrapper = mount(<UXAppRoot {...(uxMountProps as any)} />);
157-
158-
wrapper
159-
.find(RumHome)
160-
.simulateError(new Error('Oh no, an unexpected error!'));
161-
162-
expect(wrapper.find(RumHome)).toHaveLength(0);
163-
expect(wrapper.find(EuiErrorBoundary)).toHaveLength(1);
164-
expect(wrapper.find(EuiErrorBoundary).text()).toMatch(
165-
/Error: Oh no, an unexpected error!/
166-
);
167-
});
168-
});

x-pack/plugins/apm/public/components/app/rum_dashboard/hooks/use_call_api.ts

-19
This file was deleted.

x-pack/plugins/apm/public/components/app/rum_dashboard/local_ui_filters/use_data_view.test.js

-44
This file was deleted.

x-pack/plugins/apm/public/components/app/rum_dashboard/translations.ts

-188
This file was deleted.

0 commit comments

Comments
 (0)