Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/shared/web_hooks')
-rw-r--r--app/views/shared/web_hooks/_form.html.haml35
-rw-r--r--app/views/shared/web_hooks/_hook.html.haml10
-rw-r--r--app/views/shared/web_hooks/_index.html.haml33
-rw-r--r--app/views/shared/web_hooks/_title_and_docs.html.haml10
-rw-r--r--app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml2
5 files changed, 55 insertions, 35 deletions
diff --git a/app/views/shared/web_hooks/_form.html.haml b/app/views/shared/web_hooks/_form.html.haml
index 7eafd6ae092..a0e55cd5723 100644
--- a/app/views/shared/web_hooks/_form.html.haml
+++ b/app/views/shared/web_hooks/_form.html.haml
@@ -3,7 +3,7 @@
.js-vue-webhook-form{ data: webhook_form_data(hook) }
.form-group
= form.label :token, s_('Webhooks|Secret token'), class: 'label-bold'
- = form.password_field :token, value: hook.masked_token, autocomplete: 'new-password', class: 'form-control gl-form-input'
+ = form.password_field :token, value: hook.masked_token, autocomplete: 'new-password', class: 'form-control gl-form-input gl-max-w-48'
%p.form-text.text-muted
- code_start = '<code>'.html_safe
- code_end = '</code>'.html_safe
@@ -11,59 +11,66 @@
.form-group
= form.label :url, s_('Webhooks|Trigger'), class: 'label-bold'
%ul.list-unstyled
- %li.gl-pb-5
+ %li.gl-pb-3
.js-vue-push-events{ data: { push_events: hook.push_events.to_s, strategy: hook.branch_filter_strategy, is_new_hook: hook.new_record?.to_s, push_events_branch_filter: hook.push_events_branch_filter } }
- %li.gl-pb-5
+ %li.gl-pb-3
= form.gitlab_ui_checkbox_component :tag_push_events,
integration_webhook_event_human_name(:tag_push_events),
help_text: s_('Webhooks|A new tag is pushed to the repository.')
- %li.gl-pb-5
+ %li.gl-pb-3
= form.gitlab_ui_checkbox_component :note_events,
integration_webhook_event_human_name(:note_events),
help_text: s_('Webhooks|A comment is added to an issue or merge request.')
- %li.gl-pb-5
+ %li.gl-pb-3
= form.gitlab_ui_checkbox_component :confidential_note_events,
integration_webhook_event_human_name(:confidential_note_events),
help_text: s_('Webhooks|A comment is added to a confidential issue.')
- %li.gl-pb-5
+ %li.gl-pb-3
= form.gitlab_ui_checkbox_component :issues_events,
integration_webhook_event_human_name(:issues_events),
help_text: s_('Webhooks|An issue is created, updated, closed, or reopened.')
- %li.gl-pb-5
+ %li.gl-pb-3
= form.gitlab_ui_checkbox_component :confidential_issues_events,
integration_webhook_event_human_name(: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.gl-pb-5
+ %li.gl-pb-3
= form.gitlab_ui_checkbox_component :merge_requests_events,
integration_webhook_event_human_name(:merge_requests_events),
help_text: s_('Webhooks|A merge request is created, updated, or merged.')
- %li.gl-pb-5
+ %li.gl-pb-3
= form.gitlab_ui_checkbox_component :job_events,
integration_webhook_event_human_name(:job_events),
help_text: s_("Webhooks|A job's status changes.")
- %li.gl-pb-5
+ %li.gl-pb-3
= form.gitlab_ui_checkbox_component :pipeline_events,
integration_webhook_event_human_name(:pipeline_events),
help_text: s_("Webhooks|A pipeline's status changes.")
- %li.gl-pb-5
+ %li.gl-pb-3
= form.gitlab_ui_checkbox_component :wiki_page_events,
integration_webhook_event_human_name(:wiki_page_events),
help_text: s_('Webhooks|A wiki page is created or updated.')
- %li.gl-pb-5
+ %li.gl-pb-3
= form.gitlab_ui_checkbox_component :deployment_events,
integration_webhook_event_human_name(:deployment_events),
help_text: s_('Webhooks|A deployment starts, finishes, fails, or is canceled.')
- %li.gl-pb-5
+ %li.gl-pb-3
= form.gitlab_ui_checkbox_component :feature_flag_events,
integration_webhook_event_human_name(:feature_flag_events),
help_text: s_('Webhooks|A feature flag is turned on or off.')
- %li.gl-pb-5
+ %li.gl-pb-3
= form.gitlab_ui_checkbox_component :releases_events,
integration_webhook_event_human_name(:releases_events),
help_text: s_('Webhooks|A release is created or updated.')
+ - if Feature.enabled?(:emoji_webhooks, hook.parent)
+ %li.gl-pb-5
+ - emoji_help_link = link_to s_('Which emoji events trigger webhooks'), help_page_path('user/project/integrations/webhook_events.md', anchor: 'emoji-events')
+ = form.gitlab_ui_checkbox_component :emoji_events,
+ integration_webhook_event_human_name(:emoji_events),
+ help_text: s_('Webhooks|An emoji is awarded or revoked. %{help_link}?').html_safe % { help_link: emoji_help_link }
+
.form-group
= form.label :enable_ssl_verification, s_('Webhooks|SSL verification'), class: 'label-bold checkbox'
%ul.list-unstyled
diff --git a/app/views/shared/web_hooks/_hook.html.haml b/app/views/shared/web_hooks/_hook.html.haml
index 155a7b1827f..50ce6552616 100644
--- a/app/views/shared/web_hooks/_hook.html.haml
+++ b/app/views/shared/web_hooks/_hook.html.haml
@@ -1,10 +1,10 @@
- sslStatus = hook.enable_ssl_verification ? _('enabled') : _('disabled')
- sslBadgeText = _('SSL Verification:') + ' ' + sslStatus
-%li
- .row
- .col-md-8.col-lg-7
- %strong.light-header
+%li.label-list-item
+ .gl-display-flex.lgl-align-items-center.row.gl-mx-n1
+ .col-md-8.col-lg-7.gl-px-3
+ .light-header.gl-mb-2
= hook.url
- if hook.rate_limited?
= gl_badge_tag(_('Disabled'), variant: :danger, size: :sm)
@@ -19,7 +19,7 @@
= gl_badge_tag(integration_webhook_event_human_name(trigger), size: :sm)
= gl_badge_tag(sslBadgeText, size: :sm)
- .col-md-4.col-lg-5.gl-mt-2.gl-display-flex.gl-md-justify-content-end.gl-align-items-baseline.gl-gap-3
+ .col-md-4.col-lg-5.gl-mt-2.gl-px-3.gl-gap-3.gl-display-flex.gl-md-justify-content-end.gl-align-items-baseline
= render 'shared/web_hooks/test_button', hook: hook, size: 'small'
= render Pajamas::ButtonComponent.new(href: edit_hook_path(hook), size: :small) do
= _('Edit')
diff --git a/app/views/shared/web_hooks/_index.html.haml b/app/views/shared/web_hooks/_index.html.haml
index 8a81e697a59..0ea6a0307ba 100644
--- a/app/views/shared/web_hooks/_index.html.haml
+++ b/app/views/shared/web_hooks/_index.html.haml
@@ -1,13 +1,24 @@
-%hr
-= render Pajamas::CardComponent.new(card_options: { id: 'webhooks-index' }, body_options: { class: 'gl-py-0'}) do |c|
+= render Pajamas::CardComponent.new(card_options: { id: 'webhooks-index', class: 'gl-new-card js-toggle-container' }, header_options: { class: 'gl-new-card-header'}, body_options: { class: 'gl-new-card-body'}) do |c|
- c.with_header do
- = hook_class.underscore.humanize.titleize.pluralize
- (#{hooks.size})
+ .gl-new-card-title-wrapper
+ %h3.gl-new-card-title
+ = hook_class.underscore.humanize.titleize.pluralize
+ %span.gl-new-card-count
+ = sprite_icon('hook', css_class: 'gl-mr-2')
+ #{hooks.size}
+ = render Pajamas::ButtonComponent.new(size: :small, button_options: { class: 'js-toggle-button js-toggle-content' }) do
+ = _('Add new webhook')
- c.with_body do
- - if hooks.any?
- %ul.content-list
- - hooks.each do |hook|
- = render 'shared/web_hooks/hook', hook: hook
- - else
- %p.text-center.gl-mt-3.gl-mb-3
- = _('No webhooks enabled. Select trigger events above.')
+ .gl-new-card-content
+ = gitlab_ui_form_for @hook, as: :hook, url: url, html: { class: 'js-webhook-form gl-new-card-add-form gl-mb-3 gl-display-none js-toggle-content' } do |f|
+ = render partial: partial, locals: { form: f, hook: @hook }
+ = f.submit _('Add webhook'), pajamas_button: true, data: { qa_selector: "create_webhook_button" }
+ = render Pajamas::ButtonComponent.new(button_options: { type: 'reset', class: 'js-webhook-edit-close gl-ml-2 js-toggle-button' }) do
+ = _('Cancel')
+ - if hooks.any?
+ %ul.content-list{ class: 'gl-my-n3!' }
+ - hooks.each do |hook|
+ = render 'shared/web_hooks/hook', hook: hook
+ - else
+ %p.gl-new-card-empty.gl-text-center
+ = _('No webhooks enabled. Select trigger events above.')
diff --git a/app/views/shared/web_hooks/_title_and_docs.html.haml b/app/views/shared/web_hooks/_title_and_docs.html.haml
index c220b46f70f..ae32dcea7cb 100644
--- a/app/views/shared/web_hooks/_title_and_docs.html.haml
+++ b/app/views/shared/web_hooks/_title_and_docs.html.haml
@@ -1,10 +1,12 @@
- webhooks_link_start = '<a href="%{url}">'.html_safe % { url: help_page_path(hook.help_path) }
-%h4.gl-mt-0
- = page_title
+.settings-sticky-header
+ .settings-sticky-header-inner
+ %h4.gl-my-0
+ = page_title
- if @project
- integrations_link_start = '<a href="%{url}">'.html_safe % { url: scoped_integrations_path(project: @project) }
- %p= _("%{webhooks_link_start}%{webhook_type}%{link_end} enable you to send notifications to web applications in response to events in a group or project. We recommend using an %{integrations_link_start}integration%{link_end} in preference to a webhook.").html_safe % { webhooks_link_start: webhooks_link_start, webhook_type: hook.pluralized_name, integrations_link_start: integrations_link_start, link_end: '</a>'.html_safe }
+ %p.gl-text-secondary= _("%{webhooks_link_start}%{webhook_type}%{link_end} enable you to send notifications to web applications in response to events in a group or project. We recommend using an %{integrations_link_start}integration%{link_end} in preference to a webhook.").html_safe % { webhooks_link_start: webhooks_link_start, webhook_type: hook.pluralized_name, integrations_link_start: integrations_link_start, link_end: '</a>'.html_safe }
- else
- %p= _("%{webhooks_link_start}%{webhook_type}%{link_end} enable you to send notifications to web applications in response to events in a group or project.").html_safe % { webhooks_link_start: webhooks_link_start, webhook_type: hook.pluralized_name, link_end: '</a>'.html_safe }
+ %p.gl-text-secondary= _("%{webhooks_link_start}%{webhook_type}%{link_end} enable you to send notifications to web applications in response to events in a group or project.").html_safe % { webhooks_link_start: webhooks_link_start, webhook_type: hook.pluralized_name, link_end: '</a>'.html_safe }
diff --git a/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml b/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml
index cbbb2f51fd5..1580fc0bd6d 100644
--- a/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml
+++ b/app/views/shared/web_hooks/_web_hook_disabled_alert.html.haml
@@ -10,4 +10,4 @@
= succeed '.' do
= link_to _('Learn more'), help_page_path('user/project/integrations/webhooks', anchor: 'troubleshooting'), target: '_blank', rel: 'noopener noreferrer'
- c.with_actions do
- = link_to s_('Webhooks|Go to webhooks'), project_hooks_path(@project, anchor: 'webhooks-index'), class: 'btn gl-alert-action btn-confirm gl-button'
+ = link_button_to s_('Webhooks|Go to webhooks'), project_hooks_path(@project, anchor: 'webhooks-index'), class: 'gl-alert-action', variant: :confirm