Skip to content

Commit

Permalink
webhook: Add help messages at webhook setting page
Browse files Browse the repository at this point in the history
  • Loading branch information
doortts committed Oct 9, 2017
1 parent 1a32856 commit e6f3865
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/models/Webhook.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ private void sendRequest(String payload) {
requestHolder
.setHeader("Content-Type", "application/json")
.setHeader("User-Agent", "Yobi-Hookshot")
.setHeader("Authorization", "token " + this.secret)
.post(payload)
.map(
new Function<WSResponse, Integer>() {
Expand Down
3 changes: 3 additions & 0 deletions app/views/project/webhooks.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
</div>
</div>
<button type="submit" class="ybtn ybtn-primary btn-submit">@Messages("project.webhook.add")</button>
<div>
@Html(Messages("project.webhook.help"))
</div>
</form>
}

Expand Down
5 changes: 3 additions & 2 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -676,14 +676,15 @@ project.watcher.title = This project's watcher list.
project.watching = Watching
project.webhook = Webhooks
project.webhook.add = Add webhook
project.webhook.help = * Every webhook is sent in POST and with Content-Type: application/json header. <br/>* If you need to include additional fields and values, please use query string. e.g. http://abc.com?customKey=value <br />* If you put a value in the Token field, ''Authorization: token input-value'' header is added to HTTP header. <br/>
project.webhook.list.empty = No webhook exists.
project.webhook.new = Create new webhook
project.webhook.payloadUrl = Payload URL
project.webhook.payloadUrl.empty = Paylaod URL is required field.
project.webhook.payloadUrl.tooLong = Given payload URL is too long. (Maximum 2000 Characters)
project.webhook.secret = Secret token
project.webhook.secret = Authorization Token
project.webhook.secret.tooLong = Given secret token is too long. (Maximum 250 Characters)
project.webhook.gitPushOnly = Git push only
project.webhook.gitPushOnly = Git push hook
project.you.are.not.watching = You are not watching {0} project.
project.you.are.watching = You are watching {0} project.
project.you.may.want.to.be.a.member = You can send a sign-up request for {0} project.
Expand Down
6 changes: 4 additions & 2 deletions conf/messages.ko-KR
Original file line number Diff line number Diff line change
Expand Up @@ -676,12 +676,14 @@ project.watcher.title = 이 프로젝트를 지켜보는 사람
project.watching = 지켜보기 중
project.webhook = 웹후크
project.webhook.add = 웹후크 추가
project.webhook.help = * 모든 웹훅은 POST 방식, Content-Type 은 application/json 으로 전송됩니다 <br/>* 추가 필드값과 정보를 포함해야 할 경우 query 스트링을 이용해요 주세요. 예) http://abc.com?customKey=value <br/>* Token 필드에 값을 넣을 경우 HTTP 헤더에 ''Authorizatoin: token 입력한 값''이 추가됩니다. <br/>
project.webhook.list.empty = 등록된 웹후크가 없습니다.
project.webhook.new = 새 웹후크 생성
project.webhook.payloadUrl = 전송할 주소
project.webhook.payloadUrl.empty = Paylaod URL 은 필수 필드입니다.
project.webhook.payloadUrl.tooLong = Payload URL 이 너무 깁니다 (최대 2000글자)
project.webhook.secret = 보안 토큰
project.webhook.payloadUrl.tooLong = Payload URL 이 너무 깁니다 (최대 2000글자)웹후크 추가
project.webhook.gitPushOnly = Git push hook
project.webhook.secret = Authorization Token
project.webhook.secret.tooLong = 보안 토큰이 너무 깁니다. (최대 250 글자)
project.you.are.not.watching = {0} 프로젝트를 지켜보고 있지 않습니다.
project.you.are.watching = {0} 프로젝트를 지켜보는 중입니다.
Expand Down

0 comments on commit e6f3865

Please sign in to comment.