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