diff --git a/docs/user/canvas.asciidoc b/docs/user/canvas.asciidoc index d36fa3234b94e..be69c0236cd50 100644 --- a/docs/user/canvas.asciidoc +++ b/docs/user/canvas.asciidoc @@ -139,7 +139,7 @@ Add a panel that you saved in *Visualize Library* to your workpad. * *Edit Visualization* — Opens the visualization editor so that you can edit the panel. -* *Edit panel settings* — Allows you to change the panel title, panel description, and panel time range. +* *Edit panel settings* — Allows you to change the title, description, and time range for the panel. * *Inspect* — Allows you to drill down into the panel data. diff --git a/docs/user/dashboard/aggregation-based.asciidoc b/docs/user/dashboard/aggregation-based.asciidoc index 7d5e4f93bba88..9098ea6265291 100644 --- a/docs/user/dashboard/aggregation-based.asciidoc +++ b/docs/user/dashboard/aggregation-based.asciidoc @@ -238,9 +238,9 @@ To save the panel to the dashboard: .. In the panel header, click *No Title*. -.. On the *Customize panel* window, select *Show panel title*. +.. On the *Panel settings* window, select *Show title*. -.. Enter the *Panel title*, then click *Save*. +.. Enter the *Title*, then click *Save*. diff --git a/docs/user/dashboard/dashboard.asciidoc b/docs/user/dashboard/dashboard.asciidoc index cb073c7e9c9d8..a6a540acfc973 100644 --- a/docs/user/dashboard/dashboard.asciidoc +++ b/docs/user/dashboard/dashboard.asciidoc @@ -158,9 +158,9 @@ If you created the panel from the dashboard: .. In the panel header, click *No Title*. -.. On the *Customize panel* window, select *Show panel title*. +.. On the *Panel settings* window, select *Show title*. -.. Enter the *Panel title*, then click *Save*. +.. Enter the *Title*, then click *Save*. If you created the panel from the *Visualize Library*: @@ -236,9 +236,9 @@ To save the panel to the dashboard: .. In the panel header, click *No Title*. -.. On the *Customize panel* window, select *Show panel title*. +.. On the *Panel settings* window, select *Show title*. -.. Enter the *Panel title*, then click *Save*. +.. Enter the *Title*, then click *Save*. [float] [[add-image]] @@ -293,7 +293,7 @@ To make changes to the panel, use the panel menu options. + To make changes without changing the original version, open the panel menu, then click *More > Unlink from library*. -* *Edit panel settings* — Opens the *Edit panel settings* window to change the *Panel title*, *Panel description*, and *Panel time range*. +* *Edit panel settings* — Opens the *Panel settings* window to change the *title*, *description*, and *time range*. * *More > Replace panel* — Opens the *Visualize Library* so you can select a new panel to replace the existing panel. diff --git a/docs/user/dashboard/lens.asciidoc b/docs/user/dashboard/lens.asciidoc index 3467276ce236d..ff6ffe230f7e7 100644 --- a/docs/user/dashboard/lens.asciidoc +++ b/docs/user/dashboard/lens.asciidoc @@ -380,9 +380,9 @@ To save the panel to the dashboard: .. In the panel header, click *No Title*. -.. On the *Customize panel* window, select *Show panel title*. +.. On the *Panel settings* window, select *Show title*. -.. Enter the *Panel title*, then click *Save*. +.. Enter the *Title*, then click *Save*. [float] [[lens-faq]] diff --git a/docs/user/dashboard/timelion.asciidoc b/docs/user/dashboard/timelion.asciidoc index 7e5b753973ea2..f491167acda0b 100644 --- a/docs/user/dashboard/timelion.asciidoc +++ b/docs/user/dashboard/timelion.asciidoc @@ -271,9 +271,9 @@ To save the panel to the dashboard: .. In the panel header, click *No Title*. -.. On the *Customize panel* window, select *Show panel title*. +.. On the *Panel settings* window, select *Show title*. -.. Enter the *Panel title*, then click *Save*. +.. Enter the *Title*, then click *Save*. [float] [[timelion-tutorial-create-visualizations-with-mathematical-functions]] @@ -406,9 +406,9 @@ To save the panel to the dashboard: .. In the panel header, click *No Title*. -.. On the *Customize panel* window, select *Show panel title*. +.. On the *Panel settings* window, select *Show title*. -.. Enter the *Panel title*, then click *Save*. +.. Enter the *Title*, then click *Save*. [float] [[timelion-tutorial-create-visualizations-withconditional-logic-and-tracking-trends]] @@ -594,8 +594,8 @@ To save the panel to the dashboard: .. In the panel header, click *No Title*. -.. On the *Customize panel* window, select *Show panel title*. +.. On the *Panel settings* window, select *Show title*. -.. Enter the *Panel title*, then click *Save*. +.. Enter the *Title*, then click *Save*. For more information about *Timelion* conditions, refer to https://www.elastic.co/blog/timeseries-if-then-else-with-timelion[I have but one .condition()]. diff --git a/docs/user/dashboard/tsvb.asciidoc b/docs/user/dashboard/tsvb.asciidoc index d725a82d74b65..f266e9a9cc331 100644 --- a/docs/user/dashboard/tsvb.asciidoc +++ b/docs/user/dashboard/tsvb.asciidoc @@ -184,9 +184,9 @@ To save the panel to the dashboard: .. In the panel header, click *No Title*. -.. On the *Customize panel* window, select *Show panel title*. +.. On the *Panel settings* window, select *Show title*. -.. Enter the *Panel title*, then click *Save*. +.. Enter the *Title*, then click *Save*. [float] [[tsvb-faq]] @@ -304,4 +304,4 @@ For other types of month over month calculations, use <> o Calculating the duration between the start and end of an event is unsupported in *TSVB* because *TSVB* requires correlation between different time periods. *TSVB* requires that the duration is pre-calculated. -==== \ No newline at end of file +==== diff --git a/docs/user/dashboard/tutorial-create-a-dashboard-of-lens-panels.asciidoc b/docs/user/dashboard/tutorial-create-a-dashboard-of-lens-panels.asciidoc index 20912bf9d679a..0c183b91fc495 100644 --- a/docs/user/dashboard/tutorial-create-a-dashboard-of-lens-panels.asciidoc +++ b/docs/user/dashboard/tutorial-create-a-dashboard-of-lens-panels.asciidoc @@ -143,7 +143,7 @@ Since you removed the axis labels, add a panel title: . Open the panel menu, then select *Edit panel settings*. -. In the *Panel title* field, enter `Median of bytes`, then click *Save*. +. In the *Title* field, enter `Median of bytes`, then click *Save*. + [role="screenshot"] image::images/lens_lineChartMetricOverTime_8.4.0.png[Line chart that displays metric data over time] @@ -247,7 +247,7 @@ Add a panel title: . Open the panel menu, then select *Edit panel settings*. -. In the *Panel title* field, enter `Sum of bytes from large requests`, then click *Save*. +. In the *Title* field, enter `Sum of bytes from large requests`, then click *Save*. [discrete] [[histogram]] @@ -280,7 +280,7 @@ Add a panel title: . Open the panel menu, then select *Edit panel settings*. -. In the *Panel title* field, enter `Website traffic`, then click *Save*. +. In the *Title* field, enter `Website traffic`, then click *Save*. [discrete] [[treemap]] @@ -344,7 +344,7 @@ Add a panel title: . Open the panel menu, then select *Edit panel settings*. -. In the *Panel title* field, enter `Page views by location and referrer`, then click *Save*. +. In the *Title* field, enter `Page views by location and referrer`, then click *Save*. [float] [[arrange-the-lens-panels]] diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx index 49e5b27d36706..75c666d4e2903 100644 --- a/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx +++ b/src/plugins/embeddable/public/lib/embeddables/embeddable.tsx @@ -19,15 +19,14 @@ import { EmbeddableInput, ViewMode } from '../../../common/types'; import { genericEmbeddableInputIsEqual, omitGenericEmbeddableInput } from './diff_embeddable_input'; function getPanelTitle(input: EmbeddableInput, output: EmbeddableOutput) { - return input.hidePanelTitles ? '' : input.title === undefined ? output.defaultTitle : input.title; + if (input.hidePanelTitles) return ''; + return input.title ?? output.defaultTitle; } function getPanelDescription(input: EmbeddableInput, output: EmbeddableOutput) { - return input.hidePanelTitles - ? '' - : input.description === undefined - ? output.defaultDescription - : input.description; + if (input.hidePanelTitles) return ''; + return input.description ?? output.defaultDescription; } + export abstract class Embeddable< TEmbeddableInput extends EmbeddableInput = EmbeddableInput, TEmbeddableOutput extends EmbeddableOutput = EmbeddableOutput, @@ -192,11 +191,11 @@ export abstract class Embeddable< } public getTitle(): string { - return this.output.title || ''; + return this.output.title ?? ''; } public getDescription(): string { - return this.output.description || ''; + return this.output.description ?? ''; } /** diff --git a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_panel/customize_panel_editor.tsx b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_panel/customize_panel_editor.tsx index 94a2c0ead1bb1..0c19452867038 100644 --- a/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_panel/customize_panel_editor.tsx +++ b/src/plugins/embeddable/public/lib/panel/panel_header/panel_actions/customize_panel/customize_panel_editor.tsx @@ -107,7 +107,7 @@ export const CustomizePanelEditor = (props: CustomizePanelProps) => { id="hideTitle" label={ } @@ -118,7 +118,7 @@ export const CustomizePanelEditor = (props: CustomizePanelProps) => { label={ } labelAppend={ @@ -130,7 +130,7 @@ export const CustomizePanelEditor = (props: CustomizePanelProps) => { aria-label={i18n.translate( 'embeddableApi.customizePanel.flyout.optionsMenuForm.resetCustomTitleButtonAriaLabel', { - defaultMessage: 'Reset panel title', + defaultMessage: 'Reset title', } )} > @@ -162,7 +162,7 @@ export const CustomizePanelEditor = (props: CustomizePanelProps) => { label={ } labelAppend={ @@ -176,7 +176,7 @@ export const CustomizePanelEditor = (props: CustomizePanelProps) => { aria-label={i18n.translate( 'embeddableApi.customizePanel.flyout.optionsMenuForm.resetCustomDescriptionButtonAriaLabel', { - defaultMessage: 'Reset panel description', + defaultMessage: 'Reset description', } )} > @@ -220,7 +220,7 @@ export const CustomizePanelEditor = (props: CustomizePanelProps) => { id="showCustomTimeRange" label={ } @@ -233,7 +233,7 @@ export const CustomizePanelEditor = (props: CustomizePanelProps) => { label={ } > @@ -259,7 +259,7 @@ export const CustomizePanelEditor = (props: CustomizePanelProps) => {