diff options
Diffstat (limited to 'app/views/shared/issuable')
13 files changed, 35 insertions, 123 deletions
diff --git a/app/views/shared/issuable/_bulk_update_sidebar.html.haml b/app/views/shared/issuable/_bulk_update_sidebar.html.haml index 09abe9e89c4..2f30958c877 100644 --- a/app/views/shared/issuable/_bulk_update_sidebar.html.haml +++ b/app/views/shared/issuable/_bulk_update_sidebar.html.haml @@ -1,5 +1,5 @@ - type = local_assigns.fetch(:type) -- bulk_issue_health_status_flag = Feature.enabled?(:bulk_update_health_status, @project&.group, default_enabled: true) && type == :issues && @project&.group&.feature_available?(:issuable_health_status) +- bulk_issue_health_status_flag = type == :issues && @project&.group&.feature_available?(:issuable_health_status) - epic_bulk_edit_flag = @project&.group&.feature_available?(:epics) && type == :issues %aside.issues-bulk-update.js-right-sidebar.right-sidebar{ "aria-live" => "polite", data: { 'signed-in': current_user.present? } } diff --git a/app/views/shared/issuable/_close_reopen_button.html.haml b/app/views/shared/issuable/_close_reopen_button.html.haml deleted file mode 100644 index 3453db9f209..00000000000 --- a/app/views/shared/issuable/_close_reopen_button.html.haml +++ /dev/null @@ -1,26 +0,0 @@ -- is_current_user = issuable_author_is_current_user(issuable) -- display_issuable_type = issuable_display_type(issuable) -- are_close_and_open_buttons_hidden = issuable_button_hidden?(issuable, true) && issuable_button_hidden?(issuable, false) -- add_blocked_class = false -- if defined? warn_before_close - - add_blocked_class = warn_before_close - -- if is_current_user && !issuable.is_a?(MergeRequest) - - if can_update - %button{ class: "d-none d-md-block btn btn-grouped btn-close js-btn-issue-action #{issuable_button_visibility(issuable, true)} #{(add_blocked_class ? 'btn-issue-blocked' : '')}", - data: { remote: 'true', endpoint: close_issuable_path(issuable), qa_selector: 'close_issue_button' } } - = _("Close %{display_issuable_type}") % { display_issuable_type: display_issuable_type } - - if can_reopen - %button{ class: "d-none d-md-block btn btn-grouped btn-reopen js-btn-issue-action #{issuable_button_visibility(issuable, false)}", - data: { remote: 'true', endpoint: reopen_issuable_path(issuable), qa_selector: 'reopen_issue_button' } } - = _("Reopen %{display_issuable_type}") % { display_issuable_type: display_issuable_type } -- else - - if can_update && !are_close_and_open_buttons_hidden - - if issuable.is_a?(MergeRequest) - = render 'shared/issuable/close_reopen_draft_report_toggle', issuable: issuable - - else - = render 'shared/issuable/close_reopen_report_toggle', issuable: issuable, warn_before_close: add_blocked_class - - else - - unless issuable.is_a?(MergeRequest) && issuable.merged? - = link_to _('Report abuse'), new_abuse_report_path(user_id: issuable.author.id, ref_url: issuable_url(issuable)), - class: 'd-none d-md-block btn btn-grouped btn-close-color', title: _('Report abuse') diff --git a/app/views/shared/issuable/_close_reopen_draft_report_toggle.html.haml b/app/views/shared/issuable/_close_reopen_draft_report_toggle.html.haml deleted file mode 100644 index bdb53dfe323..00000000000 --- a/app/views/shared/issuable/_close_reopen_draft_report_toggle.html.haml +++ /dev/null @@ -1,37 +0,0 @@ -- display_issuable_type = issuable_display_type(issuable) -- button_action_class = issuable.closed? ? 'btn-default' : 'btn-warning btn-warning-secondary' -- button_class = "btn gl-button #{!issuable.closed? && 'js-draft-toggle-button'}" -- toggle_class = "btn gl-button dropdown-toggle" - -.float-left.btn-group.gl-ml-3.issuable-close-dropdown.d-none.d-md-inline-flex.js-issuable-close-dropdown - = link_to issuable.closed? ? reopen_issuable_path(issuable) : toggle_draft_issuable_path(issuable), method: :put, class: "#{button_class} #{button_action_class}" do - - if issuable.closed? - = _('Reopen') - = display_issuable_type - - else - = issuable.work_in_progress? ? _('Mark as ready') : _('Mark as draft') - - - if !issuable.closed? || !issuable_author_is_current_user(issuable) - = button_tag type: 'button', class: "#{toggle_class} #{button_action_class}", data: { 'toggle' => 'dropdown' } do - %span.sr-only= _('Toggle dropdown') - = sprite_icon "angle-down", size: 12 - - %ul.js-issuable-close-menu.dropdown-menu.dropdown-menu-right - - if issuable.open? - %li - = link_to close_issuable_path(issuable), method: :put do - .description - %strong.title - = _('Close') - = display_issuable_type - - - unless issuable_author_is_current_user(issuable) - - unless issuable.closed? - %li.divider.droplab-item-ignore - - %li.report-item - %a.report-abuse-link{ href: new_abuse_report_path(user_id: issuable.author.id, ref_url: issuable_url(issuable)) } - .description - %strong.title= _('Report abuse') - %p.text - = _('Report %{display_issuable_type} that are abusive, inappropriate or spam.') % { display_issuable_type: display_issuable_type.pluralize } diff --git a/app/views/shared/issuable/_close_reopen_report_toggle.html.haml b/app/views/shared/issuable/_close_reopen_report_toggle.html.haml deleted file mode 100644 index 48d1e146629..00000000000 --- a/app/views/shared/issuable/_close_reopen_report_toggle.html.haml +++ /dev/null @@ -1,47 +0,0 @@ -- display_issuable_type = issuable_display_type(issuable) -- button_action = issuable.closed? ? 'reopen' : 'close' -- display_button_action = button_action.capitalize -- button_responsive_class = 'd-none d-md-block' -- button_class = "#{button_responsive_class} btn btn-grouped js-issuable-close-button js-btn-issue-action issuable-close-button" -- toggle_class = "#{button_responsive_class} btn btn-nr dropdown-toggle js-issuable-close-toggle" -- add_blocked_class = false -- if defined? warn_before_close - - add_blocked_class = !issuable.closed? && warn_before_close - -.float-left.btn-group.gl-ml-3.issuable-close-dropdown.droplab-dropdown.js-issuable-close-dropdown - %button{ class: "#{button_class} btn-#{button_action} #{(add_blocked_class ? 'btn-issue-blocked' : '')}", data: { testid: 'close-issue-button', qa_selector: 'close_issue_button', endpoint: close_reopen_issuable_path(issuable) } } - #{display_button_action} #{display_issuable_type} - - = button_tag type: 'button', class: "#{toggle_class} btn-#{button_action}-color", - data: { 'dropdown-trigger' => '#issuable-close-menu' }, 'aria-label' => _('Toggle dropdown') do - = icon('caret-down', class: 'toggle-icon icon') - - %ul#issuable-close-menu.js-issuable-close-menu.dropdown-menu{ data: { dropdown: true } } - %li.close-item{ class: "#{issuable_button_visibility(issuable, true) || 'droplab-item-selected'}", - data: { text: _("Close %{display_issuable_type}") % { display_issuable_type: display_issuable_type }, url: close_issuable_path(issuable), - button_class: "#{button_class} btn-close", toggle_class: "#{toggle_class} btn-close-color" } } - %button.btn.btn-transparent - = sprite_icon('check', css_class: 'icon') - .description - %strong.title - = _('Close') - = display_issuable_type - - %li.reopen-item{ class: "#{issuable_button_visibility(issuable, false) || 'droplab-item-selected'}", - data: { text: _("Reopen %{display_issuable_type}") % { display_issuable_type: display_issuable_type }, url: reopen_issuable_path(issuable), - button_class: "#{button_class} btn-reopen", toggle_class: "#{toggle_class} btn-reopen-color" } } - %button.btn.btn-transparent - = sprite_icon('check', css_class: 'icon') - .description - %strong.title - = _('Reopen') - = display_issuable_type - - %li.divider.droplab-item-ignore - - %li.report-item{ data: { text: _('Report abuse'), button_class: "#{button_class} btn-close-color", toggle_class: "#{toggle_class} btn-close-color", method: '' } } - %a.report-abuse-link{ :href => new_abuse_report_path(user_id: issuable.author.id, ref_url: issuable_url(issuable)) } - .description - %strong.title= _('Report abuse') - %p.text - = _('Report %{display_issuable_type} that are abusive, inappropriate or spam.') % { display_issuable_type: display_issuable_type.pluralize } diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index c0aba0eef7f..552f83906e1 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -32,7 +32,7 @@ = form.label :confidential, class: 'form-check-label' do This issue is confidential and should only be visible to team members with at least Reporter access. -= render 'shared/issuable/form/metadata', issuable: issuable, form: form, project: project += render 'shared/issuable/form/metadata', issuable: issuable, form: form, project: project, presenter: presenter = render_if_exists 'shared/issuable/approvals', issuable: issuable, presenter: presenter, form: form @@ -88,3 +88,6 @@ = form.hidden_field :issue_type = form.hidden_field :lock_version + +- if @vulnerability_id + = hidden_field_tag 'vulnerability_id', @vulnerability_id diff --git a/app/views/shared/issuable/_search_bar.html.haml b/app/views/shared/issuable/_search_bar.html.haml index 00b235809ed..79d86500bd9 100644 --- a/app/views/shared/issuable/_search_bar.html.haml +++ b/app/views/shared/issuable/_search_bar.html.haml @@ -75,6 +75,22 @@ = render 'shared/issuable/user_dropdown_item', user: User.new(username: '{{username}}', name: '{{name}}'), avatar: { lazy: true, url: '{{avatar_url}}' } + #js-dropdown-reviewer.filtered-search-input-dropdown-menu.dropdown-menu + %ul{ data: { dropdown: true } } + %li.filter-dropdown-item{ data: { value: 'None' } } + %button.btn.btn-link{ type: 'button' } + = _('None') + %li.filter-dropdown-item{ data: { value: 'Any' } } + %button.btn.btn-link{ type: 'button' } + = _('Any') + %li.divider.droplab-item-ignore + - if current_user + = render 'shared/issuable/user_dropdown_item', + user: current_user + %ul.filter-dropdown{ data: { dynamic: true, dropdown: true } } + = render 'shared/issuable/user_dropdown_item', + user: User.new(username: '{{username}}', name: '{{name}}'), + avatar: { lazy: true, url: '{{avatar_url}}' } = render_if_exists 'shared/issuable/approver_dropdown' = render_if_exists 'shared/issuable/approved_by_dropdown' #js-dropdown-milestone.filtered-search-input-dropdown-menu.dropdown-menu @@ -182,7 +198,7 @@ = render 'shared/issuable/board_create_list_dropdown', board: board - if @project #js-add-issues-btn.gl-ml-3{ data: { can_admin_list: can?(current_user, :admin_list, @project) } } - - if current_user && Feature.enabled?(:boards_with_swimlanes, @group, default_enabled: true) + - if current_user #js-board-epics-swimlanes-toggle #js-toggle-focus-btn - elsif is_not_boards_modal_or_productivity_analytics && show_sorting_dropdown diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 1f20c1a30aa..cd265c10451 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -25,7 +25,7 @@ .block.assignee.qa-assignee-block = render "shared/issuable/sidebar_assignees", issuable_sidebar: issuable_sidebar, assignees: assignees, signed_in: signed_in - - if Feature.enabled?(:merge_request_reviewers, @project) && reviewers + - if Feature.enabled?(:merge_request_reviewers, @project, default_enabled: true) && reviewers .block.reviewer.qa-reviewer-block = render "shared/issuable/sidebar_reviewers", issuable_sidebar: issuable_sidebar, reviewers: reviewers, signed_in: signed_in @@ -58,7 +58,7 @@ = f.hidden_field 'milestone_id', value: milestone[:id], id: nil = dropdown_tag('Milestone', options: { title: _('Assign milestone'), toggle_class: 'js-milestone-select js-extra-options', filter: true, dropdown_class: 'dropdown-menu-selectable', placeholder: _('Search milestones'), data: { show_no: true, field_name: "#{issuable_type}[milestone_id]", project_id: issuable_sidebar[:project_id], issuable_id: issuable_sidebar[:id], ability_name: issuable_type, issue_update: issuable_sidebar[:issuable_json_path], use_id: true, default_no: true, selected: milestone[:title], null_default: true, display: 'static' }}) - if @project.group.present? - = render_if_exists 'shared/issuable/iteration_select', { can_edit: can_edit_issuable, group_path: @project.group.full_path, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid], issuable_type: issuable_type } + = render_if_exists 'shared/issuable/iteration_select', can_edit: can_edit_issuable, group_path: @project.group.full_path, project_path: issuable_sidebar[:project_full_path], issue_iid: issuable_sidebar[:iid], issuable_type: issuable_type - if issuable_sidebar[:supports_time_tracking] #issuable-time-tracker.block diff --git a/app/views/shared/issuable/form/_branch_chooser.html.haml b/app/views/shared/issuable/form/_branch_chooser.html.haml index 94fa43746e2..a425f5f810e 100644 --- a/app/views/shared/issuable/form/_branch_chooser.html.haml +++ b/app/views/shared/issuable/form/_branch_chooser.html.haml @@ -2,7 +2,7 @@ - form = local_assigns.fetch(:form) - return unless issuable.is_a?(MergeRequest) -- return if issuable.closed_without_fork? +- return if issuable.closed_or_merged_without_fork? - source_title, target_title = format_mr_branch_names(@merge_request) diff --git a/app/views/shared/issuable/form/_merge_params.html.haml b/app/views/shared/issuable/form/_merge_params.html.haml index e29627304b4..7233e671caa 100644 --- a/app/views/shared/issuable/form/_merge_params.html.haml +++ b/app/views/shared/issuable/form/_merge_params.html.haml @@ -2,7 +2,7 @@ - project = local_assigns.fetch(:project) - return unless issuable.is_a?(MergeRequest) -- return if issuable.closed_without_fork? +- return if issuable.closed_or_merged_without_fork? .form-group.row .col-sm-2.col-form-label.pt-sm-0 diff --git a/app/views/shared/issuable/form/_metadata.html.haml b/app/views/shared/issuable/form/_metadata.html.haml index 459eb112e4f..366e819d252 100644 --- a/app/views/shared/issuable/form/_metadata.html.haml +++ b/app/views/shared/issuable/form/_metadata.html.haml @@ -1,5 +1,6 @@ - project = local_assigns.fetch(:project) - issuable = local_assigns.fetch(:issuable) +- presenter = local_assigns.fetch(:presenter) - return unless can?(current_user, :"admin_#{issuable.to_ability_name}", issuable.project) @@ -14,7 +15,7 @@ - if issuable.allows_reviewers? .form-group.row.merge-request-reviewer - = render "shared/issuable/form/metadata_issuable_reviewer", issuable: issuable, form: form, has_due_date: has_due_date + = render "shared/issuable/form/metadata_issuable_reviewer", issuable: issuable, form: form, has_due_date: has_due_date, presenter: presenter = render_if_exists "shared/issuable/form/epic", issuable: issuable, form: form, project: project diff --git a/app/views/shared/issuable/form/_metadata_issuable_assignee.html.haml b/app/views/shared/issuable/form/_metadata_issuable_assignee.html.haml index 60dc893d9f9..b437ee1ec5f 100644 --- a/app/views/shared/issuable/form/_metadata_issuable_assignee.html.haml +++ b/app/views/shared/issuable/form/_metadata_issuable_assignee.html.haml @@ -1,4 +1,4 @@ -= form.label :assignee_id, "Assignee", class: "col-form-label #{has_due_date ? "col-md-2 col-lg-4" : "col-sm-2"}" += form.label :assignee_id, issuable.allows_multiple_assignees? ? _('Assignees') : _('Assignee'), class: "col-form-label #{has_due_date ? "col-md-2 col-lg-4" : "col-sm-2"}" .col-sm-10{ class: ("col-md-8" if has_due_date) } .issuable-form-select-holder.selectbox - issuable.assignees.each do |assignee| diff --git a/app/views/shared/issuable/form/_metadata_issuable_reviewer.html.haml b/app/views/shared/issuable/form/_metadata_issuable_reviewer.html.haml index a8b033bba36..a0df007f8ca 100644 --- a/app/views/shared/issuable/form/_metadata_issuable_reviewer.html.haml +++ b/app/views/shared/issuable/form/_metadata_issuable_reviewer.html.haml @@ -1,5 +1,5 @@ -= form.label :reviewer_id, "Reviewer", class: "col-form-label #{has_due_date ? "col-md-2 col-lg-4" : "col-sm-2"}" -.col-sm-10{ class: ("col-md-8" if has_due_date) } += form.label :reviewer_id, issuable.allows_multiple_reviewers? ? _('Reviewers') : _('Reviewer'), class: "col-form-label #{has_due_date ? "col-md-2 col-lg-4" : "col-sm-2"}" +.col-sm-10.gl-mb-2{ class: ("col-md-8" if has_due_date) } .issuable-form-select-holder.selectbox - issuable.reviewers.each do |reviewer| = hidden_field_tag "#{issuable.to_ability_name}[reviewer_ids][]", reviewer.id, id: nil, data: { meta: reviewer.name, avatar_url: reviewer.avatar_url, name: reviewer.name, username: reviewer.username } @@ -7,4 +7,6 @@ - if issuable.reviewers.empty? = hidden_field_tag "#{issuable.to_ability_name}[reviewer_ids][]", 0, id: nil, data: { meta: '' } - = dropdown_tag(users_dropdown_label(issuable.reviewers), options: reviewers_dropdown_options(issuable.to_ability_name)) + = dropdown_tag(users_dropdown_label(issuable.reviewers), options: reviewers_dropdown_options(issuable.to_ability_name, issuable.iid, issuable.target_branch)) + - if Feature.enabled?(:mr_collapsed_approval_rules, @project) + = render_if_exists 'shared/issuable/approver_suggestion', issuable: issuable, presenter: presenter diff --git a/app/views/shared/issuable/form/_type_selector.html.haml b/app/views/shared/issuable/form/_type_selector.html.haml index 5d64c15d9f9..67bc4019a82 100644 --- a/app/views/shared/issuable/form/_type_selector.html.haml +++ b/app/views/shared/issuable/form/_type_selector.html.haml @@ -13,7 +13,7 @@ .dropdown-title.gl-display-flex %span.gl-ml-auto = _("Select type") - %button.dropdown-title-button.dropdown-menu-close.gl-ml-auto{ "aria-label" => _('Close') } + %button.dropdown-title-button.dropdown-menu-close.gl-ml-auto{ type: 'button', "aria-label" => _('Close') } = sprite_icon('close', size: 16, css_class: 'dropdown-menu-close-icon') .dropdown-content %ul |