Pass query instead of slice to Action buttons to prevent lagging query (#1948)

* Pass query instead of slice to Action buttons to prevent lagging query

* Delete beforeOpen and put DisplayQueryButton in pure component
This commit is contained in:
vera-liu
2017-01-11 12:29:06 -08:00
committed by GitHub
parent a385ee9e97
commit 49b6b38741
3 changed files with 19 additions and 29 deletions

View File

@@ -7,9 +7,10 @@ import DisplayQueryButton from './DisplayQueryButton';
const propTypes = {
canDownload: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]).isRequired,
slice: PropTypes.object.isRequired,
query: PropTypes.string,
};
export default function ExploreActionButtons({ canDownload, slice }) {
export default function ExploreActionButtons({ canDownload, slice, query }) {
const exportToCSVClasses = cx('btn btn-default btn-sm', {
'disabled disabledButton': !canDownload,
});
@@ -37,7 +38,7 @@ export default function ExploreActionButtons({ canDownload, slice }) {
<i className="fa fa-file-text-o"></i> .csv
</a>
<DisplayQueryButton slice={slice} />
<DisplayQueryButton query={query} />
</div>
);
}