Skip to content

Commit

Permalink
Merge pull request #1539 from ral-facilities/search-history-#1471
Browse files Browse the repository at this point in the history
Autocomplete Recent Searches
  • Loading branch information
MRichards99 authored Jul 7, 2023
2 parents f16bc59 + 1288b4a commit e0c4fe5
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 26 deletions.
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

0 comments on commit e0c4fe5

Please sign in to comment.