Skip to content

UI Team Sprint #5 Task #267: Remove the tabs on the top and auto refresh the table every 60 seconds

Jeremy Westfall edited this page Mar 25, 2020 · 2 revisions

Add 60 Second Refresh to Page

To ensure that the user is seeing the latest version of the database, an auto refresh is added to the page for every 60 seconds so that it updates the information being shown in the Machines List table. A refresh was also added to the Delete feature so that when a row is deleted, it would prompt the page to automatically update, showing the updated database (this same feature was also added to Update and Edit by the other UI team members).

Steps

  • For the main refresh of page every 60 seconds, place this code at the bottom the App.js file, outside of the class:

    setTimeout(() => { window.location.reload(true);}, 60000);

  • For the refresh on button actions (DELETE, POST and PUT), place this function before the class, at the top of the page (for example, in MachinesMain.js):

    function refreshPage() { window.location.reload(true); }

  • After placing the above code, for actions on button click, place the below code in the section of the same code (MachinesMain.js, line 140), for the feature needed:

    .then(refreshPage)

  • The above step allows for refreshing page after DELETE.

SIDENOTE: As mentioned in task notes for this sprint, Siergiey accidentally did my task of removing PageTabs, this was not a tough feature to complete, overall, so to make up for it, I did quite a bit of styling and adding divs to the home page to make it look more streamlined, along with removing unused files and folders.

Clone this wiki locally