summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorDavid Svantesson <davidsvantesson@gmail.com>2019-10-01 07:32:28 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2019-10-01 13:32:28 +0800
commit36bcd4cd6b6d1131e3f812a825558fbfe5dcca20 (patch)
tree1606d302648ca6f2f6633d21aeb5d06a568b14d8 /templates
parentd3bc3dd4d16aef053699d5bfc45039db060d373e (diff)
downloadgitea-36bcd4cd6b6d1131e3f812a825558fbfe5dcca20.tar.gz
gitea-36bcd4cd6b6d1131e3f812a825558fbfe5dcca20.zip
API endpoint for searching teams. (#8108)
* Api endpoint for searching teams. Signed-off-by: dasv <david.svantesson@qrtech.se> * Move API to /orgs/:org/teams/search Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Regenerate swagger Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix search is Get Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Add test for search team API. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Update routers/api/v1/org/team.go grammar Co-Authored-By: Richard Mahn <richmahn@users.noreply.github.com> * Fix review comments Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix some issues in repo collaboration team search, after changes in this PR. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Remove teamUser which is not used and replace with actual user id. Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Remove unused search variable UserIsAdmin. * Add paging to team search. * Re-genereate swagger Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * Fix review comments Signed-off-by: David Svantesson <davidsvantesson@gmail.com> * fix * Regenerate swagger
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/settings/collaboration.tmpl2
-rw-r--r--templates/swagger/v1_json.tmpl64
2 files changed, 65 insertions, 1 deletions
diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl
index 61feb4ec18..c0b444dce3 100644
--- a/templates/repo/settings/collaboration.tmpl
+++ b/templates/repo/settings/collaboration.tmpl
@@ -95,7 +95,7 @@
<form class="ui form" id="repo-collab-team-form" action="{{.Link}}/team" method="post">
{{.CsrfTokenHtml}}
<div class="inline field ui left">
- <div id="search-team-box" class="ui search" data-org="{{.OrgID}}">
+ <div id="search-team-box" class="ui search" data-org="{{.OrgName}}">
<div class="ui input">
<input class="prompt" name="team" placeholder="Search teams..." autocomplete="off" autofocus required>
</div>
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index a5fef2f5e6..fcc26f5c54 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -1047,6 +1047,70 @@
}
}
},
+ "/orgs/{org}/teams/search": {
+ "get": {
+ "produces": [
+ "application/json"
+ ],
+ "tags": [
+ "organization"
+ ],
+ "summary": "Search for teams within an organization",
+ "operationId": "teamSearch",
+ "parameters": [
+ {
+ "type": "string",
+ "description": "name of the organization",
+ "name": "org",
+ "in": "path",
+ "required": true
+ },
+ {
+ "type": "string",
+ "description": "keywords to search",
+ "name": "q",
+ "in": "query"
+ },
+ {
+ "type": "boolean",
+ "description": "include search within team description (defaults to true)",
+ "name": "include_desc",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "limit size of results",
+ "name": "limit",
+ "in": "query"
+ },
+ {
+ "type": "integer",
+ "description": "page number of results to return (1-based)",
+ "name": "page",
+ "in": "query"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "SearchResults of a successful search",
+ "schema": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/Team"
+ }
+ },
+ "ok": {
+ "type": "boolean"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/repos/migrate": {
"post": {
"consumes": [