Skip to content
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
8 changes: 7 additions & 1 deletion backend/helpers/pluginhelper/api/scope_db_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,15 @@ func (s *ScopeDatabaseHelperImpl[Conn, Scope, Tr]) GetScopeAndConfig(connectionI
}

func (s *ScopeDatabaseHelperImpl[Conn, Scope, Tr]) ListScopes(input *plugin.ApiResourceInput, connectionId uint64) ([]*Scope, errors.Error) {
searchTerm := input.Query.Get("searchTerm")
query := dal.Where("connection_id = ?", connectionId)
if searchTerm != "" {
query = dal.Where(fmt.Sprintf("connection_id = ? AND %s LIKE ?", s.params.RawScopeParamName), connectionId, "%"+searchTerm+"%")

}
limit, offset := GetLimitOffset(input.Query, "pageSize", "page")
var scopes []*Scope
err := s.db.All(&scopes, dal.Where("connection_id = ?", connectionId), dal.Limit(limit), dal.Offset(offset))
err := s.db.All(&scopes, query, dal.Limit(limit), dal.Offset(offset))
return scopes, err
}

Expand Down
1 change: 1 addition & 0 deletions backend/plugins/bamboo/api/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func UpdateScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, err
// @Description get Bamboo projects
// @Tags plugins/bamboo
// @Param connectionId path int false "connection ID"
// @Param searchTerm query string false "search term for scope name"
// @Param blueprints query bool false "also return blueprints using these scopes as part of the payload"
// @Success 200 {object} []ScopeRes
// @Failure 400 {object} shared.ApiBody "Bad Request"
Expand Down
1 change: 1 addition & 0 deletions backend/plugins/bitbucket/api/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func UpdateScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, err
// @Description get repos
// @Tags plugins/bitbucket
// @Param connectionId path int true "connection ID"
// @Param searchTerm query string false "search term for scope name"
// @Param pageSize query int false "page size, default 50"
// @Param page query int false "page size, default 1"
// @Param blueprints query bool false "also return blueprints using these scopes as part of the payload"
Expand Down
1 change: 1 addition & 0 deletions backend/plugins/github/api/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func UpdateScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, err
// @Description get Github repos
// @Tags plugins/github
// @Param connectionId path int true "connection ID"
// @Param searchTerm query string false "search term for scope name"
// @Param pageSize query int false "page size, default 50"
// @Param page query int false "page size, default 1"
// @Param blueprints query bool false "also return blueprints using these scopes as part of the payload"
Expand Down
1 change: 1 addition & 0 deletions backend/plugins/gitlab/api/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func UpdateScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, err
// @Description get Gitlab projects
// @Tags plugins/gitlab
// @Param connectionId path int false "connection ID"
// @Param searchTerm query string false "search term for scope name"
// @Param blueprints query bool false "also return blueprints using these scopes as part of the payload"
// @Success 200 {object} []ScopeRes
// @Failure 400 {object} shared.ApiBody "Bad Request"
Expand Down
1 change: 1 addition & 0 deletions backend/plugins/jenkins/api/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ func UpdateScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, err
// @Description get Jenkins jobs
// @Tags plugins/jenkins
// @Param connectionId path int false "connection ID"
// @Param searchTerm query string false "search term for scope name"
// @Param pageSize query int false "page size, default 50"
// @Param page query int false "page size, default 1"
// @Param blueprints query bool false "also return blueprints using these scopes as part of the payload"
Expand Down
1 change: 1 addition & 0 deletions backend/plugins/jira/api/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type ScopeReq api.ScopeReq[models.JiraBoard]
// @Tags plugins/jira
// @Accept application/json
// @Param connectionId path int false "connection ID"
// @Param searchTerm query string false "search term for scope name"
// @Param scope body ScopeReq true "json"
// @Success 200 {object} []models.JiraBoard
// @Failure 400 {object} shared.ApiBody "Bad Request"
Expand Down
1 change: 1 addition & 0 deletions backend/plugins/pagerduty/api/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func UpdateScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, err
// @Description get PagerDuty repos
// @Tags plugins/pagerduty
// @Param connectionId path int true "connection ID"
// @Param searchTerm query string false "search term for scope name"
// @Param pageSize query int false "page size, default 50"
// @Param page query int false "page size, default 1"
// @Param blueprints query bool false "also return blueprints using these scopes as part of the payload"
Expand Down
1 change: 1 addition & 0 deletions backend/plugins/sonarqube/api/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func UpdateScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, err
// @Description get Sonarqube projects
// @Tags plugins/sonarqube
// @Param connectionId path int false "connection ID"
// @Param searchTerm query string false "search term for scope name"
// @Param pageSize query int false "page size, default 50"
// @Param page query int false "page size, default 1"
// @Param blueprints query bool false "also return blueprints using these scopes as part of the payload"
Expand Down
1 change: 1 addition & 0 deletions backend/plugins/tapd/api/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func UpdateScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, err
// @Description get tapd jobs
// @Tags plugins/tapd
// @Param connectionId path int false "connection ID"
// @Param searchTerm query string false "search term for scope name"
// @Param pageSize query int false "page size, default 50"
// @Param page query int false "page size, default 1"
// @Param blueprints query bool false "also return blueprints using these scopes as part of the payload"
Expand Down
1 change: 1 addition & 0 deletions backend/plugins/trello/api/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func UpdateScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, err
// @Description get Trello boards
// @Tags plugins/trello
// @Param connectionId path int false "connection ID"
// @Param searchTerm query string false "search term for scope name"
// @Param pageSize query int false "page size, default 50"
// @Param page query int false "page size, default 1"
// @Success 200 {object} []models.TrelloBoard
Expand Down
1 change: 1 addition & 0 deletions backend/plugins/zentao/api/project_scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func UpdateProjectScope(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutp
// @Description get Gitlab projects
// @Tags plugins/gitlab
// @Param connectionId path int false "connection ID"
// @Param searchTerm query string false "search term for scope name"
// @Param blueprints query bool false "also return blueprints using these scopes as part of the payload"
// @Success 200 {object} []ProjectScopeRes
// @Failure 400 {object} shared.ApiBody "Bad Request"
Expand Down