[go: nahoru, domu]

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

Using localStorage to save the state of the Designer #15398

Closed
wants to merge 4 commits into from

Conversation

Bournvita1998
Copy link
Contributor
@Bournvita1998 Bournvita1998 commented Jul 22, 2019

Signed-off-by: Mohit Kuri mohit.kuri@research.iiit.ac.in

Fixes #12286

Before submitting pull request, please review the following checklist:

  • Make sure you have read our CONTRIBUTING.md document.
  • Make sure you are making a pull request against the correct branch. For example, for bug fixes in a released version use the corresponding QA branch and for new features use the master branch. If you have a doubt, you can ask as a comment in the bug report or on the mailing list.
  • Every commit has proper Signed-off-by line as described in our DCO. This ensures that the work you're submitting is your own creation.
  • Every commit has a descriptive commit message.
  • Every commit is needed on its own, if you have just minor fixes to previous commits, you can squash them.
  • Any new functionality is covered by tests.

Signed-off-by: Mohit Kuri <mohit.kuri@research.iiit.ac.in>
@Bournvita1998 Bournvita1998 changed the title Used localStorage to save the state Using localStorage to save the state of the Designer Jul 22, 2019
@shucon
Copy link
Contributor
shucon commented Jul 28, 2019

@sudo-bot Deploy PR

@sudo-robot
Copy link
sudo-robot commented Jul 28, 2019

Deployed (phpmyadmin-pr-15398): localStorage commit: 54927de35cbbcc350f93515c773e3b8250ca2f1a

url: https://phpmyadmin-pr-15398.wdes.eu.org
user: public
user: public


Deploy finished

1 similar comment
@sudo-robot
Copy link
sudo-robot commented Jul 28, 2019

Deployed (phpmyadmin-pr-15398): localStorage commit: 54927de35cbbcc350f93515c773e3b8250ca2f1a

url: https://phpmyadmin-pr-15398.wdes.eu.org
user: public
user: public


Deploy finished

@shucon
Copy link
Contributor
shucon commented Jul 29, 2019

Your code is not saving variables properly in localStorage and thus not able to restore the state of the Designer.

@Bournvita1998
Copy link
Contributor Author

@shucon Yes you were right, its not storing values and the data assocated with the tables is also not poping shoehow. Thus while debugging, rather than considering all the tables at once, I have looked at the changes for one of the tables first. Here are the changes made:
Selection_061

Selection_060

Corresponding output associated to this is:

Selection_062

i.e. the values which are being SET and GET are both the same.

@Bournvita1998
Copy link
Contributor Author

Code associated with the above screen shots is:

var key = $('.designer_tab')[0].id;
if((localStorage.getItem('id_tbody_' + key) !== null) && (localStorage.getItem('id_hide_tbody_' + key) !== null)) {
    document.getElementById('id_tbody_' + key).innerHTML = localStorage.getItem('id_tbody_' + key);
    document.getElementById('id_hide_tbody_' + key).innerHTML = localStorage.getItem('id_hide_tbody_' + key);
    console.log('GET1 key = ' + 'id_tbody_' + key + '------ with value = ' + document.getElementById('id_tbody_' + key).innerHTML);
    console.log('GET1 key = ' + 'id_hide_tbody_' + key + '------ with value = ' + document.getElementById('id_hide_tbody_' + key).innerHTML);
}
console.log('GET2 key = ' + 'id_tbody_' + key + '------ with value = ' + localStorage.getItem('id_tbody_' + key));
console.log('GET2 key = ' + 'id_hide_tbody_' + key + '------ with value = ' + localStorage.getItem('id_hide_tbody_' + key));

AND

$('.designer_tab').on('click', '.small_tab,.small_tab2', function () {
    DesignerMove.smallTab($(this).attr('table_name'), 1);
    var t = $(this).attr('table_name');
    var id      = document.getElementById('id_tbody_' + t);
    var idThis = document.getElementById('id_hide_tbody_' + t);
    localStorage.setItem('id_tbody_' + t, id.innerHTML);
    localStorage.setItem('id_hide_tbody_' + t, idThis.innerHTML);
    console.log('SET key = ' + 'id_tbody_' + t + '...... with value = ' + id.innerHTML);
    console.log('SET key = ' + 'id_hide_tbody_' + t + '...... with value = ' + idThis.innerHTML);
});

Signed-off-by: Bournvita1998 <mohit.kuri@research.iiit.ac.in>
…t for one table

Signed-off-by: Bournvita1998 <mohit.kuri@research.iiit.ac.in>
@Bournvita1998
Copy link
Contributor Author

Committed the changes as per the comment message but the committed code is for all the tables(not just for one table as shown here in the comment)

@williamdes williamdes added this to To do in pull-requests Aug 20, 2019
@williamdes williamdes moved this from To do to In progress in pull-requests Aug 20, 2019
@williamdes
Copy link
Member

@Bournvita1998 can you rebase onto QA_4_9 and shash your commits ?
you will maybe need to re-do the PR

@williamdes williamdes moved this from In progress to blocked in pull-requests Aug 30, 2019
@stale
Copy link
stale bot commented Oct 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 29, 2019
@stale stale bot closed this Nov 5, 2019
pull-requests automation moved this from blocked to Done Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
pull-requests
  
Done
Development

Successfully merging this pull request may close these issues.

Designer should remember expanded/collapsed state
5 participants