[go: up one dir, main page]

refactor: loading of settings and hooks.server.ts

Proposed Changes

This PR refactors and improves the setup of the frontend:

  • it loads the config from a class instead of making it a singleton: tests and code are adapted to that change
  • the server.hooks.ts file is strutured to have handles that run in sequence: 1. setup -> 2. auth -> 3. route protection and api client auth setup

Types of Changes

What types of changes does your code introduce? Put an x in the boxes that apply

  • A bug fix (non-breaking change which fixes an issue).
  • A new feature (non-breaking change which adds functionality).
  • A breaking change (fix or feature that would cause existing functionality to not work as expected).
  • A non-productive update (documentation, tooling, etc. if none of the other choices apply).

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING guidelines.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added the necessary documentation (if appropriate).

CI Attributes

YAML Settings
build:
  lazy: true # Use this experimentally only! (this uses change detection)

  # Use this to run the DAG selecting only a single target
  # Note: pipeline will fail at end automatically!
  # targets: []

images:

# push: true # Push the images to a temporary space to test it.
# useReleaseTag: true # Use a release version tag.

debug:
# The job name where you want to launch `tmux` to attach into.
# jobName: contract-manager::test-endpoints

Further Comments

The hooks.server.ts file was quite complex and hard to read: this PR simplifies it. It was pointed out that the config singleton was a problem with the test setup, therefore this was changed to make the testup easier.

Merge request reports

Loading