kibana/x-pack/plugins/ux
Patryk Kopyciński a1d02824f1
[shared-ux-router] Add Router and Routes components (#159834)
## Summary

Why?

To simplify the process of migration to react-router@6.
https://github.com/remix-run/react-router/discussions/8753

What problems exactly it solves?

- In my previous PR I added `CompatRouter`
https://github.com/elastic/kibana/pull/159173, which caused changes in
~50 files and pinged 15 Teams. And this is just meant to be a temporary
change, so when we're done with the migration I would have to revert
these changes and engage everyone to review the PR again. And it is just
a single step in the migration strategy. So to make our lives easier I
think it would be better to have a common place where we do import our
router components because it will allow us to surface some extra logic
in single place instead of going through the whole source code again.

- `react-router@6` doesn't support a custom `Route` component, so that
means our custom `Route` component that we're using almost everywhere
today, will need to be replaced by a different solution. I have decided
to add `Routes` component, which will be responsible for rendering the
proper component (`react-router@6` renamed `Switch` to `Routes`, so I
have named this component to align with the dictionary of the new
router) and also is going to add the logic that today is done in `Route`
(moving logic to `Routes` will be done in the follow-up PR, here I just
wanted to focus on using the common router components to make the review
process easier)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2023-06-23 10:02:06 -05:00
..
.buildkite/pipelines Enable synthetics flaky runner (#137289) 2022-07-28 16:33:08 +02:00
.storybook
common [UX Dashboard] Unify processor event (#135367) 2022-08-02 15:22:19 -04:00
e2e [Synthetics/Uptime] Separate e2e tests by app (#152197) 2023-06-07 17:33:56 +02:00
public [shared-ux-router] Add Router and Routes components (#159834) 2023-06-23 10:02:06 -05:00
scripts [packages] migrate all plugins to packages (#148130) 2023-02-08 21:06:50 -06:00
typings [Synthetics] Migrate service list query out of APM (#132548) 2022-05-23 17:04:55 -07:00
.prettierrc
CONTRIBUTING.md
jest.config.js
kibana.jsonc [Synthetics][Ux][Uptime] Use Observability Page Template from Observability Shared (#154774) 2023-04-18 15:00:15 -07:00
readme.md Add a simple set of instructions on running and developing e2e tests for UX dashboard. (#134371) 2022-06-14 10:29:48 -07:00
tsconfig.json [shared-ux-router] Add Router and Routes components (#159834) 2023-06-23 10:02:06 -05:00

Documentation for UX UI developers

https://docs.elastic.dev/kibana-dev-docs/welcome

Running E2E Tests

The tests are managed via the scripts/e2e.js file. This script accepts numerous options.

From the kibana root you can run node x-pack/plugins/ux/scripts/e2e.js to simply stand up the stack, load data, and run the tests.

If you are developing a new test, it is better to stand up the stack in one shell and load data/run tests in a second session. You can do this by running:

  • node ./x-pack/plugins/ux/scripts/e2e.js --server
  • node ./x-pack/plugins/ux/scripts/e2e.js --runner, you can also specify --grep "{TEST_NAME}" to run a specific series of tests