fix: fix workspace proxy command app link href (#11423)

* fix: workspace proxy command app link href
This commit is contained in:
Steven Masley
2024-01-05 10:27:06 -06:00
committed by GitHub
parent 46b90ce898
commit f0132b543d
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ describe("create app link", () => {
},
);
expect(href).toBe(
"/path-base/@username/Test-Workspace.a-workspace-agent/terminal?command=ls%20-la",
"/@username/Test-Workspace.a-workspace-agent/terminal?command=ls%20-la",
);
});
+4 -1
View File
@@ -20,7 +20,10 @@ export const createAppLinkHref = (
agent.name
}/apps/${encodeURIComponent(appSlug)}/`;
if (app.command) {
href = `${preferredPathBase}/@${username}/${workspace.name}.${
// Terminal links are relative. The terminal page knows how
// to select the correct workspace proxy for the websocket
// connection.
href = `/@${username}/${workspace.name}.${
agent.name
}/terminal?command=${encodeURIComponent(app.command)}`;
}