Commit d5947ada authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Simplify set of assignee, milestone and label to admin_issue rule

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent b9fa82da
......@@ -145,9 +145,3 @@ h2.issue-title {
.issue-form .select2-container {
width: 250px !important;
}
.issues-holder {
.issue-info {
margin-left: 20px;
}
}
......@@ -154,9 +154,6 @@ class Ability
project_guest_rules + [
:download_code,
:fork_project,
:set_assignee,
:set_milestone,
:set_label,
:write_project_snippet
]
end
......@@ -188,7 +185,6 @@ class Ability
:modify_issue,
:modify_project_snippet,
:modify_merge_request,
:admin_issue,
:admin_milestone,
:admin_project_snippet,
:admin_project_member,
......
......@@ -28,15 +28,9 @@ class IssuableBaseService < BaseService
end
def filter_params
unless can?(current_user, :set_milestone, project)
unless can?(current_user, :admin_issue, project)
params.delete(:milestone_id)
end
unless can?(current_user, :set_label, project)
params.delete(:label_ids)
end
unless can?(current_user, :set_assignee, project)
params.delete(:assignee_id)
end
end
......
%li{ id: dom_id(issue), class: issue_css_classes(issue), url: issue_path(issue) }
- if controller.controller_name == 'issues'
- if controller.controller_name == 'issues' && can?(current_user, :admin_issue, @project)
.issue-check
= check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :set_assignee, issue)
= check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue"
.issue-title
%span.issue-title-text
......
......@@ -8,7 +8,7 @@
- else
none
.issuable-context-selectbox
- if can?(current_user, :set_assignee, @project)
- if can?(current_user, :admin_issue, @project)
= users_select_tag("#{issuable.class.table_name.singularize}[assignee_id]", placeholder: 'Select assignee', class: 'custom-form-control js-select2 js-assignee', selected: issuable.assignee_id, project: @target_project, null_user: true)
%div.prepend-top-20.clearfix
......@@ -24,7 +24,7 @@
- else
none
.issuable-context-selectbox
- if can?(current_user, :set_milestone, @project)
- if can?(current_user, :admin_issue, @project)
= f.select(:milestone_id, milestone_options(issuable), { include_blank: 'Select milestone' }, {class: 'select2 select2-compact js-select2 js-milestone'})
= hidden_field_tag :issuable_context
= f.submit class: 'btn hide'
......
......@@ -29,11 +29,10 @@
.issues-details-filters
= form_tag page_filter_path(without: [:assignee_id, :author_id, :milestone_title, :label_name]), method: :get, class: 'filter-form' do
- if controller.controller_name == 'issues'
- if controller.controller_name == 'issues' && can?(current_user, :admin_issue, @project)
.check-all-holder
= check_box_tag "check_all_issues", nil, false,
class: "check_all_issues left",
disabled: !can?(current_user, :modify_issue, @project)
class: "check_all_issues left"
.issues-other-filters
.filter-item.inline
= users_select_tag(:assignee_id, selected: params[:assignee_id],
......
......@@ -38,7 +38,7 @@
.clearfix
.error-alert
%hr
- if can?(current_user, :set_assignee, @project)
- if can?(current_user, :admin_issue, @project)
.form-group
.issue-assignee
= f.label :assignee_id, class: 'control-label' do
......@@ -50,7 +50,6 @@
selected: issuable.assignee_id, project: @target_project || @project)
&nbsp;
= link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
- if can?(current_user, :set_milestone, @project)
.form-group
.issue-milestone
= f.label :milestone_id, class: 'control-label' do
......@@ -66,7 +65,6 @@
&nbsp;
- if can? current_user, :admin_milestone, issuable.project
= link_to 'Create new milestone', new_namespace_project_milestone_path(issuable.project.namespace, issuable.project), target: :blank
- if can?(current_user, :set_label, @project)
.form-group
= f.label :label_ids, class: 'control-label' do
%i.fa.fa-tag
......
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