Skip to content

[dashboard] remove legacy section from 'Add panel' flyout#208116

Merged
nreese merged 12 commits intoelastic:mainfrom
nreese:remove_legacy_from_add_panel
Jan 30, 2025
Merged

[dashboard] remove legacy section from 'Add panel' flyout#208116
nreese merged 12 commits intoelastic:mainfrom
nreese:remove_legacy_from_add_panel

Conversation

@nreese
Copy link
Copy Markdown
Contributor

@nreese nreese commented Jan 23, 2025

Users should use Lens to visualize data. Users should not use TSVB or aggregation based panels. To this end, "easy button" UIs, such as dashboard's "Add panel" flyout, should guide users to lens and not guide them to legacy applications.

This PR removes legacy section from dashboard "Add panel" flyout. Users can still add legacy panels to dashboards via "visualize" application. The path is more steps, but this is as intended. Using old stuff should be painful and require extra work as a caret to move users to new stuff.

Screenshot 2025-01-23 at 1 08 41 PM

@nreese nreese added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// backport:skip This PR does not require backporting v9.0.0 release_note:skip Skip the PR/issue when compiling release notes labels Jan 23, 2025
@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Jan 23, 2025

/ci

@nreese nreese force-pushed the remove_legacy_from_add_panel branch from baedc23 to 7f22bce Compare January 28, 2025 22:04
@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Jan 28, 2025

/ci

@nreese nreese marked this pull request as ready for review January 28, 2025 22:06
@nreese nreese requested review from a team as code owners January 28, 2025 22:06
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@botelastic botelastic bot added the Feature:Embedding Embedding content via iFrame label Jan 28, 2025
Copy link
Copy Markdown
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Presentation team changes LGTM!

[VisGroups.PROMOTED]: ADD_PANEL_VISUALIZATION_GROUP,
[VisGroups.TOOLS]: ADD_PANEL_ANNOTATION_GROUP,
[VisGroups.LEGACY]: ADD_PANEL_LEGACY_GROUP,
[VisGroups.LEGACY]: undefined,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why is this key still here? If it's a type issue, maybe we could update the typings?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

cleaned up in abbe759

@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Jan 30, 2025

@elasticmachine merge upstream

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
visualizations 508 507 -1

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
embeddable 145 141 -4

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
dashboard 601.8KB 601.7KB -76.0B
visualizations 368.1KB 366.5KB -1.6KB
total -1.7KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
embeddable 22.5KB 22.3KB -194.0B
visualizations 38.8KB 38.5KB -316.0B
total -510.0B
Unknown metric groups

API count

id before after diff
embeddable 172 168 -4

async chunk count

id before after diff
visualizations 20 19 -1

History

@nreese nreese added backport:version Backport to applied version labels 8.19 candidate and removed backport:skip This PR does not require backporting labels Jan 30, 2025
Copy link
Copy Markdown
Contributor

@markov00 markov00 left a comment

Choose a reason for hiding this comment

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

Great thanks for this! code review only

@nreese nreese merged commit 7587681 into elastic:main Jan 30, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.1

https://github.com/elastic/kibana/actions/runs/13059687454

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.19 The branch "8.19" does not exist
9.1 The branch "9.1" does not exist

Manual backport

To create the backport manually run:

node scripts/backport --pr 208116

Questions ?

Please refer to the Backport tool documentation

nreese added a commit to nreese/kibana that referenced this pull request Jan 30, 2025
…8116)

Users should use Lens to visualize data. Users should not use TSVB or
aggregation based panels. To this end, "easy button" UIs, such as
dashboard's "Add panel" flyout, should guide users to lens and not guide
them to legacy applications.

This PR removes `legacy` section from dashboard "Add panel" flyout.
Users can still add legacy panels to dashboards via "visualize"
application. The path is more steps, but this is as intended. Using old
stuff should be painful and require extra work as a caret to move users
to new stuff.

