2018-10-18 20:43:34 +03:00
|
|
|
<header class="modal-header" data-test-modal="webhook-form">
|
2018-10-18 02:18:29 +03:00
|
|
|
<h1>New webhook</h1>
|
|
|
|
</header>
|
|
|
|
<button class="close" href="" title="Close" {{action "closeModal"}}>{{svg-jar "close"}}</button>
|
|
|
|
|
|
|
|
<div class="modal-body">
|
|
|
|
<fieldset>
|
|
|
|
{{#gh-form-group errors=webhook.errors hasValidated=webhook.hasValidated property="name"}}
|
2018-10-24 16:04:17 +03:00
|
|
|
<label for="new-webhook-name" class="fw6">Name</label>
|
2018-10-18 02:18:29 +03:00
|
|
|
{{gh-text-input
|
|
|
|
value=(readonly webhook.name)
|
|
|
|
input=(action (mut webhook.name) value="target.value")
|
|
|
|
focus-out=(action "validate" "name" target=webhook)
|
|
|
|
id="new-webhook-name"
|
|
|
|
name="name"
|
2018-10-24 16:04:17 +03:00
|
|
|
class="gh-input mt1"
|
2018-10-18 02:18:29 +03:00
|
|
|
placeholder="Webhook name..."
|
|
|
|
autofocus="autofocus"
|
|
|
|
autocapitalize="off"
|
|
|
|
autocorrect="off"
|
|
|
|
data-test-input="new-webhook-name"}}
|
|
|
|
{{gh-error-message errors=webhook.errors property="name" data-test-error="new-webhook-name"}}
|
|
|
|
{{/gh-form-group}}
|
|
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
|
|
{{#gh-form-group errors=webhook.errors hasValidated=webhook.hasValidated property="event"}}
|
2018-10-24 16:04:17 +03:00
|
|
|
<label for="new-webhook-event" class="fw6">Event</label>
|
2018-10-18 02:18:29 +03:00
|
|
|
<span class="gh-select">
|
|
|
|
{{one-way-select webhook.event
|
|
|
|
options=availableEvents
|
|
|
|
optionValuePath="event"
|
|
|
|
optionLabelPath="name"
|
|
|
|
optionTargetPath="event"
|
2018-10-24 16:04:17 +03:00
|
|
|
class="mt1"
|
2018-10-18 02:18:29 +03:00
|
|
|
includeBlank=true
|
2018-10-24 16:04:17 +03:00
|
|
|
prompt="Select an event"
|
2018-10-18 02:18:29 +03:00
|
|
|
update=(action "selectEvent")
|
|
|
|
id="new-webhook-event"
|
|
|
|
name="event"
|
|
|
|
data-test-select="new-webhook-event"}}
|
|
|
|
{{svg-jar "arrow-down-small"}}
|
|
|
|
</span>
|
|
|
|
{{gh-error-message errors=webhook.errors property="event" data-test-error="new-webhook-event"}}
|
|
|
|
{{/gh-form-group}}
|
|
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
|
|
{{#gh-form-group errors=webhook.errors hasValidated=webhook.hasValidated property="targetUrl"}}
|
2018-10-24 16:04:17 +03:00
|
|
|
<label for="new-webhook-targetUrl" class="fw6">Target URL</label>
|
2018-10-18 02:18:29 +03:00
|
|
|
{{gh-text-input
|
|
|
|
value=(readonly webhook.targetUrl)
|
|
|
|
input=(action (mut webhook.targetUrl) value="target.value")
|
|
|
|
focus-out=(action "validate" "targetUrl" target=webhook)
|
|
|
|
id="new-webhook-targetUrl"
|
|
|
|
name="targetUrl"
|
2018-10-24 16:04:17 +03:00
|
|
|
class="gh-input mt1"
|
2018-10-18 02:18:29 +03:00
|
|
|
placeholder="Webhook target URL..."
|
|
|
|
autofocus="autofocus"
|
|
|
|
autocapitalize="off"
|
|
|
|
autocorrect="off"
|
|
|
|
data-test-input="new-webhook-targetUrl"}}
|
|
|
|
{{gh-error-message errors=webhook.errors property="targetUrl" data-test-error="new-webhook-targetUrl"}}
|
|
|
|
{{/gh-form-group}}
|
|
|
|
</fieldset>
|
|
|
|
<fieldset>
|
|
|
|
{{#gh-form-group errors=webhook.errors hasValidated=webhook.hasValidated property="secret"}}
|
2018-10-24 16:04:17 +03:00
|
|
|
<label for="new-webhook-secret" class="fw6">Secret</label>
|
2018-10-18 02:18:29 +03:00
|
|
|
{{gh-text-input
|
|
|
|
value=(readonly webhook.secret)
|
|
|
|
oninput=(action (mut webhook.secret) value="target.value")
|
|
|
|
focus-out=(action "validate" "secret" target=webhook)
|
|
|
|
id="new-webhook-secret"
|
|
|
|
name="secret"
|
2018-10-24 16:04:17 +03:00
|
|
|
class="gh-input mt1"
|
2018-10-18 02:18:29 +03:00
|
|
|
placeholder="Webhook secret..."
|
|
|
|
autofocus="autofocus"
|
|
|
|
autocapitalize="off"
|
|
|
|
autocorrect="off"
|
|
|
|
data-test-input="new-webhook-secret"}}
|
|
|
|
{{gh-error-message errors=webhook.errors property="secret" data-test-error="new-webhook-secret"}}
|
|
|
|
{{/gh-form-group}}
|
|
|
|
</fieldset>
|
2018-10-19 19:34:53 +03:00
|
|
|
{{#if error}}
|
|
|
|
<p class="red">{{error}}</p>
|
|
|
|
{{/if}}
|
2018-10-18 02:18:29 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button {{action "closeModal"}} class="gh-btn" data-test-button="cancel-new-webhook">
|
|
|
|
<span>Cancel</span>
|
|
|
|
</button>
|
2018-10-18 20:43:34 +03:00
|
|
|
{{gh-task-button buttonText
|
|
|
|
successText=successText
|
|
|
|
task=saveWebhook
|
2018-10-18 02:18:29 +03:00
|
|
|
class="gh-btn gh-btn-green gh-btn-icon"
|
2018-10-18 20:43:34 +03:00
|
|
|
data-test-button="save-webhook"}}
|
2018-10-18 02:18:29 +03:00
|
|
|
</div>
|