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

[Dashboard] Default to saved object description when panel description is not provided #181177

Merged

Conversation

Heenawter
Copy link
Contributor

@Heenawter Heenawter commented Apr 18, 2024

Closes #181172

Summary

This PR fixes a bug where panels were not showing descriptions from library items - this is because (1) we weren't providing the defaultPanelDescription as part of the default embeddable API and (2) the panel header was not defaulting to the defaultPanelDescription when a panel description was not provided.

Because of (1), the panel settings flyout showed a blank description despite having the correct logic for defaulting to the default panel description - that is why the tests in customize_panel_editor.test.tsx passed but it didn't work in production.

Checklist

For maintainers

@Heenawter Heenawter changed the title Default to SO description if no panel description [Dashboard] Default to saved object description when panel description is not provided Apr 18, 2024
@Heenawter Heenawter self-assigned this Apr 18, 2024
@Heenawter
Copy link
Contributor Author

/ci

@Heenawter Heenawter added regression Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas loe:small Small Level of Effort impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. backport:prev-minor Backport to the previous minor version (i.e. one version back from main) release_note:fix bug Fixes for quality problems that affect the customer experience notabug When the issue is closed this label Indicates that it wasn't a bug and removed notabug When the issue is closed this label Indicates that it wasn't a bug labels Apr 18, 2024
@Heenawter
Copy link
Contributor Author

/ci

Comment on lines +591 to +593
const titleObjects = await this.find.allByCssSelector(
'[data-test-subj=embeddablePanelTitleInner] .embPanel__titleText'
);
Copy link
Contributor Author

@Heenawter Heenawter Apr 18, 2024

Choose a reason for hiding this comment

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

Now that the saved object description is being used, the titles for the panels used in the panel_clone and dashboard_clone had extra white space when fetched (due to the icon being included in the previous selected span) - we no longer have to worry about this if we modify how we grab the panel title to only include the panel title and not the description icon.

Note that the panel_clone and dashboard_clone tests should have started failing as part of the #178139, but they didn't because we weren't setting the default panel description for the saved objects used in these tests. So, that is why they started failing here and this change was required.

@Heenawter Heenawter marked this pull request as ready for review April 18, 2024 22:23
@Heenawter Heenawter requested a review from a team as a code owner April 18, 2024 22:23
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

LGTM
code review only

@botelastic botelastic bot added the Feature:Embedding Embedding content via iFrame label Apr 20, 2024
@Heenawter Heenawter enabled auto-merge (squash) April 22, 2024 13:35
@Heenawter Heenawter merged commit a41177f into elastic:main Apr 22, 2024
16 checks passed
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

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 453 454 +1

Async chunks

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

id before after diff
presentationPanel 8.9KB 9.0KB +53.0B

Page load bundle

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

id before after diff
embeddable 66.3KB 66.5KB +148.0B
Unknown metric groups

API count

