Skip to content
Snippets Groups Projects
Commit 82a8ed02 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed broken additional search keys.

parent 54a778c6
No related branches found
No related tags found
2 merge requests!115V0.8.0 beta,!113V0.8.0
Pipeline #71586 passed
import React from 'react' import React from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { withStyles } from '@material-ui/core/styles' import { withStyles } from '@material-ui/core/styles'
import { domains } from '../domains' // TODO this causes a weird import bug import { domains } from '../domains' // TODO this causes a weird import bug
import ChipInput from 'material-ui-chip-input' import ChipInput from 'material-ui-chip-input'
import Autosuggest from 'react-autosuggest' import Autosuggest from 'react-autosuggest'
import match from 'autosuggest-highlight/match' import match from 'autosuggest-highlight/match'
...@@ -15,7 +15,6 @@ import SearchContext from '../search/SearchContext' ...@@ -15,7 +15,6 @@ import SearchContext from '../search/SearchContext'
import { withApi } from '../api' import { withApi } from '../api'
import ClearIcon from '@material-ui/icons/Cancel' import ClearIcon from '@material-ui/icons/Cancel'
function renderInput(inputProps) { function renderInput(inputProps) {
const { classes, autoFocus, value, onChange, onAdd, onDelete, chips, ref, ...other } = inputProps const { classes, autoFocus, value, onChange, onAdd, onDelete, chips, ref, ...other } = inputProps
...@@ -163,7 +162,7 @@ class SearchBar extends React.Component { ...@@ -163,7 +162,7 @@ class SearchBar extends React.Component {
const reStr = `^(${Object.keys(domain.additionalSearchKeys).join('|')})=` const reStr = `^(${Object.keys(domain.additionalSearchKeys).join('|')})=`
const additionalSearchKeyRE = new RegExp(reStr) const additionalSearchKeyRE = new RegExp(reStr)
const match = value.match(additionalSearchKeyRE) const match = value.match(additionalSearchKeyRE)
if (match && this.props.domain.additionalSearchKeys[match[1]]) { if (match && domain.additionalSearchKeys[match[1]]) {
suggestions.push({ suggestions.push({
key: match[1], key: match[1],
value: valueWithCase.substring(match[0].length) value: valueWithCase.substring(match[0].length)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment