Skip to content

Commit

Permalink
Fix edit button label
Browse files Browse the repository at this point in the history
  • Loading branch information
dokmic committed Oct 27, 2022
1 parent b9105f8 commit ba705a9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@ export function EmbeddablePanelError({
[editPanelAction, embeddable, isEditable]
);

const title = embeddable.getTitle();
const actionDisplayName = useMemo(
const label = useMemo(
() => editPanelAction?.getDisplayName({ embeddable }),
[editPanelAction, embeddable]
);
const label = useMemo(
const title = useMemo(() => embeddable.getTitle(), [embeddable]);
const ariaLabel = useMemo(
() =>
!title
? actionDisplayName
? label
: i18n.translate('embeddableApi.panel.editPanel.displayName', {
defaultMessage: 'Edit {value}',
values: { value: title },
}),
[title, actionDisplayName]
[label, title]
);

useEffect(() => {
Expand Down Expand Up @@ -77,7 +77,7 @@ export function EmbeddablePanelError({
layout="vertical"
actions={
isEditable && (
<EuiButtonEmpty onClick={handleErrorClick} size="s">
<EuiButtonEmpty aria-label={ariaLabel} onClick={handleErrorClick} size="s">
{label}
</EuiButtonEmpty>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class VisualizeEmbeddableFactory

public getDisplayName() {
return i18n.translate('visualizations.displayName', {
defaultMessage: 'Visualization',
defaultMessage: 'visualization',
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class EmbeddableFactory implements EmbeddableFactoryDefinition {

getDisplayName() {
return i18n.translate('xpack.lens.embeddableDisplayName', {
defaultMessage: 'lens',
defaultMessage: 'Lens',
});
}

Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -6141,7 +6141,7 @@
"visualizations.deprecatedTag": "Déclassé",
"visualizations.disabledLabVisualizationLink": "Lire la documentation",
"visualizations.disabledLabVisualizationMessage": "Veuillez activer le mode lab dans les paramètres avancés pour consulter les visualisations lab.",
"visualizations.displayName": "Visualisation",
"visualizations.displayName": "visualisation",
"visualizations.editor.createBreadcrumb": "Créer",
"visualizations.editor.defaultEditBreadcrumbText": "Modifier la visualisation",
"visualizations.embeddable.inspectorTitle": "Inspecteur",
Expand Down Expand Up @@ -17452,7 +17452,7 @@
"xpack.lens.embeddable.missingTimeRangeParam.longMessage": "La propriété timeRange est requise pour cette configuration.",
"xpack.lens.embeddable.missingTimeRangeParam.shortMessage": "Propriété timeRange manquante",
"xpack.lens.embeddable.moreErrors": "Effectuez des modifications dans l'éditeur Lens pour afficher plus d'erreurs",
"xpack.lens.embeddableDisplayName": "lens",
"xpack.lens.embeddableDisplayName": "Lens",
"xpack.lens.endValue.nearest": "La plus proche",
"xpack.lens.endValue.none": "Masquer",
"xpack.lens.endValue.zero": "Zéro",
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -17460,7 +17460,7 @@
"xpack.lens.embeddable.missingTimeRangeParam.longMessage": "给定配置需要包含 timeRange 属性",
"xpack.lens.embeddable.missingTimeRangeParam.shortMessage": "缺少 timeRange 属性",
"xpack.lens.embeddable.moreErrors": "在 Lens 编辑器中编辑以查看更多错误",
"xpack.lens.embeddableDisplayName": "lens",
"xpack.lens.embeddableDisplayName": "Lens",
"xpack.lens.endValue.nearest": "最近",
"xpack.lens.endValue.none": "隐藏",
"xpack.lens.endValue.zero": "零",
Expand Down

0 comments on commit ba705a9

Please sign in to comment.