Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
configure(searchkit) {
this.searchkit = searchkit
if (this.options.accessorId) {
let accessor = searchkit.accessors.statefulAccessors[this.options.accessorId]
if (!accessor) {
console.error(`Could not create facet filter datasource with accessorId=${this.options.accessorId}`)
} else {
this.originalAccessor = accessor
}
} else {
let { id, field, operator, fieldOptions, title, size } = this.options
this.originalAccessor = new FacetAccessor(id, {
id, field, operator, fieldOptions, title, size
})
this.searchkit.addAccessor(this.originalAccessor)
}
this.delegateAccessor = this.createDelegate(this.originalAccessor)
}
configure(searchkit) {
this.searchkit = searchkit
if (this.options.accessorId) {
let accessor = searchkit.accessors.statefulAccessors[this.options.accessorId]
if (!accessor) {
console.error(`Could not create facet filter datasource with accessorId=${this.options.accessorId}`)
} else {
this.originalAccessor = accessor
}
} else {
let { id, field, operator, fieldOptions, title } = this.options
this.originalAccessor = new FacetAccessor(id, {
id, field, operator, fieldOptions, title
})
this.searchkit.addAccessor(this.originalAccessor)
}
this.delegateAccessor = this.createDelegate(this.originalAccessor)
}
createDelegate(accessor) {
let delegateAccessor = new FacetAccessor(accessor.options.id, { ...accessor.options })
delegateAccessor.uuid = accessor.options.id
return delegateAccessor
}
createDelegate(accessor) {
let delegateAccessor = new FacetAccessor(accessor.options.id, { ...accessor.options })
delegateAccessor.uuid = accessor.options.id
return delegateAccessor
}
defineAccessor() {
const { field, id, operator, title, size, translations } = this.props;
return new FacetAccessor(field, {
id, operator, title, size, translations
})
}
defineAccessor() {
const {
field, id, size, title,
include, exclude, orderKey, orderDirection
} = this.props
const operator = "OR"
return new FacetAccessor(field, {
id, operator, title, size, orderKey, orderDirection,
include, exclude
})
}
defineAccessor() {
const {
field, id, operator, title, include, exclude,
size, translations, orderKey, orderDirection
} = this.props
return new FacetAccessor(field, {
id, operator, title, size, include, exclude,
translations, orderKey, orderDirection
})
}