feat(site): connect open_in parameter (#16036)

Second step to resolve [open_in
issue](https://github.com/coder/terraform-provider-coder/issues/297)

This PR improves the way the open_in parameter is forwarded across the
code, changing the last `string` to const everywhere.

Also make sure it is available and forwarded up to the `CreateLink`
component.
This commit is contained in:
Vincent Vielle
2025-01-07 18:08:03 +01:00
committed by GitHub
parent b5c85a8abd
commit 289338f19e
13 changed files with 510 additions and 466 deletions
+1 -1
View File
@@ -452,7 +452,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent} \
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
+14 -8
View File
@@ -78,7 +78,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -273,7 +273,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild} \
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -602,7 +602,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/res
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -729,7 +729,7 @@ Status Code **200**
| `»»» hidden` | boolean | false | | |
| `»»» icon` | string | false | | Icon is a relative path or external URL that specifies an icon to be displayed in the dashboard. |
| `»»» id` | string(uuid) | false | | |
| `»»» open_in` | string | false | | |
| `»»» open_in` | [codersdk.WorkspaceAppOpenIn](schemas.md#codersdkworkspaceappopenin) | false | | |
| `»»» sharing_level` | [codersdk.WorkspaceAppSharingLevel](schemas.md#codersdkworkspaceappsharinglevel) | false | | |
| `»»» slug` | string | false | | Slug is a unique identifier within the agent. |
| `»»» subdomain` | boolean | false | | Subdomain denotes whether the app should be accessed via a path on the `coder server` or via a hostname-based dev URL. If this is set to true and there is no app wildcard configured on the server, the app will not be accessible in the UI. |
@@ -808,6 +808,9 @@ Status Code **200**
| `health` | `initializing` |
| `health` | `healthy` |
| `health` | `unhealthy` |
| `open_in` | `slim-window` |
| `open_in` | `window` |
| `open_in` | `tab` |
| `sharing_level` | `owner` |
| `sharing_level` | `authenticated` |
| `sharing_level` | `public` |
@@ -908,7 +911,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/sta
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -1176,7 +1179,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/builds \
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -1344,7 +1347,7 @@ Status Code **200**
| `»»»» hidden` | boolean | false | | |
| `»»»» icon` | string | false | | Icon is a relative path or external URL that specifies an icon to be displayed in the dashboard. |
| `»»»» id` | string(uuid) | false | | |
| `»»»» open_in` | string | false | | |
| `»»»» open_in` | [codersdk.WorkspaceAppOpenIn](schemas.md#codersdkworkspaceappopenin) | false | | |
| `»»»» sharing_level` | [codersdk.WorkspaceAppSharingLevel](schemas.md#codersdkworkspaceappsharinglevel) | false | | |
| `»»»» slug` | string | false | | Slug is a unique identifier within the agent. |
| `»»»» subdomain` | boolean | false | | Subdomain denotes whether the app should be accessed via a path on the `coder server` or via a hostname-based dev URL. If this is set to true and there is no app wildcard configured on the server, the app will not be accessible in the UI. |
@@ -1443,6 +1446,9 @@ Status Code **200**
| `health` | `initializing` |
| `health` | `healthy` |
| `health` | `unhealthy` |
| `open_in` | `slim-window` |
| `open_in` | `window` |
| `open_in` | `tab` |
| `sharing_level` | `owner` |
| `sharing_level` | `authenticated` |
| `sharing_level` | `public` |
@@ -1579,7 +1585,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/builds \
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
+23 -7
View File
@@ -6872,7 +6872,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -7060,7 +7060,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -7465,7 +7465,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -7486,7 +7486,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
| `hidden` | boolean | false | | |
| `icon` | string | false | | Icon is a relative path or external URL that specifies an icon to be displayed in the dashboard. |
| `id` | string | false | | |
| `open_in` | string | false | | |
| `open_in` | [codersdk.WorkspaceAppOpenIn](#codersdkworkspaceappopenin) | false | | |
| `sharing_level` | [codersdk.WorkspaceAppSharingLevel](#codersdkworkspaceappsharinglevel) | false | | |
| `slug` | string | false | | Slug is a unique identifier within the agent. |
| `subdomain` | boolean | false | | Subdomain denotes whether the app should be accessed via a path on the `coder server` or via a hostname-based dev URL. If this is set to true and there is no app wildcard configured on the server, the app will not be accessible in the UI. |
@@ -7518,6 +7518,22 @@ If the schedule is empty, the user will be updated to use the default schedule.|
| `healthy` |
| `unhealthy` |
## codersdk.WorkspaceAppOpenIn
```json
"slim-window"
```
### Properties
#### Enumerated Values
| Value |
|---------------|
| `slim-window` |
| `window` |
| `tab` |
## codersdk.WorkspaceAppSharingLevel
```json
@@ -7589,7 +7605,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -7989,7 +8005,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -8239,7 +8255,7 @@ If the schedule is empty, the user will be updated to use the default schedule.|
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
+10 -4
View File
@@ -2074,7 +2074,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/d
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -2201,7 +2201,7 @@ Status Code **200**
| `»»» hidden` | boolean | false | | |
| `»»» icon` | string | false | | Icon is a relative path or external URL that specifies an icon to be displayed in the dashboard. |
| `»»» id` | string(uuid) | false | | |
| `»»» open_in` | string | false | | |
| `»»» open_in` | [codersdk.WorkspaceAppOpenIn](schemas.md#codersdkworkspaceappopenin) | false | | |
| `»»» sharing_level` | [codersdk.WorkspaceAppSharingLevel](schemas.md#codersdkworkspaceappsharinglevel) | false | | |
| `»»» slug` | string | false | | Slug is a unique identifier within the agent. |
| `»»» subdomain` | boolean | false | | Subdomain denotes whether the app should be accessed via a path on the `coder server` or via a hostname-based dev URL. If this is set to true and there is no app wildcard configured on the server, the app will not be accessible in the UI. |
@@ -2280,6 +2280,9 @@ Status Code **200**
| `health` | `initializing` |
| `health` | `healthy` |
| `health` | `unhealthy` |
| `open_in` | `slim-window` |
| `open_in` | `window` |
| `open_in` | `tab` |
| `sharing_level` | `owner` |
| `sharing_level` | `authenticated` |
| `sharing_level` | `public` |
@@ -2506,7 +2509,7 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/r
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -2633,7 +2636,7 @@ Status Code **200**
| `»»» hidden` | boolean | false | | |
| `»»» icon` | string | false | | Icon is a relative path or external URL that specifies an icon to be displayed in the dashboard. |
| `»»» id` | string(uuid) | false | | |
| `»»» open_in` | string | false | | |
| `»»» open_in` | [codersdk.WorkspaceAppOpenIn](schemas.md#codersdkworkspaceappopenin) | false | | |
| `»»» sharing_level` | [codersdk.WorkspaceAppSharingLevel](schemas.md#codersdkworkspaceappsharinglevel) | false | | |
| `»»» slug` | string | false | | Slug is a unique identifier within the agent. |
| `»»» subdomain` | boolean | false | | Subdomain denotes whether the app should be accessed via a path on the `coder server` or via a hostname-based dev URL. If this is set to true and there is no app wildcard configured on the server, the app will not be accessible in the UI. |
@@ -2712,6 +2715,9 @@ Status Code **200**
| `health` | `initializing` |
| `health` | `healthy` |
| `health` | `unhealthy` |
| `open_in` | `slim-window` |
| `open_in` | `window` |
| `open_in` | `tab` |
| `sharing_level` | `owner` |
| `sharing_level` | `authenticated` |
| `sharing_level` | `public` |
+6 -6
View File
@@ -119,7 +119,7 @@ of the template will be used.
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -350,7 +350,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -605,7 +605,7 @@ of the template will be used.
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -835,7 +835,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces \
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -1067,7 +1067,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace} \
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
@@ -1414,7 +1414,7 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/dormant \
"hidden": true,
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"open_in": "string",
"open_in": "slim-window",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,