dashboard Reset button disable#159430
Conversation
|
Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually? |
|
💚 CLA has been signed |
|
@AbrarAlHasan would you mind signing the CLA? If you do, I can kick off a build. |
Sure. I have Signed it |
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
|
@buildkite test this |
ThomThomson
left a comment
There was a problem hiding this comment.
Thank you for your contribution @AbrarAlHasan!
The reset button is actually meant to only reset to the default title. This allows the dashboard author to remove the custom title and fall back directly to the saved object title. To see this behaviour you'll need to use a panel linked to a library item (use the add from Library button on the Dashboard).
The way you've written this is equivalent to resetting to the last saved custom title, which can be done just by clicking cancel instead of save in the bottom of the flyout. I've made some suggested changes which make the buttons disabled when the current title / description is equal to the default title / description.
| onClick={() => { | ||
| setPanelTitle(embeddable.getInput().title ?? embeddable.getOutput().defaultTitle); | ||
| }} |
There was a problem hiding this comment.
This change should be undone: the reset button should always set it back to the default title.
| onClick={() => { | |
| setPanelTitle(embeddable.getInput().title ?? embeddable.getOutput().defaultTitle); | |
| }} | |
| onClick={() => setPanelTitle(embeddable.getOutput().defaultTitle)} |
| disabled={ | ||
| hideTitle || !editMode || embeddable.getInput().title != undefined | ||
| ? embeddable.getInput().title === panelTitle | ||
| : embeddable.getOutput().defaultTitle === panelTitle || panelTitle === '' | ||
| } |
There was a problem hiding this comment.
This should only be disabled if the panel title is equal to the default title:
| disabled={ | |
| hideTitle || !editMode || embeddable.getInput().title != undefined | |
| ? embeddable.getInput().title === panelTitle | |
| : embeddable.getOutput().defaultTitle === panelTitle || panelTitle === '' | |
| } | |
| disabled={ | |
| hideTitle || !editMode || embeddable.getOutput().defaultTitle === panelTitle | |
| } |
| setPanelDescription( | ||
| embeddable.getInput().description ?? embeddable.getOutput().defaultDescription | ||
| ); |
There was a problem hiding this comment.
This change should be undone: the reset button should always set it back to the default description.
| setPanelDescription( | |
| embeddable.getInput().description ?? embeddable.getOutput().defaultDescription | |
| ); | |
| setPanelDescription(embeddable.getOutput().defaultDescription); |
| disabled={ | ||
| hideTitle || !editMode || embeddable.getInput().description != undefined | ||
| ? embeddable.getInput().description === panelDescription | ||
| : embeddable.getOutput().defaultDescription === panelDescription || | ||
| panelDescription === '' | ||
| } |
There was a problem hiding this comment.
This should only be disabled if the panel description is equal to the default description:
| disabled={ | |
| hideTitle || !editMode || embeddable.getInput().description != undefined | |
| ? embeddable.getInput().description === panelDescription | |
| : embeddable.getOutput().defaultDescription === panelDescription || | |
| panelDescription === '' | |
| } | |
| disabled={ | |
| hideTitle || | |
| !editMode || | |
| embeddable.getOutput().defaultDescription === panelDescription | |
| } |
|
I apologize for the misunderstanding. Thank you for clarifying the intended behavior of the reset button. I will make the necessary changes to ensure that it only resets to the default title and functions as intended with panels linked to library items.I will incorporate these changes into the code to align with the intended behavior. |
|
buildkite test this |
|
buildkite test this |
💚 Build Succeeded
Metrics [docs]Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
|
@elasticmachine run elasticsearch-ci/docs |
* main: (199 commits) [Lens] Add custom formatter within the Lens editor (elastic#158468) [Uptime] Hide app if no data is available (elastic#159118) [CodeEditor] Add grok highlighting (elastic#159334) Expose decoded cloudId components from the cloud plugin's contract (elastic#159442) [Profiling] Use collector and symbolizer integrations in the add data page (elastic#159481) [Infrastructure UI] Hosts View: Unified Search bar with auto-refresh enabled (elastic#157011) [APM] Add feature flag for not available apm schema (elastic#158911) [Lens] Remove deprecated componentWillReceiveProps usage (elastic#159502) [api-docs] 2023-06-13 Daily api_docs build (elastic#159536) [data views] Use versioned router for REST routes (elastic#158608) [maps] fix geo line source not loaded unless maps application is opened (elastic#159432) [Enterprise Search][Search application]Fix Create Api key url (elastic#159519) [Security Solution] Increase timeout for indexing hosts (elastic#159518) dashboard Reset button disable (elastic#159430) [Security Solution] Unskip Endpoint API tests after package fix (elastic#159484) [Synthetics] adjust alert timing (elastic#159511) [ResponseOps][rule registry] Remove usages of `refresh: true` (elastic#159252) Revert "Remove unused package (elastic#158597)" [Serverless] Adding config to disable authentication on task manager background worker utilization API (elastic#159505) Remove unused package (elastic#158597) ...
Summary
Closes #159422
Summarize your PR. If it involves visual changes include a screenshot or gif.
Added Reset Disable for Title and Description.
Cases
Screen.Recording.2023-06-10.at.11.21.35.AM.1.mp4
](url)
For maintainers