-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 Usability] Unified panel options pane #148301
Conversation
…e' into unified-options-pane
…ibana into unified-options-pane
Unlike EuiTextField, EuiTextArea cannot receive undefined for the value prop. So we must coerce to a blank string.
Looks like I broke panel time ranges for embeddables in Canvas. Working on a fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything LGTM! Ran this locally and tested on a number of dashboards editing or not editing the panel titles and descriptions of a variety of embeddable types both by reference and by value.
Also looked through the code, and the changes are looking great, left a few very small nits.
Appreciate the FTR results - looks like it failed once due to an unrelated flaky test?
One thing - I'm not sure if this is just my computer, but I was having a bug where the unified options pane would animate open twice each time it was clicked:
@@ -21,6 +21,13 @@ import { genericEmbeddableInputIsEqual, omitGenericEmbeddableInput } from './dif | |||
function getPanelTitle(input: EmbeddableInput, output: EmbeddableOutput) { | |||
return input.hidePanelTitles ? '' : input.title === undefined ? output.defaultTitle : input.title; | |||
} | |||
function getPanelDescription(input: EmbeddableInput, output: EmbeddableOutput) { | |||
return input.hidePanelTitles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to make this slightly more understandable? Double ternaries can sometimes be head-scratching.
@@ -187,6 +195,10 @@ export abstract class Embeddable< | |||
return this.output.title || ''; | |||
} | |||
|
|||
public getDescription(): string { | |||
return this.output.description || ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super tiny nit: Would using ??
be more correct here? With this code, if the output.description
was already a blank string it would fail the check and return the fallback. The behaviour is completely the same - which is why this is a super tiny nit!
return new Promise<{ title: string | undefined; hideTitle?: boolean }>((resolve) => { | ||
const session = overlays.openModal( | ||
toMountPoint( | ||
<CustomizePanelModal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, I didn't realise this code lived right inside the embeddable panel before, nice clean up!
onClose(); | ||
}; | ||
|
||
const renderCustomTitleComponent = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually we could split these up into separate files, might be a good follow-up PR, especially as this window is only expected to grow!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. Happy to work on a follow-up PR for this. 👍
THIS is amazing! I have a few suggestions for the UI copy. For Controls, the settings page header is Since the header includes the word
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
async chunk count
History
To update your PR or re-run it, just comment with: |
## Summary Closes elastic#148563 After this [PR]( elastic#148301) being merged, it will be easier to add the description info icon and the custom data range to the new metric. For this reason we decided to also allow the panel title for now. On the next minors we are going to hide it from the panel and display all the aforementioned info on the viz title. <img width="988" alt="image" src="https://user-images.githubusercontent.com/17003240/215037834-0f556673-8628-484e-aa32-c34188fc7064.png"> ### 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
Fixes #146314
Summary
Adds a panel settings flyover to customize the title, description, and time range for panels in a dashboard. Replaces the "Customize panel title" and "Customize time range" options in the panel context menu with a "Customize panel setting" option.
It is not currently possible to provide description for by-value panels in a dashboard. By-reference panels can have a description, but it must be defined in the saved object. To enable support for custom descriptions on both by-value and by-reference panels this PR adds
description
anddefaultDescription
keys to theEmbeddableOutput
interface and agetDescription
method to theIEmbeddable
interface.CustomizePanelTitleAction
andCustomTimeRangeAction
have been replaced byCustomizePanelAction
.CustomTimeRangeAction
was moved from theui_actions_enhanced
plugin to theembeddable
plugin.CustomTimeRangeAction
was originally Basic licensed, but because of the license change from OSS to SSPL, we no longer need maintain these in separate codebases.Flaky test runner
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers