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

[Lens] Embeddable react refactor #186642

Merged
merged 321 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 231 commits
Commits
Show all changes
321 commits
Select commit Hold shift + click to select a range
542b751
:bug: Fix merging issues
dej611 Sep 25, 2024
6a68e2d
:bug: Publish dataViews correctly
dej611 Sep 25, 2024
4649991
fix filters pills
mbondyra Sep 25, 2024
81591fb
:white_check_mark: use the new types
dej611 Sep 25, 2024
c34d4c2
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Sep 25, 2024
1bcaa20
:rotating_light: Fix file casing
dej611 Sep 25, 2024
e49d957
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Sep 25, 2024
15ebfb4
restore resizeability for the inline editor flyout
mbondyra Sep 25, 2024
e8ae231
:bug: fix viewMode bug
dej611 Sep 25, 2024
b27c92d
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Sep 25, 2024
5b1f902
:bug: Fix title bug
dej611 Sep 25, 2024
8e72a8b
:label: Fix more types and unit tests
dej611 Sep 25, 2024
8ff30ef
:label: More type fixes
dej611 Sep 25, 2024
3e35668
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Sep 25, 2024
3a29e3d
Update in_app_embeddable_edit_action_helpers.tsx
mbondyra Sep 26, 2024
3f82a8d
Fix filters/brushing etc
mbondyra Sep 27, 2024
7d4b0f0
:bug: Fix onEditAction
dej611 Sep 27, 2024
cdc027f
:white_check_mark: Improve mocks
dej611 Sep 27, 2024
67757a8
:white_check_mark: Add unit test for event handlers
dej611 Sep 27, 2024
654a3b1
:bug: Remove abort call
dej611 Sep 27, 2024
9f284f2
:camera_flash: Update snapshot tests
dej611 Sep 30, 2024
e174bfa
:bug: Fix bug
dej611 Sep 30, 2024
daace28
:bug: Fix discover issues
dej611 Oct 1, 2024
b2e0e60
Merge remote-tracking branch 'upstream/main' into feat/react-embeddable
dej611 Oct 1, 2024
054a1e4
:bug: Fix inline editing issue
dej611 Oct 2, 2024
fa27a42
Merge branch 'main' into feat/react-embeddable
dej611 Oct 2, 2024
d9c13f4
:bug: Fix panel removal on cancel bug
dej611 Oct 2, 2024
740ff3a
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Oct 2, 2024
1c5a8d5
:recycle: Heavy internal refactor
dej611 Oct 3, 2024
393adf2
Merge branch 'main' into feat/react-embeddable
dej611 Oct 3, 2024
d23dec7
:label: Fixed types
dej611 Oct 3, 2024
77a8e29
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Oct 3, 2024
5c8babb
Update src/plugins/unified_histogram/public/chart/chart.tsx
dej611 Oct 7, 2024
ae3a6bb
:bug: Fix test
dej611 Oct 7, 2024
ae6532d
:white_check_mark: Fix test
dej611 Oct 7, 2024
8d8a204
:recycle: Use the new api for filters
dej611 Oct 7, 2024
a5a02cf
Merge remote-tracking branch 'upstream/main' into feat/react-embeddable
dej611 Oct 7, 2024
1b986bd
fix https://github.com/elastic/kibana/issues/192470
mbondyra Oct 7, 2024
9bbcbc0
:bug: Fix explore in discover
dej611 Oct 7, 2024
8b8d4df
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Oct 7, 2024
87bf399
Update mocks.tsx
mbondyra Oct 8, 2024
20d4da6
:bug: Fix inline editing issue
dej611 Oct 9, 2024
5bf0d0b
:zap: Make test faster
dej611 Oct 9, 2024
16c1460
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Oct 9, 2024
381b50a
Merge remote-tracking branch 'upstream/main' into feat/react-embeddable
dej611 Oct 9, 2024
08462d7
:bug: Fix latest merge issues
dej611 Oct 9, 2024
ea89ca9
:label: Fix type issues after merge
dej611 Oct 9, 2024
e09f66c
Update app.test.tsx
mbondyra Oct 10, 2024
d142bca
remove unnecessary duplication
mbondyra Oct 10, 2024
41c4b7d
fix moving between edit/view mode
mbondyra Oct 10, 2024
e5529e0
Merge branch 'feat/react-embeddable' of github.com:dej611/kibana into…
mbondyra Oct 10, 2024
e0bd89b
:bug: Revisit user messages logic
dej611 Oct 10, 2024
9281c8b
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Oct 10, 2024
c0f047c
:bug: Fix cancel removal issue
dej611 Oct 10, 2024
8c7b2de
:label: fix lens api type issues
dej611 Oct 10, 2024
ad11067
:pencil2: Add some doc
dej611 Oct 11, 2024
83ee184
:bug: Fix refetching bug
dej611 Oct 11, 2024
ee63ebd
Merge branch 'main' into feat/react-embeddable
dej611 Oct 11, 2024
f35c2e8
:bug: fix saving flow bug
dej611 Oct 11, 2024
2a6e744
:white_check_mark: Add tests for regression
dej611 Oct 11, 2024
b7936fb
:label: resolve len api mock type once for all
dej611 Oct 11, 2024
86c6e99
:white_check_mark: Fix edit flow
dej611 Oct 11, 2024
9fcb65e
:recycle: small refactor
dej611 Oct 11, 2024
86b0ed4
:white_check_mark: Fix edit flows
dej611 Oct 11, 2024
c627d97
:bug: fix rendering bug
dej611 Oct 11, 2024
d408c52
:bug: Fix Canvas issue
dej611 Oct 11, 2024
d927f0f
:white_check_mark: Fix more tests
dej611 Oct 11, 2024
7e4465e
Merge branch 'main' into feat/react-embeddable
dej611 Oct 11, 2024
9e7cb04
Merge remote-tracking branch 'upstream/main' into feat/react-embeddable
dej611 Oct 14, 2024
1b540ab
:bug: Resolve so id issue on save
dej611 Oct 14, 2024
e4a6a0f
:white_check_mark: Make tests stricter on so id check
dej611 Oct 14, 2024
2333cce
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Oct 14, 2024
0044ff4
:recycle: Fix save modal input prop format
dej611 Oct 14, 2024
91f000e
:fire: Remove unnecessary page method
dej611 Oct 14, 2024
ab10de9
:bug: Forward uuid correctly
dej611 Oct 15, 2024
f32dd32
:bug: Make description resettable
dej611 Oct 15, 2024
a0a7e57
Merge remote-tracking branch 'upstream/main' into feat/react-embeddable
dej611 Oct 15, 2024
b3a04e0
:bug: Fix blocking error rendering
dej611 Oct 15, 2024
2858bea
:bug: fix warnings bug
dej611 Oct 15, 2024
0406df7
:white_check_mark: Fix test suite
dej611 Oct 17, 2024
2c56102
:bug: Fix the error recovering bug
dej611 Oct 17, 2024
f7f2db6
:bug: Fix user messages bug
dej611 Oct 17, 2024
2cd7164
:bug: Fix missing forwarded id
dej611 Oct 17, 2024
1f81099
:recycle: unify empty state logic
dej611 Oct 17, 2024
49c3da3
:white_check_mark: Use the shared mock
dej611 Oct 17, 2024
9005870
:bug: Fix regression introduced with recent fix
dej611 Oct 17, 2024
eecab21
Merge branch 'main' into feat/react-embeddable
dej611 Oct 17, 2024
8b1bb37
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Oct 17, 2024
adc41be
:bug: Fix panel settings reset logic
dej611 Oct 18, 2024
67b8bea
:recycle: Revert changes
dej611 Oct 18, 2024
db1abef
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Oct 18, 2024
09ea73e
:bug: Revert title logic
dej611 Oct 18, 2024
80cc2e9
:bug: Fix unsaved changes bug
dej611 Oct 18, 2024
c8194bc
:recycle: Break things into smaller modules
dej611 Oct 18, 2024
3cf9dd7
:fire: Removed unused import
dej611 Oct 18, 2024
c8e45a1
:bug: Integrate viewMode into API
dej611 Oct 21, 2024
2a7089c
:recycle: Add test id
dej611 Oct 21, 2024
3db0cec
:sparkles: Update mocks
dej611 Oct 21, 2024
38d2110
:bug: Fix rerender on blocking errors
dej611 Oct 21, 2024
93a8ca1
:bug: Try again to force a rerender on expression rendering blocking …
dej611 Oct 21, 2024
1ce6773
:loud_sound: Add more debug log
dej611 Oct 21, 2024
8601b91
:bug: Fix issue with blocking error
dej611 Oct 21, 2024
3fb36ae
Merge branch 'main' into feat/react-embeddable
dej611 Oct 21, 2024
649236f
Update x-pack/plugins/lens/public/react_embeddable/inline_editing/mou…
dej611 Oct 21, 2024
feaee2b
:bug: Fix render events
dej611 Oct 22, 2024
67f9996
:bug: Reduce re-render fix to make tests pass
dej611 Oct 22, 2024
7807a9c
:bug: Fix render count bug
dej611 Oct 23, 2024
efae4d5
:bug: Move back higher error logic to loader
dej611 Oct 23, 2024
818c7c9
:bug: Final fix for the blocking error issue
dej611 Oct 23, 2024
204a1b3
:white_check_mark: Fix esql ftr
dej611 Oct 24, 2024
a9d94c0
:fire: Remove unused test id
dej611 Oct 24, 2024
9e3af25
:recycle: Provide a distinct API for validation errors
dej611 Oct 24, 2024
cd890c5
:label: Update api types
dej611 Oct 24, 2024
6a77f58
:label: More types update
dej611 Oct 24, 2024
de4e768
:bug: New fix for user messages
dej611 Oct 24, 2024
6f2e467
:zap: Little refactor speed up
dej611 Oct 24, 2024
e1d4025
Merge branch 'main' into feat/react-embeddable
dej611 Oct 24, 2024
e1ecc53
:label: Fix type issues
dej611 Oct 24, 2024
b35e7e0
:fire: Remove logs
dej611 Oct 24, 2024
e4ffbdc
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Oct 24, 2024
14b7390
:white_check_mark: Make test pass
dej611 Oct 25, 2024
c881fba
Merge remote-tracking branch 'upstream/main' into feat/react-embeddable
dej611 Oct 25, 2024
49ed84d
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Oct 25, 2024
4ea7622
:bug: fix merge conflicts
dej611 Oct 25, 2024
f387938
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Oct 25, 2024
9a150e3
:bug: Push viz title and description into data attributes as fallback
dej611 Oct 25, 2024
6139715
:bug: Minor fixes
dej611 Oct 28, 2024
0210d30
Merge remote-tracking branch 'upstream/main' into feat/react-embeddable
dej611 Oct 28, 2024
d8dd05d
:fire: Remove temporary fix
dej611 Oct 28, 2024
ff942a7
:sparkles: Use search api
dej611 Oct 28, 2024
05fae9d
:recycle: Change url to fix tests
dej611 Oct 28, 2024
f675390
:white_check_mark: Temporary fix for the test
dej611 Oct 28, 2024
de2e3ea
:white_check_mark: Fix test
dej611 Oct 28, 2024
ed079f4
:adhesive_bandage: Skip suite for now
dej611 Oct 30, 2024
9f6dee4
:label: Fix type
dej611 Oct 30, 2024
e495aee
:white_check_mark: Fix test
dej611 Oct 30, 2024
23b59a7
:label: Sync test with new type
dej611 Oct 30, 2024
b46f639
:bug: Fix refresh bug
dej611 Oct 30, 2024
bc083d7
:bug: Fix edit path bug
dej611 Oct 30, 2024
9fdac9e
:label: Remove todo
dej611 Oct 31, 2024
20a389a
:recycle: Apply suggestions from self code review
dej611 Oct 31, 2024
456173f
Merge branch 'main' into feat/react-embeddable
dej611 Oct 31, 2024
1fd093c
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Oct 31, 2024
35749d2
Merge branch 'main' into feat/react-embeddable
bhavyarm Oct 31, 2024
48c34a1
:whirte_check_mark: Skip the test for now
dej611 Nov 4, 2024
9854d66
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Nov 4, 2024
dcc2baa
Merge branch 'main' into feat/react-embeddable
dej611 Nov 4, 2024
7efe070
:bug: fix missing active data update
dej611 Nov 4, 2024
90d9e43
:ok_hand: Integrated feedback
dej611 Nov 4, 2024
8fdec4e
:pencil2: Added comment
dej611 Nov 4, 2024
3a4100f
:truck: Rename file
dej611 Nov 4, 2024
1264bac
:bug: Fix issue when cancelling with adhoc dataViews
dej611 Nov 4, 2024
b801e99
:label: Fix missing arg issue
dej611 Nov 4, 2024
33b0235
:bug: Fix path
dej611 Nov 4, 2024
f546409
:camera_flash: update snapshot
dej611 Nov 5, 2024
53e5729
:fire: Remove unused line
dej611 Nov 5, 2024
846d753
:bug: Better fix for the inline editing
dej611 Nov 5, 2024
55cda92
Merge branch 'main' into feat/react-embeddable
dej611 Nov 5, 2024
7cb51e9
:recycle: Revert comment
dej611 Nov 5, 2024
f6167c5
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Nov 5, 2024
42bb70e
Merge remote-tracking branch 'upstream/main' into feat/react-embeddable
dej611 Nov 6, 2024
dc8a110
:recycle: Fix merging conflicts
dej611 Nov 6, 2024
09b6163
:fire: Remove unused type
dej611 Nov 6, 2024
e27d471
:ok_hand: Push down the esql check
dej611 Nov 6, 2024
8e81678
:ok_hand: Remove useless check
dej611 Nov 6, 2024
11f3164
:truck: Refactor ids
dej611 Nov 6, 2024
13f57c2
:ok_hand: integrate feedback
dej611 Nov 6, 2024
6b487d4
:ok_hand: Multiple helper fixes
dej611 Nov 6, 2024
2140e3f
:ok_hand: Take execution context result
dej611 Nov 6, 2024
37760dd
:ok_hand: Forgot to add more execution context
dej611 Nov 6, 2024
61d3e1a
:ok_hand: Use shared nonNullable
dej611 Nov 6, 2024
dbab16d
:ok_hand: Make type required
dej611 Nov 6, 2024
de7c04e
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Nov 6, 2024
a80f618
:pencil2: Add more doc about callback types
dej611 Nov 6, 2024
d86ddad
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Nov 6, 2024
b307ed1
:bug: Fix explore data and drilldowns bugs
dej611 Nov 6, 2024
9c2629a
:white_check_mark: Add assertion
dej611 Nov 6, 2024
99f5528
:white_check_mark: Make sure context menu is open before going to editor
dej611 Nov 7, 2024
fdfec0d
:bug: Setup again inline editing
dej611 Nov 7, 2024
11579e7
:bug: Apply fix for custom action too
dej611 Nov 7, 2024
2a20a17
:white_check_mark: Add tests for inline editing for more scenarios
dej611 Nov 7, 2024
6d21cec
:recycle: Improved unified search context merge
dej611 Nov 8, 2024
aaf1f31
:lipstick: Fixed panel wrapper ui regressions
dej611 Nov 8, 2024
463ee58
:fire: Removed unused check
dej611 Nov 8, 2024
2f246fe
:bug: fix canvas specific issue
dej611 Nov 8, 2024
2dcb2eb
:mute: Skip specific request count test
dej611 Nov 8, 2024
c9f86ae
Merge branch 'main' into feat/react-embeddable
dej611 Nov 8, 2024
3b982d9
:bug: Deserialize fix
dej611 Nov 11, 2024
c7c6de0
:white_check_mark: Add unit tests for reference injections
dej611 Nov 11, 2024
0bab982
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Nov 11, 2024
a362bd7
Merge remote-tracking branch 'upstream/main' into feat/react-embeddable
dej611 Nov 11, 2024
ce07080
:bug: Improved inject fix
dej611 Nov 12, 2024
a8f49af
:white_check_mark: Fixed test
dej611 Nov 12, 2024
5ebf31f
:white_check_mark: Fixed function to call for edit
dej611 Nov 12, 2024
ab4409b
:white_check_mark: Reset dashboard before other suite
dej611 Nov 12, 2024
c9ee526
Merge branch 'main' into feat/react-embeddable
stratoula Nov 13, 2024
7527b64
:bug: Expose expolore in Discover for ES|QL charts
dej611 Nov 14, 2024
14e0aa5
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Nov 14, 2024
b2be257
:bug: Lift creation flag at internal api
dej611 Nov 14, 2024
f3f5f40
:bug: Fix issue on unsaved changes re-edit
dej611 Nov 14, 2024
058a373
:sparkles: Enhance to support any panel
dej611 Nov 14, 2024
1b2b134
:white_check_mark: Add more test cases for cancel action
dej611 Nov 14, 2024
3c4fedb
:label: Fix type issues
dej611 Nov 14, 2024
0b8d1f8
:bug: Serialize drilldowns correctly
dej611 Nov 14, 2024
a1ac7eb
:white_check_mark: Add test for drilldowns
dej611 Nov 14, 2024
3d4e6b2
:recycle: restore test
dej611 Nov 14, 2024
a785186
Merge branch 'main' into feat/react-embeddable
dej611 Nov 14, 2024
1c25c87
[CI] Auto-commit changed files from 'make api-docs'
kibanamachine Nov 14, 2024
602d3f1
:bug: Fix slo chart
dej611 Nov 14, 2024
7485734
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Nov 14, 2024
16b4a59
:recycle: Restore skip for now
dej611 Nov 14, 2024
409cbf1
:bug: Avoid more conflicts with solutions
dej611 Nov 14, 2024
06c715d
:pencil2: Better naming
dej611 Nov 14, 2024
7aacc18
:mute: Mute live check for now
dej611 Nov 18, 2024
218b84f
:fire: Remove unused imports
dej611 Nov 18, 2024
8ce8be2
:white_check_mark: Clear unused context
dej611 Nov 18, 2024
5386438
:bug: Fix nested attributes bug
dej611 Nov 18, 2024
5560171
:bug: Possible fix for requests count
dej611 Nov 18, 2024
9ae6fc2
:white_check_mark: Add extra assertion to debug CI issue
dej611 Nov 18, 2024
2a38177
:recycle: Reworked types
dej611 Nov 18, 2024
1578d17
Merge branch 'main' into feat/react-embeddable
dej611 Nov 18, 2024
fe503fb
:bug: final fix for inline editing
dej611 Nov 18, 2024
647bfe5
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Nov 18, 2024
0a3f07c
:recycle: Unskip test
dej611 Nov 18, 2024
348c2d5
:label: Fix type
dej611 Nov 18, 2024
0b67223
:label: Fix type
dej611 Nov 19, 2024
f355a68
:white_check_mark: Restore count number
dej611 Nov 19, 2024
233ef76
Merge branch 'main' into feat/react-embeddable
dej611 Nov 19, 2024
e86c510
:mute: Skip test for now as it seems flaky
dej611 Nov 19, 2024
ef33089
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Nov 19, 2024
6f62aab
Fix test
dej611 Nov 19, 2024
cffbb97
:bug: fix cancel issue with ad hoc dataView and multiple re-edits
dej611 Nov 20, 2024
ae797d8
:white_check_mark: Add test for ad hoc inline editing
dej611 Nov 20, 2024
2f7f49d
:bug: Address a race condition that affects unified histogram
dej611 Nov 20, 2024
163c65b
:bug: second part of the fix
dej611 Nov 20, 2024
53f6e81
:recycle: Revert changes back
dej611 Nov 20, 2024
a1690a8
:camera_flash: Update snapshots
dej611 Nov 20, 2024
2b4dfa8
Merge remote-tracking branch 'upstream/main' into feat/react-embeddable
dej611 Nov 21, 2024
28c65b9
:label: Fix types
dej611 Nov 21, 2024
323fd01
:sparkles: Expose the action handler to customize embeddable actions
dej611 Nov 21, 2024
95399ea
:bug: Fix custom actions on Lens custom component
dej611 Nov 21, 2024
bf670f6
:fire: Remove check
dej611 Nov 21, 2024
5758fb4
Merge remote-tracking branch 'upstream/main' into feat/react-embeddable
dej611 Nov 21, 2024
6605240
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Nov 21, 2024
0e65ba7
:label: Fix type issues
dej611 Nov 21, 2024
5fcf51c
Merge branch 'feat/react-embeddable' of https://github.com/dej611/kib…
dej611 Nov 21, 2024
d0a48b1
Merge branch 'main' into feat/react-embeddable
dej611 Nov 22, 2024
27e27bf
Merge branch 'main' into feat/react-embeddable
mbondyra Nov 25, 2024
a6ffd5c
Merge branch 'main' into feat/react-embeddable
dej611 Nov 25, 2024
684b106
Merge branch 'main' into feat/react-embeddable
dej611 Nov 25, 2024
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
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just import move.

