[Notice] Announcing the End of Demo Server [Read me]
webhook: Minor update (webhook UI, naming)
@4caef1c0c9fbdc4f6212d44fde6817f0ad11df2b
--- app/assets/stylesheets/less/_common.less
+++ app/assets/stylesheets/less/_common.less
... | ... | @@ -305,4 +305,9 @@ |
305 | 305 |
line-height: 36px; |
306 | 306 |
} |
307 | 307 |
|
308 |
-.dimgray { color:dimgray; }(No newline at end of file) |
|
308 |
+.dimgray { color:dimgray; } |
|
309 |
+ |
|
310 |
+.vertical-align { |
|
311 |
+ display: flex; |
|
312 |
+ align-items: center; |
|
313 |
+}(No newline at end of file) |
--- app/models/Webhook.java
+++ app/models/Webhook.java
... | ... | @@ -78,7 +78,7 @@ |
78 | 78 |
*/ |
79 | 79 |
public Boolean gitPushOnly; |
80 | 80 |
|
81 |
- public WebhookType webhookType = WebhookType.WITH_DETAILS; |
|
81 |
+ public WebhookType webhookType = WebhookType.SIMPLE; |
|
82 | 82 |
|
83 | 83 |
/** |
84 | 84 |
* Payload URL of webhook. |
... | ... | @@ -250,7 +250,7 @@ |
250 | 250 |
} |
251 | 251 |
requestMessage += " <" + utils.Config.getScheme() + "://" + utils.Config.getHostport("localhost:9000") + RouteUtil.getUrl(eventPullRequest) + "|#" + eventPullRequest.number + ": " + eventPullRequest.title + ">"; |
252 | 252 |
|
253 |
- if (this.webhookType == WebhookType.WITH_DETAILS) { |
|
253 |
+ if (this.webhookType == WebhookType.DETAIL_SLACK) { |
|
254 | 254 |
return buildJsonWithPullReqtuestDetails(eventPullRequest, detailFields, attachments, requestMessage); |
255 | 255 |
} else { |
256 | 256 |
return buildTextPropertyOnlyJSON(requestMessage); |
--- app/models/enumeration/WebhookType.java
+++ app/models/enumeration/WebhookType.java
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 |
package models.enumeration; |
8 | 8 |
|
9 | 9 |
public enum WebhookType { |
10 |
- SIMPLE(0), WITH_DETAILS(1); |
|
10 |
+ SIMPLE(0), DETAIL_SLACK(1); |
|
11 | 11 |
|
12 | 12 |
private int type; |
13 | 13 |
|
--- app/views/project/partial_webhooks_list.scala.html
+++ app/views/project/partial_webhooks_list.scala.html
... | ... | @@ -30,50 +30,51 @@ |
30 | 30 |
</div> |
31 | 31 |
} else { |
32 | 32 |
<div class="row-fluid list-head"> |
33 |
- <div class="span6 payload-url"> |
|
33 |
+ <div class="span5 payload-url"> |
|
34 | 34 |
<strong>@Messages("project.webhook.payloadUrl")</strong> |
35 | 35 |
</div> |
36 |
- <div class="span6 secret"> |
|
37 |
- <strong>@Messages("project.webhook.secret") | Include details or not | Working only when to push commit</strong> |
|
36 |
+ <div class="span2 secret text-center"> |
|
37 |
+ <strong>@Messages("project.webhook.secret")</strong> |
|
38 | 38 |
</div> |
39 |
+ <div class="span2 secret text-center"> |
|
40 |
+ <strong>Type of message</strong> |
|
41 |
+ </div> |
|
42 |
+ <div class="span2 secret text-center"> |
|
43 |
+ <strong>Just the push event</strong> |
|
44 |
+ </div> |
|
45 |
+ <div class="span1 secret text-center"></div> |
|
46 |
+ |
|
39 | 47 |
</div> |
40 | 48 |
|
41 | 49 |
@webhooks.map { webhook => |
42 |
- <div class="row-fluid list-item" data-webhook-id="@webhook.id"> |
|
43 |
- <div class="span6"> |
|
50 |
+ <div class="row-fluid list-item vertical-align" data-webhook-id="@webhook.id"> |
|
51 |
+ <div class="span5"> |
|
44 | 52 |
<h6 class="mr20 truncate"> |
45 | 53 |
@webhook.payloadUrl |
46 | 54 |
</h6> |
47 | 55 |
</div> |
48 |
- <div class="span6"> |
|
49 |
- <table class="table nm"> |
|
50 |
- <tr> |
|
51 |
- <td> |
|
52 |
- <span class="webhook-secret truncate"> |
|
53 |
- @if(webhook.secret.isEmpty) { |
|
54 |
- NONE |
|
55 |
- } else { |
|
56 |
- @webhook.secret |
|
57 |
- } |
|
58 |
- </span> |
|
59 |
- </td> |
|
60 |
- <td> |
|
61 |
- <span class="webhook-secret truncate"> |
|
62 |
- @webhook.webhookType |
|
63 |
- </span> |
|
64 |
- </td> |
|
65 |
- <td> |
|
66 |
- <span class="webhook-secret truncate"> |
|
67 |
- <input type="checkbox" @if(webhook.gitPushOnly){checked} onclick="return false;" /> |
|
68 |
- </span> |
|
69 |
- </td> |
|
70 |
- <td class="actions"> |
|
71 |
- <button type="button" class="ybtn ybtn-danger ybtn-small" data-request-method="delete" data-request-uri="@routes.ProjectApp.deleteWebhook(project.owner, project.name, webhook.id)"> |
|
72 |
- @Messages("button.delete") |
|
73 |
- </button> |
|
74 |
- </td> |
|
75 |
- </tr> |
|
76 |
- </table> |
|
56 |
+ <div class="span2 text-center"> |
|
57 |
+ <h6> |
|
58 |
+ @if(webhook.secret.isEmpty) { |
|
59 |
+ NONE |
|
60 |
+ } else { |
|
61 |
+ @webhook.secret |
|
62 |
+ } |
|
63 |
+ </h6> |
|
64 |
+ </div> |
|
65 |
+ <div class="span2 text-center"> |
|
66 |
+ <h6> |
|
67 |
+ @webhook.webhookType |
|
68 |
+ </h6> |
|
69 |
+ </div> |
|
70 |
+ <div class="span2 text-center"> |
|
71 |
+ <input type="checkbox" @if(webhook.gitPushOnly){checked} onclick="return false;" /> |
|
72 |
+ |
|
73 |
+ </div> |
|
74 |
+ <div class="span1 text-center"> |
|
75 |
+ <button type="button" class="ybtn ybtn-danger ybtn-small" data-request-method="delete" data-request-uri="@routes.ProjectApp.deleteWebhook(project.owner, project.name, webhook.id)"> |
|
76 |
+ @Messages("button.delete") |
|
77 |
+ </button> |
|
77 | 78 |
</div> |
78 | 79 |
</div> |
79 | 80 |
} |
--- app/views/project/webhooks.scala.html
+++ app/views/project/webhooks.scala.html
... | ... | @@ -24,7 +24,7 @@ |
24 | 24 |
<input type="text" name="secret" class="input-webhook-secret" maxlength="250" autocomplete="off" placeholder="@Messages("project.webhook.secret")"> |
25 | 25 |
<select class="form-control" title="add details or not" name="webhookType"> |
26 | 26 |
<option value="SIMPLE">SIMPLE Version (no details)</option> |
27 |
- <option value="WITH_DETAILS">Normal (Slack/with details)</option> |
|
27 |
+ <option value="DETAIL_SLACK">DETAIL Version (for slack) </option> |
|
28 | 28 |
</select> |
29 | 29 |
<label for="gitPushOnly">@Messages("project.webhook.gitPushOnly")</label> |
30 | 30 |
<input type="checkbox" id="gitPushOnly" name="gitPushOnly" class="form-check-input"> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?