mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[Search] update copy for try in console button, to Run in Console (#190412)
## Summary Updated the default copy for "Try in Console" to be "Run in Console" instead. ### Screenshots <img width="716" alt="image" src="https://github.com/user-attachments/assets/ccd102ec-4732-429f-bb7b-76c157481c09"> ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
This commit is contained in:
parent
193458417e
commit
be2b853062
5 changed files with 13 additions and 14 deletions
|
@ -73,7 +73,7 @@ describe('TryInConsoleButton', () => {
|
|||
const wrapper = render(<TryInConsoleButton {...defaultProps(props)} />);
|
||||
|
||||
expect(wrapper.getByTestId('tryInConsoleButton')).toBeTruthy();
|
||||
expect(wrapper.getByRole('button')).toHaveTextContent('Try in Console');
|
||||
expect(wrapper.getByRole('button')).toHaveTextContent('Run in Console');
|
||||
expect(mockLocatorUseUrl).toHaveBeenCalledWith(
|
||||
{
|
||||
loadFrom: 'data:text/plain,OIUQKgBA9A+gzgFwIYLkA',
|
||||
|
@ -87,7 +87,7 @@ describe('TryInConsoleButton', () => {
|
|||
const wrapper = render(<TryInConsoleButton {...defaultProps(props)} />);
|
||||
|
||||
expect(wrapper.getByTestId('tryInConsoleLink')).toBeTruthy();
|
||||
expect(wrapper.getByRole('button')).toHaveTextContent('Try in Console');
|
||||
expect(wrapper.getByRole('button')).toHaveTextContent('Run in Console');
|
||||
});
|
||||
it('renders null if dev tools are unavailable', async () => {
|
||||
const props: Partial<TryInConsoleButtonProps> = {
|
||||
|
@ -153,7 +153,7 @@ describe('TryInConsoleButton', () => {
|
|||
const props: Partial<TryInConsoleButtonProps> = { request: 'GET /_stats' };
|
||||
render(<TryInConsoleButton {...defaultProps(props)} />);
|
||||
|
||||
fireEvent.click(screen.getByText('Try in Console'));
|
||||
fireEvent.click(screen.getByText('Run in Console'));
|
||||
|
||||
expect(windowOpenSpy).toHaveBeenCalledTimes(1);
|
||||
expect(windowOpenSpy).toHaveBeenCalledWith('/app/test/dev_tools', '_blank', 'noreferrer');
|
||||
|
@ -161,7 +161,7 @@ describe('TryInConsoleButton', () => {
|
|||
it('can open in new tab without data', async () => {
|
||||
render(<TryInConsoleButton {...defaultProps({})} />);
|
||||
|
||||
fireEvent.click(screen.getByText('Try in Console'));
|
||||
fireEvent.click(screen.getByText('Run in Console'));
|
||||
|
||||
expect(mockLocatorUseUrl).toHaveBeenCalledWith({}, undefined, [undefined]);
|
||||
expect(windowOpenSpy).toHaveBeenCalledTimes(1);
|
||||
|
@ -175,7 +175,7 @@ describe('TryInConsoleButton', () => {
|
|||
/>
|
||||
);
|
||||
|
||||
fireEvent.click(screen.getByText('Try in Console'));
|
||||
fireEvent.click(screen.getByText('Run in Console'));
|
||||
|
||||
expect(windowOpenSpy).toHaveBeenCalledTimes(0);
|
||||
expect(mockConsole.openEmbeddedConsole).toHaveBeenCalledTimes(1);
|
||||
|
@ -185,7 +185,7 @@ describe('TryInConsoleButton', () => {
|
|||
mockConsole.isEmbeddedConsoleAvailable.mockReturnValue(false);
|
||||
render(<TryInConsoleButton {...defaultProps({ consolePlugin: mockConsole })} />);
|
||||
|
||||
fireEvent.click(screen.getByText('Try in Console'));
|
||||
fireEvent.click(screen.getByText('Run in Console'));
|
||||
|
||||
expect(windowOpenSpy).toHaveBeenCalledTimes(1);
|
||||
expect(mockConsole.openEmbeddedConsole).toHaveBeenCalledTimes(0);
|
||||
|
|
|
@ -16,7 +16,9 @@ import type { ConsolePluginStart } from '@kbn/console-plugin/public';
|
|||
import { i18n } from '@kbn/i18n';
|
||||
import { compressToEncodedURIComponent } from 'lz-string';
|
||||
|
||||
const TRY_IN_CONSOLE = i18n.translate('tryInConsole.button', { defaultMessage: 'Try in Console' });
|
||||
const RUN_IN_CONSOLE = i18n.translate('tryInConsole.button.text', {
|
||||
defaultMessage: 'Run in Console',
|
||||
});
|
||||
|
||||
export interface TryInConsoleButtonProps {
|
||||
request?: string;
|
||||
|
@ -32,7 +34,7 @@ export const TryInConsoleButton = ({
|
|||
application,
|
||||
consolePlugin,
|
||||
sharePlugin,
|
||||
content = TRY_IN_CONSOLE,
|
||||
content = RUN_IN_CONSOLE,
|
||||
showIcon = true,
|
||||
type = 'emptyButton',
|
||||
}: TryInConsoleButtonProps) => {
|
||||
|
@ -70,11 +72,11 @@ export const TryInConsoleButton = ({
|
|||
consolePlugin?.isEmbeddedConsoleAvailable?.()
|
||||
) {
|
||||
return i18n.translate('tryInConsole.embeddedConsoleButton.ariaLabel', {
|
||||
defaultMessage: 'Try in Console - opens in embedded console',
|
||||
defaultMessage: 'Run in Console - opens in embedded console',
|
||||
});
|
||||
}
|
||||
return i18n.translate('tryInConsole.inNewTab.button.ariaLabel', {
|
||||
defaultMessage: 'Try in Console - opens in a new tab',
|
||||
defaultMessage: 'Run in Console - opens in a new tab',
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -83,7 +85,7 @@ export const TryInConsoleButton = ({
|
|||
'aria-label': getAriaLabel(),
|
||||
onClick,
|
||||
};
|
||||
const iconType = showIcon ? 'popout' : undefined;
|
||||
const iconType = showIcon ? 'play' : undefined;
|
||||
|
||||
switch (type) {
|
||||
case 'link':
|
||||
|
|
|
@ -7697,7 +7697,6 @@
|
|||
"timelion.vis.invalidIntervalErrorMessage": "Format d'intervalle non valide.",
|
||||
"timelion.vis.selectIntervalHelpText": "Choisissez une option ou créez une valeur personnalisée. Exemples : 30s, 20m, 24h, 2d, 1w, 1M",
|
||||
"timelion.vis.selectIntervalPlaceholder": "Choisir un intervalle",
|
||||
"tryInConsole.button": "Essayer dans la console",
|
||||
"uiActions.actionPanel.more": "Plus",
|
||||
"uiActions.actionPanel.title": "Options",
|
||||
"uiActions.errors.incompatibleAction": "Action non compatible",
|
||||
|
|
|
@ -7691,7 +7691,6 @@
|
|||
"timelion.vis.invalidIntervalErrorMessage": "無効な間隔フォーマット。",
|
||||
"timelion.vis.selectIntervalHelpText": "オプションを選択するかカスタム値を作成します。例:30s、20m、24h、2d、1w、1M",
|
||||
"timelion.vis.selectIntervalPlaceholder": "間隔を選択",
|
||||
"tryInConsole.button": "コンソールで試す",
|
||||
"uiActions.actionPanel.more": "詳細",
|
||||
"uiActions.actionPanel.title": "オプション",
|
||||
"uiActions.errors.incompatibleAction": "操作に互換性がありません",
|
||||
|
|
|
@ -7704,7 +7704,6 @@
|
|||
"timelion.vis.invalidIntervalErrorMessage": "时间间隔格式无效。",
|
||||
"timelion.vis.selectIntervalHelpText": "选择选项或创建定制值。示例:30s、20m、24h、2d、1w、1M",
|
||||
"timelion.vis.selectIntervalPlaceholder": "选择时间间隔",
|
||||
"tryInConsole.button": "在 Console 中试用",
|
||||
"uiActions.actionPanel.more": "更多",
|
||||
"uiActions.actionPanel.title": "选项",
|
||||
"uiActions.errors.incompatibleAction": "操作不兼容",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue