fix(site): Show folders in the template version editor (#6145)

This commit is contained in:
Bruno Quaresma
2023-02-10 13:22:20 -03:00
committed by GitHub
parent 32fbd10a1f
commit 77afdf71dc
12 changed files with 399 additions and 209 deletions
+37
View File
@@ -6,6 +6,7 @@ import * as TypesGen from "../api/typesGenerated"
import range from "lodash/range"
import { Permissions } from "xServices/auth/authXService"
import { TemplateVersionFiles } from "util/templateVersion"
import { FileTree } from "util/filetree"
export const MockTemplateDAUResponse: TypesGen.TemplateDAUsResponse = {
entries: [
@@ -303,6 +304,42 @@ spec {
`,
}
export const MockTemplateVersionFileTree: FileTree = {
"README.md": "# Example\n\nThis is an example template.",
"main.tf": `// Provides info about the workspace.
data "coder_workspace" "me" {}
// Provides the startup script used to download
// the agent and communicate with Coder.
resource "coder_agent" "dev" {
os = "linux"
arch = "amd64"
}
resource "kubernetes_pod" "main" {
// Ensures that the Pod dies when the workspace shuts down!
count = data.coder_workspace.me.start_count
metadata {
name = "dev-\${data.coder_workspace.me.id}"
}
spec {
container {
image = "ubuntu"
command = ["sh", "-c", coder_agent.main.init_script]
env {
name = "CODER_AGENT_TOKEN"
value = coder_agent.main.token
}
}
}
}
`,
images: {
"java.Dockerfile": "FROM eclipse-temurin:17-jdk-jammy",
"python.Dockerfile": "FROM python:3.8-slim-buster",
},
}
export const MockWorkspaceApp: TypesGen.WorkspaceApp = {
id: "test-app",
slug: "test-app",