hughhhh commented on a change in pull request #15898:
URL: https://github.com/apache/superset/pull/15898#discussion_r677933737
##########
File path: superset-frontend/src/explore/components/ExploreChartHeader.jsx
##########
@@ -141,6 +159,44 @@ export class ExploreChartHeader extends
React.PureComponent {
this.setState({ showingReportModal: false });
}
+ renderReportModal() {
+ const attachedReportExists = this.props.report?.count > 0;
+ return attachedReportExists ? (
+ <HeaderReportActionsDropdown
+ showReportModal={this.showReportModal}
+ hideReportModal={this.hideReportModal}
+ toggleActive={this.props.toggleActive}
+ />
+ ) : (
+ <>
+ <span
+ role="button"
+ title={t('Schedule email report')}
+ tabIndex={0}
+ className="action-button"
+ onClick={this.showReportModal}
+ >
+ <Icons.Calendar />
+ </span>
+ </>
+ );
+ }
+
+ canAddReports() {
+ const { user } = this.props;
+ if (!user) {
+ // this is in the case that there is an anonymous user.
Review comment:
Just put "handle anonymous user"
##########
File path: superset-frontend/src/explore/components/ExploreChartHeader.jsx
##########
@@ -166,7 +222,7 @@ export class ExploreChartHeader extends React.PureComponent
{
{this.props.slice && (
<StyledButtons>
- {this.props.userId && (
+ {this.props.user.userId && (
Review comment:
Nit: deconstruct user from props
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]