doortts doortts 2017-10-10
webhook: Add help messages at webhook setting page
@e6f386555ec391184a5ae0699ecf158e70e8ea01
app/models/Webhook.java
--- app/models/Webhook.java
+++ app/models/Webhook.java
@@ -167,6 +167,7 @@
             requestHolder
                     .setHeader("Content-Type", "application/json")
                     .setHeader("User-Agent", "Yobi-Hookshot")
+                    .setHeader("Authorization", "token " + this.secret)
                     .post(payload)
                     .map(
                             new Function<WSResponse, Integer>() {
app/views/project/webhooks.scala.html
--- app/views/project/webhooks.scala.html
+++ app/views/project/webhooks.scala.html
@@ -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>
       }
 
conf/messages
--- conf/messages
+++ conf/messages
@@ -676,14 +676,15 @@
 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.
conf/messages.ko-KR
--- conf/messages.ko-KR
+++ conf/messages.ko-KR
@@ -676,12 +676,14 @@
 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} 프로젝트를 지켜보는 중입니다.
Add a comment
List