This is an automated email from the ASF dual-hosted git repository.

elizabeth pushed a commit to branch selfSubscribeReports
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/selfSubscribeReports by this 
push:
     new 6a79189  feat: Begin incorporation of email report modal to Charts 
(#15793)
6a79189 is described below

commit 6a791893c14daa4f5aab0bfba1c399e4cc86c124
Author: Lyndsi Kay Williams <[email protected]>
AuthorDate: Thu Jul 22 15:37:43 2021 -0500

    feat: Begin incorporation of email report modal to Charts (#15793)
    
    * Add email report modal to Charts
    
    * Fix px themes
---
 .../src/explore/components/ExploreChartHeader.jsx  | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/superset-frontend/src/explore/components/ExploreChartHeader.jsx 
b/superset-frontend/src/explore/components/ExploreChartHeader.jsx
index fdcf7d2..0337e64 100644
--- a/superset-frontend/src/explore/components/ExploreChartHeader.jsx
+++ b/superset-frontend/src/explore/components/ExploreChartHeader.jsx
@@ -20,8 +20,10 @@ import React from 'react';
 import { connect } from 'react-redux';
 import { bindActionCreators } from 'redux';
 import PropTypes from 'prop-types';
+import Icons from 'src/components/Icons';
 import { styled, t } from '@superset-ui/core';
 import { Tooltip } from 'src/components/Tooltip';
+import ReportModal from 'src/components/ReportModal';
 import { chartPropShape } from '../../dashboard/util/propShapes';
 import ExploreActionButtons from './ExploreActionButtons';
 import RowCountLabel from './RowCountLabel';
@@ -80,6 +82,11 @@ const StyledHeader = styled.div`
       margin-left: ${({ theme }) => theme.gridUnit}px;
     }
   }
+
+  .action-button {
+    margin: 0 ${({ theme }) => theme.gridUnit * 1.5}px 0
+      ${({ theme }) => theme.gridUnit}px;
+  }
 `;
 
 const StyledButtons = styled.span`
@@ -92,9 +99,12 @@ export class ExploreChartHeader extends React.PureComponent {
     super(props);
     this.state = {
       isPropertiesModalOpen: false,
+      showingReportModal: false,
     };
     this.openPropertiesModal = this.openPropertiesModal.bind(this);
     this.closePropertiesModal = this.closePropertiesModal.bind(this);
+    this.showReportModal = this.showReportModal.bind(this);
+    this.hideReportModal = this.hideReportModal.bind(this);
   }
 
   getSliceName() {
@@ -123,6 +133,14 @@ export class ExploreChartHeader extends 
React.PureComponent {
     });
   }
 
+  showReportModal() {
+    this.setState({ showingReportModal: true });
+  }
+
+  hideReportModal() {
+    this.setState({ showingReportModal: false });
+  }
+
   render() {
     const formData = this.props.form_data;
     const {
@@ -205,6 +223,19 @@ export class ExploreChartHeader extends 
React.PureComponent {
             isRunning={chartStatus === 'loading'}
             status={CHART_STATUS_MAP[chartStatus]}
           />
+          <span
+            role="button"
+            title={t('Schedule email report')}
+            tabIndex={0}
+            className="action-button"
+            onClick={this.showReportModal}
+          >
+            <Icons.Calendar />
+          </span>
+          <ReportModal
+            show={this.state.showingReportModal}
+            onHide={this.hideReportModal}
+          />
           <ExploreActionButtons
             actions={{
               ...this.props.actions,

Reply via email to