dej611 marked this conversation as resolved.
Show resolved Hide resolved
stratoula marked this conversation as resolved.
Show resolved Hide resolved
stratoula marked this conversation as resolved.
Show resolved Hide resolved
stratoula marked this conversation as resolved.
Show resolved Hide resolved
stratoula marked this conversation as resolved.
Show resolved Hide resolved
stratoula marked this conversation as resolved.
Show resolved Hide resolved
stratoula marked this conversation as resolved.
Show resolved Hide resolved
stratoula marked this conversation as resolved.
Show resolved Hide resolved
stratoula marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import {
EmbeddableComponent,
Copy link
Contributor

@mbondyra mbondyra Nov 6, 2024

Choose a reason for hiding this comment

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

Something is being malformed when it comes to saved object state for by value objects. On this PR, I created this dashboard (3 by value panels, 1 by reference, one with filter, one with query):
Screenshot 2024-11-06 at 12 44 35
export.json

and then I ran this saved object in main (or switch branches), I get a bunch of errors in the console:
Screenshot 2024-11-06 at 12 44 12

Is this intentional? Should anything from saved object persisted state change? It makes the potential revert risky so we should keep an eye on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm currently investigating this bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed via 3b982d9 and ce07080. Added tests at unit level with a8f49af

FieldBasedIndexPatternColumn,
TypedLensByValueInput,
LensByValueInput,
} from '@kbn/lens-plugin/public';
import { Datatable } from '@kbn/expressions-plugin/common';
import { render, screen, waitFor } from '@testing-library/react';
import '@testing-library/jest-dom';
import userEvent from '@testing-library/user-event';
import { I18nProvider } from '@kbn/i18n-react';
import { GroupPreview } from './group_preview';
import { LensByValueInput } from '@kbn/lens-plugin/public/embeddable';
import { DATA_LAYER_ID, DATE_HISTOGRAM_COLUMN_ID, getCurrentTimeField } from './lens_attributes';
import { EuiSuperDatePickerTestHarness } from '@kbn/test-eui-helpers';

