mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-11 18:26:50 +00:00
Per review, fix test webhook
- only show button for payment status changed webhook - update translation
This commit is contained in:
@@ -9,4 +9,8 @@ class WebhookEndpointFormComponent < ViewComponent::Base
|
||||
private
|
||||
|
||||
attr_reader :webhooks, :webhook_type
|
||||
|
||||
def is_webhook_payment_status?
|
||||
webhook_type == "payment_status_changed"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
data: { confirm: I18n.t(:are_you_sure) } do
|
||||
= I18n.t(:delete)
|
||||
|
||||
= form_tag helpers.webhook_endpoint_test_account_path(webhook_endpoint), class: "button_to", 'data-turbo': true do
|
||||
= button_tag type: "submit", class: "tiny alert no-margin", data: { confirm: I18n.t(:are_you_sure) } do
|
||||
= I18n.t("components.webhook_endpoint_form.test_endpoint")
|
||||
- if is_webhook_payment_status?
|
||||
= form_tag helpers.webhook_endpoint_test_account_path(webhook_endpoint), class: "button_to", 'data-turbo': true do
|
||||
= button_tag type: "submit", class: "tiny alert no-margin", data: { confirm: I18n.t(:are_you_sure) } do
|
||||
= I18n.t("components.webhook_endpoint_form.test_endpoint")
|
||||
|
||||
@@ -4089,7 +4089,7 @@ en:
|
||||
success: Webhook endpoint successfully deleted
|
||||
error: Webhook endpoint failed to delete
|
||||
test:
|
||||
success: Some test data has been sent to the webhook url
|
||||
success: Some test data will be sent to the webhook url
|
||||
|
||||
spree:
|
||||
order_updated: "Order Updated"
|
||||
|
||||
@@ -84,7 +84,7 @@ RSpec.describe WebhookEndpointsController do
|
||||
it "shows a success mesage" do
|
||||
subject
|
||||
|
||||
expect(flash[:success]).to eq "Some test data has been sent to the webhook url"
|
||||
expect(flash[:success]).to eq "Some test data will be sent to the webhook url"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user