Skip to content

feat(site): connect open_in parameter #16036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
848 changes: 419 additions & 429 deletions agent/proto/agent.pb.go

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion agent/proto/agent.proto
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ message WorkspaceApp {
}
Health health = 12;
bool hidden = 13;
string open_in = 14;
}

message WorkspaceAgentScript {
Expand Down
15 changes: 14 additions & 1 deletion coderd/apidoc/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion coderd/apidoc/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions coderd/database/db2sdk/db2sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ func Apps(dbApps []database.WorkspaceApp, agent database.WorkspaceAgent, ownerNa
},
Health: codersdk.WorkspaceAppHealth(dbApp.Health),
Hidden: dbApp.Hidden,
OpenIn: codersdk.WorkspaceAppOpenIn(dbApp.OpenIn),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This piece is the most important of the PR - basically extracting data from the db to make them be visible in the SDK and API calls.

})
}
return apps
Expand Down
2 changes: 0 additions & 2 deletions codersdk/agentsdk/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ func AppFromProto(protoApp *proto.WorkspaceApp) (codersdk.WorkspaceApp, error) {
},
Health: health,
Hidden: protoApp.Hidden,
OpenIn: protoApp.OpenIn,
}, nil
}

Expand Down Expand Up @@ -286,7 +285,6 @@ func ProtoFromApp(a codersdk.WorkspaceApp) (*proto.WorkspaceApp, error) {
},
Health: proto.WorkspaceApp_Health(health),
Hidden: a.Hidden,
OpenIn: a.OpenIn,
}, nil
}

Expand Down
16 changes: 11 additions & 5 deletions codersdk/workspaceapps.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ const (
WorkspaceAppSharingLevelPublic WorkspaceAppSharingLevel = "public"
)

var MapWorkspaceAppSharingLevels = map[WorkspaceAppSharingLevel]struct{}{
WorkspaceAppSharingLevelOwner: {},
WorkspaceAppSharingLevelAuthenticated: {},
WorkspaceAppSharingLevelPublic: {},
}

type WorkspaceAppOpenIn string

const (
Expand All @@ -36,10 +42,10 @@ const (
WorkspaceAppOpenInTab WorkspaceAppOpenIn = "tab"
)

var MapWorkspaceAppSharingLevels = map[WorkspaceAppSharingLevel]struct{}{
WorkspaceAppSharingLevelOwner: {},
WorkspaceAppSharingLevelAuthenticated: {},
WorkspaceAppSharingLevelPublic: {},
var MapWorkspaceAppOpenIns = map[WorkspaceAppOpenIn]struct{}{
WorkspaceAppOpenInSlimWindow: {},
WorkspaceAppOpenInWindow: {},
WorkspaceAppOpenInTab: {},
}

type WorkspaceApp struct {
Expand Down Expand Up @@ -70,7 +76,7 @@ type WorkspaceApp struct {
Healthcheck Healthcheck `json:"healthcheck"`
Health WorkspaceAppHealth `json:"health"`
Hidden bool `json:"hidden"`
OpenIn string `json:"open_in"`
OpenIn WorkspaceAppOpenIn `json:"open_in"`
}

type Healthcheck struct {
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/api/agents.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 14 additions & 8 deletions docs/reference/api/builds.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 23 additions & 7 deletions docs/reference/api/schemas.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading