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
Bugfix 4415,4453,4452,4451; RFE-1518 (Navigate away) improvements #1222
Conversation
-> Now, listens only on forms with "lock-page" class. |
-> Displays lock icon at top right corner (just before "goto pagetop") in menubar when form gets edited. |
-> Complete makeover |
Changes Unknown when pulling de0f7bc on D-storm:bug-4415 into * on phpmyadmin:master*. |
Thanks for the github example, maybe now I can explain it in a better way. CASE 1 (No changes, no prompt on cancel): CASE 2 (Unsaved changes, prompt on cancel): CASE 3 (Revert changes, no prompt on cancel): [Bug-4452] CASE 4 (Truncating existing data, prompt on cancel): [Bug-4453] CASE 5 (cut/pasting using mouse, prompt on cancel): [Bug-4451] |
I think we should also use similar prompt message. How about this one: "Are you sure you want to leave this page? You have unsaved changes that will be reverted." or any other suggestion would be appreciated. |
I suggest "You have unsaved changes; are you sure you want to leave this page?". |
That is also a good one. |
Well, I was considering case of editing any file in github, they do not take care if the values have been reverted, the prompt is triggered for any change. Although its a good feature to have if saving the values of each fields in not an overhead! But considering the one, when we truncate the values. If we look at the scenario for PMA, If I have empty fields, I do not have any data to loose.. in this case, I think maximum probability is user intentionally want to navigate away and thus should not get a prompt. Even if false negative occurs, the user has no data to loose! |
@mebjas, after reverting the changes whether we save or not does not make the difference so there is no need to prompt and as far as saving values of each field is considered then it is not an overhead because I am not saving the values of each field, here I am hashing the old value and saving that hash inside data-attribute of form element which is fixed small size data no matter how big your data is. And considering the data loss only is not good, we should consider changes because deletions are equally important to additions. It may be possible that user wants to empty the field and accidentally navigates away and his/her changes will not get saved. Suppose a user is editing a row (insert/edit tab) having 100 columns all full of data and you want to empty the 90 columns of it. After doing this, (s)he accidentally clicked a link then it would get navigated away without saving it. Yes, if the field initially was empty then it will not prompt the user. |
Well I think this condition will arise in mostly in editing tab only. So we can keep it. |
Exactly. |
Signed-off-by: Chirayu Chiripal <chirayu.chiripal@gmail.com>
The inspection completed: No new issues |
I have started testing and so far, I like this patch. Can you confirm that grid editing with the following case does not lock the page?
|
Currently, I have not added lock-page class to grid editing form. So, it will not work now. If it is needed to add there, I can add it. |
Well it can wait; I'll merge this pull request first, after my tests. |
Nice work. I'm not sure we need to lock the table Search page (at least, leaving this page would not cause much harm) but I'm happy to leave it locked for now. |
Bugfix 4415,4453,4452,4451; RFE-1518 (Navigate away) improvements
-> Reverted old partial fix for bug-4415
-> Complete Fix for Bug-4415 + "Filter Rows:" prompt fix
-> It now considers only input/textarea which are inside form elements. (This fixes unnecessary prompts on "Filter rows:" of browse tab).