Skip to content

Commit

Permalink
Merge pull request #457 from VTUL/default_search_field
Browse files Browse the repository at this point in the history
Change default search field to 'all'
  • Loading branch information
whunter authored Apr 9, 2024
2 parents 4fd221d + 1d7ed48 commit d7bd937
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/SearchBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class SearchBar extends Component {
q: this.props.q
};

fields = ["title", "description", "all"];
fields = ["all", "description", "title"];

fieldOptions = () => {
return this.fields.map((field) => (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/HomePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class HomePage extends Component {
site={this.props.site}
/>
<div className="home-search-wrapper">
<SearchBar filters={{}} view="Gallery" field="title" q="" />
<SearchBar filters={{}} view="Gallery" field="all" q="" />
</div>
<HomeStatement homeStatement={homeStatement} />
<div className="home-nav-links">
Expand Down
4 changes: 2 additions & 2 deletions src/pages/archives/ArchivePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ArchivePage extends Component {
collectionTitle: "",
page: 0,
category: "archive",
searchField: "title",
searchField: "all",
view: "Gallery",
info: {},
languages: null,
Expand Down Expand Up @@ -304,7 +304,7 @@ class ArchivePage extends Component {
<SearchBar
category={this.state.category}
view={this.state.view}
searchField={this.state.searchField}
field={this.state.searchField}
setPage={this.setPage}
updateFormState={this.updateFormState}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/search/SearchLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class SearchLoader extends Component {
page: 0,
totalPages: 1,
filters: {},
field: "title",
field: "all",
view: "Gallery",
q: "",
languages: null,
Expand Down Expand Up @@ -138,7 +138,7 @@ class SearchLoader extends Component {
}
return {
q: searchParams.get("q") || "",
field: searchParams.get("field") || "title",
field: searchParams.get("field") || "all",
view: searchParams.get("view") || "Gallery",
...restQuery
};
Expand Down

0 comments on commit d7bd937

Please sign in to comment.