<img width="500" alt="Screenshot 2025-01-23 at 1 08 41 PM"
src="https://github.com/user-attachments/assets/e142cba9-a880-4ad6-a3f8-a981a03daaec"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 7587681)
@nreese
Copy link
Copy Markdown
Contributor Author

nreese commented Jan 30, 2025

💚 All backports created successfully

Status Branch Result
9.0
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

nreese added a commit to nreese/kibana that referenced this pull request Jan 30, 2025
…8116)

Users should use Lens to visualize data. Users should not use TSVB or
aggregation based panels. To this end, "easy button" UIs, such as
dashboard's "Add panel" flyout, should guide users to lens and not guide
them to legacy applications.

This PR removes `legacy` section from dashboard "Add panel" flyout.
Users can still add legacy panels to dashboards via "visualize"
application. The path is more steps, but this is as intended. Using old
stuff should be painful and require extra work as a caret to move users
to new stuff.

<img width="500" alt="Screenshot 2025-01-23 at 1 08 41 PM"
src="https://github.com/user-attachments/assets/e142cba9-a880-4ad6-a3f8-a981a03daaec"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 7587681)

# Conflicts:
#	test/functional/apps/dashboard/group1/create_and_add_embeddables.ts
nreese added a commit that referenced this pull request Jan 30, 2025
) (#209015)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[dashboard] remove legacy section from &#x27;Add panel&#x27; flyout
(#208116)](#208116)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2025-01-30T19:22:51Z","message":"[dashboard]
remove legacy section from 'Add panel' flyout (#208116)\n\nUsers should
use Lens to visualize data. Users should not use TSVB or\r\naggregation
based panels. To this end, \"easy button\" UIs, such as\r\ndashboard's
\"Add panel\" flyout, should guide users to lens and not guide\r\nthem
to legacy applications.\r\n\r\nThis PR removes `legacy` section from
dashboard \"Add panel\" flyout.\r\nUsers can still add legacy panels to
dashboards via \"visualize\"\r\napplication. The path is more steps, but
this is as intended. Using old\r\nstuff should be painful and require
extra work as a caret to move users\r\nto new stuff.\r\n\r\n<img
width=\"500\" alt=\"Screenshot 2025-01-23 at 1 08
41 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/e142cba9-a880-4ad6-a3f8-a981a03daaec\"\r\n/>\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"758768136d58815b282d3f0bb2eb11b9b33d7989","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Embedding","Team:Presentation","release_note:skip","v9.0.0","backport:version","v9.1.0","v8.19.0"],"title":"[dashboard]
remove legacy section from 'Add panel'
flyout","number":208116,"url":"https://github.com/elastic/kibana/pull/208116","mergeCommit":{"message":"[dashboard]
remove legacy section from 'Add panel' flyout (#208116)\n\nUsers should
use Lens to visualize data. Users should not use TSVB or\r\naggregation
based panels. To this end, \"easy button\" UIs, such as\r\ndashboard's
\"Add panel\" flyout, should guide users to lens and not guide\r\nthem
to legacy applications.\r\n\r\nThis PR removes `legacy` section from
dashboard \"Add panel\" flyout.\r\nUsers can still add legacy panels to
dashboards via \"visualize\"\r\napplication. The path is more steps, but
this is as intended. Using old\r\nstuff should be painful and require
extra work as a caret to move users\r\nto new stuff.\r\n\r\n<img
width=\"500\" alt=\"Screenshot 2025-01-23 at 1 08
41 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/e142cba9-a880-4ad6-a3f8-a981a03daaec\"\r\n/>\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"758768136d58815b282d3f0bb2eb11b9b33d7989"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/208116","number":208116,"mergeCommit":{"message":"[dashboard]
remove legacy section from 'Add panel' flyout (#208116)\n\nUsers should
use Lens to visualize data. Users should not use TSVB or\r\naggregation
based panels. To this end, \"easy button\" UIs, such as\r\ndashboard's
\"Add panel\" flyout, should guide users to lens and not guide\r\nthem
to legacy applications.\r\n\r\nThis PR removes `legacy` section from
dashboard \"Add panel\" flyout.\r\nUsers can still add legacy panels to
dashboards via \"visualize\"\r\napplication. The path is more steps, but
this is as intended. Using old\r\nstuff should be painful and require
extra work as a caret to move users\r\nto new stuff.\r\n\r\n<img
width=\"500\" alt=\"Screenshot 2025-01-23 at 1 08
41 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/e142cba9-a880-4ad6-a3f8-a981a03daaec\"\r\n/>\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"758768136d58815b282d3f0bb2eb11b9b33d7989"}},{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
nreese added a commit that referenced this pull request Jan 31, 2025
) (#209016)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[dashboard] remove legacy section from &#x27;Add panel&#x27; flyout
(#208116)](#208116)

<!--- Backport version: 9.6.4 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2025-01-30T19:22:51Z","message":"[dashboard]
remove legacy section from 'Add panel' flyout (#208116)\n\nUsers should
use Lens to visualize data. Users should not use TSVB or\r\naggregation
based panels. To this end, \"easy button\" UIs, such as\r\ndashboard's
\"Add panel\" flyout, should guide users to lens and not guide\r\nthem
to legacy applications.\r\n\r\nThis PR removes `legacy` section from
dashboard \"Add panel\" flyout.\r\nUsers can still add legacy panels to
dashboards via \"visualize\"\r\napplication. The path is more steps, but
this is as intended. Using old\r\nstuff should be painful and require
extra work as a caret to move users\r\nto new stuff.\r\n\r\n<img
width=\"500\" alt=\"Screenshot 2025-01-23 at 1 08
41 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/e142cba9-a880-4ad6-a3f8-a981a03daaec\"\r\n/>\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"758768136d58815b282d3f0bb2eb11b9b33d7989","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Embedding","Team:Presentation","release_note:skip","v9.0.0","backport:version","v9.1.0","v8.19.0"],"title":"[dashboard]
remove legacy section from 'Add panel'
flyout","number":208116,"url":"https://github.com/elastic/kibana/pull/208116","mergeCommit":{"message":"[dashboard]
remove legacy section from 'Add panel' flyout (#208116)\n\nUsers should
use Lens to visualize data. Users should not use TSVB or\r\naggregation
based panels. To this end, \"easy button\" UIs, such as\r\ndashboard's
\"Add panel\" flyout, should guide users to lens and not guide\r\nthem
to legacy applications.\r\n\r\nThis PR removes `legacy` section from
dashboard \"Add panel\" flyout.\r\nUsers can still add legacy panels to
dashboards via \"visualize\"\r\napplication. The path is more steps, but
this is as intended. Using old\r\nstuff should be painful and require
extra work as a caret to move users\r\nto new stuff.\r\n\r\n<img
width=\"500\" alt=\"Screenshot 2025-01-23 at 1 08
41 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/e142cba9-a880-4ad6-a3f8-a981a03daaec\"\r\n/>\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"758768136d58815b282d3f0bb2eb11b9b33d7989"}},"sourceBranch":"main","suggestedTargetBranches":["9.1","8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/208116","number":208116,"mergeCommit":{"message":"[dashboard]
remove legacy section from 'Add panel' flyout (#208116)\n\nUsers should
use Lens to visualize data. Users should not use TSVB or\r\naggregation
based panels. To this end, \"easy button\" UIs, such as\r\ndashboard's
\"Add panel\" flyout, should guide users to lens and not guide\r\nthem
to legacy applications.\r\n\r\nThis PR removes `legacy` section from
dashboard \"Add panel\" flyout.\r\nUsers can still add legacy panels to
dashboards via \"visualize\"\r\napplication. The path is more steps, but
this is as intended. Using old\r\nstuff should be painful and require
extra work as a caret to move users\r\nto new stuff.\r\n\r\n<img
width=\"500\" alt=\"Screenshot 2025-01-23 at 1 08
41 PM\"\r\nsrc=\"https://github.com/user-attachments/assets/e142cba9-a880-4ad6-a3f8-a981a03daaec\"\r\n/>\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"758768136d58815b282d3f0bb2eb11b9b33d7989"}},{"branch":"9.1","label":"v9.1.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
nreese added a commit that referenced this pull request Feb 18, 2025
…le to dashboard (#211264)

Follow up to #210125

[8.16](#211057) and
[8.17](#211054) backports for
#210125 were failing functional
test
https://github.com/elastic/kibana/blob/8.17/test/functional/apps/dashboard/group1/dashboard_unsaved_listing.ts#L142.
The functional test adds a by-value and by-reference legacy
visualization to a new dashboard. Upon saving the dashboard, the
dashboard still showed unsaved changes.

The reason this test did not fail main and other branches is that
#208116 removed the "by-value"
part of the test (since its no longer possible to add a by-value legacy
visualization from within a dashboard). It is still possible to recreate
the issue in main with the following steps
1) Click "Visualize Library" in left nav
2) Click "Create visualization" button. 
3) Click "Legacy" tab
4) Click "Aggregation based"
5) Click "Area"
6) Click web logs sample data view
7) Click "Save"
8) Set title
9) Under "Add to dashboard", click "New", click save
10) save dashboard. Notice how dashboard still has unsaved changes.

8.16 and 8.17 required a [new
commit](1fd631c)
to resolve the issue by updating the `linkedToLibrary` to ignore
undefined values.

This PR fixes the issue for the other branches that have already been
merged.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Feb 18, 2025
…le to dashboard (elastic#211264)

Follow up to elastic#210125

[8.16](elastic#211057) and
[8.17](elastic#211054) backports for
elastic#210125 were failing functional
test
https://github.com/elastic/kibana/blob/8.17/test/functional/apps/dashboard/group1/dashboard_unsaved_listing.ts#L142.
The functional test adds a by-value and by-reference legacy
visualization to a new dashboard. Upon saving the dashboard, the
dashboard still showed unsaved changes.

The reason this test did not fail main and other branches is that
elastic#208116 removed the "by-value"
part of the test (since its no longer possible to add a by-value legacy
visualization from within a dashboard). It is still possible to recreate
the issue in main with the following steps
1) Click "Visualize Library" in left nav
2) Click "Create visualization" button.
3) Click "Legacy" tab
4) Click "Aggregation based"
5) Click "Area"
6) Click web logs sample data view
7) Click "Save"
8) Set title
9) Under "Add to dashboard", click "New", click save
10) save dashboard. Notice how dashboard still has unsaved changes.

