Rename `allowWildcard` -> `freeChoice`

pull/2773/head
Uku Taht 4 years ago
parent 6642a4c14e
commit b688e29211

@ -46,7 +46,7 @@ export default function PlausibleCombobox(props) {
const listRef = useRef(null);
const visibleOptions = [...options]
if (props.allowWildcard && input.length > 0) {
if (props.freeChoice && input.length > 0) {
visibleOptions.push({value: input, label: input, freeChoice: true})
}
@ -149,7 +149,7 @@ export default function PlausibleCombobox(props) {
}, [])
const matchesFound = !loading && visibleOptions.length > 0
const noMatchesFound = !loading && !props.allowWildcard && options.length === 0
const noMatchesFound = !loading && !props.freeChoice && options.length === 0
return (
<div onKeyDown={onKeyDown} ref={containerRef} className="relative ml-2 w-full">

@ -184,8 +184,8 @@ class FilterModal extends React.Component {
}
renderSearchBox(filter) {
const allowWildcard = this.state.selectedFilterGroup === 'page'
return <Combobox fetchOptions={this.fetchOptions(filter)} allowWildcard={allowWildcard} values={this.state.formState[filter].clauses} onChange={this.onChange(filter)} placeholder={`Select ${withIndefiniteArticle(formattedFilters[filter])}`} />
const freeChoice = this.state.selectedFilterGroup === 'page'
return <Combobox fetchOptions={this.fetchOptions(filter)} freeChoice={freeChoice} values={this.state.formState[filter].clauses} onChange={this.onChange(filter)} placeholder={`Select ${withIndefiniteArticle(formattedFilters[filter])}`} />
}
renderFilterInputs() {

Loading…
Cancel
Save