mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add OpenIn option to coder_app (#15743)
This PR is the coder/coder part of [the open_in parameter issue](https://github.com/coder/terraform-provider-coder/issues/297) aiming to add a new optional parameter to choose how to open modules. This PR is heavily linked [to this PR](https://github.com/coder/terraform-provider-coder/pull/321). ℹ️ For now, some integrations tests can not be pushed as it requires a release on the terraform-provider repo.
This commit is contained in:
@@ -255,6 +255,7 @@ func AppFromProto(protoApp *proto.WorkspaceApp) (codersdk.WorkspaceApp, error) {
|
||||
},
|
||||
Health: health,
|
||||
Hidden: protoApp.Hidden,
|
||||
OpenIn: protoApp.OpenIn,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -285,6 +286,7 @@ func ProtoFromApp(a codersdk.WorkspaceApp) (*proto.WorkspaceApp, error) {
|
||||
},
|
||||
Health: proto.WorkspaceApp_Health(health),
|
||||
Hidden: a.Hidden,
|
||||
OpenIn: a.OpenIn,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,14 @@ const (
|
||||
WorkspaceAppSharingLevelPublic WorkspaceAppSharingLevel = "public"
|
||||
)
|
||||
|
||||
type WorkspaceAppOpenIn string
|
||||
|
||||
const (
|
||||
WorkspaceAppOpenInSlimWindow WorkspaceAppOpenIn = "slim-window"
|
||||
WorkspaceAppOpenInWindow WorkspaceAppOpenIn = "window"
|
||||
WorkspaceAppOpenInTab WorkspaceAppOpenIn = "tab"
|
||||
)
|
||||
|
||||
var MapWorkspaceAppSharingLevels = map[WorkspaceAppSharingLevel]struct{}{
|
||||
WorkspaceAppSharingLevelOwner: {},
|
||||
WorkspaceAppSharingLevelAuthenticated: {},
|
||||
@@ -62,6 +70,7 @@ type WorkspaceApp struct {
|
||||
Healthcheck Healthcheck `json:"healthcheck"`
|
||||
Health WorkspaceAppHealth `json:"health"`
|
||||
Hidden bool `json:"hidden"`
|
||||
OpenIn string `json:"open_in"`
|
||||
}
|
||||
|
||||
type Healthcheck struct {
|
||||
|
||||
Reference in New Issue
Block a user