mirror of
https://github.com/coder/coder.git
synced 2025-07-21 01:28:49 +00:00
feat: Allow hide resources (#3977)
This commit is contained in:
@ -4320,7 +4320,7 @@ func (q *sqlQuerier) UpdateWorkspaceBuildByID(ctx context.Context, arg UpdateWor
|
||||
|
||||
const getWorkspaceResourceByID = `-- name: GetWorkspaceResourceByID :one
|
||||
SELECT
|
||||
id, created_at, job_id, transition, type, name
|
||||
id, created_at, job_id, transition, type, name, hide
|
||||
FROM
|
||||
workspace_resources
|
||||
WHERE
|
||||
@ -4337,6 +4337,7 @@ func (q *sqlQuerier) GetWorkspaceResourceByID(ctx context.Context, id uuid.UUID)
|
||||
&i.Transition,
|
||||
&i.Type,
|
||||
&i.Name,
|
||||
&i.Hide,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
@ -4451,7 +4452,7 @@ func (q *sqlQuerier) GetWorkspaceResourceMetadataCreatedAfter(ctx context.Contex
|
||||
|
||||
const getWorkspaceResourcesByJobID = `-- name: GetWorkspaceResourcesByJobID :many
|
||||
SELECT
|
||||
id, created_at, job_id, transition, type, name
|
||||
id, created_at, job_id, transition, type, name, hide
|
||||
FROM
|
||||
workspace_resources
|
||||
WHERE
|
||||
@ -4474,6 +4475,7 @@ func (q *sqlQuerier) GetWorkspaceResourcesByJobID(ctx context.Context, jobID uui
|
||||
&i.Transition,
|
||||
&i.Type,
|
||||
&i.Name,
|
||||
&i.Hide,
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -4489,7 +4491,7 @@ func (q *sqlQuerier) GetWorkspaceResourcesByJobID(ctx context.Context, jobID uui
|
||||
}
|
||||
|
||||
const getWorkspaceResourcesCreatedAfter = `-- name: GetWorkspaceResourcesCreatedAfter :many
|
||||
SELECT id, created_at, job_id, transition, type, name FROM workspace_resources WHERE created_at > $1
|
||||
SELECT id, created_at, job_id, transition, type, name, hide FROM workspace_resources WHERE created_at > $1
|
||||
`
|
||||
|
||||
func (q *sqlQuerier) GetWorkspaceResourcesCreatedAfter(ctx context.Context, createdAt time.Time) ([]WorkspaceResource, error) {
|
||||
@ -4508,6 +4510,7 @@ func (q *sqlQuerier) GetWorkspaceResourcesCreatedAfter(ctx context.Context, crea
|
||||
&i.Transition,
|
||||
&i.Type,
|
||||
&i.Name,
|
||||
&i.Hide,
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -4524,9 +4527,9 @@ func (q *sqlQuerier) GetWorkspaceResourcesCreatedAfter(ctx context.Context, crea
|
||||
|
||||
const insertWorkspaceResource = `-- name: InsertWorkspaceResource :one
|
||||
INSERT INTO
|
||||
workspace_resources (id, created_at, job_id, transition, type, name)
|
||||
workspace_resources (id, created_at, job_id, transition, type, name, hide)
|
||||
VALUES
|
||||
($1, $2, $3, $4, $5, $6) RETURNING id, created_at, job_id, transition, type, name
|
||||
($1, $2, $3, $4, $5, $6, $7) RETURNING id, created_at, job_id, transition, type, name, hide
|
||||
`
|
||||
|
||||
type InsertWorkspaceResourceParams struct {
|
||||
@ -4536,6 +4539,7 @@ type InsertWorkspaceResourceParams struct {
|
||||
Transition WorkspaceTransition `db:"transition" json:"transition"`
|
||||
Type string `db:"type" json:"type"`
|
||||
Name string `db:"name" json:"name"`
|
||||
Hide bool `db:"hide" json:"hide"`
|
||||
}
|
||||
|
||||
func (q *sqlQuerier) InsertWorkspaceResource(ctx context.Context, arg InsertWorkspaceResourceParams) (WorkspaceResource, error) {
|
||||
@ -4546,6 +4550,7 @@ func (q *sqlQuerier) InsertWorkspaceResource(ctx context.Context, arg InsertWork
|
||||
arg.Transition,
|
||||
arg.Type,
|
||||
arg.Name,
|
||||
arg.Hide,
|
||||
)
|
||||
var i WorkspaceResource
|
||||
err := row.Scan(
|
||||
@ -4555,6 +4560,7 @@ func (q *sqlQuerier) InsertWorkspaceResource(ctx context.Context, arg InsertWork
|
||||
&i.Transition,
|
||||
&i.Type,
|
||||
&i.Name,
|
||||
&i.Hide,
|
||||
)
|
||||
return i, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user