Closed sjvrijn closed 2 months ago
Unless I'm doing something wrong with the browser caching, if I switch to this branch, after testing it I observe that the data is lost on F5 and page navigation due to the elimination of the session variable. Reasonably, this is not the behaviour expected from a web app, i.e. the user has to be able to navigate the pages (like the help page) and go back to the workspace in the index page without loosing the information.
To achive this, we have to store the information into a session variable or using a local storage. I don't see other option than that. Concluding, I think this PR emerges from the presence of the PHP code. Just try to achieve the same storing with JavaScript if you prefer.
I have no experience with that but you may want to try:
// Storing data localStorage.setItem("user", JSON.stringify({ ... }));
// Session storage sessionStorage.setItem("sessionData", "Session Info");
Thanks. :)
Before
After visiting the help page
@ermannolocascio Good find, I've looked into it, and it seems like this was already broken by #93: The session is not maintained when data is loaded from a json file. I've created issue #110 about this.
Latest commits seem to have solved the issue, which would also fix #110. @ermannolocascio can you confirm?
Hi @sjvrijn, thanks for the update. The chart and table now remains on on F5 press. I notice few problems that I list here, to be discussed:
Reset position after page refresh. When I drag the statements and then I press F5 the position of the item is reset. We can eventually accept this. At the same time it would be nice to update the new position when the user unclick the mouse (I guess this is not as simple as is sounds to code).
The connection between the statements fails sometimes. I see an extra connection and the positioning goes bad when dragging. We knew it. Sometime we should also fix it :)
For the rest, it looks ok so far. Thanks again.
Thanks for checking, let's indeed make new issues for the two problems you indicated.
Combined PR for three issues that are all part of refactoring and streamlining the code flow when either uploading a file or refreshing the page.
populateTable
function in javascript, remove PHP/html datatable creationstatement
objectsconfirmUpload
andrenderOnLoad
functions; makerenderOnLoad
get all values from the globalINA
namespace, and add a dedicated function to set values in theINA
namespace when needed (such as on a page refresh)