Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs in SQL query restore after session expire #14094

Closed
wants to merge 5 commits into from
Closed

Fix bugs in SQL query restore after session expire #14094

wants to merge 5 commits into from

Conversation

shucon
Copy link
Contributor

@shucon shucon commented Mar 18, 2018

Fixes: #14093
Also, the sql query was getting stored in the browser indefinetly even after visiting another page and then coming back. So it had to be cleared from localstorage on page change.

Signed-off-by: Saksham Gupta shucon01@gmail.com

Before submitting pull request, please check that every commit:

  • Has proper Signed-Off-By
  • Has commit message which describes it
  • Is needed on it's own, if you have just minor fixes to previous commits, you can squash them
  • Any new functionality is covered by tests

Fixes: #14093
Also, the sql query was getting stored in the browser indefinetly even after visiting another page and then coming back. So it had to be cleared from localstorage on page change.

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
@codecov
Copy link

codecov bot commented Mar 24, 2018

Codecov Report

Merging #14094 into master will increase coverage by <.01%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master   #14094      +/-   ##
============================================
+ Coverage     55.43%   55.43%   +<.01%     
- Complexity    14366    14374       +8     
============================================
  Files           494      494              
  Lines         70550    70612      +62     
============================================
+ Hits          39106    39147      +41     
- Misses        31444    31465      +21

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
@@ -82,6 +82,7 @@ public static function getHtml(
// start output
$html .= '<form method="post" action="import.php" ' . $enctype;
$html .= ' class="ajax lock-page"';
$html .= ' onsubmit=window.localStorage.auto_saved_sql=""';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add inline javascript here? See #13270.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most places have inline onsubmit present in forms so maintain the same coding style I preferred inline js.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, so all the onsubmit js are inline and needs to be changed, so I'll just fix this one here.

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
Signed-off-by: Saksham Gupta <shucon01@gmail.com>
Copy link
Member

@MauricioFauth MauricioFauth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Get auto-saved query" button has no more action after these changes.

@shucon
Copy link
Contributor Author

shucon commented Mar 31, 2018

@MauricioFauth Get auto-saved query is not working on master branch too. I'll check it and try to fix that too.

Signed-off-by: Saksham Gupta <shucon01@gmail.com>
@MauricioFauth
Copy link
Member

Thanks for your contribution.
Closing this PR in favor of #14166.

@MauricioFauth MauricioFauth self-assigned this May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No auto saved query everytime new sql page is loaded
2 participants