mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add backend logic for determining tasks tab visibility (#18401)
This PR implements the backend logic for determining if the Tasks tab should be visible in the web UI as described in [the RFC](https://www.notion.so/coderhq/Coder-Tasks-207d579be5928053ab68c8d9a4b59eaa?source=copy_link#210d579be5928013ab5acbe69a2f548b). The frontend component will be added in a follow-up PR once the entire Tasks backend is implemented so as not to break the dogfood environment until then.
This commit is contained in:
@@ -3451,6 +3451,11 @@ func (q *querier) GetWorkspacesEligibleForTransition(ctx context.Context, now ti
|
||||
return q.db.GetWorkspacesEligibleForTransition(ctx, now)
|
||||
}
|
||||
|
||||
func (q *querier) HasTemplateVersionsWithAITask(ctx context.Context) (bool, error) {
|
||||
// Anyone can call HasTemplateVersionsWithAITask.
|
||||
return q.db.HasTemplateVersionsWithAITask(ctx)
|
||||
}
|
||||
|
||||
func (q *querier) InsertAPIKey(ctx context.Context, arg database.InsertAPIKeyParams) (database.APIKey, error) {
|
||||
return insert(q.log, q.auth,
|
||||
rbac.ResourceApiKey.WithOwner(arg.UserID.String()),
|
||||
|
||||
@@ -4566,6 +4566,9 @@ func (s *MethodTestSuite) TestSystemFunctions() {
|
||||
s.Run("GetProvisionerJobByIDForUpdate", s.Subtest(func(db database.Store, check *expects) {
|
||||
check.Args(uuid.New()).Asserts(rbac.ResourceProvisionerJobs, policy.ActionRead).Errors(sql.ErrNoRows)
|
||||
}))
|
||||
s.Run("HasTemplateVersionsWithAITask", s.Subtest(func(db database.Store, check *expects) {
|
||||
check.Args().Asserts()
|
||||
}))
|
||||
}
|
||||
|
||||
func (s *MethodTestSuite) TestNotifications() {
|
||||
|
||||
Reference in New Issue
Block a user