Commit graph

22 commits

Author SHA1 Message Date
Stratoula Kalafateli
422d0f9b82
[Lens] Improvements in readme (#163295)
## Summary

We got some feedback for our readme. Some parts were wrong or a bit
confusing. This PR is trying to improve it a bit.
2023-08-07 08:12:47 -07:00
Dzmitry Lemechko
483edea966
[lens] split x-pack/test/functional/apps/lens/group3/config.ts into smaller groups (#155860)
## Summary


Re-grouping lens functional tests into 6 groups since 2 groups often
cross the 35+ min runtime. Also, we have retry in place so pipeline
might have +40 minutes run if any of test fails.

<img width="1354" alt="image"
src="https://user-images.githubusercontent.com/10977896/234843379-aec47a81-22dc-4ecf-aee5-b1d489b3b31f.png">

x-pack/test/functional/apps/lens/group1/config.ts 18m 42s
x-pack/test/functional/apps/lens/group2/config.ts 19m 26s
x-pack/test/functional/apps/lens/group3/config.ts 18m 26s
x-pack/test/functional/apps/lens/group4/config.ts 18m 40s
x-pack/test/functional/apps/lens/group5/config.ts 17m 55s
x-pack/test/functional/apps/lens/group6/config.ts 19m 24s

---------

Co-authored-by: Jon <jon@budzenski.me>
2023-04-27 11:14:41 -07:00
Marco Liberati
16d8f404d8
[Lens] Introduce ability to prevent default behaviour from action callback (#152842)
## Summary

Fixes #149027

This PR adds the ability to provide an override to high level actions
like `filter` or `brushEnd`.

Note that the order of execution is now changed, nor that it was
guaranteed before, but due to the prevent default triggers behaviour,
the custom callback has to be executed as first step. Should we consider
it as breaking change? cc @stratoula

## How to use

```jsx
<LensEmbeddable
                        ...
                        onBrushEnd={({ range, preventDefault }) => {
                          setTime({
                            from: new Date(range[0]).toISOString(),
                            to: new Date(range[1]).toISOString(),
                          });

                          preventDefault(); // stop from bubbling
                        }}
                        onFilter={(_data) => {
                          // call back event for on filter event
                          ...
                          _data.preventDefault(); // stop from bubbling
                        }}
                        onTableRowClick={(_data) => {
                          // call back event for on table row click event
                           ...
                          _data.preventDefault(); // stop from bubbling
                        }}
                        ... />
```


### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
2023-04-05 12:45:14 +02:00
Marco Liberati
bd48d13e17
[Lens] Embeddable overrides feature (#153204)
## Summary

Fixes #149220
Fixes https://github.com/elastic/kibana/issues/148845


This PR introduces the concept of `Embeddable` overrides within the Lens
Embeddable: overrides are a small subset of configuration options that
can overwrite Lens original Elastic Chart rendering configuration.
This feature will only apply at the Embeddable level and is ignored
within the Lens editor context.
The readme has been updated with some documentation on the topic.

### Playground changes

This PR also contains a refactor/enhancement of the playground example
app to showcase the `attributes` and `overrides` for most Lens charts.
The UI has been redesigned with 3 main dropdowns with some explanation
of the different switch controls:

<img width="730" alt="Screenshot 2023-03-16 at 16 01 22"
src="https://user-images.githubusercontent.com/924948/225660824-f40446d7-923b-4b0c-af5a-aacf1c3b3b33.png">
<img width="661" alt="Screenshot 2023-03-16 at 16 01 28"
src="https://user-images.githubusercontent.com/924948/225660841-82ae8428-d003-4379-beea-5eac70662955.png">
<img width="658" alt="Screenshot 2023-03-16 at 16 01 33"
src="https://user-images.githubusercontent.com/924948/225660930-87fce81b-55b2-46fd-bc8b-f4767abc2848.png">

For each override setting an example code snippet is shown on hover:
<img width="387" alt="Screenshot 2023-03-20 at 11 16 52"
src="https://user-images.githubusercontent.com/924948/226362615-46920754-e519-4584-adfd-b7b9c2b5bde6.png">
<img width="388" alt="Screenshot 2023-03-20 at 11 17 00"
src="https://user-images.githubusercontent.com/924948/226362620-8e77cf38-9f2f-48d5-a5eb-f65ad089bc40.png">


The second menu badge shows when overrides are enabled:
<img width="659" alt="Screenshot 2023-03-16 at 16 01 44"
src="https://user-images.githubusercontent.com/924948/225661114-2aaf0c46-2320-41dc-aad1-8e4a26da0635.png">

Different chart types have different options available:
<img width="724" alt="Screenshot 2023-03-16 at 16 04 58"
src="https://user-images.githubusercontent.com/924948/225661241-61899a19-64d3-4326-9645-f908c9b35b65.png">
<img width="653" alt="Screenshot 2023-03-16 at 16 07 42"
src="https://user-images.githubusercontent.com/924948/225661248-3f6e489e-6a0e-4ac6-a0b9-994ed1572750.png">
<img width="635" alt="Screenshot 2023-03-20 at 14 58 00"
src="https://user-images.githubusercontent.com/924948/226362432-76cd8d7d-06de-4a55-a809-9e64e243cd8a.png">


The datatable and metric visualization have no overrides for now.

### Difference with #152842

The two feature work in a similar space, but they are substantially
different from their use cases.

The `overrides` feature is something to use in 2 scenarios:
* small styling/tuning configuration of the final chart via
Lens-unsupported Elastic Chart props
* For instance having `integersOnly` ticks on a XY axis, or value labels
outside only for a pie chart
* Selectively turning off specific event handlers on the component
* For instance to completely remove any complex logic from a legend item
(i.e. filter popup)

The `preventDefault` feature is useful instead when the user wants to
keep all the handlers at chart level, but selectively disabled some
Kibana-wide event from bubble. For instance clicking on a bar or pie
slice should trigger the `edit` event but the consumer's custom handler
should be the only one to be executed, without bubbling up to the
`unifiedSearch` registered triggers.

### Checklist

Delete any items that are not applicable to this PR.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [ ] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [ ] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)


### Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to
identify risks that should be tested prior to the change/feature
release.

When forming the risk matrix, consider some of the following examples
and how they may potentially impact the change:

| Risk | Probability | Severity | Mitigation/Notes |

|---------------------------|-------------|----------|-------------------------|
| Multiple Spaces&mdash;unexpected behavior in non-default Kibana Space.
| Low | High | Integration tests will verify that all features are still
supported in non-default Kibana Space and when user switches between
spaces. |
| Multiple nodes&mdash;Elasticsearch polling might have race conditions
when multiple Kibana nodes are polling for the same tasks. | High | Low
| Tasks are idempotent, so executing them multiple times will not result
in logical error, but will degrade performance. To test for this case we
add plenty of unit tests around this logic and document manual testing
procedure. |
| Code should gracefully handle cases when feature X or plugin Y are
disabled. | Medium | High | Unit tests will verify that any feature flag
or plugin combination still results in our service operational. |
| [See more potential risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx) |


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <stratoula1@gmail.com>
Co-authored-by: Drew Tate <drewctate@gmail.com>
2023-04-04 12:22:49 +02:00
Joe Reuter
15c12bdd39
Rename all vis-editors and datavis to visualizations (#144589)
* rename all the vis-editors

* rename datavis to visualizations
2022-11-05 19:16:20 -04:00
Joe Reuter
e799ee8f74
add section about re-render performance (#144535) 2022-11-03 17:32:18 +01:00
Stratoula Kalafateli
8c4976f25d
[Lens] Rename datasources (#142553)
* Rename to textBased instead of textBasedLanguages

* [Lens] Rename datasources to textBased and formBased

* Fix css

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* Move datasources under a common foler

* Fix types

* Revert css classes

* Add migration script

* Fix lens embeddable functional tests

* Fix types

* Fixes cases test

* Adds migration script test

* Revert

* Update jest integration test

* Fix security solution tests

* Fix jest test

* Address type nit

* Fix types

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2022-10-12 11:25:24 +03:00
Joe Reuter
b0e6a41220
[Lens] Performance journey (#140195)
* add Lens performance journey

* cleanup

* always wait

* Update utils.ts

* gzip mappings

Co-authored-by: Liza Katz <liza.katz@elastic.co>
2022-09-14 16:15:53 +02:00
Joe Reuter
4f77418af4
add note (#140385) 2022-09-09 16:11:43 +02:00
Joe Reuter
0e9845f13e
add ad-hoc data view section to readme (#140170) 2022-09-07 19:43:32 +02:00
Joe Reuter
c04eac8f54
[Lens] Expose adapters in onLoad callback (#139647)
* expose adapters in onLoad callback

* fix test
2022-08-31 10:24:11 +02:00
Joe Reuter
e9dd7efa8e
[Lens] Add section for how to handle refresh using search sessions (#138396)
* update readme

* use refresh in example
2022-08-12 20:57:06 +02:00
Joe Reuter
fd50544641
[Lens] Extend readme (#135695)
* extend readme

* [CI] Auto-commit changed files from 'node scripts/build_plugin_list_docs'

* Update x-pack/plugins/lens/readme.md

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>

* Update x-pack/plugins/lens/readme.md

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>

* Update x-pack/plugins/lens/readme.md

Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Marco Liberati <dej611@users.noreply.github.com>
2022-07-06 03:06:33 -07:00
Spencer
542b381fa5
[ftr] automatically determine config run order (#130983)
* [ftr] automatically determine config run order

* split lens config into two groups

* support ftr configs always running against CI

* Split detection_engine_api_integration rule exception list tests

* Add configs from previous commit

* [ftr] remove testMetadata and maintain a unique lifecycle instance per run

* Revert "[ftr] remove testMetadata and maintain a unique lifecycle instance per run"

This reverts commit d2b4fdb824.

* Split alerting_api_integration/security_and_spaces tests

* Add groups to yaml

* Revert "Revert "[ftr] remove testMetadata and maintain a unique lifecycle instance per run""

This reverts commit 56232eea68.

* stop ES more forcefully and fix timeout

* only cleanup lifecycle phases when the cleanup is totally complete

* only use kill when cleaning up an esTestInstance

* fix broken import

* fix runOptions.alwaysUseSource implementation

* fix config access

* fix x-pack/ccs config

* fix ml import file paths

* update kibana build id

* revert array.concat() change

* fix baseConfig usage

* fix pie chart data

* split up maps tests

* pull in all of group5 so that es archives are loaded correctly

* add to ftr configs.yml

* fix pie chart data without breaking legacy version

* fix more pie_chart stuff in new vis lib

* restore normal PR tasks

* bump kibana-buildkite-library

* remove ciGroup validation

* remove the script which is no longer called from checks.sh

* [CI] Auto-commit changed files from 'yarn kbn run build -i @kbn/pm'

* adapt flaky test runner scripts to handle ftrConfig paths

* fix types in alerting_api_integration

* improve flaky config parsing and use non-local var name for passing explicit configs to ftr_configs.sh

* Split xpack dashboard tests

* Add configs

* [flaky] remove key from ftr-config steps

* [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix'

* restore cypress builds

* remove ciGroups from FTR config files

* fixup some docs

* add temporary script to hunt for FTR config files

* use config.base.js naming for clarity

* use script to power ftr_configs.yml

* remove usage of removed x-pack/scripts/functional_tests

* fix test names in dashboard snapshots

* bump kibana-buildkite-library

* Try retrying only failed configs

* be a little quieter about trying to get testStats from configs with testRunners defined

* Remove test code

* bump kibana-buildkite-library

* update es_snapshot and on_merge jobs too

* track duration and exit code for each config and print it at the end of the script

* store results in order, rather than by key, in case there are duplicates in $config

* bash is hard

* fix env source and use +e rather than disabling e for whole file

* bash sucks

* print config summary in jest jobs too

* define results in jest_parallel.sh

* simplify config summary print, format times a little better

* fix reference to unbound time variable, use better variable name

* skip the newline between each result

* finish with the nitpicking

* sync changes with ftr_configs.sh

* refuse to execute config files which aren't listed in the .buildkite/ftr_configs.yml

* fix config.edge.js base config import paths

* fix some readmes

* resolve paths from ftr_configs manifest

* fix readConfigFile tests

* just allow __fixtures__ configs

* list a few more cypress config files

* install the main branch of kibana-buildkite-library

* split up lens group1

* move ml data_visualizer tests to their own config

* fix import paths

* fix more imports

* install specific commit of buildkite-pipeline-library

* sort configs in ftr_configs.yml

* bump kibana-buildkite-library

* remove temporary script

* fix env var for limiting config types

* Update docs/developer/contributing/development-functional-tests.asciidoc

Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>

* produce a JUnit report for saved objects field count

* apply standard concurrency limits from flaky test runner

* support customizing FTR concurrency via the env

Co-authored-by: Brian Seeders <brian.seeders@elastic.co>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Christiane (Tina) Heiligers <christiane.heiligers@elastic.co>
2022-05-04 17:05:58 -05:00
Joe Reuter
1185a33470
[Lens] Do not refresh session on "now" drift on incoming data (#124389) 2022-02-03 16:00:42 +00:00
Marta Bondyra
cae5bdca04
[Lens] Added logger info and restructuring some mounter tests (#111953)
* [Lens] added logger info and restructuring some mounter tests

* snapshot updated
2021-09-13 23:09:43 +02:00
Joe Reuter
f4ebdf3a79
[Lens] Export nested types (#89868) 2021-02-03 12:03:55 +01:00
Tyler Smalley
504c8739de
test:jest improvements to better support our monorepo (#84848)
Signed-off-by: Tyler Smalley <tyler.smalley@elastic.co>
2020-12-14 14:07:50 -08:00
Caroline Horn
5a2f7ae897
[Lens] Move configuration popover to flyout (#76046)
* Moving to a Flyout implementation
* Fix up inner layout of flyout
* Fix up form rows
2020-09-14 18:23:13 -04:00
Joe Reuter
9186171ad1
[Lens] Document UI terminology (#72423) 2020-08-06 14:02:37 +02:00
Aleh Zasypkin
c6e2fed1c6
Register privileges in Kibana Platform Security plugin and remove legacy getUser API. (#65472) 2020-06-05 08:11:58 +02:00
Tim Roes
ebbc062689
Move Lens frontend to Kibana Platform (#62965)
* Move Lens frontend to Kibana platform

* Fix line breaks

* Fix jest tests

* Fix remaining test

* Remove old Lens plugin entry

* Fix i18n prefix

* Add config schema

* Address review
2020-04-15 12:22:37 +02:00
Renamed from x-pack/legacy/plugins/lens/readme.md (Browse further)