Commit 4dce42cc authored by Phil Hughes's avatar Phil Hughes

Merge branch '2946-promote-issue-weight' into 'master'

Resolve "Promote Issue weight"

Closes #2946

See merge request !2800
parents 6cf17029 443bd1b1
......@@ -76,3 +76,31 @@
max-width: 700px;
}
}
.promotion-info-weight-message {
padding: $gl-padding-top;
.dropdown-title {
margin: 0 0 10px;
}
.btn {
padding: $gl-vert-padding $gl-btn-padding;
border-radius: $border-radius-default;
display: block;
line-height: $line-height-base;
}
.btn-link {
display: inline;
color: $gl-link-color;
background-color: transparent;
padding: 0;
&:hover {
background-color: transparent;
color: $gl-link-hover-color;
}
}
}
......@@ -141,6 +141,7 @@
%li
%a{ href: "#", data: { id: weight, none: weight == Issue::WEIGHT_NONE }, class: ("is-active" if params[:weight] == weight.to_s) }
= weight
= render 'shared/promotions/promote_issue_weights'
- if issuable.has_attribute?(:confidential)
%script#js-confidential-issue-data{ type: "application/json" }= { is_confidential: @issue.confidential, is_editable: can_edit_issuable }.to_json.html_safe
......
- if show_promotions? && !@project.feature_available?(:issue_weights)
.block.weight
.sidebar-collapsed-icon{ data: { toggle: "dropdown", target: ".weight" } }
= icon('balance-scale')
%span
No
.title.hide-collapsed
= _('Weight')
= link_to _('Edit'), '#', class: 'edit-link promote-weight-link pull-right', data: { toggle: "dropdown", target: ".weight" }
.promotion-info-weight.dropdown
.dropdown-menu.promotion-info-weight-message
.dropdown-title
%span
= _('Change Weight')
%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
- if current_application_settings.should_check_namespace_plan?
= _('Upgrade your plan to activate Issue weight.')
- else
= _('Improve issues management with Issue weight and GitLab Enterprise Edition.')
= link_to _('Read more'), help_page_path('workflow/issue_weight.html'), class: 'btn-link', target: '_blank'
%div
= render 'shared/promotions/promotion_link_project', short_form: true
.hide-collapsed
%span.no-value
= _('None')
- short_form = local_assigns.fetch :short_form, false
- if current_application_settings.should_check_namespace_plan?
- if can?(current_user, :admin_namespace, @project.namespace)
= link_to 'Upgrade your plan', upgrade_plan_url, class: 'btn btn-primary'
......@@ -8,9 +9,9 @@
%p Contact owner #{ link_to(owner.name, user_path(owner)) } to upgrade the plan.
- elsif current_user&.admin?
- if License.current&.expired?
= link_to 'Buy GitLab Enterprise Edition', Gitlab::SUBSCRIPTIONS_PLANS_URL, class: 'btn btn-primary'
= link_to (!short_form ? 'Buy GitLab Enterprise Edition' : 'Buy EE'), Gitlab::SUBSCRIPTIONS_PLANS_URL, class: 'btn btn-primary'
- else
= link_to 'Start GitLab Enterprise Edition trial', new_trial_url, class: 'btn btn-primary'
= link_to (!short_form ? 'Start GitLab Enterprise Edition trial' : 'Start GitLab EE trial'), new_trial_url, class: 'btn btn-primary'
- else
%p
Contact your Administrator to upgrade your license.
......@@ -247,6 +247,23 @@ describe 'Promotions', js: true do
end
end
describe 'for issue weight', 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 project_issue_path(project, issue)
wait_for_requests
find('.promote-weight-link').click
expect(find('.promotion-info-weight-message')).to have_content 'Improve issues management with Issue weight and GitLab Enterprise Edition'
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