Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(CO-1458): let the user to search for multi words token from search bar #18

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
/lib
*.tgz
/LICENSES
.tool-versions
4 changes: 2 additions & 2 deletions src/components/search-bar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('Search bar', () => {
).toBeVisible();
});

it.each(['[Enter]', ',', '[Space]'])(
it.each(['[Enter]', ','])(
'should enable the search button when the user presses keyboard key (%s) to add the chips',
async (key) => {
const { user } = setup(<SearchBar />);
Expand Down Expand Up @@ -372,7 +372,7 @@ describe('Search bar', () => {
screen.getByRole('textbox', { name: `Search in ${app1SearchView.label}` }),
'key1'
);
await user.type(screen.getByRole('textbox'), ' ');
await user.type(screen.getByRole('textbox'), ',');
expect(localStorageStore[LOCAL_STORAGE_SEARCH_KEY]).toContainEqual({
value: 'key1',
label: 'key1',
Expand Down
5 changes: 2 additions & 3 deletions src/components/search-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export const SearchBar = (): React.JSX.Element => {
const placeholder = useMemo(
() =>
inputHasFocus && currentSearchModuleRoute
? t('search.active_input_label', 'Separate your keywords by a comma or pressing TAB')
? t('search.active_input_label', 'Separate your keywords by a comma')
: t('search.idle_input_label', 'Search in {{module}}', {
module: moduleLabel
}),
Expand Down Expand Up @@ -374,8 +374,7 @@ export const SearchBar = (): React.JSX.Element => {
confirmChipOnBlur={false}
separators={[
{ key: 'Enter', ctrlKey: false },
{ key: ',', ctrlKey: false },
{ key: ' ', ctrlKey: false }
{ key: ',', ctrlKey: false }
]}
background={searchDisabled ? 'gray5' : 'gray6'}
onChange={onQueryChange}
Expand Down