You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2017/08/15 01:25:38 UTC
[incubator-superset] branch master updated: [dashboard] add link to
export CSV from dashboard (#3280)
This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 9c6248f [dashboard] add link to export CSV from dashboard (#3280)
9c6248f is described below
commit 9c6248f3bac6e83f7a4418e499a3f2646a841b3a
Author: Maxime Beauchemin <ma...@gmail.com>
AuthorDate: Mon Aug 14 18:25:36 2017 -0700
[dashboard] add link to export CSV from dashboard (#3280)
* [dashboard] add link to export CSV from dashboard
fixes #1304
* Fix tests
---
superset/assets/javascripts/dashboard/components/SliceCell.jsx | 7 ++++++-
superset/assets/spec/javascripts/dashboard/SliceCell_spec.jsx | 4 ++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/superset/assets/javascripts/dashboard/components/SliceCell.jsx b/superset/assets/javascripts/dashboard/components/SliceCell.jsx
index a57fbde..c6ddf31 100644
--- a/superset/assets/javascripts/dashboard/components/SliceCell.jsx
+++ b/superset/assets/javascripts/dashboard/components/SliceCell.jsx
@@ -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
diff --git a/superset/assets/spec/javascripts/dashboard/SliceCell_spec.jsx b/superset/assets/spec/javascripts/dashboard/SliceCell_spec.jsx
index a66ed4e..8dbf661 100644
--- a/superset/assets/spec/javascripts/dashboard/SliceCell_spec.jsx
+++ b/superset/assets/spec/javascripts/dashboard/SliceCell_spec.jsx
@@ -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);
});
});
--
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <co...@superset.apache.org>'].