Skip to content

refactor(frontend): Use AppPath mapping for all href redirections#9343

Merged
AntonioVentilii merged 12 commits intomainfrom
refactor-frontend/Use-AppPath-mapping-for-all-href-redirections
Mar 30, 2026
Merged

refactor(frontend): Use AppPath mapping for all href redirections#9343
AntonioVentilii merged 12 commits intomainfrom
refactor-frontend/Use-AppPath-mapping-for-all-href-redirections

Conversation

@AntonioVentilii
Copy link
Copy Markdown
Collaborator

@AntonioVentilii AntonioVentilii commented Oct 2, 2025

Motivation

We have the mapping AppPath to keep track of all the paths of our app. We should use that for all href for maintainability.

Changes

  • Add LicenseAgreement, PrivacyPolicy, and TermsOfUse paths to the AppPath enum.
  • Replace all hard-coded href values in link components with resolve(AppPath.X).

Tests

Updated existing tests.

@AntonioVentilii AntonioVentilii requested a review from a team as a code owner October 2, 2025 10:46
Copilot AI review requested due to automatic review settings October 2, 2025 10:46
@AntonioVentilii AntonioVentilii marked this pull request as draft October 2, 2025 10:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the frontend to use centralized AppPath mapping for all href redirections instead of hard-coded paths, improving maintainability and consistency.

  • Created a new pathToHref utility function to convert AppPath values to href strings
  • Added new AppPath entries for license agreement, privacy policy, and terms of use pages
  • Replaced hard-coded href values in multiple components with centralized path references

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/frontend/src/lib/utils/nav.utils.ts Added pathToHref utility function to convert AppPath to href format
src/frontend/src/lib/constants/routes.constants.ts Added new AppPath entries for agreement pages
src/frontend/src/tests/lib/utils/nav.utils.spec.ts Added comprehensive tests for the new pathToHref function
src/frontend/src/lib/components/terms-of-use/TermsOfUseLink.svelte Replaced hard-coded href with AppPath reference
src/frontend/src/lib/components/privacy-policy/PrivacyPolicyLink.svelte Replaced hard-coded href with AppPath reference
src/frontend/src/lib/components/license-agreement/LicenseAgreementLink.svelte Replaced hard-coded href with AppPath reference
src/frontend/src/lib/components/core/OisyWalletLogoLink.svelte Replaced hard-coded href with AppPath reference

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/frontend/src/lib/components/core/OisyWalletLogoLink.svelte
@AntonioVentilii AntonioVentilii marked this pull request as ready for review March 27, 2026 13:04
@AntonioVentilii AntonioVentilii requested a review from a team as a code owner March 27, 2026 13:04
Copy link
Copy Markdown
Contributor

@DenysKarmazynDFINITY DenysKarmazynDFINITY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one!

@AntonioVentilii AntonioVentilii added this pull request to the merge queue Mar 30, 2026
Merged via the queue into main with commit f91c2d5 Mar 30, 2026
80 checks passed
@AntonioVentilii AntonioVentilii deleted the refactor-frontend/Use-AppPath-mapping-for-all-href-redirections branch March 30, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants