diff options
Diffstat (limited to 'app/views/shared/web_hooks/_hook_errors.html.haml')
-rw-r--r-- | app/views/shared/web_hooks/_hook_errors.html.haml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/app/views/shared/web_hooks/_hook_errors.html.haml b/app/views/shared/web_hooks/_hook_errors.html.haml new file mode 100644 index 00000000000..23010b8349c --- /dev/null +++ b/app/views/shared/web_hooks/_hook_errors.html.haml @@ -0,0 +1,41 @@ +- strong_start = '<strong>'.html_safe +- strong_end = '</strong>'.html_safe +- link_start = '<a href="%{url}">'.html_safe +- link_end = '</a>'.html_safe + +- if hook.rate_limited? + - support_path = 'https://support.gitlab.com/hc/en-us/requests/new' + - placeholders = { strong_start: strong_start, + strong_end: strong_end, + limit: hook.rate_limit, + support_link_start: link_start % { url: support_path }, + support_link_end: link_end } + = render 'shared/global_alert', + title: s_('Webhooks|Webhook was automatically disabled'), + variant: :danger, + is_contained: true, + close_button_class: 'js-close' do + .gl-alert-body + = s_('Webhooks|The webhook was triggered more than %{limit} times per minute and is now disabled. To re-enable this webhook, fix the problems shown in %{strong_start}Recent events%{strong_end}, then re-test your settings. %{support_link_start}Contact Support%{support_link_end} if you need help re-enabling your webhook.').html_safe % placeholders +- elsif hook.permanently_disabled? + = render 'shared/global_alert', + title: s_('Webhooks|Webhook failed to connect'), + variant: :danger, + is_contained: true, + close_button_class: 'js-close' do + .gl-alert-body + = s_('Webhooks|The webhook failed to connect, and is disabled. To re-enable it, check %{strong_start}Recent events%{strong_end} for error details, then test your settings below.').html_safe % { strong_start: strong_start, strong_end: strong_end } +- elsif hook.temporarily_disabled? + - help_path = help_page_path('user/project/integrations/webhooks', anchor: 'webhook-fails-or-multiple-webhook-requests-are-triggered') + - placeholders = { strong_start: strong_start, + strong_end: strong_end, + retry_time: time_interval_in_words(hook.disabled_until - Time.now), + help_link_start: link_start % { url: help_path }, + help_link_end: link_end } + = render 'shared/global_alert', + title: s_('Webhooks|Webhook fails to connect'), + variant: :warning, + is_contained: true, + close_button_class: 'js-close' do + .gl-alert-body + = s_('Webhooks|The webhook %{help_link_start}failed to connect%{help_link_end}, and will retry in %{retry_time}. To re-enable it, check %{strong_start}Recent events%{strong_end} for error details, then test your settings below.').html_safe % placeholders |