Explore: Translate table title in runtime to get a better test id (#83236)

* Explore: Translate table title in runtime to get a better test id

* Fix escaping

* Retrigger the build

* Prettify
This commit is contained in:
Piotr Jamróz
2024-02-28 09:19:20 +01:00
committed by GitHub
parent 3901077f39
commit ecb8447a7f

View File

@@ -7,7 +7,7 @@ import { getTemplateSrv } from '@grafana/runtime';
import { TimeZone } from '@grafana/schema'; import { TimeZone } from '@grafana/schema';
import { Table, AdHocFilterItem, PanelChrome, withTheme2, Themeable2 } from '@grafana/ui'; import { Table, AdHocFilterItem, PanelChrome, withTheme2, Themeable2 } from '@grafana/ui';
import { config } from 'app/core/config'; import { config } from 'app/core/config';
import { t, Trans } from 'app/core/internationalization'; import { t } from 'app/core/internationalization';
import { import {
hasDeprecatedParentRowIndex, hasDeprecatedParentRowIndex,
migrateFromParentRowIndexToNestedFrames, migrateFromParentRowIndexToNestedFrames,
@@ -59,11 +59,9 @@ export class TableContainer extends PureComponent<Props> {
name = data.refId || `${i}`; name = data.refId || `${i}`;
} }
return name ? ( return name
<Trans i18nKey="explore.table.title-with-name">Table - {{ name }}</Trans> ? t('explore.table.title-with-name', 'Table - {{name}}', { name, interpolation: { escapeValue: false } })
) : ( : t('explore.table.title', 'Table');
t('explore.table.title', 'Table')
);
} }
render() { render() {