diff options
Diffstat (limited to 'app/views/shared/web_hooks')
-rw-r--r-- | app/views/shared/web_hooks/_form.html.haml | 141 | ||||
-rw-r--r-- | app/views/shared/web_hooks/_hook_errors.html.haml | 18 |
2 files changed, 64 insertions, 95 deletions
diff --git a/app/views/shared/web_hooks/_form.html.haml b/app/views/shared/web_hooks/_form.html.haml index 5650f08b2a9..afe72767b9a 100644 --- a/app/views/shared/web_hooks/_form.html.haml +++ b/app/views/shared/web_hooks/_form.html.haml @@ -14,92 +14,67 @@ = s_('Webhooks|Used to validate received payloads. Sent with the request in the %{code_start}X-Gitlab-Token HTTP%{code_end} header.').html_safe % { code_start: code_start, code_end: code_end } .form-group = form.label :url, s_('Webhooks|Trigger'), class: 'label-bold' - %ul.list-unstyled.gl-ml-6 - %li - = form.check_box :push_events, class: 'form-check-input' - = form.label :push_events, class: 'list-label form-check-label gl-ml-1 gl-mb-3' do - %strong= s_('Webhooks|Push events') - = form.text_field :push_events_branch_filter, class: 'form-control gl-form-input', placeholder: 'Branch name or wildcard pattern to trigger on (leave blank for all)' - %p.text-muted.gl-ml-1 + %ul.list-unstyled + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :push_events, s_('Webhooks|Push events') + .gl-pl-6 + = form.text_field :push_events_branch_filter, class: 'form-control gl-form-input', + placeholder: 'Branch name or wildcard pattern to trigger on (leave blank for all)' + %p.form-text.text-muted.custom-control = s_('Webhooks|Push to the repository.') - %li - = form.check_box :tag_push_events, class: 'form-check-input' - = form.label :tag_push_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Tag push events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A new tag is pushed to the repository.') - %li - = form.check_box :note_events, class: 'form-check-input' - = form.label :note_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Comments') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A comment is added to an issue.') - %li - = form.check_box :confidential_note_events, class: 'form-check-input' - = form.label :confidential_note_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Confidential comments') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A comment is added to a confidential issue.') - %li - = form.check_box :issues_events, class: 'form-check-input' - = form.label :issues_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Issues events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|An issue is created, updated, closed, or reopened.') - %li - = form.check_box :confidential_issues_events, class: 'form-check-input' - = form.label :confidential_issues_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Confidential issues events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A confidential issue is created, updated, closed, or reopened.') + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :tag_push_events, + s_('Webhooks|Tag push events'), + help_text: s_('Webhooks|A new tag is pushed to the repository.') + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :note_events, + s_('Webhooks|Comments'), + help_text: s_('Webhooks|A comment is added to an issue or merge request.') + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :confidential_note_events, + s_('Webhooks|Confidential comments'), + help_text: s_('Webhooks|A comment is added to a confidential issue.') + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :issues_events, + s_('Webhooks|Issues events'), + help_text: s_('Webhooks|An issue is created, updated, closed, or reopened.') + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :confidential_issues_events, + s_('Webhooks|Confidential issues events'), + help_text: s_('Webhooks|A confidential issue is created, updated, closed, or reopened.') - if @group = render_if_exists 'groups/hooks/member_events', form: form = render_if_exists 'groups/hooks/subgroup_events', form: form - %li - = form.check_box :merge_requests_events, class: 'form-check-input' - = form.label :merge_requests_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Merge request events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A merge request is created, updated, or merged.') - %li - = form.check_box :job_events, class: 'form-check-input' - = form.label :job_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Job events') - %p.text-muted.gl-ml-1 - = s_("Webhooks|A job's status changes.") - %li - = form.check_box :pipeline_events, class: 'form-check-input' - = form.label :pipeline_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Pipeline events') - %p.text-muted.gl-ml-1 - = s_("Webhooks|A pipeline's status changes.") - %li - = form.check_box :wiki_page_events, class: 'form-check-input' - = form.label :wiki_page_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Wiki page events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A wiki page is created or updated.') - %li - = form.check_box :deployment_events, class: 'form-check-input' - = form.label :deployment_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Deployment events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A deployment starts, finishes, fails, or is canceled.') - %li - = form.check_box :feature_flag_events, class: 'form-check-input' - = form.label :feature_flag_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Feature flag events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A feature flag is turned on or off.') - %li - = form.check_box :releases_events, class: 'form-check-input' - = form.label :releases_events, class: 'list-label form-check-label gl-ml-1' do - %strong= s_('Webhooks|Releases events') - %p.text-muted.gl-ml-1 - = s_('Webhooks|A release is created or updated.') + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :merge_requests_events, + s_('Webhooks|Merge request events'), + help_text: s_('Webhooks|A merge request is created, updated, or merged.') + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :job_events, + s_('Webhooks|Job events'), + help_text: s_("Webhooks|A job's status changes.") + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :pipeline_events, + s_('Webhooks|Pipeline events'), + help_text: s_("Webhooks|A pipeline's status changes.") + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :wiki_page_events, + s_('Webhooks|Wiki page events'), + help_text: s_('Webhooks|A wiki page is created or updated.') + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :deployment_events, + s_('Webhooks|Deployment events'), + help_text: s_('Webhooks|A deployment starts, finishes, fails, or is canceled.') + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :feature_flag_events, + s_('Webhooks|Feature flag events'), + help_text: s_('Webhooks|A feature flag is turned on or off.') + %li.gl-pb-5 + = form.gitlab_ui_checkbox_component :releases_events, + s_('Webhooks|Releases events'), + help_text: s_('Webhooks|A release is created or updated.') .form-group = form.label :enable_ssl_verification, s_('Webhooks|SSL verification'), class: 'label-bold checkbox' - .form-check - = form.check_box :enable_ssl_verification, class: 'form-check-input' - = form.label :enable_ssl_verification, class: 'form-check-label gl-ml-1' do - %strong= s_('Webhooks|Enable SSL verification') + %ul.list-unstyled + %li + = form.gitlab_ui_checkbox_component :enable_ssl_verification, s_('Webhooks|Enable SSL verification') diff --git a/app/views/shared/web_hooks/_hook_errors.html.haml b/app/views/shared/web_hooks/_hook_errors.html.haml index 03f373783f8..a100a620cea 100644 --- a/app/views/shared/web_hooks/_hook_errors.html.haml +++ b/app/views/shared/web_hooks/_hook_errors.html.haml @@ -10,17 +10,13 @@ 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, - close_button_class: 'js-close' do + = render Pajamas::AlertComponent.new(title: s_('Webhooks|Webhook was automatically disabled'), + variant: :danger) 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, - close_button_class: 'js-close' do + = render Pajamas::AlertComponent.new(title: s_('Webhooks|Webhook failed to connect'), + variant: :danger) 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? @@ -30,9 +26,7 @@ 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, - close_button_class: 'js-close' do + = render Pajamas::AlertComponent.new(title: s_('Webhooks|Webhook fails to connect'), + variant: :warning) 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 |