From 3463f69a342db3f84ef000f6f70688885126bc7c Mon Sep 17 00:00:00 2001 From: defelmnq Date: Mon, 20 Jan 2025 12:06:40 +0100 Subject: [PATCH 1/4] remove window option --- docs/resources/app.md | 2 +- integration/coder-app-open-in/main.tf | 8 -------- integration/integration_test.go | 5 ++--- provider/app.go | 8 ++++---- provider/app_test.go | 11 +++-------- 5 files changed, 10 insertions(+), 24 deletions(-) diff --git a/docs/resources/app.md b/docs/resources/app.md index e2bbe435..b3ac728f 100644 --- a/docs/resources/app.md +++ b/docs/resources/app.md @@ -66,7 +66,7 @@ resource "coder_app" "vim" { - `healthcheck` (Block Set, Max: 1) HTTP health checking to determine the application readiness. (see [below for nested schema](#nestedblock--healthcheck)) - `hidden` (Boolean) Determines if the app is visible in the UI (minimum Coder version: v2.16). - `icon` (String) A URL to an icon that will display in the dashboard. View built-in icons here: https://github.com/coder/coder/tree/main/site/static/icon. Use a built-in icon with `"${data.coder_workspace.me.access_url}/icon/"`. -- `open_in` (String) Determines where the app will be opened. Valid values are `"tab"`, `"window"`, and `"slim-window" (default)`. `"tab"` opens in a new tab in the same browser window. `"window"` opens a fresh browser window with navigation options. `"slim-window"` opens a new browser window without navigation controls. +- `open_in` (String) Determines where the app will be opened. Valid values are `"tab"` and `"slim-window" (default)`. `"tab"` opens in a new tab in the same browser window. `"slim-window"` opens a new browser window without navigation controls. - `order` (Number) The order determines the position of app in the UI presentation. The lowest order is shown first and apps with equal order are sorted by name (ascending order). - `share` (String) Determines the level which the application is shared at. Valid levels are `"owner"` (default), `"authenticated"` and `"public"`. Level `"owner"` disables sharing on the app, so only the workspace owner can access it. Level `"authenticated"` shares the app with all authenticated users. Level `"public"` shares it with any user, including unauthenticated users. Permitted application sharing levels can be configured site-wide via a flag on `coder server` (Enterprise only). - `subdomain` (Boolean) Determines whether the app will be accessed via it's own subdomain or whether it will be accessed via a path on Coder. If wildcards have not been setup by the administrator then apps with `subdomain` set to `true` will not be accessible. Defaults to `false`. diff --git a/integration/coder-app-open-in/main.tf b/integration/coder-app-open-in/main.tf index 529d9bef..99f3a253 100644 --- a/integration/coder-app-open-in/main.tf +++ b/integration/coder-app-open-in/main.tf @@ -17,13 +17,6 @@ resource "coder_agent" "dev" { dir = "/workspace" } -resource "coder_app" "window" { - agent_id = coder_agent.dev.id - slug = "window" - share = "owner" - open_in = "window" -} - resource "coder_app" "slim-window" { agent_id = coder_agent.dev.id slug = "slim-window" @@ -40,7 +33,6 @@ resource "coder_app" "defaulted" { locals { # NOTE: these must all be strings in the output output = { - "coder_app.window.open_in" = tostring(coder_app.window.open_in) "coder_app.slim-window.open_in" = tostring(coder_app.slim-window.open_in) "coder_app.defaulted.open_in" = tostring(coder_app.defaulted.open_in) } diff --git a/integration/integration_test.go b/integration/integration_test.go index 50ef71b5..8ac68f28 100644 --- a/integration/integration_test.go +++ b/integration/integration_test.go @@ -147,9 +147,8 @@ func TestIntegration(t *testing.T) { name: "coder-app-open-in", minVersion: "v2.19.0", expectedOutput: map[string]string{ - "coder_app.window.open_in": "window", - "coder_app.slim-window.open_in": "slim-window", - "coder_app.defaulted.open_in": "slim-window", + "coder_app.tab.open_in": "tab", + "coder_app.defaulted.open_in": "slim-window", }, }, { diff --git a/provider/app.go b/provider/app.go index 391bdfc3..cd64db54 100644 --- a/provider/app.go +++ b/provider/app.go @@ -225,8 +225,8 @@ func appResource() *schema.Resource { }, "open_in": { Type: schema.TypeString, - Description: "Determines where the app will be opened. Valid values are `\"tab\"`, `\"window\"`, and `\"slim-window\" (default)`. " + - "`\"tab\"` opens in a new tab in the same browser window. `\"window\"` opens a fresh browser window with navigation options. " + + Description: "Determines where the app will be opened. Valid values are `\"tab\"` and `\"slim-window\" (default)`. " + + "`\"tab\"` opens in a new tab in the same browser window. " + "`\"slim-window\"` opens a new browser window without navigation controls.", ForceNew: true, Optional: true, @@ -238,11 +238,11 @@ func appResource() *schema.Resource { } switch valStr { - case "tab", "window", "slim-window": + case "tab", "slim-window": return nil } - return diag.Errorf(`invalid "coder_app" open_in value, must be one of "tab", "window", "slim-window": %q`, valStr) + return diag.Errorf(`invalid "coder_app" open_in value, must be one of "tab", "slim-window": %q`, valStr) }, }, }, diff --git a/provider/app_test.go b/provider/app_test.go index aaa4f631..005e8377 100644 --- a/provider/app_test.go +++ b/provider/app_test.go @@ -263,12 +263,7 @@ func TestApp(t *testing.T) { { name: "InvalidValue", value: "nonsense", - expectError: regexp.MustCompile(`invalid "coder_app" open_in value, must be one of "tab", "window", "slim-window": "nonsense"`), - }, - { - name: "ExplicitWindow", - value: "window", - expectValue: "window", + expectError: regexp.MustCompile(`invalid "coder_app" open_in value, must be one of "tab", "slim-window": "nonsense"`), }, { name: "ExplicitSlimWindow", @@ -389,11 +384,11 @@ func TestApp(t *testing.T) { url = "https://google.com" external = true hidden = false - open_in = "window" + open_in = "tab" } `, hidden: false, - openIn: "window", + openIn: "tab", }} for _, tc := range cases { tc := tc From 4e7dcaa611674b2453a4014fd1d5ab971a3afc50 Mon Sep 17 00:00:00 2001 From: defelmnq Date: Mon, 20 Jan 2025 12:18:24 +0100 Subject: [PATCH 2/4] fix missing integration test --- integration/coder-app-open-in/main.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/integration/coder-app-open-in/main.tf b/integration/coder-app-open-in/main.tf index 99f3a253..8f215a8f 100644 --- a/integration/coder-app-open-in/main.tf +++ b/integration/coder-app-open-in/main.tf @@ -17,11 +17,11 @@ resource "coder_agent" "dev" { dir = "/workspace" } -resource "coder_app" "slim-window" { +resource "coder_app" "tab" { agent_id = coder_agent.dev.id - slug = "slim-window" + slug = "tab" share = "owner" - open_in = "slim-window" + open_in = "tab" } resource "coder_app" "defaulted" { From 79eded5b4c1ed294e6bbf171d3d9f9f87701e79f Mon Sep 17 00:00:00 2001 From: defelmnq Date: Mon, 20 Jan 2025 12:36:46 +0100 Subject: [PATCH 3/4] fix tests --- integration/coder-app-open-in/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration/coder-app-open-in/main.tf b/integration/coder-app-open-in/main.tf index 8f215a8f..c87fad4c 100644 --- a/integration/coder-app-open-in/main.tf +++ b/integration/coder-app-open-in/main.tf @@ -33,7 +33,7 @@ resource "coder_app" "defaulted" { locals { # NOTE: these must all be strings in the output output = { - "coder_app.slim-window.open_in" = tostring(coder_app.slim-window.open_in) + "coder_app.tab.open_in" = tostring(coder_app.tab.open_in) "coder_app.defaulted.open_in" = tostring(coder_app.defaulted.open_in) } } From 8f259be3edd90c351a5bab5b85fda0a6a9daf4ac Mon Sep 17 00:00:00 2001 From: defelmnq Date: Mon, 20 Jan 2025 12:43:40 +0100 Subject: [PATCH 4/4] run linter --- integration/coder-app-open-in/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration/coder-app-open-in/main.tf b/integration/coder-app-open-in/main.tf index c87fad4c..f06947ae 100644 --- a/integration/coder-app-open-in/main.tf +++ b/integration/coder-app-open-in/main.tf @@ -33,8 +33,8 @@ resource "coder_app" "defaulted" { locals { # NOTE: these must all be strings in the output output = { - "coder_app.tab.open_in" = tostring(coder_app.tab.open_in) - "coder_app.defaulted.open_in" = tostring(coder_app.defaulted.open_in) + "coder_app.tab.open_in" = tostring(coder_app.tab.open_in) + "coder_app.defaulted.open_in" = tostring(coder_app.defaulted.open_in) } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy