Commit 55c9f099 authored by Tim Zallmann's avatar Tim Zallmann Committed by Phil Hughes

Resolve "Promote Issue/MR templates"

parent 33741438
......@@ -128,3 +128,37 @@
}
}
.promotion-issue-template-message {
padding: $gl-padding 30px 20px $gl-padding;
p {
margin-right: 20px;
}
.dropdown-title {
margin: 0 -25px;
padding: 0;
overflow: initial;
border-bottom: none;
}
.btn {
padding: $gl-vert-padding $gl-btn-padding;
border-radius: $border-radius-default;
display: inline-block;
line-height: $line-height-base;
}
.btn-link {
display: inline;
color: $gl-link-color;
padding: 0;
&:hover {
background-color: transparent;
color: $gl-link-hover-color;
}
}
}
......@@ -30,7 +30,10 @@
merge request from being merged before it's ready.
- if no_issuable_templates && can?(current_user, :push_code, issuable.project)
%p.help-block
Add
= link_to 'description templates', help_page_path('user/project/description_templates'), tabindex: -1
to help your contributors communicate effectively!
- if show_promotions?
= render 'shared/promotions/promote_issue_templates'
- else
%p.help-block
Add
= link_to 'description templates', help_page_path('user/project/description_templates'), tabindex: -1
to help your contributors communicate effectively!
.help-block
= _('Add')
= link_to 'description templates', 'javascript:void(0);', id: 'promotion-issue-template-link', data: {toggle: 'dropdown'}
= _('to help your contributors communicate effectively!')
.dropdown.promotion-issue-template
.dropdown-menu.promotion-issue-template-message
.dropdown-title
%button.dropdown-title-button.dropdown-menu-close{ "aria-label" => "Close", :type => "button" }
%i.fa.fa-times.dropdown-menu-close-icon{ "aria-hidden" => "true", "data-hidden" => "true" }
%div
%p
= _('Description templates allow you to define context-specific templates for issue and merge request description fields for your project.')
= link_to _('Read more'), help_page_path('user/project/description_templates'), class: 'btn-link'
%div
= render 'shared/promotions/promotion_link_project'
......@@ -264,6 +264,23 @@ describe 'Promotions', js: true do
end
end
describe 'for issue templates', js: true do
before do
allow(License).to receive(:current).and_return(nil)
stub_application_setting(check_namespace_plan: false)
project.team << [user, :master]
sign_in(user)
end
it 'should appear on the page', js: true do
visit new_project_issue_path(project)
wait_for_requests
find('#promotion-issue-template-link').click
expect(find('.promotion-issue-template-message')).to have_content 'Description templates allow you to define context-specific templates for issue and merge request description fields for your project.'
end
end
describe 'for project audit events', js: true do
before do
allow(License).to receive(:current).and_return(nil)
......
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