Expand Down
Copy link
Contributor Author

Choose a reason for hiding this comment

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

After the refactor the new Embeddable system won't adapt its height to its container, so the wrapper div here has been removed in favour of direct styling on the component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new custom component didn't get the right height with the previous configuration.
Usually the height was set directly on the component, so I've removed the wrapping here.

Original file line number Diff line number Diff line change
Expand Up @@ -198,28 +198,25 @@ export const GroupPreview = ({
justifyContent="center"
>
<EuiFlexItem grow={0}>
<div
<LensEmbeddableComponent
css={css`
& > div {
height: 400px;
width: 100%;
}
`}
>
<LensEmbeddableComponent
data-test-subj="chart"
id="annotation-library-preview"
timeRange={chartTimeRange}
attributes={lensAttributes}
onBrushEnd={({ range }) =>
setChartTimeRange({
from: new Date(range[0]).toISOString(),
to: new Date(range[1]).toISOString(),
})
}
searchSessionId={searchSessionId}
/>
</div>
data-test-subj="chart"
id="annotation-library-preview"
timeRange={chartTimeRange}
attributes={lensAttributes}
onBrushEnd={({ range }) =>
setChartTimeRange({
from: new Date(range[0]).toISOString(),
to: new Date(range[1]).toISOString(),
})
}
searchSessionId={searchSessionId}
/>
</EuiFlexItem>
</EuiFlexGroup>
) : (
Expand Down
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 was required to match the new type for the Inspector.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface ExpressionRendererParams extends IExpressionLoaderParams {
debounce?: number;
expression: string | ExpressionAstExpression;
hasCustomErrorRenderer?: boolean;
onData$?<TData, TInspectorAdapters>(
onData$?<TData, TInspectorAdapters extends unknown>(
data: TData,
adapters?: TInspectorAdapters,
partial?: boolean
Expand Down
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mbondyra app.test.tsx testing work.

Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,24 @@
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/

import React from 'react';
import { of } from 'rxjs';
import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public';
import { Plugin } from '.';
import { createTopNav } from './top_nav_menu';

export type Setup = jest.Mocked<ReturnType<Plugin['setup']>>;
export type Start = jest.Mocked<ReturnType<Plugin['start']>>;

// mock mountPointPortal
jest.mock('@kbn/react-kibana-mount', () => {
const original = jest.requireActual('@kbn/react-kibana-mount');
return {
...original,
MountPointPortal: jest.fn(({ children }) => children),
};
});

const createSetupContract = (): jest.Mocked<Setup> => {
const setupContract = {
registerMenuItem: jest.fn(),
Expand All @@ -21,12 +32,21 @@ const createSetupContract = (): jest.Mocked<Setup> => {
return setupContract;
};

export const unifiedSearchMock = {
ui: {
SearchBar: () => <div className="searchBar" />,
AggregateQuerySearchBar: () => <div className="searchBar" />,
},
} as unknown as UnifiedSearchPublicPluginStart;

const createStartContract = (): jest.Mocked<Start> => {
const startContract = {
ui: {
TopNavMenu: jest.fn(),
createTopNavWithCustomContext: jest.fn().mockImplementation(() => jest.fn()),
AggregateQueryTopNavMenu: jest.fn(),
TopNavMenu: jest.fn().mockImplementation(createTopNav(unifiedSearchMock, [])),
AggregateQueryTopNavMenu: jest.fn().mockImplementation(createTopNav(unifiedSearchMock, [])),
createTopNavWithCustomContext: jest
.fn()
.mockImplementation(createTopNav(unifiedSearchMock, [])),
},
addSolutionNavigation: jest.fn(),
isSolutionNavEnabled$: of(false),
Expand Down
Copy link
Contributor Author

Choose a reason for hiding this comment

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

More @mbondyra app.test.tsx testing work

Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,9 @@ import { MountPoint } from '@kbn/core/public';
import { TopNavMenu } from './top_nav_menu';
import { TopNavMenuData } from './top_nav_menu_data';
import { findTestSubject, mountWithIntl } from '@kbn/test-jest-helpers';
import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public';
import { EuiToolTipProps } from '@elastic/eui';
import type { TopNavMenuBadgeProps } from './top_nav_menu_badges';

const unifiedSearch = {
ui: {
SearchBar: () => <div className="searchBar" />,
AggregateQuerySearchBar: () => <div className="searchBar" />,
},
} as unknown as UnifiedSearchPublicPluginStart;
import { unifiedSearchMock } from '../mocks';

describe('TopNavMenu', () => {
const WRAPPER_SELECTOR = '.kbnTopNavMenu__wrapper';
Expand Down Expand Up @@ -97,7 +90,7 @@ describe('TopNavMenu', () => {

it('Should render search bar', () => {
const component = mountWithIntl(
<TopNavMenu appName={'test'} showSearchBar={true} unifiedSearch={unifiedSearch} />
<TopNavMenu appName={'test'} showSearchBar={true} unifiedSearch={unifiedSearchMock} />
);
expect(component.find(WRAPPER_SELECTOR).length).toBe(1);
expect(component.find(TOP_NAV_ITEM_SELECTOR).length).toBe(0);
Expand All @@ -110,7 +103,7 @@ describe('TopNavMenu', () => {
appName={'test'}
config={menuItems}
showSearchBar={true}
unifiedSearch={unifiedSearch}
unifiedSearch={unifiedSearchMock}
/>
);
expect(component.find(WRAPPER_SELECTOR).length).toBe(1);
Expand All @@ -124,7 +117,7 @@ describe('TopNavMenu', () => {
appName={'test'}
config={menuItems}
showSearchBar={true}
unifiedSearch={unifiedSearch}
unifiedSearch={unifiedSearchMock}
className={'myCoolClass'}
/>
);
Expand Down Expand Up @@ -172,7 +165,7 @@ describe('TopNavMenu', () => {
appName={'test'}
config={menuItems}
showSearchBar={true}
unifiedSearch={unifiedSearch}
unifiedSearch={unifiedSearchMock}
setMenuMountPoint={setMountPoint}
/>
);
Expand All @@ -195,7 +188,7 @@ describe('TopNavMenu', () => {
appName={'test'}
badges={badges}
showSearchBar={true}
unifiedSearch={unifiedSearch}
unifiedSearch={unifiedSearchMock}
setMenuMountPoint={setMountPoint}
/>
);
Expand Down
31 changes: 13 additions & 18 deletions src/plugins/unified_histogram/public/chart/chart.tsx
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before the embeddable used to push the entire EmbeddableOutput as third argument in the onLoad callback as undocumented. This was leveraged by the inline editing to know when the data changed in the chart to update itself.
I've changed the onLoad signature of the embeddable to receive now a dataLoading observable which has the only purpose of emit at every data change on the embeddable. The changes here reflect this new API.

An additional change was around the SaveModal component: before there was some confusion around the input and Lens attributes content and sometimes the two would be passed (possibly with forced casting).
With the refactor the input should be the embeddable initialState, which is a wrapper around Lens attributes.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

import React, { memo, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';
import type { Observable } from 'rxjs';
import { Subject } from 'rxjs';
import useObservable from 'react-use/lib/useObservable';
import { IconButtonGroup, type IconButtonGroupProps } from '@kbn/shared-ux-button-toolbar';
Expand Down Expand Up @@ -70,7 +69,7 @@ export interface ChartProps {
disabledActions?: LensEmbeddableInput['disabledActions'];
input$?: UnifiedHistogramInput$;
lensAdapters?: UnifiedHistogramChartLoadEvent['adapters'];
lensEmbeddableOutput$?: Observable<LensEmbeddableOutput>;
dataLoading$?: LensEmbeddableOutput['dataLoading'];
isChartLoading?: boolean;
onChartHiddenChange?: (chartHidden: boolean) => void;
onTimeIntervalChange?: (timeInterval: string) => void;
Expand Down Expand Up @@ -105,7 +104,7 @@ export function Chart({
disabledActions,
input$: originalInput$,
lensAdapters,
lensEmbeddableOutput$,
dataLoading$,
isChartLoading,
onChartHiddenChange,
onTimeIntervalChange,
Expand Down Expand Up @@ -383,28 +382,24 @@ export function Chart({
)}
{canSaveVisualization && isSaveModalVisible && visContext.attributes && (
<LensSaveModalComponent
initialInput={
removeTablesFromLensAttributes(visContext.attributes) as unknown as LensEmbeddableInput
}
initialInput={removeTablesFromLensAttributes(visContext.attributes)}
onSave={() => {}}
onClose={() => setIsSaveModalVisible(false)}
isSaveable={false}
/>
)}
{isFlyoutVisible && !!visContext && !!lensVisServiceCurrentSuggestionContext && (
<ChartConfigPanel
{...{
services,
visContext,
lensAdapters,
lensEmbeddableOutput$,
isFlyoutVisible,
setIsFlyoutVisible,
isPlainRecord,
query,
currentSuggestionContext: lensVisServiceCurrentSuggestionContext,
onSuggestionContextEdit,
}}
services={services}
visContext={visContext}
lensAdapters={lensAdapters}
dataLoading$={dataLoading$}
isFlyoutVisible={isFlyoutVisible}
setIsFlyoutVisible={setIsFlyoutVisible}
isPlainRecord={isPlainRecord}
query={query}
currentSuggestionContext={lensVisServiceCurrentSuggestionContext}
onSuggestionContextEdit={onSuggestionContextEdit}
/>
)}
</EuiFlexGroup>
Expand Down
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No more usage of embeddableOutput, rather use the documented dataLoading$ observable to update on data change.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was not able to reproduce #184600 when testing this PR.

Let's try unskiping test/functional/apps/discover/group3/_lens_vis.ts in this branch?

Copy link
Member

Choose a reason for hiding this comment

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

Let's unskip this after this PR get merged. I just don't want to keep adding changes to this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

We can't validate this PR fully if our main test suit for Discover visualizations is skipped. To me it's a blocker for merging this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've unskipped the test, let's see what the CI says.

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 has been unskipped and it is passing as 6f62aab .
I've also added a flaky runner for this discover test group (including both this suite and the request_count one) which is passing: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/7424

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

import React, { ComponentProps, useCallback, useEffect, useRef, useState } from 'react';
import type { Observable } from 'rxjs';
import type { AggregateQuery, Query } from '@kbn/es-query';
import { isEqual, isObject } from 'lodash';
import type { LensEmbeddableOutput, Suggestion } from '@kbn/lens-plugin/public';
Expand All @@ -29,7 +28,7 @@ export function ChartConfigPanel({
services,
visContext,
lensAdapters,
lensEmbeddableOutput$,
dataLoading$,
currentSuggestionContext,
isFlyoutVisible,
setIsFlyoutVisible,
Expand All @@ -42,7 +41,7 @@ export function ChartConfigPanel({
isFlyoutVisible: boolean;
setIsFlyoutVisible: (flag: boolean) => void;
lensAdapters?: UnifiedHistogramChartLoadEvent['adapters'];
lensEmbeddableOutput$?: Observable<LensEmbeddableOutput>;
dataLoading$?: LensEmbeddableOutput['dataLoading'];
currentSuggestionContext: UnifiedHistogramSuggestionContext;
isPlainRecord?: boolean;
query?: Query | AggregateQuery;
Expand Down Expand Up @@ -108,7 +107,7 @@ export function ChartConfigPanel({
updateSuggestion={updateSuggestion}
updatePanelState={updatePanelState}
lensAdapters={lensAdapters}
output$={lensEmbeddableOutput$}
dataLoading$={dataLoading$}
displayFlyoutHeader
closeFlyout={() => {
setIsFlyoutVisible(false);
Expand Down Expand Up @@ -141,7 +140,7 @@ export function ChartConfigPanel({
isFlyoutVisible,
setIsFlyoutVisible,
lensAdapters,
lensEmbeddableOutput$,
dataLoading$,
currentSuggestionType,
]);

Expand Down
Loading