Frontend: Artifacts: Push page changes to browser history

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

After navigating through pages of artifacts on the artifacts page, using the browser back button navigates away from the page altogether.

Proposal

Push page changes to the browser history so that the browser back button will navigate back through the pages of artifacts that were viewed.

Technical proposal

In job_artifacts_table.vue:

  • to add each page change as a new entry in the browser history: update the handlePageChange method to call updateHistory with the new page param
  • to trigger an update to the list based on navigation through the browser history:
    • add created/destroyed lifecycle hooks to the component that add/remove an event listener for the popstate event
    • make the listener call a new method that sets this.page to the page param from the current url using getParameterByName

Here's a commit from another recent implementation for reference: 64e16509

Edited by 🤖 GitLab Bot 🤖