diff --git a/app/coffee/modules/admin/third-parties.coffee b/app/coffee/modules/admin/third-parties.coffee index 96eb6ff1..5e88b3fb 100644 --- a/app/coffee/modules/admin/third-parties.coffee +++ b/app/coffee/modules/admin/third-parties.coffee @@ -94,6 +94,7 @@ WebhookDirective = ($rs, $repo, $confirm, $loading) -> log.prettySentHeaders = JSON.stringify(log.request_headers, undefined, 2) log.prettyDate = moment(log.created).format("DD MMM YYYY [at] hh:mm:ss") + webhook.logs_counter = webhooklogs.length webhook.logs = webhooklogs updateShowHideHistoryText() @@ -113,6 +114,9 @@ WebhookDirective = ($rs, $repo, $confirm, $loading) -> $el.find(".visualization-mode").addClass("hidden") $el.find(".edition-mode").removeClass("hidden") + openHistory = () -> + $el.find(".webhooks-history").addClass("open") + cancel = () -> showVisualizationMode() $scope.$apply -> @@ -132,10 +136,9 @@ WebhookDirective = ($rs, $repo, $confirm, $loading) -> form.setErrors(data) $el.on "click", ".test-webhook", () -> + openHistory() $rs.webhooks.test(webhook.id).then => updateLogs() - $el.find(".webhooks-history").addClass("open") - updateShowHideHistoryText() $el.on "click", ".edit-webhook", () -> showEditMode() diff --git a/app/partials/admin/admin-third-parties-webhooks.jade b/app/partials/admin/admin-third-parties-webhooks.jade index a6a7794d..6b8810de 100644 --- a/app/partials/admin/admin-third-parties-webhooks.jade +++ b/app/partials/admin/admin-third-parties-webhooks.jade @@ -44,7 +44,7 @@ block content span(ng-bind="webhook.name") div.webhook-url span(ng-bind="webhook.url") - a.show-history.toggle-history(href="", title="Toggle history", ng-show="webhook.logs_counter ") (Show history) + a.show-history.toggle-history(href="", title="Toggle history", ng-show="webhook.logs_counter") (Show history) div.webhook-options div.webhook-options-wrapper