Repository navigation
fix(dashboard): stop doubling https:// on deployment URLs - #1944
Open
FrancocDev wants to merge 1 commit into
Open
FrancocDev wants to merge 1 commit into
FrancocDev wants to merge 1 commit into
Conversation
The deployment history maps the API's url column, which already carries the scheme, into deployment.domain. The deployments menu and commit details modal then prefixed https:// again, so Copy URL produced https://https://host and Open/Visit opened a broken link. Add deploymentUrl(), which only prefixes https:// when no scheme is present, and use it for Open, Copy URL and Visit site.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Franco · project thread
Summary
Copy URL in the Deployments tab now copies
https://beszel.example.cominstead ofhttps://https://beszel.example.com. The same fix applies to Open deployment and the commit details Visit site button, which opened the same broken link.Motivation
mapRowToDeploymentsetsdeployment.domainfrom the API row'surl, and that column already includes the scheme (the deploy services storehttps://<hostname>;projects/components/DeploymentCard.tsxusesdeployment.urlas anhrefdirectly).DeploymentMenuandCommitDetailsModalthen built`https://${deployment.domain}`, so the scheme was added twice.Related issue
None
Changes
apps/dashboard
deployments/utils.ts: adddeploymentUrl(domain), which returns the value unchanged when it already has a scheme and prefixeshttps://only for a bare hostname.deployments/components/DeploymentMenu.tsx: Open deployment and Copy URL usedeploymentUrl.deployments/components/CommitDetailsModal.tsx: Visit site usesdeploymentUrl.deployments/utils.test.ts: maps an API row withurl: "https://app.example.com"and checks the resulting URL, plus the bare-hostname case.Verification
With the old
`https://${domain}`body restored, the new test fails:Checklist
bun run test,bun run --cwd <workspace> lint, andbun formatall pass locally (ran the deployments tests and the dashboard typecheck; the full suite was not run, and Prettier was checked on the new lines only sinceutils.tshas existing drift)