Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[User Experience App] Move UX public code out of apm #88645

Merged
merged 15 commits into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -853,12 +853,13 @@ module.exports = {
},

/**
* APM and Observability overrides
* APM, UX and Observability overrides
*/
{
files: [
'x-pack/plugins/apm/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/ux/**/*.{js,mjs,ts,tsx}',
],
rules: {
'no-console': ['warn', { allow: ['error'] }],
Expand Down
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@

# Observability Shared
/x-pack/plugins/observability/ @elastic/observability-ui
/x-pack/plugins/observability/public/components/shared/date_picker/ @elastic/uptime

# Unified Observability
/x-pack/plugins/observability/public/components/shared/exploratory_view @elastic/unified-observability
Expand Down Expand Up @@ -136,6 +137,8 @@

# Uptime
/x-pack/plugins/uptime @elastic/uptime
/x-pack/plugins/ux @elastic/uptime
/x-pack/plugins/observability/public/components/shared/exploratory_view @elastic/uptime
/x-pack/test/functional_with_es_ssl/apps/uptime @elastic/uptime
/x-pack/test/functional/apps/uptime @elastic/uptime
/x-pack/test/functional/es_archives/uptime @elastic/uptime
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,10 @@ in their infrastructure.
|NOTE: This plugin contains implementation of URL drilldown. For drilldowns infrastructure code refer to ui_actions_enhanced plugin.


|{kib-repo}blob/{branch}/x-pack/plugins/ux/readme.md[ux]
|https://docs.elastic.dev/kibana-dev-docs/welcome


|{kib-repo}blob/{branch}/x-pack/plugins/watcher/README.md[watcher]
|This plugins adopts some conventions in addition to or in place of conventions in Kibana (at the time of the plugin's creation):

Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-babel-preset/styled_components_files.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
USES_STYLED_COMPONENTS: [
/packages[\/\\]kbn-ui-shared-deps-(npm|src)[\/\\]/,
/src[\/\\]plugins[\/\\](data|kibana_react)[\/\\]/,
/x-pack[\/\\]plugins[\/\\](apm|beats_management|cases|fleet|infra|lists|observability|osquery|security_solution|timelines|uptime)[\/\\]/,
/x-pack[\/\\]plugins[\/\\](apm|beats_management|cases|fleet|infra|lists|observability|osquery|security_solution|timelines|uptime|ux)[\/\\]/,
/x-pack[\/\\]test[\/\\]plugin_functional[\/\\]plugins[\/\\]resolver_test[\/\\]/,
],
};
1 change: 1 addition & 0 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,4 @@ pageLoadAssetSize:
controls: 34788
expressionPie: 26338
sharedUX: 16225
ux: 20784
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mind updating the one for APM?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm shouldn't this happen auto? i ran the script

1 change: 1 addition & 0 deletions x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"xpack.triggersActionsUI": "plugins/triggers_actions_ui",
"xpack.upgradeAssistant": "plugins/upgrade_assistant",
"xpack.uptime": ["plugins/uptime"],
"xpack.ux": ["plugins/ux"],
"xpack.urlDrilldown": "plugins/drilldowns/url_drilldown",
"xpack.watcher": "plugins/watcher",
"xpack.observability": "plugins/observability",
Expand Down
6 changes: 6 additions & 0 deletions x-pack/plugins/apm/common/ux_ui_filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,9 @@ export const uxLocalUIFilters = uxLocalUIFilterNames.reduce((acc, key) => {
},
};
}, {} as UxLocalUIFilterMap);

export type UxUIFilters = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any chance we can move this entire file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this one is tricky, it's being used in APM server. And UX plugin is using some stuff from APM. So for now relationship is one directional. UX app is dependant on APM. I kept it here for now , to not introduce circular dependency.

Once routes are removed from APM, this will be gone auto.

environment?: string;
} & {
[key in UxLocalUIFilterName]?: string[];
};
2 changes: 0 additions & 2 deletions x-pack/plugins/apm/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"cloud",
"fleet",
"home",
"maps",
"ml",
"security",
"spaces",
Expand All @@ -39,7 +38,6 @@
"home",
"kibanaReact",
"kibanaUtils",
"maps",
"ml",
"observability"
]
Expand Down
26 changes: 0 additions & 26 deletions x-pack/plugins/apm/public/application/application.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,21 @@

import React from 'react';
import { act } from '@testing-library/react';
import { EuiErrorBoundary } from '@elastic/eui';
import { mount } from 'enzyme';
import { createMemoryHistory } from 'history';
import { Observable } from 'rxjs';
import { AppMountParameters, DocLinksStart, HttpStart } from 'src/core/public';
import { mockApmPluginContextValue } from '../context/apm_plugin/mock_apm_plugin_context';
import { createCallApmApi } from '../services/rest/create_call_apm_api';
import { renderApp as renderApmApp } from './';
import { UXAppRoot } from './ux_app';
import { disableConsoleWarning } from '../utils/test_helpers';
import { dataPluginMock } from 'src/plugins/data/public/mocks';
import { embeddablePluginMock } from 'src/plugins/embeddable/public/mocks';
import { ApmPluginSetupDeps, ApmPluginStartDeps } from '../plugin';
import { RumHome } from '../components/app/rum_dashboard/rum_home';

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

jest.mock('../components/app/rum_dashboard/rum_home', () => ({
RumHome: () => <p>Home Mock</p>,
}));

describe('renderApp (APM)', () => {
let mockConsole: jest.SpyInstance;
beforeAll(() => {
Expand Down Expand Up @@ -148,21 +140,3 @@ describe('renderApp (APM)', () => {
}).not.toThrowError();
});
});

describe('renderUxApp', () => {
it('has an error boundary for the UXAppRoot', async () => {
const uxMountProps = mockApmPluginContextValue;

const wrapper = mount(<UXAppRoot {...(uxMountProps as any)} />);

wrapper
.find(RumHome)
.simulateError(new Error('Oh no, an unexpected error!'));

expect(wrapper.find(RumHome)).toHaveLength(0);
expect(wrapper.find(EuiErrorBoundary)).toHaveLength(1);
expect(wrapper.find(EuiErrorBoundary).text()).toMatch(
/Error: Oh no, an unexpected error!/
);
});
});

This file was deleted.

This file was deleted.

188 changes: 0 additions & 188 deletions x-pack/plugins/apm/public/components/app/rum_dashboard/translations.ts

This file was deleted.

Loading