Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpeihl committed Feb 2, 2023
1 parent 6aa6987 commit de19d09
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 39 deletions.
2 changes: 1 addition & 1 deletion docs/user/canvas.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions docs/user/dashboard/aggregation-based.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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*.



10 changes: 5 additions & 5 deletions docs/user/dashboard/dashboard.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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*:

Expand Down Expand Up @@ -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]]
Expand Down Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions docs/user/dashboard/lens.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
12 changes: 6 additions & 6 deletions docs/user/dashboard/timelion.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down Expand Up @@ -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]]
Expand Down Expand Up @@ -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()].
6 changes: 3 additions & 3 deletions docs/user/dashboard/tsvb.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down Expand Up @@ -304,4 +304,4 @@ For other types of month over month calculations, use <<timelion, *Timelion*>> 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.
====
====
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]]
Expand Down Expand Up @@ -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]]
Expand Down Expand Up @@ -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]]
Expand Down
15 changes: 7 additions & 8 deletions src/plugins/embeddable/public/lib/embeddables/embeddable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 ?? '';
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const CustomizePanelEditor = (props: CustomizePanelProps) => {
id="hideTitle"
label={
<FormattedMessage
defaultMessage="Show panel title"
defaultMessage="Show title"
id="embeddableApi.customizePanel.flyout.optionsMenuForm.showTitle"
/>
}
Expand All @@ -118,7 +118,7 @@ export const CustomizePanelEditor = (props: CustomizePanelProps) => {
label={
<FormattedMessage
id="embeddableApi.customizePanel.flyout.optionsMenuForm.panelTitleFormRowLabel"
defaultMessage="Panel title"
defaultMessage="Title"
/>
}
labelAppend={
Expand All @@ -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',
}
)}
>
Expand Down Expand Up @@ -162,7 +162,7 @@ export const CustomizePanelEditor = (props: CustomizePanelProps) => {
label={
<FormattedMessage
id="embeddableApi.customizePanel.flyout.optionsMenuForm.panelDescriptionFormRowLabel"
defaultMessage="Panel description"
defaultMessage="Description"
/>
}
labelAppend={
Expand All @@ -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',
}
)}
>
Expand Down Expand Up @@ -220,7 +220,7 @@ export const CustomizePanelEditor = (props: CustomizePanelProps) => {
id="showCustomTimeRange"
label={
<FormattedMessage
defaultMessage="Apply custom time range to panel"
defaultMessage="Apply custom time range"
id="embeddableApi.customizePanel.flyout.optionsMenuForm.showCustomTimeRangeSwitch"
/>
}
Expand All @@ -233,7 +233,7 @@ export const CustomizePanelEditor = (props: CustomizePanelProps) => {
label={
<FormattedMessage
id="embeddableApi.customizePanel.flyout.optionsMenuForm.panelTimeRangeFormRowLabel"
defaultMessage="Panel time range"
defaultMessage="Time range"
/>
}
>
Expand All @@ -259,7 +259,7 @@ export const CustomizePanelEditor = (props: CustomizePanelProps) => {
<h2>
<FormattedMessage
id="embeddableApi.customizePanel.flyout.title"
defaultMessage="Edit panel settings"
defaultMessage="Panel settings"
/>
</h2>
</EuiTitle>
Expand Down

0 comments on commit de19d09

Please sign in to comment.