From 251eee4c964a9093bd727a2ea5d42274804af173 Mon Sep 17 00:00:00 2001 From: Lachlan Kermode Date: Wed, 23 Sep 2020 18:41:01 +0200 Subject: [PATCH 1/3] rm unused search --- src/components/Toolbar/Layout.js | 17 -------- src/components/Toolbar/Search.js | 71 -------------------------------- 2 files changed, 88 deletions(-) delete mode 100644 src/components/Toolbar/Search.js diff --git a/src/components/Toolbar/Layout.js b/src/components/Toolbar/Layout.js index cceab2a..ca0d1ae 100644 --- a/src/components/Toolbar/Layout.js +++ b/src/components/Toolbar/Layout.js @@ -31,23 +31,6 @@ class Toolbar extends React.Component { ) } - renderSearch () { - if (this.props.features.USE_SEARCH) { - return ( - - - - ) - } - } - goToNarrative (narrative) { this.selectTab(-1) // set all unselected within this component this.props.methods.onSelectNarrative(narrative) diff --git a/src/components/Toolbar/Search.js b/src/components/Toolbar/Search.js deleted file mode 100644 index 2004e15..0000000 --- a/src/components/Toolbar/Search.js +++ /dev/null @@ -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 ( - - ) - }) - ) - } - - render () { - return ( -
-

{copy[this.props.language].toolbar.panels.search.title}

-
- -
-
    - {this.renderSearchResults()} -
-
- ) - } -} From a089ea587bc52c6d175b7521d52333844c8517f7 Mon Sep 17 00:00:00 2001 From: Lachlan Kermode Date: Wed, 23 Sep 2020 19:02:59 +0200 Subject: [PATCH 2/3] rm import --- src/components/Toolbar/Layout.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/Toolbar/Layout.js b/src/components/Toolbar/Layout.js index ca0d1ae..7221b6f 100644 --- a/src/components/Toolbar/Layout.js +++ b/src/components/Toolbar/Layout.js @@ -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' From 0374ac5d7625a4d2e163e7bfc334239299557fe2 Mon Sep 17 00:00:00 2001 From: efarooqui Date: Wed, 23 Sep 2020 10:25:18 -0700 Subject: [PATCH 3/3] Removed extraneous USE_SEARCH declarations --- docs/configuration.md | 1 - example.config.js | 1 - src/store/initial.js | 1 - 3 files changed, 3 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index db6b268..303129c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -19,7 +19,6 @@ The URLs for these endpoints, as well as other configurable settings in your tim | MAP_ANCHOR | Geographic coordinates for original map anchor | Array of numbers | No | | MAPBOX_TOKEN | Access token for Mapbox satellite imagery | String | No | | features.USE_ASSOCIATIONS | Enable / Disable filters | boolean | No | -| features.USE_SEARCH | Enable / Disable search | boolean | No | | features.USE_SITES | Enable / Disable sites | boolean | No | In this configuration file you'll need to add your Mapbox token (see [here for more info](https://www.mapbox.com/help/define-access-token/)). Additionally, you'll need to replace the required endpoints by functioning ones. Finally, you'll want to initialize your application set in `MAP_ANCHOR`, as a (lat, long) pair, which determines the specific location at which the application will center itself on start. diff --git a/example.config.js b/example.config.js index f257c79..a159c4c 100644 --- a/example.config.js +++ b/example.config.js @@ -26,7 +26,6 @@ module.exports = { USE_ASSOCIATIONS: true, USE_SOURCES: true, USE_COVER: true, - USE_SEARCH: false, USE_SITES: false, USE_SHAPES: false, GRAPH_NONLOCATED: false, diff --git a/src/store/initial.js b/src/store/initial.js index beb475b..1b9ab6d 100644 --- a/src/store/initial.js +++ b/src/store/initial.js @@ -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,