Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Remove unused code

Marcin Gębalace405feedd73
diff --git a/saleor/static/js/components/CategoryFilter.js b/saleor/static/js/components/CategoryFilter.js
index f5c5e176c9..c9dd5dd833 100644
--- a/saleor/static/js/components/CategoryFilter.js
+++ b/saleor/static/js/components/CategoryFilter.js
@@ -1,5 +1,4 @@
import React, { Component, PropTypes } from 'react'
-import Relay from 'react-relay';
export default class CategoryFilter extends Component {
diff --git a/saleor/static/js/components/CategoryPage.js b/saleor/static/js/components/CategoryPage.js
index bc22e7bffa..ac7313df80 100644
--- a/saleor/static/js/components/CategoryPage.js
+++ b/saleor/static/js/components/CategoryPage.js
@@ -1,6 +1,5 @@
import React, { Component, PropTypes } from 'react';
import Relay from 'react-relay';
-import queryString from 'query-string';
import CategoryFilter from './CategoryFilter';
import PriceFilter from './PriceFilter';
diff --git a/saleor/static/js/components/PriceFilter.js b/saleor/static/js/components/PriceFilter.js
index 52e2e9b4a7..123b37572e 100644
--- a/saleor/static/js/components/PriceFilter.js
+++ b/saleor/static/js/components/PriceFilter.js
@@ -1,5 +1,4 @@
import React, { Component, PropTypes } from 'react';
-import queryString from 'query-string';
export default class PriceFilter extends Component {
diff --git a/saleor/static/js/components/ProductFilters.js b/saleor/static/js/components/ProductFilters.js
index 039d3a2dde..8f8ee2453b 100644
--- a/saleor/static/js/components/ProductFilters.js
+++ b/saleor/static/js/components/ProductFilters.js
@@ -1,6 +1,5 @@
import React, { Component, PropTypes } from 'react'
import Relay from 'react-relay';
-import queryString from 'query-string';
class ProductFilters extends Component {
@@ -18,10 +17,8 @@ class ProductFilters extends Component {
};
}
- onClick = (attribute, value, event) => {
+ onClick = (attribute, value) => {
const attrValue = `${attribute}:${value}`;
- const element = event.target;
-
this.setState({
filters: Object.assign(
this.state.filters,
@@ -32,37 +29,6 @@ class ProductFilters extends Component {
}
- componentDidMount() {
- /*let url_params = queryString.parse(location.search);
- Object.keys(url_params).map((params) => {
- let attrValue = '';
- if (Array.isArray(url_params[params])) {
- url_params[params].map((param) => {
- attrValue = `${params}:${param}`;
- this.setState({
- filters: Object.assign(
- this.state.filters,
- {[attrValue]: true})
- });
- const elementID = 'attr'+params+param;
- document.getElementById(elementID).checked = true;
- })
- } else {
- attrValue = `${params}:${url_params[params]}`;
- this.setState({
- filters: Object.assign(
- this.state.filters,
- {[attrValue]: true})
- });
- const elementID = 'attr'+params+url_params[params];
- document.getElementById(elementID).checked = true;
- }
- })
-
- const enabled = Object.keys(this.state.filters).filter(key => this.state.filters[key] === true);
- this.props.onFilterChanged(enabled);*/
- }
-
render() {
const { attributes } = this.props;
return (
@@ -76,7 +42,7 @@ class ProductFilters extends Component {
return (
<li key={value.id} className="item">
<label>
- <input id={"attr"+attribute.pk+value.pk} type="checkbox" value="" onClick={(event) => this.onClick(attribute.pk, value.pk, event)} />
+ <input id={'attr' + attribute.pk + value.pk} type="checkbox" value="" onClick={() => this.onClick(attribute.pk, value.pk)} />
{value.display}
</label>
</li>