Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • nomad-FAIR nomad-FAIR
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 239
    • Issues 239
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 42
    • Merge requests 42
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • nomad-labnomad-lab
  • nomad-FAIRnomad-FAIR
  • Merge requests
  • !690

Refactor the relationship between FileBrowser, various entry/upload views and their contexts

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged David Sikter requested to merge 828-refactor-the-relationship-between-filebrowser-various-entry-upload-views-and-their-contexts into v1.1.1 May 24, 2022
  • Overview 8
  • Commits 7
  • Pipelines 13
  • Changes 56

Refactoring logic along the lines suggested by #828 (closed). A central "store" is introduced, where components can subscribe to uploads or entries they are interested in. The subscriptions are done in useEffect (the way react recommend handling subscriptions). The components provide a callback function, which is called whenever the store upload object changes. The store is responsible for fetching data and notifying subscribers.

The store fetches data if it sees the need to. If an upload or entry is processing, it will poll once per second until it finishes processing, or no subscriber is interested in it anymore.

The file browser and the upload overview page use the store for synching. Making an update to the files on one of these pages and switching to the other should show an updated result, unlike before. Also removed the blocking dialogue saying that the upload is processing when an action is performed in the file browser. It's quite possible to browse while the upload is processing (if additional file operations are issued during processing, they should just be queued), and with the store, it's easy to make sure everything is updated when done.

Edited Jun 10, 2022 by David Sikter
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: 828-refactor-the-relationship-between-filebrowser-various-entry-upload-views-and-their-contexts