Merge branch 'develop' of https://github.com/forensic-architecture/timemap into feature/multi-select-events

This commit is contained in:
efarooqui
2020-09-23 10:31:08 -07:00
5 changed files with 0 additions and 92 deletions

View File

@@ -5,7 +5,6 @@ import * as actions from '../../actions'
import * as selectors from '../../selectors'
import { Tabs, TabPanel } from 'react-tabs'
import Search from './Search'
import FilterListPanel from './FilterListPanel'
import CategoriesListPanel from './CategoriesListPanel'
import BottomActions from './BottomActions'
@@ -31,23 +30,6 @@ class Toolbar extends React.Component {
)
}
renderSearch () {
if (this.props.features.USE_SEARCH) {
return (
<TabPanel>
<Search
language={this.props.language}
filters={this.props.filters}
categories={this.props.categories}
filterFilters={this.props.filterFilters}
categoryFilters={this.props.categoryFilters}
filter={this.props.filter}
/>
</TabPanel>
)
}
}
goToNarrative (narrative) {
this.selectTab(-1) // set all unselected within this component
this.props.methods.onSelectNarrative(narrative)

View File

@@ -1,71 +0,0 @@
/* global fetch */
import React from 'react'
import copy from '../../common/data/copy.json'
import SelectFilter from './SelectFilter'
export default class Search extends React.Component {
constructor (props) {
super(props)
this.state = {
searchValue: undefined,
searchResults: []
}
this.handleSearchChange = this.handleSearchChange.bind(this)
this.handleSearchSubmit = this.handleSearchSubmit.bind(this)
}
handleSearchSubmit (e) {
e.preventDefault()
fetch(`api/search/${this.state.searchValue}`)
.then(response => response.json())
.then(json => {
this.setState({
searchResults: json.filters
})
})
}
handleSearchChange (event) {
this.setState({ searchValue: event.target.value })
}
renderSearchResults () {
return (
this.state.searchResults.map(filter => {
return (
<SelectFilter
isShowTree
filters={this.props.filters}
categories={this.props.categories}
filterFilters={this.props.filterFilters}
categoryFilters={this.props.categoryFilters}
filter={this.props.filter}
isCategory={this.props.isCategory}
/>
)
})
)
}
render () {
return (
<div className='search-content'>
<h2>{copy[this.props.language].toolbar.panels.search.title}</h2>
<form onSubmit={this.handleSearchSubmit}>
<input
value={this.state.searchValue}
onChange={this.handleSearchChange}
autoFocus
type='text'
name='search-input'
placeholder={copy[this.props.language].toolbar.panels.search.placeholder}
/>
</form>
<ul>
{this.renderSearchResults()}
</ul>
</div>
)
}
}

View File

@@ -134,7 +134,6 @@ const initial = {
features: {
USE_COVER: false,
USE_ASSOCIATIONS: false,
USE_SEARCH: false,
USE_SITES: false,
USE_SOURCES: false,
USE_SHAPES: false,