Commit 5ef4a5f0 authored by Tim Zallmann's avatar Tim Zallmann Committed by Phil Hughes

Resolve "Promote webhooks"

parent 3ad4f552
......@@ -9,16 +9,18 @@
margin-bottom: 20px;
}
.user-callout-copy {
max-width: 700px;
margin-left: auto;
margin-right: auto;
}
.bordered-box {
padding: 20px;
border-color: $border-color;
background-color: $white-light;
align-items: flex-start;
.user-callout-copy {
max-width: 700px;
}
.close {
.dismiss-icon {
......@@ -40,6 +42,10 @@
}
}
.user-callout.promotion-callout.promotion-empty-page {
margin-top: 56px;
}
.promotion-modal {
.modal-dialog {
......
......@@ -69,4 +69,8 @@ class Groups::HooksController < Groups::ApplicationController
:wiki_page_events
)
end
def check_group_webhooks_available!
render_404 unless @group.feature_available?(:group_webhooks) || LicenseHelper.show_promotions?(current_user)
end
end
= render "groups/settings_head"
.row.prepend-top-default
.col-lg-3
%h4.prepend-top-0
= page_title
%p
#{link_to 'Webhooks', help_page_path('user/project/integrations/webhooks')} can be
used for binding events when something is happening within the project.
- if @group.feature_available?(:group_webhooks)
.row.prepend-top-default
.col-lg-3
%h4.prepend-top-0
= page_title
%p
#{link_to 'Webhooks', help_page_path('user/project/integrations/webhooks')} can be
used for binding events when something is happening within the project.
.col-lg-9.append-bottom-default
= form_for @hook, as: :hook, url: polymorphic_path([@group, :hooks]) do |f|
= render partial: 'shared/web_hooks/form', locals: { form: f, hook: @hook }
= f.submit 'Add webhook', class: 'btn btn-create'
.col-lg-9.append-bottom-default
= form_for @hook, as: :hook, url: polymorphic_path([@group, :hooks]) do |f|
= render partial: 'shared/web_hooks/form', locals: { form: f, hook: @hook }
= f.submit 'Add webhook', class: 'btn btn-create'
%hr
%h5.prepend-top-default
Webhooks (#{@hooks.count})
- if @hooks.any?
%ul.well-list
- @hooks.each do |hook|
= render 'project_hook', hook: hook
- else
%p.settings-message.text-center.append-bottom-0
No webhooks found, add one in the form above.
%hr
%h5.prepend-top-default
Webhooks (#{@hooks.count})
- if @hooks.any?
%ul.well-list
- @hooks.each do |hook|
= render 'project_hook', hook: hook
- else
%p.settings-message.text-center.append-bottom-0
No webhooks found, add one in the form above.
- elsif show_promotions?
= render 'shared/promotions/promote_group_webhooks'
<svg xmlns="http://www.w3.org/2000/svg" width="78" height="82" viewBox="0 0 78 82"><g fill="none" fill-rule="evenodd"><path fill="#F9F9F9" d="M2.12 42c-.08.99-.12 1.99-.12 3 0 20.435 16.565 37 37 37s37-16.565 37-37c0-1.01-.04-2.01-.12-3C74.353 61.032 58.425 76 39 76 19.575 76 3.647 61.032 2.12 42z"/><path fill="#EEE" fill-rule="nonzero" d="M39 78C17.46 78 0 60.54 0 39S17.46 0 39 0s39 17.46 39 39-17.46 39-39 39zm0-4c19.33 0 35-15.67 35-35S58.33 4 39 4 4 19.67 4 39s15.67 35 35 35z"/><path fill="#E1DBF2" d="M25 50a6 6 0 1 0 12 0V38h4v12a6 6 0 1 0 12 0h-2a1 1 0 0 1-.8-1.6l4-5.333a1 1 0 0 1 1.6 0l4 5.333A1 1 0 0 1 59 50h-2c0 5.523-4.477 10-10 10a9.985 9.985 0 0 1-8-3.999A9.985 9.985 0 0 1 31 60c-5.523 0-10-4.477-10-10h-2a1 1 0 0 1-.8-1.6l4-5.333a1 1 0 0 1 1.6 0l4 5.333A1 1 0 0 1 27 50h-2z"/><path fill="#6B4FBB" d="M42 19h1a6 6 0 0 1 6 6v9a6 6 0 0 1-6 6h-8a6 6 0 0 1-6-6v-9a6 6 0 0 1 6-6h1v-1a3 3 0 0 1 6 0v1zm-7 4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-8z"/></g></svg>
\ No newline at end of file
......@@ -4,7 +4,7 @@
%span
LDAP Group
- if @group.feature_available?(:group_webhooks)
- if @group.feature_available?(:group_webhooks) || show_promotions?
= nav_link(path: 'hooks#index') do
= link_to group_hooks_path(@group), title: 'Webhooks' do
%span
......
.center.promotion-backdrop
.center.user-callout.promotion-callout
.svg-container
= custom_icon('icon_contribution_analytics')
.user-callout-copy
%h4
- if current_application_settings.should_check_namespace_plan?
Upgrade your plan to activate Contribution Analytics.
= _('Upgrade your plan to activate Contribution Analytics.')
- else
Track activity with Contribution Analytics.
= _('Track activity with Contribution Analytics.')
%p
With contribution analytics you can have an overview for the activity of issues, merge requests and push events of your organization and its members.
= link_to 'Read more', help_page_path('user/analytics/contribution_analytics.html'), target: '_blank'
= _('With contribution analytics you can have an overview for the activity of issues, merge requests and push events of your organization and its members.')
= link_to _('Read more'), help_page_path('user/analytics/contribution_analytics.md'), target: '_blank'
= render 'shared/promotions/promotion_link_project'
.center.user-callout.promotion-callout.promotion-empty-page
.svg-container
= custom_icon('icon_group_webhook')
.user-callout-copy
%h4
- if current_application_settings.should_check_namespace_plan?
= _('Upgrade your plan to activate Group Webhooks.')
- else
= _('Add Group Webhooks and GitLab Enterprise Edition.')
%p
= _('Webhooks allow you to trigger a URL if, for example, new code is pushed or a new issue is created. You can configure webhooks to listen for specific events like pushes, issues or merge requests. Group webhooks will apply to all projects in a group, allowing you to standardize webhook functionality across your entire group.')
= link_to _('Read more'), help_page_path('user/project/integrations/webhooks.html'), target: '_blank'
.prepend-top-15
= render 'shared/promotions/promotion_link_project'
......@@ -249,4 +249,19 @@ describe 'Promotions', js: true do
expect(find('.user-callout-copy')).to have_content 'Track activity with Contribution Analytics.'
end
end
describe 'for group webhooks' do
before do
allow(License).to receive(:current).and_return(nil)
stub_application_setting(check_namespace_plan: false)
group.add_owner(user)
sign_in(user)
end
it 'should appear on the page' do
visit group_hooks_path(group)
expect(find('.user-callout-copy')).to have_content 'Add Group Webhooks'
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment