suddjian commented on a change in pull request #10288:
URL:
https://github.com/apache/incubator-superset/pull/10288#discussion_r546199584
##########
File path: superset-frontend/src/explore/components/ExploreViewContainer.jsx
##########
@@ -265,88 +242,100 @@ class ExploreViewContainer extends React.Component {
}
}
- findChangedControlKeys(prevControls, currentControls) {
- return Object.keys(currentControls).filter(
- key =>
- typeof prevControls[key] !== 'undefined' &&
- !areObjectsEqual(currentControls[key].value, prevControls[key].value),
- );
+ function onStop() {
+ if (props.chart && props.chart.queryController) {
+ props.chart.queryController.abort();
+ }
}
- hasDisplayControlChanged(changedControlKeys, currentControls) {
- return changedControlKeys.some(key => currentControls[key].renderTrigger);
+ function toggleModal() {
+ setShowingModal(!showingModal);
}
- hasQueryControlChanged(changedControlKeys, currentControls) {
- return changedControlKeys.some(
- key =>
- !currentControls[key].renderTrigger &&
- !currentControls[key].dontRefreshOnChange,
- );
+ function toggleCollapse() {
+ setIsCollapsed(!isCollapsed);
}
- addHistory({ isReplace = false, title }) {
- const payload = { ...this.props.form_data };
- const longUrl = getExploreLongUrl(this.props.form_data, null, false);
- try {
- if (isReplace) {
- window.history.replaceState(payload, title, longUrl);
- } else {
- window.history.pushState(payload, title, longUrl);
- }
- } catch (e) {
- logging.warn(
- 'Failed at altering browser history',
- payload,
- title,
- longUrl,
- );
- }
+ // effect to run on mount
+ useEffect(() => {
+ props.actions.logEvent(LOG_ACTIONS_MOUNT_EXPLORER);
+ addHistory({ isReplace: true });
+ window.addEventListener('popstate', handlePopstate);
+ document.addEventListener('keydown', handleKeydown);
+ return () => {
+ window.removeEventListener('popstate', handlePopstate);
+ document.removeEventListener('keydown', handleKeydown);
+ };
+ }, []);
- // it seems some browsers don't support pushState title attribute
- if (title) {
- document.title = title;
+ useEffect(() => {
+ if (wasDynamicPluginLoading && !isDynamicPluginLoading) {
Review comment:
this effect is the only functionality in this file that's actually new
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]