2018-10-18 02:18:29 +03:00
|
|
|
<section class="gh-canvas">
|
2021-02-08 23:16:41 +03:00
|
|
|
<form {{action (perform "save") on="submit"}}>
|
2019-06-18 13:47:21 +03:00
|
|
|
<GhCanvasHeader class="gh-canvas-header">
|
2018-10-18 02:18:29 +03:00
|
|
|
<h2 class="gh-canvas-title" data-test-screen-title>
|
2021-01-28 18:25:21 +03:00
|
|
|
<LinkTo @route="integrations" data-test-link="integrations-back">Integrations</LinkTo>
|
2018-10-18 02:18:29 +03:00
|
|
|
<span>{{svg-jar "arrow-right"}}</span>
|
2019-12-13 17:20:29 +03:00
|
|
|
{{this.integration.name}}
|
2018-10-18 02:18:29 +03:00
|
|
|
</h2>
|
|
|
|
<section class="view-actions">
|
2021-02-08 23:16:41 +03:00
|
|
|
<GhTaskButton @task={{this.save}} @class="gh-btn gh-btn-primary gh-btn-icon" data-test-button="save" />
|
2018-10-18 02:18:29 +03:00
|
|
|
</section>
|
2019-06-18 13:47:21 +03:00
|
|
|
</GhCanvasHeader>
|
2018-10-18 02:18:29 +03:00
|
|
|
|
2021-02-10 20:48:27 +03:00
|
|
|
<div class="gh-main-section">
|
|
|
|
<h4 class="gh-main-section-header small bn">Configuration</h4>
|
|
|
|
<section class="gh-main-section-block">
|
|
|
|
<div class="gh-main-section-content padding-top-s grey">
|
2021-02-09 19:22:58 +03:00
|
|
|
<div class="flex">
|
|
|
|
<div class="flex flex-column items-start app-custom-icon-container">
|
|
|
|
<label class="mb1">Icon</label>
|
|
|
|
<figure class="app-custom-icon hide-child" style={{this.iconImageStyle}}>
|
|
|
|
<AspectRatioBox @class="flex items-center h-100 justify-center" @ratio="1/1" @base="height">
|
|
|
|
{{#unless this.integration.iconImage}}
|
|
|
|
{{svg-jar "integration" class="w11 h11"}}
|
|
|
|
{{/unless}}
|
|
|
|
</AspectRatioBox>
|
2018-10-23 12:29:49 +03:00
|
|
|
|
2021-02-09 19:22:58 +03:00
|
|
|
<GhUploader
|
|
|
|
@extensions={{this.imageExtensions}}
|
|
|
|
@onComplete={{action "setIconImage"}}
|
|
|
|
as |uploader|
|
|
|
|
>
|
|
|
|
{{#if uploader.isUploading}}
|
|
|
|
<div class="absolute top-0 left-0 w-100 h-100 br4 bg-black-70 flex items-center">
|
|
|
|
{{uploader.progressBar}}
|
|
|
|
</div>
|
|
|
|
{{else}}
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="child app-custom-icon-uploadlabel"
|
|
|
|
{{action "triggerIconFileDialog"}}
|
|
|
|
>
|
|
|
|
Upload
|
|
|
|
</button>
|
|
|
|
{{/if}}
|
|
|
|
<div style="display:none">
|
|
|
|
<GhFileInput
|
|
|
|
@name="iconImage"
|
|
|
|
@multiple={{false}}
|
|
|
|
@action={{uploader.setFiles}}
|
|
|
|
@accept={{this.imageMimeTypes}} data-test-file-input="icon" />
|
|
|
|
</div>
|
|
|
|
</GhUploader>
|
|
|
|
</figure>
|
|
|
|
</div>
|
|
|
|
<div class="flex-auto">
|
|
|
|
<GhValidationStatusContainer
|
|
|
|
@class="flex flex-column w-100 mr3"
|
|
|
|
@errors={{this.integration.errors}}
|
|
|
|
@hasValidated={{this.integration.hasValidated}}
|
|
|
|
@property="name"
|
2021-02-08 23:16:41 +03:00
|
|
|
>
|
2021-02-09 19:22:58 +03:00
|
|
|
<label for="integration_name">Name</label>
|
|
|
|
<GhTextInput
|
|
|
|
@id="integration_name"
|
|
|
|
@class="gh-input mt1 mb1"
|
|
|
|
@type="text"
|
|
|
|
@value={{readonly this.integration.name}}
|
|
|
|
@input={{action (mut this.integration.name) value="target.value"}}
|
|
|
|
@focus-out={{action "validate" "name" target=this.integration}}
|
|
|
|
data-test-input="name"
|
|
|
|
/>
|
|
|
|
<GhErrorMessage @errors={{this.integration.errors}} @property="name" data-test-error="name" class="ma0" />
|
|
|
|
</GhValidationStatusContainer>
|
2021-02-08 23:16:41 +03:00
|
|
|
|
2021-02-09 19:22:58 +03:00
|
|
|
<GhValidationStatusContainer
|
|
|
|
@class="flex flex-column w-100 mr3"
|
|
|
|
@errors={{this.integration.errors}}
|
|
|
|
@hasValidated={{this.integration.hasValidated}}
|
|
|
|
@property="decription"
|
|
|
|
>
|
|
|
|
<label for="integration_description" class="mt3">Description</label>
|
|
|
|
<GhTextInput
|
|
|
|
@id="integration_description"
|
|
|
|
@class="gh-input mt1"
|
|
|
|
@type="text"
|
|
|
|
@value={{readonly this.integration.description}}
|
|
|
|
@input={{action (mut this.integration.description) value="target.value"}}
|
|
|
|
@focus-out={{action "validate" "description" target=this.integration}}
|
|
|
|
data-test-input="description"
|
|
|
|
/>
|
|
|
|
<GhErrorMessage @errors={{this.integration.errors}} @property="description" data-test-error="description" class="ma0" />
|
|
|
|
</GhValidationStatusContainer>
|
2018-10-18 02:18:29 +03:00
|
|
|
|
2021-02-09 19:22:58 +03:00
|
|
|
<table class="app-custom-api-table list" style="table-layout: fixed">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td class="data-label">Content API key</td>
|
|
|
|
<td class="data highlight-hover">
|
|
|
|
<div class="relative flex items-center {{unless this.copyContentKey.isRunning "hide-child-instant"}}">
|
|
|
|
<span class="truncate" data-test-text="content-key">
|
|
|
|
{{this.integration.contentKey.secret}}
|
|
|
|
</span>
|
|
|
|
<div class="app-api-buttons child">
|
|
|
|
<button type="button" {{action "confirmRegenerateKeyModal" this.integration.contentKey}} class="app-button-regenerate" data-tooltip="Regenerate">
|
|
|
|
{{svg-jar "reload" class="w4 h4 stroke-midgrey"}}
|
|
|
|
</button>
|
|
|
|
<button type="button" {{action (perform this.copyContentKey)}} class="app-button-copy">
|
|
|
|
{{#if this.copyContentKey.isRunning}}
|
|
|
|
{{svg-jar "check-circle" class="w3 v-mid mr2 stroke-white"}} Copied
|
|
|
|
{{else}}
|
|
|
|
Copy
|
|
|
|
{{/if}}
|
|
|
|
</button>
|
|
|
|
</div>
|
2021-02-08 23:16:41 +03:00
|
|
|
</div>
|
2021-02-09 19:22:58 +03:00
|
|
|
{{#if (eq this.regeneratedKeyType this.integration.contentKey.type)}}
|
|
|
|
<div class="green nt3 mb2"> Content API Key was successfully regenerated </div>
|
|
|
|
{{/if}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="data-label">Admin API key</td>
|
|
|
|
<td class="data highlight-hover">
|
|
|
|
<div class="relative flex items-center {{unless this.copyAdminKey.isRunning "hide-child-instant"}}">
|
|
|
|
<span class="truncate" data-test-text="admin-key">
|
|
|
|
{{this.integration.adminKey.secret}}
|
|
|
|
</span>
|
|
|
|
<div class="app-api-buttons child">
|
|
|
|
<button type="button" {{action "confirmRegenerateKeyModal" this.integration.adminKey}} class="app-button-regenerate" data-tooltip="Regenerate">
|
|
|
|
{{svg-jar "reload" class="w4 h4 stroke-midgrey"}}
|
|
|
|
</button>
|
|
|
|
<button type="button" {{action (perform this.copyAdminKey)}} class="app-button-copy">
|
|
|
|
{{#if this.copyAdminKey.isRunning}}
|
|
|
|
{{svg-jar "check-circle" class="w3 v-mid mr2 stroke-white"}} Copied
|
|
|
|
{{else}}
|
|
|
|
Copy
|
|
|
|
{{/if}}
|
|
|
|
</button>
|
|
|
|
</div>
|
2021-02-08 23:16:41 +03:00
|
|
|
</div>
|
2021-02-09 19:22:58 +03:00
|
|
|
{{#if (eq this.regeneratedKeyType this.integration.adminKey.type)}}
|
2021-02-22 23:17:53 +03:00
|
|
|
<div class="green"> Admin API key was successfully regenerated </div>
|
2021-02-09 19:22:58 +03:00
|
|
|
{{/if}}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td class="data-label">API URL</td>
|
|
|
|
<td class="data highlight-hover truncate">
|
|
|
|
<div class="relative flex items-center {{unless this.copyApiUrl.isRunning "hide-child-instant"}}">
|
|
|
|
<span data-test-text="api-url">
|
|
|
|
{{this.apiUrl}}
|
|
|
|
</span>
|
|
|
|
<div class="app-api-buttons child">
|
|
|
|
<button type="button" {{action (perform this.copyApiUrl)}} class="app-button-copy">
|
|
|
|
{{#if this.copyApiUrl.isRunning}}
|
|
|
|
{{svg-jar "check-circle" class="w3 v-mid mr2 stroke-white"}} Copied
|
|
|
|
{{else}}
|
|
|
|
Copy
|
|
|
|
{{/if}}
|
|
|
|
</button>
|
|
|
|
</div>
|
2021-02-08 23:16:41 +03:00
|
|
|
</div>
|
2021-02-09 19:22:58 +03:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2021-02-08 23:16:41 +03:00
|
|
|
</div>
|
2019-06-18 13:47:21 +03:00
|
|
|
</div>
|
2021-02-09 19:22:58 +03:00
|
|
|
</section>
|
|
|
|
</div>
|
2021-02-08 23:16:41 +03:00
|
|
|
</form>
|
|
|
|
|
|
|
|
<section class="gh-main-section">
|
2021-02-09 19:22:58 +03:00
|
|
|
<h4 class="gh-main-section-header small">Webhooks</h4>
|
2021-02-08 23:16:41 +03:00
|
|
|
<div class="gh-main-section-block p0">
|
|
|
|
<table class="gh-list small">
|
|
|
|
<thead>
|
|
|
|
<tr class="gh-list-row header">
|
|
|
|
<th class="gh-list-header">Name</th>
|
|
|
|
<th class="gh-list-header">Event</th>
|
|
|
|
<th class="gh-list-header">URL</th>
|
|
|
|
<th class="gh-list-header">Last triggered</th>
|
|
|
|
<th class="gh-list-header"></th>
|
2019-06-18 13:47:21 +03:00
|
|
|
</tr>
|
2021-02-08 23:16:41 +03:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{#each this.filteredWebhooks as |webhook|}}
|
|
|
|
<tr class="gh-list-row hide-child" data-test-webhook-row="{{webhook.id}}">
|
|
|
|
<td class="gh-list-data" data-test-text="name">{{webhook.name}}</td>
|
|
|
|
<td class="gh-list-data" data-test-text="event">{{event-name webhook.event}}</td>
|
|
|
|
<td class="gh-list-data" data-test-text="targetUrl">{{webhook.targetUrl}}</td>
|
|
|
|
<td class="gh-list-data" data-test-text="last-triggered">{{or webhook.lastTriggeredAtUTC "Not triggered"}}</td>
|
|
|
|
<td class="w1 gh-list-data nowrap">
|
|
|
|
<div class="child flex items-center">
|
|
|
|
<LinkTo @route="integration.webhooks.edit" @models={{array this.integration webhook}} data-test-link="edit-webhook">
|
|
|
|
{{svg-jar "pen" class="w6 h6 fill-midgrey pa1 mr1"}}
|
|
|
|
</LinkTo>
|
|
|
|
<button {{action "confirmWebhookDeletion" webhook}} data-test-button="delete-webhook">
|
|
|
|
{{svg-jar "trash" class="w6 fill-red pa1"}}
|
2020-05-05 21:14:45 +03:00
|
|
|
</button>
|
2019-02-23 12:48:18 +03:00
|
|
|
</div>
|
2021-02-08 23:16:41 +03:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{else}}
|
|
|
|
<tr class="bt b--whitegrey" data-test-webhooks-blank-slate>
|
|
|
|
<td colspan="5" class="pa5 pt15 pb15 tc midgrey f7">
|
|
|
|
<div class="flex flex-column items-center">
|
|
|
|
<p class="ma0 pa0 tc midgrey lh-title mt2">
|
|
|
|
No webhooks configured
|
|
|
|
</p>
|
|
|
|
<LinkTo @route="integration.webhooks.new" @model={{this.integration}} @classNames="flex items-center" data-test-link="add-webhook">
|
|
|
|
<div class="flex items-center pa2 pt1">
|
|
|
|
{{svg-jar "add" class="w3 h3 fill-blue-d1"}}
|
|
|
|
<span class="ml1 blue">Add webhook</span>
|
2019-02-23 12:48:18 +03:00
|
|
|
</div>
|
2020-01-16 18:14:03 +03:00
|
|
|
</LinkTo>
|
2018-10-19 19:34:53 +03:00
|
|
|
</div>
|
|
|
|
</td>
|
2018-10-18 02:18:29 +03:00
|
|
|
</tr>
|
2021-02-08 23:16:41 +03:00
|
|
|
{{/each}}
|
|
|
|
</tbody>
|
|
|
|
{{#if this.filteredWebhooks}}
|
|
|
|
<tfoot>
|
|
|
|
<tr class="gh-list-row new-webhook-cell">
|
|
|
|
<td colspan="5" class="gh-list-data">
|
2021-01-28 18:25:21 +03:00
|
|
|
<LinkTo @route="integration.webhooks.new" @model={{this.integration}} @classNames="flex items-center" data-test-link="add-webhook">
|
2021-02-08 23:16:41 +03:00
|
|
|
<div class="pt1 pb1 f7">
|
2019-01-28 15:53:48 +03:00
|
|
|
{{svg-jar "add" class="w3 h3 fill-blue-d1"}}
|
|
|
|
<span class="ml1 blue">Add webhook</span>
|
|
|
|
</div>
|
2020-01-16 18:14:03 +03:00
|
|
|
</LinkTo>
|
2021-02-08 23:16:41 +03:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
|
|
|
{{/if}}
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
<section class="gh-main-section">
|
|
|
|
<div class="gh-main-section-block">
|
|
|
|
<button class="gh-btn gh-btn-red gh-btn-icon" {{action "confirmIntegrationDeletion"}}>
|
|
|
|
<span> Delete integration </span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</section>
|
2018-10-18 02:18:29 +03:00
|
|
|
</section>
|
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.showUnsavedChangesModal}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhFullscreenModal @modal="leave-settings"
|
|
|
|
@confirm={{action "leaveScreen"}}
|
|
|
|
@close={{action "toggleUnsavedChangesModal"}}
|
|
|
|
@modifier="action wide" />
|
2018-10-18 02:18:29 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2020-05-05 21:14:45 +03:00
|
|
|
{{#if this.showRegenerateKeyModal}}
|
|
|
|
<GhFullscreenModal @modal="regenerate-key"
|
|
|
|
@model={{hash
|
|
|
|
apiKey=this.selectedApiKey
|
|
|
|
integration=this.integration
|
|
|
|
}}
|
|
|
|
@confirm={{action "regenerateKey"}}
|
|
|
|
@close={{action "cancelRegenerateKeyModal"}}
|
|
|
|
@modifier="action wide" />
|
|
|
|
{{/if}}
|
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.showDeleteIntegrationModal}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhFullscreenModal @modal="delete-integration"
|
|
|
|
@confirm={{action "deleteIntegration"}}
|
|
|
|
@close={{action "cancelIntegrationDeletion"}}
|
|
|
|
@modifier="action wide" />
|
2018-10-19 19:37:27 +03:00
|
|
|
{{/if}}
|
2018-10-23 12:29:49 +03:00
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if this.webhookToDelete}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhFullscreenModal @modal="delete-webhook"
|
|
|
|
@confirm={{action "deleteWebhook"}}
|
|
|
|
@close={{action "cancelWebhookDeletion"}}
|
|
|
|
@modifier="action wide" />
|
2018-10-19 19:34:53 +03:00
|
|
|
{{/if}}
|
|
|
|
|
2018-12-04 17:02:58 +03:00
|
|
|
{{outlet}}
|