Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions static/app/components/searchQueryBuilder/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4147,9 +4147,7 @@ describe('SearchQueryBuilder', () => {
{organization: {features: ['search-query-builder-case-insensitivity']}}
);

expect(
await screen.findByRole('button', {name: 'Toggle case sensitivity'})
).toBeInTheDocument();
expect(await screen.findByRole('button', {name: 'Match case'})).toBeInTheDocument();
});
});

Expand Down
33 changes: 20 additions & 13 deletions static/app/components/searchQueryBuilder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import {useContext, useLayoutEffect} from 'react';
import {css} from '@emotion/react';
import styled from '@emotion/styled';

import {Button} from 'sentry/components/core/button';
import {Input} from 'sentry/components/core/input';
import {Button} from '@sentry/scraps/button';
import {Input} from '@sentry/scraps/input';
import {Tooltip} from '@sentry/scraps/tooltip';

import {
SearchQueryBuilderContext,
SearchQueryBuilderProvider,
Expand Down Expand Up @@ -198,21 +200,26 @@ function ActionButtons({
return null;
}

const isCaseInsensitive = caseInsensitive === 1;
const caseInsensitiveLabel = isCaseInsensitive ? t('Match case') : t('Ignore case');

return (
<ButtonsWrapper ref={ref}>
{trailingItems}
{defined(onCaseInsensitiveClick) && hasCaseSensitiveSearch ? (
<ActionButton
aria-label={t('Toggle case sensitivity')}
aria-pressed={caseInsensitive === 1}
size="zero"
icon={<IconCase color={caseInsensitive ? 'active' : 'subText'} />}
borderless
active={caseInsensitive === 1}
onClick={() => {
onCaseInsensitiveClick?.(caseInsensitive === 1 ? null : 1);
}}
/>
<Tooltip title={caseInsensitiveLabel}>
<ActionButton
aria-label={caseInsensitiveLabel}
aria-pressed={isCaseInsensitive}
size="zero"
icon={<IconCase color={isCaseInsensitive ? 'subText' : 'active'} />}
borderless
active={!isCaseInsensitive}
onClick={() => {
onCaseInsensitiveClick?.(isCaseInsensitive ? null : 1);
}}
/>
</Tooltip>
) : null}
{query === '' ? null : (
<ActionButton
Expand Down
2 changes: 1 addition & 1 deletion static/app/views/explore/logs/logsTab.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ describe('LogsTabContent', () => {
expect(eventTableMock).toHaveBeenCalled();

const caseInsensitiveBtn = await screen.findByRole('button', {
name: 'Toggle case sensitivity',
name: 'Ignore case',
});
await userEvent.click(caseInsensitiveBtn);

Expand Down
6 changes: 3 additions & 3 deletions static/app/views/explore/spans/spansTab.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ describe('SpansTabContent', () => {
);

const caseSensitivityToggle = screen.getByRole('button', {
name: 'Toggle case sensitivity',
name: 'Ignore case',
});
expect(caseSensitivityToggle).toBeInTheDocument();
});
Expand All @@ -275,7 +275,7 @@ describe('SpansTabContent', () => {
);

const caseSensitivityToggle = screen.getByRole('button', {
name: 'Toggle case sensitivity',
name: 'Ignore case',
});
expect(caseSensitivityToggle).toBeInTheDocument();
await userEvent.click(caseSensitivityToggle);
Expand Down Expand Up @@ -304,7 +304,7 @@ describe('SpansTabContent', () => {
);

const caseSensitivityToggle = screen.getByRole('button', {
name: 'Toggle case sensitivity',
name: 'Ignore case',
});
expect(caseSensitivityToggle).toBeInTheDocument();
await userEvent.click(caseSensitivityToggle);
Expand Down
Loading