Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added filter in ControlPanelsContainer for explore V2 #1647

Merged
merged 6 commits into from
Nov 23, 2016

Conversation

vera-liu
Copy link
Contributor

@vera-liu vera-liu commented Nov 19, 2016

Done:

  • Filter component in Control Panel container
  • parse url params into store in index.jsx
  • transfer filters to url params on query and save
  • move function for getting url params based on form_data outside SaveModal and ExploreViewContainer

Todo:

giphy 8

needs-review @ascott @mistercrunch

// only display filters with current prefix
if (filter.prefix === this.props.prefix) {
filters.push(
<div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we pull this out into it's own SFC?

});
}
/* eslint no-param-reassign: 0 */
delete form_data[`${prefix}_col_${i}`];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need to delete these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I store and deal with filters in store as arrays since it's cleaner, in the form_data passed in it has arbitrary number of flt_eq/op/col as params, if we don't delete them they will linger in store and passed back again in onQuery.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok cool

return filters;
};

const getFilters = function (form_data, datasource_type) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our style guide calls for named functions:

function getFilters(form_data, datasource_type) {
  ...
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
{
label: 'Result Filters',
description: 'Filters are defined using comma delimited strings as in <US,FR,Other>' +
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is Result Filters supposed to have the same description as Filters?

// Todo: remove after launch
data.V2 = true;
data.datasource_id = form_data.datasource;
data.datasource_type = datasource_type;
Copy link

@ascott ascott Nov 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could simplify this to:

const data = {
  datasource_type,  
  datasource_id: form_data.datasource,
  V2: true, // todo: remove after launch, V2 tag temporarily for updating url
};

@@ -7,6 +7,7 @@ import { Panel, Alert } from 'react-bootstrap';
import { visTypes, commonControlPanelSections } from '../stores/store';
import ControlPanelSection from './ControlPanelSection';
import FieldSetRow from './FieldSetRow';
import Filters from './Filters';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have a test for this component? if not in this PR, would probably be beneficial to add.

@vera-liu vera-liu force-pushed the vliu_filter branch 3 times, most recently from 0c70a9c to 7d9308f Compare November 23, 2016 01:14
@vera-liu vera-liu force-pushed the vliu_filter branch 2 times, most recently from 603c3c5 to e1172b3 Compare November 23, 2016 17:34
@vera-liu vera-liu merged commit 39ce4aa into apache:master Nov 23, 2016
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.14.0 labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants