diff --git a/docs/resources/app.md b/docs/resources/app.md index e2bbe43..b3ac728 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 529d9be..f06947a 100644 --- a/integration/coder-app-open-in/main.tf +++ b/integration/coder-app-open-in/main.tf @@ -17,18 +17,11 @@ resource "coder_agent" "dev" { dir = "/workspace" } -resource "coder_app" "window" { +resource "coder_app" "tab" { agent_id = coder_agent.dev.id - slug = "window" + slug = "tab" share = "owner" - open_in = "window" -} - -resource "coder_app" "slim-window" { - agent_id = coder_agent.dev.id - slug = "slim-window" - share = "owner" - open_in = "slim-window" + open_in = "tab" } resource "coder_app" "defaulted" { @@ -40,9 +33,8 @@ 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) + "coder_app.tab.open_in" = tostring(coder_app.tab.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 50ef71b..8ac68f2 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 391bdfc..cd64db5 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 aaa4f63..005e837 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