2018-10-18 20:43:34 +03:00
|
|
|
<header class="modal-header" data-test-modal="webhook-form">
|
2019-12-13 17:20:29 +03:00
|
|
|
<h1 data-test-text="title">{{if this.webhook.isNew "New" "Edit"}} webhook</h1>
|
2018-10-18 02:18:29 +03:00
|
|
|
</header>
|
2019-12-13 17:20:29 +03:00
|
|
|
<button class="close" href title="Close" {{action "closeModal"}} {{action (optional this.noop) on="mouseDown"}}>
|
2019-03-15 17:38:54 +03:00
|
|
|
{{svg-jar "close"}}
|
|
|
|
</button>
|
2018-10-18 02:18:29 +03:00
|
|
|
|
|
|
|
<div class="modal-body">
|
|
|
|
<fieldset>
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#gh-form-group errors=this.webhook.errors hasValidated=this.webhook.hasValidated property="name"}}
|
2018-11-12 19:31:47 +03:00
|
|
|
<label for="webhook-name" class="fw6">Name</label>
|
2018-10-18 02:18:29 +03:00
|
|
|
{{gh-text-input
|
2019-12-13 17:20:29 +03:00
|
|
|
value=(readonly this.webhook.name)
|
|
|
|
input=(action (mut this.webhook.name) value="target.value")
|
|
|
|
focus-out=(action "validate" "name" target=this.webhook)
|
2018-11-12 19:31:47 +03:00
|
|
|
id="webhook-name"
|
2018-10-18 02:18:29 +03:00
|
|
|
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..."
|
2020-01-09 20:20:13 +03:00
|
|
|
shouldFocus=true
|
2018-10-18 02:18:29 +03:00
|
|
|
autocapitalize="off"
|
|
|
|
autocorrect="off"
|
2018-11-12 19:31:47 +03:00
|
|
|
data-test-input="webhook-name"}}
|
2019-12-13 19:11:49 +03:00
|
|
|
<GhErrorMessage @errors={{this.webhook.errors}} @property="name" data-test-error="webhook-name" />
|
2018-10-18 02:18:29 +03:00
|
|
|
{{/gh-form-group}}
|
|
|
|
</fieldset>
|
|
|
|
<fieldset>
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#gh-form-group errors=this.webhook.errors hasValidated=this.webhook.hasValidated property="event"}}
|
2018-11-12 19:31:47 +03:00
|
|
|
<label for="webhook-event" class="fw6">Event</label>
|
2018-10-18 02:18:29 +03:00
|
|
|
<span class="gh-select">
|
2019-12-13 17:20:29 +03:00
|
|
|
{{one-way-select this.webhook.event
|
|
|
|
options=this.availableEvents
|
2018-10-18 02:18:29 +03:00
|
|
|
optionValuePath="event"
|
|
|
|
optionLabelPath="name"
|
|
|
|
optionTargetPath="event"
|
2019-02-26 09:23:37 +03:00
|
|
|
groupLabelPath="group"
|
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")
|
2018-11-12 19:31:47 +03:00
|
|
|
id="webhook-event"
|
2018-10-18 02:18:29 +03:00
|
|
|
name="event"
|
2018-11-12 19:31:47 +03:00
|
|
|
data-test-select="webhook-event"}}
|
2018-10-18 02:18:29 +03:00
|
|
|
{{svg-jar "arrow-down-small"}}
|
|
|
|
</span>
|
2019-12-13 19:11:49 +03:00
|
|
|
<GhErrorMessage @errors={{this.webhook.errors}} @property="event" data-test-error="webhook-event" />
|
2018-10-18 02:18:29 +03:00
|
|
|
{{/gh-form-group}}
|
|
|
|
</fieldset>
|
|
|
|
<fieldset>
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#gh-form-group errors=this.webhook.errors hasValidated=this.webhook.hasValidated property="targetUrl"}}
|
2018-11-12 19:31:47 +03:00
|
|
|
<label for="webhook-targetUrl" class="fw6">Target URL</label>
|
2018-10-18 02:18:29 +03:00
|
|
|
{{gh-text-input
|
2019-12-13 17:20:29 +03:00
|
|
|
value=(readonly this.webhook.targetUrl)
|
|
|
|
input=(action (mut this.webhook.targetUrl) value="target.value")
|
|
|
|
focus-out=(action "validate" "targetUrl" target=this.webhook)
|
2018-11-12 19:31:47 +03:00
|
|
|
id="webhook-targetUrl"
|
2018-10-18 02:18:29 +03:00
|
|
|
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..."
|
2020-01-09 20:20:13 +03:00
|
|
|
shouldFocus=true
|
2018-10-18 02:18:29 +03:00
|
|
|
autocapitalize="off"
|
|
|
|
autocorrect="off"
|
2018-11-12 19:31:47 +03:00
|
|
|
data-test-input="webhook-targetUrl"}}
|
2019-12-13 19:11:49 +03:00
|
|
|
<GhErrorMessage @errors={{this.webhook.errors}} @property="targetUrl" data-test-error="webhook-targetUrl" />
|
2018-10-18 02:18:29 +03:00
|
|
|
{{/gh-form-group}}
|
|
|
|
</fieldset>
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.config.enableDeveloperExperiments}}
|
2018-11-06 13:59:47 +03:00
|
|
|
<fieldset>
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#gh-form-group errors=this.webhook.errors hasValidated=this.webhook.hasValidated property="secret"}}
|
2018-11-12 19:31:47 +03:00
|
|
|
<label for="webhook-secret" class="fw6">Secret</label>
|
2018-11-06 13:59:47 +03:00
|
|
|
{{gh-text-input
|
2019-12-13 17:20:29 +03:00
|
|
|
value=(readonly this.webhook.secret)
|
|
|
|
oninput=(action (mut this.webhook.secret) value="target.value")
|
|
|
|
focus-out=(action "validate" "secret" target=this.webhook)
|
2018-11-12 19:31:47 +03:00
|
|
|
id="webhook-secret"
|
2018-11-06 13:59:47 +03:00
|
|
|
name="secret"
|
|
|
|
class="gh-input mt1"
|
|
|
|
placeholder="Webhook secret..."
|
2020-01-09 20:20:13 +03:00
|
|
|
shouldFocus=true
|
2018-11-06 13:59:47 +03:00
|
|
|
autocapitalize="off"
|
|
|
|
autocorrect="off"
|
2018-11-12 19:31:47 +03:00
|
|
|
data-test-input="webhook-secret"}}
|
2019-12-13 19:11:49 +03:00
|
|
|
<GhErrorMessage @errors={{this.webhook.errors}} @property="secret" data-test-error="webhook-secret" />
|
2018-11-06 13:59:47 +03:00
|
|
|
{{/gh-form-group}}
|
|
|
|
</fieldset>
|
|
|
|
{{/if}}
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.error}}
|
|
|
|
<p class="red">{{this.error}}</p>
|
2018-10-19 19:34:53 +03:00
|
|
|
{{/if}}
|
2018-10-18 02:18:29 +03:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal-footer">
|
2019-03-15 17:38:54 +03:00
|
|
|
<button
|
|
|
|
class="gh-btn"
|
|
|
|
{{action "closeModal"}}
|
|
|
|
{{!-- disable mouseDown so it doesn't trigger focus-out validations --}}
|
2019-12-13 17:20:29 +03:00
|
|
|
{{action (optional this.noop) on="mouseDown"}}
|
2019-03-15 17:38:54 +03:00
|
|
|
data-test-button="cancel-webhook"
|
|
|
|
>
|
2018-10-18 02:18:29 +03:00
|
|
|
<span>Cancel</span>
|
|
|
|
</button>
|
2019-12-13 17:20:29 +03:00
|
|
|
{{gh-task-button this.buttonText
|
|
|
|
successText=this.successText
|
|
|
|
task=this.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>
|