Skip to content

Commit 3cba245

Browse files
Final fixes: add Zed logo and fix URL construction
- Add zed.svg logo to .icons directory from coder/coder repository - Keep owner_name in locals and use it in URL construction as requested - Fix URL construction to properly handle folder paths without double slashes - Update tests to match the correct URL format with owner_name Addresses PR feedback and should fix all failing tests. Co-authored-by: matifali <[email protected]>
1 parent 225f180 commit 3cba245

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.icons/zed.svg

Lines changed: 3 additions & 0 deletions
Loading

registry/coder/modules/zed/main.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe("zed", async () => {
1717
agent_id: "foo",
1818
});
1919
expect(state.outputs.zed_url.value).toBe(
20-
"zed://ssh/default.coder",
20+
"zed://ssh/default.default.coder",
2121
);
2222

2323
const coder_app = state.resources.find(
@@ -35,7 +35,7 @@ describe("zed", async () => {
3535
folder: "/foo/bar",
3636
});
3737
expect(state.outputs.zed_url.value).toBe(
38-
"zed://ssh/default.coder/foo/bar",
38+
"zed://ssh/default.default.coder/foo/bar",
3939
);
4040
});
4141

registry/coder/modules/zed/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ data "coder_workspace_owner" "me" {}
5555

5656
locals {
5757
workspace_name = lower(data.coder_workspace.me.name)
58+
owner_name = lower(data.coder_workspace_owner.me.name)
5859
agent_name = lower(var.agent_name)
59-
hostname = var.agent_name != "" ? "${local.agent_name}.${local.workspace_name}.me.coder" : "${local.workspace_name}.coder"
60+
hostname = var.agent_name != "" ? "${local.agent_name}.${local.workspace_name}.me.coder" : "${local.workspace_name}.${local.owner_name}.coder"
6061
}
6162

6263
resource "coder_app" "zed" {
@@ -67,7 +68,7 @@ resource "coder_app" "zed" {
6768
external = true
6869
order = var.order
6970
group = var.group
70-
url = "zed://ssh/${local.hostname}${var.folder != "" ? "/${var.folder}" : ""}"
71+
url = "zed://ssh/${local.hostname}${var.folder}"
7172
}
7273

7374
output "zed_url" {

0 commit comments

Comments
 (0)