diff options
Diffstat (limited to 'app/views/shared/issuable')
10 files changed, 45 insertions, 22 deletions
diff --git a/app/views/shared/issuable/_close_reopen_button.html.haml b/app/views/shared/issuable/_close_reopen_button.html.haml index 8365bc6f863..3453db9f209 100644 --- a/app/views/shared/issuable/_close_reopen_button.html.haml +++ b/app/views/shared/issuable/_close_reopen_button.html.haml @@ -21,5 +21,6 @@ - else = render 'shared/issuable/close_reopen_report_toggle', issuable: issuable, warn_before_close: add_blocked_class - else - = 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') + - 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_report_toggle.html.haml b/app/views/shared/issuable/_close_reopen_report_toggle.html.haml index df441e6d0af..48d1e146629 100644 --- a/app/views/shared/issuable/_close_reopen_report_toggle.html.haml +++ b/app/views/shared/issuable/_close_reopen_report_toggle.html.haml @@ -21,7 +21,7 @@ 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 - = icon('check', class: 'icon') + = sprite_icon('check', css_class: 'icon') .description %strong.title = _('Close') @@ -31,7 +31,7 @@ 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 - = icon('check', class: 'icon') + = sprite_icon('check', css_class: 'icon') .description %strong.title = _('Reopen') diff --git a/app/views/shared/issuable/_form.html.haml b/app/views/shared/issuable/_form.html.haml index 728b527f499..c0aba0eef7f 100644 --- a/app/views/shared/issuable/_form.html.haml +++ b/app/views/shared/issuable/_form.html.haml @@ -20,8 +20,6 @@ = render 'shared/issuable/form/title', issuable: issuable, form: form, has_wip_commits: commits && commits.detect(&:work_in_progress?) #js-suggestions{ data: { project_path: @project.full_path } } -= render 'shared/form_elements/apply_template_warning', issuable: issuable - = render 'shared/issuable/form/type_selector', issuable: issuable, form: form = render 'shared/form_elements/description', model: issuable, form: form, project: project diff --git a/app/views/shared/issuable/_label_dropdown.html.haml b/app/views/shared/issuable/_label_dropdown.html.haml index 535af522c1a..08883bb3372 100644 --- a/app/views/shared/issuable/_label_dropdown.html.haml +++ b/app/views/shared/issuable/_label_dropdown.html.haml @@ -26,7 +26,7 @@ - apply_is_default_styles = (selected.nil? || selected.empty?) && !no_default_styles %span.dropdown-toggle-text{ class: ("is-default" if apply_is_default_styles) } = multi_label_name(selected, label_name) - = icon('chevron-down') + = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") .dropdown-menu.dropdown-select.dropdown-menu-paging.dropdown-menu-labels.dropdown-menu-selectable.dropdown-extended-height = render partial: "shared/issuable/label_page_default", locals: { title: dropdown_title, show_footer: show_footer, show_create: show_create } - if show_create && project && can?(current_user, :admin_label, project) diff --git a/app/views/shared/issuable/_search_bar.html.haml b/app/views/shared/issuable/_search_bar.html.haml index ae79d5e3c3e..00b235809ed 100644 --- a/app/views/shared/issuable/_search_bar.html.haml +++ b/app/views/shared/issuable/_search_bar.html.haml @@ -96,6 +96,7 @@ %li.filter-dropdown-item %button.btn.btn-link.js-data-value{ type: 'button' } {{title}} + = render_if_exists 'shared/issuable/filter_iteration', type: type #js-dropdown-release.filtered-search-input-dropdown-menu.dropdown-menu %ul{ data: { dropdown: true } } %li.filter-dropdown-item{ data: { value: 'None' } } @@ -181,7 +182,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) + - if current_user && Feature.enabled?(:boards_with_swimlanes, @group, default_enabled: true) #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 458703ebc5f..1f20c1a30aa 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -96,24 +96,14 @@ %button.dropdown-menu-toggle.js-due-date-select{ type: 'button', data: { toggle: 'dropdown', field_name: "#{issuable_type}[due_date]", ability_name: issuable_type, issue_update: issuable_sidebar[:issuable_json_path], display: 'static' } } %span.dropdown-toggle-text = _('Due date') - = icon('chevron-down', 'aria-hidden': 'true') + = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") .dropdown-menu.dropdown-menu-due-date = dropdown_title(_('Due date')) = dropdown_content do .js-due-date-calendar - .js-sidebar-labels{ data: { allow_label_create: issuable_sidebar.dig(:current_user, :can_admin_label).to_s, - allow_scoped_labels: issuable_sidebar[:scoped_labels_available].to_s, - can_edit: can_edit_issuable.to_s, - iid: issuable_sidebar[:iid], - issuable_type: issuable_type, - labels_fetch_path: issuable_sidebar[:project_labels_path], - labels_manage_path: project_labels_path(@project), - labels_update_path: issuable_sidebar[:issuable_json_path], - project_issues_path: issuable_sidebar[:project_issuables_path], - project_path: @project.full_path, - selected_labels: issuable_sidebar[:labels].to_json } } + .js-sidebar-labels{ data: sidebar_labels_data(issuable_sidebar, @project) } = render_if_exists 'shared/issuable/sidebar_weight', issuable_sidebar: issuable_sidebar diff --git a/app/views/shared/issuable/_sort_dropdown.html.haml b/app/views/shared/issuable/_sort_dropdown.html.haml index 81dbecb430b..f60be3f3e4a 100644 --- a/app/views/shared/issuable/_sort_dropdown.html.haml +++ b/app/views/shared/issuable/_sort_dropdown.html.haml @@ -7,7 +7,7 @@ .btn-group{ role: 'group' } %button.dropdown-menu-toggle{ type: 'button', data: { toggle: 'dropdown', display: 'static' }, class: 'btn btn-default' } = sort_title - = icon('chevron-down') + = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") %ul.dropdown-menu.dropdown-menu-right.dropdown-menu-selectable.dropdown-menu-sort %li = sortable_item(sort_title_priority, page_filter_path(sort: sort_value_priority), sort_title) diff --git a/app/views/shared/issuable/csv_export/_button.html.haml b/app/views/shared/issuable/csv_export/_button.html.haml new file mode 100644 index 00000000000..3584c9c1ed5 --- /dev/null +++ b/app/views/shared/issuable/csv_export/_button.html.haml @@ -0,0 +1,4 @@ +- if current_user + %button.csv_download_link.btn.gl-button.has-tooltip{ title: _('Export as CSV'), + data: { toggle: 'modal', target: ".#{issuable_type}-export-modal", qa_selector: 'export_as_csv_button' } } + = sprite_icon('export') diff --git a/app/views/shared/issuable/csv_export/_modal.html.haml b/app/views/shared/issuable/csv_export/_modal.html.haml new file mode 100644 index 00000000000..4a4c6b90cd9 --- /dev/null +++ b/app/views/shared/issuable/csv_export/_modal.html.haml @@ -0,0 +1,29 @@ +- class_name = "#{issuable_type.dasherize}-export-modal" +- if current_user + .modal.issuable-export-modal{ class: class_name } + .modal-dialog + .modal-content{ data: { qa_selector: "export_issuable_modal" } } + .modal-header + %h3 + = _("Export %{issuable_type}" % { issuable_type: issuable_type.humanize(capitalize: false) }) + .svg-content.import-export-svg-container + = image_tag 'illustrations/export-import.svg', role: "presentation", class: 'illustration' + %button.close{ type: "button", "data-dismiss": "modal", "aria-label" => _('Close') } + = sprite_icon('close', css_class: 'gl-icon') + .modal-body + - issuable_count = issuables_count_for_state(issuable_type.to_sym, params[:state]) + - unless issuable_count == -1 # The count timed out + .modal-subheader + = sprite_icon('check', css_class: 'gl-icon gl-color-green-400') + %strong.gl-ml-3 + - if issuable_type.eql?('merge_requests') + = n_("%{count} merge request selected", "%{count} merge requests selected", issuable_count) % { count: issuable_count } + - else + = n_("%{count} issue selected", "%{count} issues selected", issuable_count) % { count: issuable_count } + .modal-text + = html_escape(_('The CSV export will be created in the background. Once finished, it will be sent to %{strong_open}%{email}%{strong_close} in an attachment.')) % { email: @current_user.notification_email, strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe } + .modal-footer + - if issuable_type.eql?('merge_requests') + = link_to _("Export merge requests"), export_csv_project_merge_requests_path(@project, request.query_parameters), method: :post, class: 'btn gl-button btn-success', data: { track_label: "export_merge_requests_csv", track_event: "click_button", track_value: "" } + - else + = link_to _('Export issues'), export_csv_project_issues_path(@project, request.query_parameters), method: :post, class: 'btn gl-button btn-success', data: { track_label: "export_issues_csv", track_event: "click_button", track_value: "", qa_selector: "export_issues_button" } diff --git a/app/views/shared/issuable/form/_type_selector.html.haml b/app/views/shared/issuable/form/_type_selector.html.haml index 3347966f39a..5d64c15d9f9 100644 --- a/app/views/shared/issuable/form/_type_selector.html.haml +++ b/app/views/shared/issuable/form/_type_selector.html.haml @@ -8,7 +8,7 @@ %button.dropdown-menu-toggle{ type: 'button', 'data-toggle' => 'dropdown' } %span.dropdown-toggle-text.is-default = issuable.issue_type.capitalize || _("Select type") - = icon('chevron-down') + = sprite_icon('chevron-down', css_class: "dropdown-menu-toggle-icon gl-top-3") .dropdown-menu.dropdown-menu-selectable.dropdown-select .dropdown-title.gl-display-flex %span.gl-ml-auto |