Skip to content

Commit

Permalink
use in webhook editor
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Mar 19, 2024
1 parent 83ef717 commit 2bb0feb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion templates/repo/settings/webhook/history.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
<div class="ui right">
<!-- the button is wrapped with a span because the tooltip doesn't show on hover if we put data-tooltip-content directly on the button -->
<span data-tooltip-content="{{if or $isNew .Webhook.IsActive}}{{ctx.Locale.Tr "repo.settings.webhook.test_delivery_desc"}}{{else}}{{ctx.Locale.Tr "repo.settings.webhook.test_delivery_desc_disabled"}}{{end}}">
<button class="ui teal tiny button{{if not (or $isNew .Webhook.IsActive)}} disabled{{end}}" id="test-delivery" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{ctx.Locale.Tr "repo.settings.webhook.test_delivery"}}</button>
<button class="ui teal tiny button{{if not (or $isNew .Webhook.IsActive)}} disabled{{end}}" id="test-delivery" data-link="{{.Link}}/test" data-redirect="{{.Link}}">
<span class="text">{{ctx.Locale.Tr "repo.settings.webhook.test_delivery"}}</span>
</button>
</span>
</div>
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/features/comp/WebHookEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function initCompWebHookEditor() {

// Test delivery
document.getElementById('test-delivery')?.addEventListener('click', async function () {
this.classList.add('loading', 'disabled');
this.classList.add('is-loading', 'disabled');
await POST(this.getAttribute('data-link'));
setTimeout(() => {
window.location.href = this.getAttribute('data-redirect');
Expand Down

0 comments on commit 2bb0feb

Please sign in to comment.