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

Autocomplete Recent Searches #1539

Merged
merged 2 commits into from
Jul 7, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ exports[`SearchBoxContainerSide - Tests renders searchBoxContainerSide correctly
aria-label="searchBox.search_text_arialabel"
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputTypeSearch css-1g24dm6-MuiInputBase-input-MuiOutlinedInput-input"
id="filled-search"
name="dgSearchTextField"
type="search"
value=""
/>
Expand Down Expand Up @@ -245,7 +246,7 @@ exports[`SearchBoxContainerSide - Tests renders searchBoxContainerSide correctly
aria-label="searchBox.search_button_arialabel"
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeLarge MuiButton-containedSizeLarge MuiButton-fullWidth MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeLarge MuiButton-containedSizeLarge MuiButton-fullWidth css-189e9pj-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
type="submit"
>
searchBox.search_button
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`Search Button component tests renders correctly 1`] = `
aria-label="searchBox.search_button_arialabel"
class="MuiButtonBase-root MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeLarge MuiButton-containedSizeLarge MuiButton-fullWidth MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeLarge MuiButton-containedSizeLarge MuiButton-fullWidth css-189e9pj-MuiButtonBase-root-MuiButton-root"
tabindex="0"
type="button"
type="submit"
>
searchBox.search_button
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ exports[`Search text box component tests renders correctly 1`] = `
aria-label="searchBox.search_text_arialabel"
class="MuiInputBase-input MuiOutlinedInput-input MuiInputBase-inputTypeSearch css-1g24dm6-MuiInputBase-input-MuiOutlinedInput-input"
id="filled-search"
name="dgSearchTextField"
type="search"
value=""
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const SearchButton = (props: SearchButtonCombinedProps): React.ReactElement => {
aria-label={t('searchBox.search_button_arialabel')}
size="large"
fullWidth={true}
type="submit"
>
{t('searchBox.search_button')}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const SearchTextBox = (props: SearchTextProps): React.ReactElement => {
<TextField
className="tour-search-textfield"
id="filled-search"
name="dgSearchTextField"
label={t('searchBox.search_text')}
type="search"
margin="normal"
Expand Down
54 changes: 30 additions & 24 deletions packages/datagateway-search/src/searchBoxContainer.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,35 +38,41 @@ const SearchBoxContainer = (

return (
<ContainerBox data-testid="search-box-container">
<Grid
container
direction="row"
justifyContent="center"
id="container-searchbox"
<form
onSubmit={(event) => {
event.preventDefault();
}}
>
<Grid item xs="auto" style={{ flexGrow: 1 }}>
<SearchTextBox
searchText={searchText}
initiateSearch={initiateSearch}
onChange={onSearchTextChange}
/>
</Grid>
<Grid
container
direction="row"
justifyContent="center"
id="container-searchbox"
>
<Grid item xs="auto" style={{ flexGrow: 1 }}>
<SearchTextBox
searchText={searchText}
initiateSearch={initiateSearch}
onChange={onSearchTextChange}
/>
</Grid>

<Grid item sx={{ marginTop: '8px' }}>
<CheckboxesGroup />
</Grid>
<Grid item sx={{ marginTop: '8px' }}>
<CheckboxesGroup />
</Grid>

<Grid item sx={{ marginTop: '8px' }}>
<SelectDates initiateSearch={initiateSearch} />
</Grid>
<Grid item sx={{ marginTop: '8px' }}>
<SelectDates initiateSearch={initiateSearch} />
</Grid>

<Grid
item
sx={{ display: 'flex', marginTop: '24px', marginLeft: '6px' }}
>
<SearchButton initiateSearch={initiateSearch} />
<Grid
item
sx={{ display: 'flex', marginTop: '24px', marginLeft: '6px' }}
>
<SearchButton initiateSearch={initiateSearch} />
</Grid>
</Grid>
</Grid>
</form>
<div style={{ display: 'flex' }}>
<Typography
sx={{
Expand Down