id before after diff
embeddable 559 560 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @Heenawter

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Apr 22, 2024
…n is not provided (elastic#181177)

Closes elastic#181172

## Summary

This PR fixes a bug where panels were not showing descriptions from
library items - this is because (1) we weren't providing the
`defaultPanelDescription` as part of the default embeddable API and (2)
the panel header was not defaulting to the `defaultPanelDescription`
when a panel description was not provided.

Because of (1), the panel settings flyout showed a blank description
**despite** having the correct logic for defaulting to the default panel
description - that is why the tests in `customize_panel_editor.test.tsx`
passed but it didn't work in production.

### Checklist

- [x] [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

### 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)

(cherry picked from commit a41177f)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.14

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Apr 22, 2024
…cription is not provided (#181177) (#181333)

# Backport

This will backport the following commits from `main` to `8.14`:
- [[Dashboard] Default to saved object description when panel
description is not provided
(#181177)](#181177)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Hannah
Mudge","email":"Heenawter@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-04-22T14:52:46Z","message":"[Dashboard]
Default to saved object description when panel description is not
provided (#181177)\n\nCloses
#181172
Summary\r\n\r\nThis PR fixes a bug where panels were not showing
descriptions from\r\nlibrary items - this is because (1) we weren't
providing the\r\n`defaultPanelDescription` as part of the default
embeddable API and (2)\r\nthe panel header was not defaulting to the
`defaultPanelDescription`\r\nwhen a panel description was not
provided.\r\n\r\nBecause of (1), the panel settings flyout showed a
blank description\r\n**despite** having the correct logic for defaulting
to the default panel\r\ndescription - that is why the tests in
`customize_panel_editor.test.tsx`\r\npassed but it didn't work in
production.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"a41177f32cc1d02a425f70979694d8c160195649","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Feature:Embedding","regression","release_note:fix","Team:Presentation","loe:small","impact:high","backport:prev-minor","v8.15.0"],"title":"[Dashboard]
Default to saved object description when panel description is not
provided","number":181177,"url":"#181177
Default to saved object description when panel description is not
provided (#181177)\n\nCloses
#181172
Summary\r\n\r\nThis PR fixes a bug where panels were not showing
descriptions from\r\nlibrary items - this is because (1) we weren't
providing the\r\n`defaultPanelDescription` as part of the default
embeddable API and (2)\r\nthe panel header was not defaulting to the
`defaultPanelDescription`\r\nwhen a panel description was not
provided.\r\n\r\nBecause of (1), the panel settings flyout showed a
blank description\r\n**despite** having the correct logic for defaulting
to the default panel\r\ndescription - that is why the tests in
`customize_panel_editor.test.tsx`\r\npassed but it didn't work in
production.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"a41177f32cc1d02a425f70979694d8c160195649"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/181177","number":181177,"mergeCommit":{"message":"[Dashboard]
Default to saved object description when panel description is not
provided (#181177)\n\nCloses
#181172
Summary\r\n\r\nThis PR fixes a bug where panels were not showing
descriptions from\r\nlibrary items - this is because (1) we weren't
providing the\r\n`defaultPanelDescription` as part of the default
embeddable API and (2)\r\nthe panel header was not defaulting to the
`defaultPanelDescription`\r\nwhen a panel description was not
provided.\r\n\r\nBecause of (1), the panel settings flyout showed a
blank description\r\n**despite** having the correct logic for defaulting
to the default panel\r\ndescription - that is why the tests in
`customize_panel_editor.test.tsx`\r\npassed but it didn't work in
production.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"a41177f32cc1d02a425f70979694d8c160195649"}}]}]
BACKPORT-->

Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
Heenawter added a commit to Heenawter/kibana that referenced this pull request Apr 22, 2024
…n is not provided (elastic#181177)

Closes elastic#181172

## Summary

This PR fixes a bug where panels were not showing descriptions from
library items - this is because (1) we weren't providing the
`defaultPanelDescription` as part of the default embeddable API and (2)
the panel header was not defaulting to the `defaultPanelDescription`
when a panel description was not provided.

Because of (1), the panel settings flyout showed a blank description
**despite** having the correct logic for defaulting to the default panel
description - that is why the tests in `customize_panel_editor.test.tsx`
passed but it didn't work in production.

### Checklist

- [x] [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

### 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)

(cherry picked from commit a41177f)
@Heenawter
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.13

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

Questions ?

Please refer to the Backport tool documentation

Heenawter added a commit that referenced this pull request Apr 24, 2024
…cription is not provided (#181177) (#181354)

# Backport

This will backport the following commits from `main` to `8.13`:
- [[Dashboard] Default to saved object description when panel
description is not provided
(#181177)](#181177)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Hannah
Mudge","email":"Heenawter@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-04-22T14:52:46Z","message":"[Dashboard]
Default to saved object description when panel description is not
provided (#181177)\n\nCloses
#181172
Summary\r\n\r\nThis PR fixes a bug where panels were not showing
descriptions from\r\nlibrary items - this is because (1) we weren't
providing the\r\n`defaultPanelDescription` as part of the default
embeddable API and (2)\r\nthe panel header was not defaulting to the
`defaultPanelDescription`\r\nwhen a panel description was not
provided.\r\n\r\nBecause of (1), the panel settings flyout showed a
blank description\r\n**despite** having the correct logic for defaulting
to the default panel\r\ndescription - that is why the tests in
`customize_panel_editor.test.tsx`\r\npassed but it didn't work in
production.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"a41177f32cc1d02a425f70979694d8c160195649","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Feature:Embedding","regression","release_note:fix","Team:Presentation","loe:small","impact:high","backport:prev-minor","v8.14.0","v8.15.0"],"number":181177,"url":"https://github.com/elastic/kibana/pull/181177","mergeCommit":{"message":"[Dashboard]
Default to saved object description when panel description is not
provided (#181177)\n\nCloses
#181172
Summary\r\n\r\nThis PR fixes a bug where panels were not showing
descriptions from\r\nlibrary items - this is because (1) we weren't
providing the\r\n`defaultPanelDescription` as part of the default
embeddable API and (2)\r\nthe panel header was not defaulting to the
`defaultPanelDescription`\r\nwhen a panel description was not
provided.\r\n\r\nBecause of (1), the panel settings flyout showed a
blank description\r\n**despite** having the correct logic for defaulting
to the default panel\r\ndescription - that is why the tests in
`customize_panel_editor.test.tsx`\r\npassed but it didn't work in
production.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"a41177f32cc1d02a425f70979694d8c160195649"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"8.14","label":"v8.14.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/181333","number":181333,"state":"MERGED","mergeCommit":{"sha":"aea09828f336324ce69a5601c84691b85269ad66","message":"[8.14]
[Dashboard] Default to saved object description when panel description
is not provided (#181177) (#181333)\n\n# Backport\n\nThis will backport
the following commits from `main` to `8.14`:\n- [[Dashboard] Default to
saved object description when panel\ndescription is not
provided\n(#181177)](https://github.com/elastic/kibana/pull/181177)\n\n<!---
Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Hannah\nMudge\",\"email\":\"Heenawter@users.noreply.github.com\"},\"sourceCommit\":{\"committedDate\":\"2024-04-22T14:52:46Z\",\"message\":\"[Dashboard]\nDefault
to saved object description when panel description is not\nprovided
(#181177)\\n\\nCloses\nhttps://github.com//issues/181172\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nThis
PR fixes a bug where panels were not showing\ndescriptions
from\\r\\nlibrary items - this is because (1) we weren't\nproviding
the\\r\\n`defaultPanelDescription` as part of the default\nembeddable
API and (2)\\r\\nthe panel header was not defaulting to
the\n`defaultPanelDescription`\\r\\nwhen a panel description was
not\nprovided.\\r\\n\\r\\nBecause of (1), the panel settings flyout
showed a\nblank description\\r\\n**despite** having the correct logic
for defaulting\nto the default panel\\r\\ndescription - that is why the
tests in\n`customize_panel_editor.test.tsx`\\r\\npassed but it didn't
work in\nproduction.\\r\\n\\r\\n### Checklist\\r\\n\\r\\n- [x] [Unit
or\nfunctional\\r\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\r\\nwere\nupdated
or added to match the most common scenarios\\r\\n\\r\\n\\r\\n###
For\nmaintainers\\r\\n\\r\\n- [ ] This was checked for breaking API
changes
and\nwas\n[labeled\\r\\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\",\"sha\":\"a41177f32cc1d02a425f70979694d8c160195649\",\"branchLabelMapping\":{\"^v8.15.0$\":\"main\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"bug\",\"Feature:Embedding\",\"regression\",\"release_note:fix\",\"Team:Presentation\",\"loe:small\",\"impact:high\",\"backport:prev-minor\",\"v8.15.0\"],\"title\":\"[Dashboard]\nDefault
to saved object description when panel description is
not\nprovided\",\"number\":181177,\"url\":\"#181177
to saved object description when panel description is not\nprovided
(#181177)\\n\\nCloses\nhttps://github.com//issues/181172\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nThis
PR fixes a bug where panels were not showing\ndescriptions
from\\r\\nlibrary items - this is because (1) we weren't\nproviding
the\\r\\n`defaultPanelDescription` as part of the default\nembeddable
API and (2)\\r\\nthe panel header was not defaulting to
the\n`defaultPanelDescription`\\r\\nwhen a panel description was
not\nprovided.\\r\\n\\r\\nBecause of (1), the panel settings flyout
showed a\nblank description\\r\\n**despite** having the correct logic
for defaulting\nto the default panel\\r\\ndescription - that is why the
tests in\n`customize_panel_editor.test.tsx`\\r\\npassed but it didn't
work in\nproduction.\\r\\n\\r\\n### Checklist\\r\\n\\r\\n- [x] [Unit
or\nfunctional\\r\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\r\\nwere\nupdated
or added to match the most common scenarios\\r\\n\\r\\n\\r\\n###
For\nmaintainers\\r\\n\\r\\n- [ ] This was checked for breaking API
changes
and\nwas\n[labeled\\r\\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\",\"sha\":\"a41177f32cc1d02a425f70979694d8c160195649\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v8.15.0\",\"branchLabelMappingKey\":\"^v8.15.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/181177\",\"number\":181177,\"mergeCommit\":{\"message\":\"[Dashboard]\nDefault
to saved object description when panel description is not\nprovided
(#181177)\\n\\nCloses\nhttps://github.com//issues/181172\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nThis
PR fixes a bug where panels were not showing\ndescriptions
from\\r\\nlibrary items - this is because (1) we weren't\nproviding
the\\r\\n`defaultPanelDescription` as part of the default\nembeddable
API and (2)\\r\\nthe panel header was not defaulting to
the\n`defaultPanelDescription`\\r\\nwhen a panel description was
not\nprovided.\\r\\n\\r\\nBecause of (1), the panel settings flyout
showed a\nblank description\\r\\n**despite** having the correct logic
for defaulting\nto the default panel\\r\\ndescription - that is why the
tests in\n`customize_panel_editor.test.tsx`\\r\\npassed but it didn't
work in\nproduction.\\r\\n\\r\\n### Checklist\\r\\n\\r\\n- [x] [Unit
or\nfunctional\\r\\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\\r\\nwere\nupdated
or added to match the most common scenarios\\r\\n\\r\\n\\r\\n###
For\nmaintainers\\r\\n\\r\\n- [ ] This was checked for breaking API
changes
and\nwas\n[labeled\\r\\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\",\"sha\":\"a41177f32cc1d02a425f70979694d8c160195649\"}}]}]\nBACKPORT-->\n\nCo-authored-by:
Hannah Mudge
<Heenawter@users.noreply.github.com>"}},{"branch":"main","label":"v8.15.0","labelRegex":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"#181177
Default to saved object description when panel description is not
provided (#181177)\n\nCloses
#181172
Summary\r\n\r\nThis PR fixes a bug where panels were not showing
descriptions from\r\nlibrary items - this is because (1) we weren't
providing the\r\n`defaultPanelDescription` as part of the default
embeddable API and (2)\r\nthe panel header was not defaulting to the
`defaultPanelDescription`\r\nwhen a panel description was not
provided.\r\n\r\nBecause of (1), the panel settings flyout showed a
blank description\r\n**despite** having the correct logic for defaulting
to the default panel\r\ndescription - that is why the tests in
`customize_panel_editor.test.tsx`\r\npassed but it didn't work in
production.\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common scenarios\r\n\r\n\r\n### For
maintainers\r\n\r\n- [ ] This was checked for breaking API changes and
was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"a41177f32cc1d02a425f70979694d8c160195649"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to the previous minor version (i.e. one version back from main) bug Fixes for quality problems that affect the customer experience Feature:Embedding Embedding content via iFrame impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:small Small Level of Effort regression release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v8.13.3 v8.14.0 v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dashboard] Descriptions not showing up on by-reference panels after upgrade
5 participants