Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: handle alias redirection #1128

Merged
merged 15 commits into from
Jan 29, 2025
Merged

feat: handle alias redirection #1128

merged 15 commits into from
Jan 29, 2025

Conversation

ChaituVR
Copy link
Member

@ChaituVR ChaituVR commented Jan 29, 2025

Almost same as #1121
except with the new condition if (spaceName.includes(':') || isWhiteLabel.value) return next();

Summary:

Closes: https://github.com/snapshot-labs/workflow/issues/369

  • Handle alias spaces redirection
  • space's /about should redirect to the space overview page to handle v1's URLs
  • Ignores white label domains and networks other than s:

How to test:

List of redirects:

Original URL Redirect URL
https://localhost:8080/#/s:gal.eth https://localhost:8080/#/s:g-dao.eth
https://localhost:8080/#/gal.eth https://localhost:8080/#/s:g-dao.eth
https://localhost:8080/#/s:safe.eth https://localhost:8080/#/s:safe.eth
https://localhost:8080/#/safe.eth https://localhost:8080/#/s:safe.eth
https://localhost:8080/#/s:safe.eth/about https://localhost:8080/#/s:safe.eth
https://localhost:8080/#/safe.eth/about https://localhost:8080/#/s:safe.eth
http://localhost:8080/#/s:arbitrumfoundation.eth/proposal/0x2bc8e69eb65f3b2127072242ca317f51578db014019e22e8b370254e0566a4cf http://localhost:8080/#/s:arbitrumfoundation.eth/proposal/0x2bc8e69eb65f3b2127072242ca317f51578db014019e22e8b370254e0566a4cf
http://localhost:8080/#/arbitrumfoundation.eth/proposal/0x2bc8e69eb65f3b2127072242ca317f51578db014019e22e8b370254e0566a4cf http://localhost:8080/#/s:arbitrumfoundation.eth/proposal/0x2bc8e69eb65f3b2127072242ca317f51578db014019e22e8b370254e0566a4cf
http://localhost:8080/#/gal.eth/proposal/0xe93fb72cba1d271ab9bce0a7b7decda091ff16efb3b1574c06f3bf3042b2a7d5 http://localhost:8080/#/s:g-dao.eth/proposal/0xe93fb72cba1d271ab9bce0a7b7decda091ff16efb3b1574c06f3bf3042b2a7d5
http://localhost:8080/#/s:gal.eth/proposal/0xe93fb72cba1d271ab9bce0a7b7decda091ff16efb3b1574c06f3bf3042b2a7d5 http://localhost:8080/#/s:g-dao.eth/proposal/0xe93fb72cba1d271ab9bce0a7b7decda091ff16efb3b1574c06f3bf3042b2a7d5
http://localhost:8080/#/g-dao.eth/proposal/0xe93fb72cba1d271ab9bce0a7b7decda091ff16efb3b1574c06f3bf3042b2a7d5 http://localhost:8080/#/s:g-dao.eth/proposal/0xe93fb72cba1d271ab9bce0a7b7decda091ff16efb3b1574c06f3bf3042b2a7d5
https://localhost:8080/#/delegate/safe.eth https://localhost:8080/#/s:safe.eth/delegates
https://localhost:8080/#/strategy/erc20-balance-of https://v1.snapshot.box/#/strategy/erc20-balance-of
https://localhost:8080/#/playground/erc20-balance-of https://v1.snapshot.box/#/playground/erc20-balance-of
https://localhost:8080/#/sn:0x009fedaf0d7a480d21a27683b0965c0f8ded35b3f1cac39827a25a06a8a682a4 https://localhost:8080/#/sn:0x009fedaf0d7a480d21a27683b0965c0f8ded35b3f1cac39827a25a06a8a682a4
https://localhost:8080/#/base:0x282d013BF31374D0046F04D6a7644d97751ed339/proposal/6 https://localhost:8080/#/base:0x282d013BF31374D0046F04D6a7644d97751ed339/proposal/6
https://localhost:8080/#/base:0x282d013BF31374D0046F04D6a7644d97751ed339 https://localhost:8080/#/base:0x282d013BF31374D0046F04D6a7644d97751ed339

@ChaituVR ChaituVR requested review from Sekhmet and wa0x6e January 29, 2025 12:11
apps/ui/src/routes/index.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@wa0x6e wa0x6e left a comment

Choose a reason for hiding this comment

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

tAck

apps/ui/src/routes/index.ts Outdated Show resolved Hide resolved
@ChaituVR ChaituVR merged commit 6196993 into master Jan 29, 2025
2 checks passed
@ChaituVR ChaituVR deleted the alias-space-name branch January 29, 2025 16:29
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