Skip to content

Commit

Permalink
Fix experiments page prediction filter
Browse files Browse the repository at this point in the history
It now will hide and set itself to 'all' when a particular dataset is
chosen in the dataset filter
  • Loading branch information
mgstauffer committed Jul 9, 2021
1 parent 1180561 commit 3e97b41
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,18 @@ function ExperimentFilters({
onChange={(e, data) => updateQuery('dataset', data.value)}
className="filter"
/>
<Form.Field
inline
label="Prediction Type:"
control={Dropdown}
value={filters.prediction.selected}
options={filters.prediction.options}
onChange={(e, data) => updateQuery('prediction', data.value)}
className="filter"
/>
{
filters.dataset.selected.toLowerCase() === 'all' &&
<Form.Field
inline
label="Prediction Type:"
control={Dropdown}
value={filters.prediction.selected}
options={filters.prediction.options}
onChange={(e, data) => updateQuery('prediction', data.value)}
className="filter"
/>
}
<Form.Field
inline
label="Algorithm:"
Expand Down
7 changes: 7 additions & 0 deletions lab/webapp/src/components/Experiments/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ class Experiments extends Component {
Object.assign(nextLocation.query, { [key]: value });
}
hashHistory.push(nextLocation);
//Special check for Dataset value. If it's not set to show all,
// the Prediction Type filter gets hidden in ExperimentFilters,
// so we have to force it's value to be 'all' so it doesn't get
// stuck on an inappropriate value
if(key === 'dataset' && value !== 'all'){
this.updateQuery('prediction','all');
}
}

resetQuery() {
Expand Down

0 comments on commit 3e97b41

Please sign in to comment.