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

ROOT-198: remove default field from queries, make autocomplete wildcard* configurable #29

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/.env.local.js.example
Expand Up @@ -46,11 +46,11 @@ module.exports = {
// 'ds_federated_date',
// 'sm_federated_terms',
// ],
// OPTIONAL: Provides config for adding autocomplete functionality to text search
// OPTIONAL: Provides config for adding autocomplete functionality to text search, defaults to false
// autocomplete : {
// url: <your-endpoint-for-autocomplete-results>, // required @todo document accepted types
// queryField: 'tem_suggestion_title', // REQUIRED
// suggestionRows: 5, // REQUIRED: no current default set
// appendWildcard: true, // OPTIONAL: defaults to false, whether or not to append wildcard to query term
// suggestionRows: 5, // OPTIONAL: defaults to 5
// numChars: 2, // OPTIONAL: defaults to 2, number of characters *after* which autocomplete results should appear
// mode: 'result', // REQUIRED: show search-as-you-type results ('result', default) or search term ('term') suggestions
// result: { // OPTIONAL: define result based autocomplete-specific config
Expand All @@ -59,7 +59,7 @@ module.exports = {
// },
// term: { // OPTIONAL: define term based autocomplete-specific config
// titleText: 'What would you like to search for?', // OPTIONAL: default set
// showDirectionsText: true, // OPTIONAL: defaults to false
// showDirectionsText: false, // OPTIONAL: defaults to true
// },
// },
};
4 changes: 2 additions & 2 deletions src/components/text-search/search-as-you-type.js
Expand Up @@ -178,14 +178,14 @@ class FederatedTextSearchAsYouType extends React.Component {
? this.props.autocomplete.result.titleText
: 'What are you looking for?';
const resultShowDirectionsText = hasResultModeConfig
&& this.props.autocomplete.result.showDirectionsText
&& Object.hasOwnProperty.call(this.props.autocomplete.result, 'showDirectionsText')
? this.props.autocomplete.result.showDirectionsText
: true;
const termTitleText = hasTermModeConfig && this.props.autocomplete.term.titleText
? this.props.autocomplete.term.titleText
: 'Suggested search terms';
const termShowDirectionsText = hasTermModeConfig
&& this.props.autocomplete.term.showDirectionsText
&& Object.hasOwnProperty.call(this.props.autocomplete.term, 'showDirectionsText')
? this.props.autocomplete.term.showDirectionsText
: true;

Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Expand Up @@ -7410,7 +7410,7 @@ sockjs@0.3.18:

"solr-faceted-search-react@git+ssh://git@github.com:palantirnet/solr-faceted-search-react#root-138-autocomplete":
version "0.12.1"
resolved "git+ssh://git@github.com:palantirnet/solr-faceted-search-react#82eb9366e0650b43be57565139da296ffc62e565"
resolved "git+ssh://git@github.com:palantirnet/solr-faceted-search-react#f0df9079a3a0e56d866ff2640c780decc645617a"
dependencies:
classnames "^2.2.5"
prop-types "^15.6.1"
Expand Down