[dashboard] add link to export CSV from dashboard (#3280)

* [dashboard] add link to export CSV from dashboard

fixes #1304

* Fix tests
This commit is contained in:
Maxime Beauchemin 2017-08-14 18:25:36 -07:00 committed by GitHub
parent 6841697917
commit 9c6248f3ba
2 changed files with 8 additions and 3 deletions

View File

@ -2,6 +2,8 @@
import React from 'react';
import PropTypes from 'prop-types';
import { getExploreUrl } from '../../explore/exploreUtils';
const propTypes = {
slice: PropTypes.object.isRequired,
removeSlice: PropTypes.func.isRequired,
@ -40,7 +42,10 @@ function SliceCell({ expandedSlices, removeSlice, slice }) {
>
<i className="fa fa-pencil" />
</a>
<a href={slice.slice_url} title="Explore chart" data-toggle="tooltip">
<a href={getExploreUrl(slice.form_data, 'csv')} title="Export CSV" data-toggle="tooltip">
<i className="fa fa-table" />
</a>
<a href={getExploreUrl(slice.form_data)} title="Explore chart" data-toggle="tooltip">
<i className="fa fa-share" />
</a>
<a

View File

@ -17,8 +17,8 @@ describe('SliceCell', () => {
React.isValidElement(<SliceCell {...mockedProps} />),
).to.equal(true);
});
it('renders five links', () => {
it('renders six links', () => {
const wrapper = mount(<SliceCell {...mockedProps} />);
expect(wrapper.find('a')).to.have.length(5);
expect(wrapper.find('a')).to.have.length(6);
});
});