8.16 and 8.17 required a [new
commit](elastic@1fd631c)
to resolve the issue by updating the `linkedToLibrary` to ignore
undefined values.

This PR fixes the issue for the other branches that have already been
merged.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 6789c94)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Feb 18, 2025
…le to dashboard (elastic#211264)

Follow up to elastic#210125

[8.16](elastic#211057) and
[8.17](elastic#211054) backports for
elastic#210125 were failing functional
test
https://github.com/elastic/kibana/blob/8.17/test/functional/apps/dashboard/group1/dashboard_unsaved_listing.ts#L142.
The functional test adds a by-value and by-reference legacy
visualization to a new dashboard. Upon saving the dashboard, the
dashboard still showed unsaved changes.

The reason this test did not fail main and other branches is that
elastic#208116 removed the "by-value"
part of the test (since its no longer possible to add a by-value legacy
visualization from within a dashboard). It is still possible to recreate
the issue in main with the following steps
1) Click "Visualize Library" in left nav
2) Click "Create visualization" button.
3) Click "Legacy" tab
4) Click "Aggregation based"
5) Click "Area"
6) Click web logs sample data view
7) Click "Save"
8) Set title
9) Under "Add to dashboard", click "New", click save
10) save dashboard. Notice how dashboard still has unsaved changes.

