You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/07/15 21:56:30 UTC

[GitHub] [superset] geido commented on a change in pull request #15709: fix(dashboard): Remove edit from url params when discarding changes

geido commented on a change in pull request #15709:
URL: https://github.com/apache/superset/pull/15709#discussion_r670831297



##########
File path: superset-frontend/src/dashboard/components/Header/index.jsx
##########
@@ -129,7 +129,10 @@ const StyledDashboardHeader = styled.div`
 
 class Header extends React.PureComponent {
   static discardChanges() {
-    window.location.reload();
+    const url = new URL(window.location.href);
+
+    url.searchParams.delete('edit');
+    window.location.replace(url);

Review comment:
       I agree. However, the original implementation used window reload for simplicity, otherwise we would need to implement a method to remove ptogrammatically any component that was added to the dashboard and that wasn't saved yet. As this is a P1 bug, I think we should fix the original problem first and consider making a better implementation in a later stage.




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org