fix: do not render favorite favStars and filters for anonymous user (#14120)

* fix: do not render favorite favStar and filter for anonymous user

* fix: prevent anonymous user to trigger the favstar view route

* fix: lint over previous commit

* fix: linter follow-up
This commit is contained in:
Cedric Gampert
2021-05-14 17:05:50 +02:00
committed by GitHub
parent 97c9e37c24
commit 74473e2ad1
6 changed files with 97 additions and 67 deletions

View File

@@ -148,13 +148,15 @@ export class ExploreChartHeader extends React.PureComponent {
{this.props.slice && (
<StyledButtons>
<FaveStar
itemId={this.props.slice.slice_id}
fetchFaveStar={this.props.actions.fetchFaveStar}
saveFaveStar={this.props.actions.saveFaveStar}
isStarred={this.props.isStarred}
showTooltip
/>
{this.props.userId && (
<FaveStar
itemId={this.props.slice.slice_id}
fetchFaveStar={this.props.actions.fetchFaveStar}
saveFaveStar={this.props.actions.saveFaveStar}
isStarred={this.props.isStarred}
showTooltip
/>
)}
<PropertiesModal
show={this.state.isPropertiesModalOpen}
onHide={this.closePropertiesModal}

View File

@@ -252,6 +252,7 @@ const ExploreChartPanel = props => {
form_data={props.form_data}
timeout={props.timeout}
chart={props.chart}
userId={props.userId}
/>
);

View File

@@ -592,6 +592,7 @@ function mapStateToProps(state) {
timeout: explore.common.conf.SUPERSET_WEBSERVER_TIMEOUT,
ownState: dataMask[form_data.slice_id]?.ownState,
impressionId,
userId: explore.user_id,
};
}