8.16 and 8.17 required a [new
commit](elastic@1fd631c)
to resolve the issue by updating the `linkedToLibrary` to ignore
undefined values.

This PR fixes the issue for the other branches that have already been
merged.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 6789c94)
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Feb 18, 2025
…le to dashboard (elastic#211264)

Follow up to elastic#210125

[8.16](elastic#211057) and
[8.17](elastic#211054) backports for
elastic#210125 were failing functional
test
https://github.com/elastic/kibana/blob/8.17/test/functional/apps/dashboard/group1/dashboard_unsaved_listing.ts#L142.
The functional test adds a by-value and by-reference legacy
visualization to a new dashboard. Upon saving the dashboard, the
dashboard still showed unsaved changes.

The reason this test did not fail main and other branches is that
elastic#208116 removed the "by-value"
part of the test (since its no longer possible to add a by-value legacy
visualization from within a dashboard). It is still possible to recreate
the issue in main with the following steps
1) Click "Visualize Library" in left nav
2) Click "Create visualization" button.
3) Click "Legacy" tab
4) Click "Aggregation based"
5) Click "Area"
6) Click web logs sample data view
7) Click "Save"
8) Set title
9) Under "Add to dashboard", click "New", click save
10) save dashboard. Notice how dashboard still has unsaved changes.

