Merge pull request #3466 from aignatov-bio/ai-sci-5964-cancel-changes-after-exit-webhook-edit-mode

Cancel changes after exit webhook edit mode [SCI-5964]
This commit is contained in:
artoscinote 2021-08-11 12:14:12 +02:00 committed by GitHub
commit 1fc9027d1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -49,7 +49,9 @@
$('.activity-filters-list').on('click', '.edit-webhook-container .cancel-action', function(e) {
let webhookContainer = $(this).closest('.webhook');
let input = webhookContainer.find('.url-input');
e.preventDefault();
input.val(input.data('original-value'));
webhookContainer.find('.view-mode').removeClass('hidden');
webhookContainer.find('.edit-webhook-container').addClass('hidden');
});

View file

@ -4,7 +4,7 @@
</div>
<span class="form-text"><%= t("webhooks.index.target") %></span>
<div class="sci-input-container url-input-container form-group">
<%= f.text_field :url, class: "sci-input-field url-input", placeholder: t("webhooks.index.url_placeholder") %>
<%= f.text_field :url, class: "sci-input-field url-input", placeholder: t("webhooks.index.url_placeholder"), data: {original_value: f.object.url } %>
</div>
<button class="btn btn-light cancel-action">
<i class="fas fa-times"></i>