summaryrefslogtreecommitdiffstats
path: root/Documentation/pg-plugin-repo-api.txt
blob: 1272ea6869703466b78911192193daf853b1b89e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
= Gerrit Code Review - Repo admin customization API

This API is provided by link:pg-plugin-dev.html#plugin-repo[plugin.repo()]
and provides customization to admin page.

== createCommand
`repoApi.createCommand(title, checkVisibleCallback)`

Create a repo command in the admin panel.

.Params
- *title* String title.
- *checkVisibleCallback* function to configure command visibility.

.Returns
- GrRepoApi for chaining.

`checkVisibleCallback(repoName, repoConfig)`

.Params
- *repoName* String project name.
- *repoConfig* Object REST API response for repo config.

.Returns
- `false` to hide the command for the specific project.

== onTap
`repoApi.onTap(tapCalback)`

Add a command tap callback.

.Params
- *tapCallback* function that's excuted on command tap.

.Returns
- Nothing