8.16 and 8.17 required a [new
commit](elastic@1fd631c)
to resolve the issue by updating the `linkedToLibrary` to ignore
undefined values.

This PR fixes the issue for the other branches that have already been
merged.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 6789c94)
kibanamachine added a commit that referenced this pull request Feb 18, 2025
…beddable to dashboard (#211264) (#211611)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[visualize] fix unsaved state when adding by-value visualize
embeddable to dashboard
(#211264)](#211264)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2025-02-18T16:17:42Z","message":"[visualize]
fix unsaved state when adding by-value visualize embeddable to dashboard
(#211264)\n\nFollow up to
https://github.com/elastic/kibana/pull/210125\r\n\r\n[8.16](https://github.com/elastic/kibana/pull/211057)
and\r\n[8.17](#211054) backports
for\r\nhttps://github.com//pull/210125 were failing
functional\r\ntest\r\nhttps://github.com/elastic/kibana/blob/8.17/test/functional/apps/dashboard/group1/dashboard_unsaved_listing.ts#L142.\r\nThe
functional test adds a by-value and by-reference legacy\r\nvisualization
to a new dashboard. Upon saving the dashboard, the\r\ndashboard still
showed unsaved changes.\r\n\r\nThe reason this test did not fail main
and other branches is
that\r\nhttps://github.com//pull/208116 removed the
\"by-value\"\r\npart of the test (since its no longer possible to add a
by-value legacy\r\nvisualization from within a dashboard). It is still
possible to recreate\r\nthe issue in main with the following steps\r\n1)
Click \"Visualize Library\" in left nav\r\n2) Click \"Create
visualization\" button. \r\n3) Click \"Legacy\" tab\r\n4) Click
\"Aggregation based\"\r\n5) Click \"Area\"\r\n6) Click web logs sample
data view\r\n7) Click \"Save\"\r\n8) Set title\r\n9) Under \"Add to
dashboard\", click \"New\", click save\r\n10) save dashboard. Notice how
dashboard still has unsaved changes.\r\n\r\n8.16 and 8.17 required a
[new\r\ncommit](https://github.com/elastic/kibana/pull/211054/commits/1fd631c5a30046b5ab2f63948174ec29bac6fd84)\r\nto
resolve the issue by updating the `linkedToLibrary` to
ignore\r\nundefined values.\r\n\r\nThis PR fixes the issue for the other
branches that have already
been\r\nmerged.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"6789c946885fe0b6a2e57e056831f1ff25156f73","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Visualizations","release_note:skip","v9.0.0","project:embeddableRebuild","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[visualize]
fix unsaved state when adding by-value visualize embeddable to
dashboard","number":211264,"url":"https://github.com/elastic/kibana/pull/211264","mergeCommit":{"message":"[visualize]
fix unsaved state when adding by-value visualize embeddable to dashboard
(#211264)\n\nFollow up to
https://github.com/elastic/kibana/pull/210125\r\n\r\n[8.16](https://github.com/elastic/kibana/pull/211057)
and\r\n[8.17](#211054) backports
for\r\nhttps://github.com//pull/210125 were failing
functional\r\ntest\r\nhttps://github.com/elastic/kibana/blob/8.17/test/functional/apps/dashboard/group1/dashboard_unsaved_listing.ts#L142.\r\nThe
functional test adds a by-value and by-reference legacy\r\nvisualization
to a new dashboard. Upon saving the dashboard, the\r\ndashboard still
showed unsaved changes.\r\n\r\nThe reason this test did not fail main
and other branches is
that\r\nhttps://github.com//pull/208116 removed the
\"by-value\"\r\npart of the test (since its no longer possible to add a
by-value legacy\r\nvisualization from within a dashboard). It is still
possible to recreate\r\nthe issue in main with the following steps\r\n1)
Click \"Visualize Library\" in left nav\r\n2) Click \"Create
visualization\" button. \r\n3) Click \"Legacy\" tab\r\n4) Click
\"Aggregation based\"\r\n5) Click \"Area\"\r\n6) Click web logs sample
data view\r\n7) Click \"Save\"\r\n8) Set title\r\n9) Under \"Add to
dashboard\", click \"New\", click save\r\n10) save dashboard. Notice how
dashboard still has unsaved changes.\r\n\r\n8.16 and 8.17 required a
[new\r\ncommit](https://github.com/elastic/kibana/pull/211054/commits/1fd631c5a30046b5ab2f63948174ec29bac6fd84)\r\nto
resolve the issue by updating the `linkedToLibrary` to
ignore\r\nundefined values.\r\n\r\nThis PR fixes the issue for the other
branches that have already
been\r\nmerged.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"6789c946885fe0b6a2e57e056831f1ff25156f73"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211264","number":211264,"mergeCommit":{"message":"[visualize]
fix unsaved state when adding by-value visualize embeddable to dashboard
(#211264)\n\nFollow up to
https://github.com/elastic/kibana/pull/210125\r\n\r\n[8.16](https://github.com/elastic/kibana/pull/211057)
and\r\n[8.17](#211054) backports
for\r\nhttps://github.com//pull/210125 were failing
functional\r\ntest\r\nhttps://github.com/elastic/kibana/blob/8.17/test/functional/apps/dashboard/group1/dashboard_unsaved_listing.ts#L142.\r\nThe
functional test adds a by-value and by-reference legacy\r\nvisualization
to a new dashboard. Upon saving the dashboard, the\r\ndashboard still
showed unsaved changes.\r\n\r\nThe reason this test did not fail main
and other branches is
that\r\nhttps://github.com//pull/208116 removed the
\"by-value\"\r\npart of the test (since its no longer possible to add a
by-value legacy\r\nvisualization from within a dashboard). It is still
possible to recreate\r\nthe issue in main with the following steps\r\n1)
Click \"Visualize Library\" in left nav\r\n2) Click \"Create
visualization\" button. \r\n3) Click \"Legacy\" tab\r\n4) Click
\"Aggregation based\"\r\n5) Click \"Area\"\r\n6) Click web logs sample
data view\r\n7) Click \"Save\"\r\n8) Set title\r\n9) Under \"Add to
dashboard\", click \"New\", click save\r\n10) save dashboard. Notice how
dashboard still has unsaved changes.\r\n\r\n8.16 and 8.17 required a
[new\r\ncommit](https://github.com/elastic/kibana/pull/211054/commits/1fd631c5a30046b5ab2f63948174ec29bac6fd84)\r\nto
resolve the issue by updating the `linkedToLibrary` to
ignore\r\nundefined values.\r\n\r\nThis PR fixes the issue for the other
branches that have already
been\r\nmerged.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"6789c946885fe0b6a2e57e056831f1ff25156f73"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
kibanamachine added a commit that referenced this pull request Feb 20, 2025
…beddable to dashboard (#211264) (#211612)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[visualize] fix unsaved state when adding by-value visualize
embeddable to dashboard
(#211264)](#211264)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2025-02-18T16:17:42Z","message":"[visualize]
fix unsaved state when adding by-value visualize embeddable to dashboard
(#211264)\n\nFollow up to
https://github.com/elastic/kibana/pull/210125\r\n\r\n[8.16](https://github.com/elastic/kibana/pull/211057)
and\r\n[8.17](#211054) backports
for\r\nhttps://github.com//pull/210125 were failing
functional\r\ntest\r\nhttps://github.com/elastic/kibana/blob/8.17/test/functional/apps/dashboard/group1/dashboard_unsaved_listing.ts#L142.\r\nThe
functional test adds a by-value and by-reference legacy\r\nvisualization
to a new dashboard. Upon saving the dashboard, the\r\ndashboard still
showed unsaved changes.\r\n\r\nThe reason this test did not fail main
and other branches is
that\r\nhttps://github.com//pull/208116 removed the
\"by-value\"\r\npart of the test (since its no longer possible to add a
by-value legacy\r\nvisualization from within a dashboard). It is still
possible to recreate\r\nthe issue in main with the following steps\r\n1)
Click \"Visualize Library\" in left nav\r\n2) Click \"Create
visualization\" button. \r\n3) Click \"Legacy\" tab\r\n4) Click
\"Aggregation based\"\r\n5) Click \"Area\"\r\n6) Click web logs sample
data view\r\n7) Click \"Save\"\r\n8) Set title\r\n9) Under \"Add to
dashboard\", click \"New\", click save\r\n10) save dashboard. Notice how
dashboard still has unsaved changes.\r\n\r\n8.16 and 8.17 required a
[new\r\ncommit](https://github.com/elastic/kibana/pull/211054/commits/1fd631c5a30046b5ab2f63948174ec29bac6fd84)\r\nto
resolve the issue by updating the `linkedToLibrary` to
ignore\r\nundefined values.\r\n\r\nThis PR fixes the issue for the other
branches that have already
been\r\nmerged.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"6789c946885fe0b6a2e57e056831f1ff25156f73","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Visualizations","release_note:skip","v9.0.0","project:embeddableRebuild","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[visualize]
fix unsaved state when adding by-value visualize embeddable to
dashboard","number":211264,"url":"https://github.com/elastic/kibana/pull/211264","mergeCommit":{"message":"[visualize]
fix unsaved state when adding by-value visualize embeddable to dashboard
(#211264)\n\nFollow up to
https://github.com/elastic/kibana/pull/210125\r\n\r\n[8.16](https://github.com/elastic/kibana/pull/211057)
and\r\n[8.17](#211054) backports
for\r\nhttps://github.com//pull/210125 were failing
functional\r\ntest\r\nhttps://github.com/elastic/kibana/blob/8.17/test/functional/apps/dashboard/group1/dashboard_unsaved_listing.ts#L142.\r\nThe
functional test adds a by-value and by-reference legacy\r\nvisualization
to a new dashboard. Upon saving the dashboard, the\r\ndashboard still
showed unsaved changes.\r\n\r\nThe reason this test did not fail main
and other branches is
that\r\nhttps://github.com//pull/208116 removed the
\"by-value\"\r\npart of the test (since its no longer possible to add a
by-value legacy\r\nvisualization from within a dashboard). It is still
possible to recreate\r\nthe issue in main with the following steps\r\n1)
Click \"Visualize Library\" in left nav\r\n2) Click \"Create
visualization\" button. \r\n3) Click \"Legacy\" tab\r\n4) Click
\"Aggregation based\"\r\n5) Click \"Area\"\r\n6) Click web logs sample
data view\r\n7) Click \"Save\"\r\n8) Set title\r\n9) Under \"Add to
dashboard\", click \"New\", click save\r\n10) save dashboard. Notice how
dashboard still has unsaved changes.\r\n\r\n8.16 and 8.17 required a
[new\r\ncommit](https://github.com/elastic/kibana/pull/211054/commits/1fd631c5a30046b5ab2f63948174ec29bac6fd84)\r\nto
resolve the issue by updating the `linkedToLibrary` to
ignore\r\nundefined values.\r\n\r\nThis PR fixes the issue for the other
branches that have already
been\r\nmerged.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"6789c946885fe0b6a2e57e056831f1ff25156f73"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211264","number":211264,"mergeCommit":{"message":"[visualize]
fix unsaved state when adding by-value visualize embeddable to dashboard
(#211264)\n\nFollow up to
https://github.com/elastic/kibana/pull/210125\r\n\r\n[8.16](https://github.com/elastic/kibana/pull/211057)
and\r\n[8.17](#211054) backports
for\r\nhttps://github.com//pull/210125 were failing
functional\r\ntest\r\nhttps://github.com/elastic/kibana/blob/8.17/test/functional/apps/dashboard/group1/dashboard_unsaved_listing.ts#L142.\r\nThe
functional test adds a by-value and by-reference legacy\r\nvisualization
to a new dashboard. Upon saving the dashboard, the\r\ndashboard still
showed unsaved changes.\r\n\r\nThe reason this test did not fail main
and other branches is
that\r\nhttps://github.com//pull/208116 removed the
\"by-value\"\r\npart of the test (since its no longer possible to add a
by-value legacy\r\nvisualization from within a dashboard). It is still
possible to recreate\r\nthe issue in main with the following steps\r\n1)
Click \"Visualize Library\" in left nav\r\n2) Click \"Create
visualization\" button. \r\n3) Click \"Legacy\" tab\r\n4) Click
\"Aggregation based\"\r\n5) Click \"Area\"\r\n6) Click web logs sample
data view\r\n7) Click \"Save\"\r\n8) Set title\r\n9) Under \"Add to
dashboard\", click \"New\", click save\r\n10) save dashboard. Notice how
dashboard still has unsaved changes.\r\n\r\n8.16 and 8.17 required a
[new\r\ncommit](https://github.com/elastic/kibana/pull/211054/commits/1fd631c5a30046b5ab2f63948174ec29bac6fd84)\r\nto
resolve the issue by updating the `linkedToLibrary` to
ignore\r\nundefined values.\r\n\r\nThis PR fixes the issue for the other
branches that have already
been\r\nmerged.\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"6789c946885fe0b6a2e57e056831f1ff25156f73"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
…le to dashboard (elastic#211264)

Follow up to elastic#210125

[8.16](elastic#211057) and
[8.17](elastic#211054) backports for
elastic#210125 were failing functional
test
https://github.com/elastic/kibana/blob/8.17/test/functional/apps/dashboard/group1/dashboard_unsaved_listing.ts#L142.
The functional test adds a by-value and by-reference legacy
visualization to a new dashboard. Upon saving the dashboard, the
dashboard still showed unsaved changes.

The reason this test did not fail main and other branches is that
elastic#208116 removed the "by-value"
part of the test (since its no longer possible to add a by-value legacy
visualization from within a dashboard). It is still possible to recreate
the issue in main with the following steps
1) Click "Visualize Library" in left nav
2) Click "Create visualization" button. 
3) Click "Legacy" tab
4) Click "Aggregation based"
5) Click "Area"
6) Click web logs sample data view
7) Click "Save"
8) Set title
9) Under "Add to dashboard", click "New", click save
10) save dashboard. Notice how dashboard still has unsaved changes.

8.16 and 8.17 required a [new
commit](elastic@1fd631c)
to resolve the issue by updating the `linkedToLibrary` to ignore
undefined values.

This PR fixes the issue for the other branches that have already been
merged.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Embedding Embedding content via iFrame release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v8.19.0 v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants