Skip to content

Commit

Permalink
[dashboard] add link to export CSV from dashboard (#3280)
Browse files Browse the repository at this point in the history
* [dashboard] add link to export CSV from dashboard

fixes #1304

* Fix tests
  • Loading branch information
mistercrunch authored Aug 15, 2017
1 parent 6841697 commit 9c6248f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions superset/assets/spec/javascripts/dashboard/SliceCell_spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

0 comments on commit 9c6248f

Please sign in to comment.