diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /app/views/projects/issues | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) | |
download | gitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'app/views/projects/issues')
12 files changed, 86 insertions, 52 deletions
diff --git a/app/views/projects/issues/_alert_moved_from_service_desk.html.haml b/app/views/projects/issues/_alert_moved_from_service_desk.html.haml index a6f969f8b10..9b142b08574 100644 --- a/app/views/projects/issues/_alert_moved_from_service_desk.html.haml +++ b/app/views/projects/issues/_alert_moved_from_service_desk.html.haml @@ -3,8 +3,8 @@ - service_desk_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: service_desk_link_url } .hide.gl-alert.gl-alert-warning.js-alert-moved-from-service-desk-warning.gl-mt-5{ role: 'alert' } - = sprite_icon('warning', size: 16, css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title') + = sprite_icon('warning', css_class: 'gl-icon gl-alert-icon gl-alert-icon-no-title') %button.js-close.gl-alert-dismiss{ type: 'button', 'aria-label' => _('Dismiss') } - = sprite_icon('close', size: 16, css_class: 'gl-icon') + = sprite_icon('close', css_class: 'gl-icon') .gl-alert-body.gl-mr-3 = s_('This project does not have %{service_desk_link_start}Service Desk%{service_desk_link_end} enabled, so the user who created the issue will no longer receive email notifications about new activity.').html_safe % { service_desk_link_start: service_desk_link_start, service_desk_link_end: '</a>'.html_safe } diff --git a/app/views/projects/issues/_discussion.html.haml b/app/views/projects/issues/_discussion.html.haml index bcc74e8d1d9..4273130bbc2 100644 --- a/app/views/projects/issues/_discussion.html.haml +++ b/app/views/projects/issues/_discussion.html.haml @@ -1,3 +1,5 @@ +- add_page_startup_api_call discussions_path(@issue) + - @gfm_form = true - content_for :note_actions do diff --git a/app/views/projects/issues/_form.html.haml b/app/views/projects/issues/_form.html.haml index 1be1087b36f..dcc8000c0c5 100644 --- a/app/views/projects/issues/_form.html.haml +++ b/app/views/projects/issues/_form.html.haml @@ -1,3 +1,3 @@ -= form_for [@project.namespace.becomes(Namespace), @project, @issue], += form_for [@project, @issue], html: { class: 'issue-form common-note-form js-quick-submit js-requires-input' } do |f| = render 'shared/issuable/form', f: f, issuable: @issue diff --git a/app/views/projects/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml index e7cd35497e8..ba9ab50cb3a 100644 --- a/app/views/projects/issues/_issue.html.haml +++ b/app/views/projects/issues/_issue.html.haml @@ -1,12 +1,12 @@ -# DANGER: Any changes to this file need to be reflected in issuables_list/components/issuable.vue! -%li{ id: dom_id(issue), class: issue_css_classes(issue), url: issue_path(issue), data: { labels: issue.label_ids, id: issue.id, qa_selector: 'issue', qa_issue_title: issue.title } } +%li{ id: dom_id(issue), class: issue_css_classes(issue), url: issue_path(issue), data: { labels: issue.label_ids, id: issue.id, qa_selector: 'issue_container', qa_issue_title: issue.title } } .issue-box - if @can_bulk_update .issue-check.hidden = check_box_tag dom_id(issue, "selected"), nil, false, 'data-id' => issue.id, class: "selected-issuable" .issuable-info-container .issuable-main-info - .issue-title.title.d-flex.align-items-center + .issue-title.title %span.issue-title-text.js-onboarding-issue-item{ dir: "auto" } - if issue.confidential? %span.has-tooltip{ title: _('Confidential') } @@ -30,7 +30,7 @@ %span.issuable-milestone.d-none.d-sm-inline-block = link_to project_issues_path(issue.project, milestone_title: issue.milestone.title), data: { html: 'true', toggle: 'tooltip', title: milestone_tooltip_due_date(issue.milestone) } do - = icon('clock-o') + = sprite_icon('clock', css_class: 'gl-vertical-align-text-bottom') = issue.milestone.title - if issue.due_date %span.issuable-due-date.d-none.d-sm-inline-block.has-tooltip{ class: "#{'cred' if issue.overdue?}", title: _('Due date') } diff --git a/app/views/projects/issues/_issue_estimate.html.haml b/app/views/projects/issues/_issue_estimate.html.haml index 46797d0f1a0..c49bf626f4e 100644 --- a/app/views/projects/issues/_issue_estimate.html.haml +++ b/app/views/projects/issues/_issue_estimate.html.haml @@ -3,5 +3,5 @@ - if issue.time_estimate > 0 %span.issuable-estimate.d-none.d-sm-inline-block.has-tooltip{ data: { container: 'body', qa_selector: 'issuable_estimate' }, title: _('Estimate') } - = sprite_icon('timer', size: 16, css_class: 'issue-estimate-icon') + = sprite_icon('timer', css_class: 'issue-estimate-icon') = Gitlab::TimeTrackingFormatter.output(issue.time_estimate) diff --git a/app/views/projects/issues/_issues.html.haml b/app/views/projects/issues/_issues.html.haml index c0383c57e63..1e24b08ece2 100644 --- a/app/views/projects/issues/_issues.html.haml +++ b/app/views/projects/issues/_issues.html.haml @@ -1,8 +1,13 @@ - if Feature.enabled?(:vue_issuables_list, @project) - .js-issuables-list{ data: { endpoint: expose_url(api_v4_projects_issues_path(id: @project.id)), + - data_endpoint = local_assigns.fetch(:data_endpoint, expose_path(api_v4_projects_issues_path(id: @project.id))) + - default_empty_state_meta = { create_issue_path: new_project_issue_path(@project), svg_path: image_path('illustrations/issues.svg') } + - data_empty_state_meta = local_assigns.fetch(:data_empty_state_meta, default_empty_state_meta) + - type = local_assigns.fetch(:type, '') + .js-issuables-list{ data: { endpoint: data_endpoint, + 'empty-state-meta': data_empty_state_meta.to_json, 'can-bulk-edit': @can_bulk_update.to_json, - 'empty-svg-path': image_path('illustrations/issues.svg'), - 'sort-key': @sort } } + 'sort-key': @sort, + 'type': type } } - else - empty_state_path = local_assigns.fetch(:empty_state_path, 'shared/empty_states/issues') %ul.content-list.issues-list.issuable-list{ class: ("manual-ordering" if @sort == 'relative_position') } diff --git a/app/views/projects/issues/_service_desk_empty_state.html.haml b/app/views/projects/issues/_service_desk_empty_state.html.haml new file mode 100644 index 00000000000..4f004439f45 --- /dev/null +++ b/app/views/projects/issues/_service_desk_empty_state.html.haml @@ -0,0 +1,33 @@ +- service_desk_enabled = @project.service_desk_enabled? + +- can_edit_project_settings = can?(current_user, :admin_project, @project) +- title_text = _("Use Service Desk to connect with your users (e.g. to offer customer support) through email right inside GitLab") + +- if Gitlab::ServiceDesk.supported? + .empty-state + .svg-content + = render 'shared/empty_states/icons/service_desk_empty_state.svg' + + .text-content + %h4= title_text + + - if can_edit_project_settings && service_desk_enabled + %p + = _("Have your users email") + %code= @project.service_desk_address + + %span= _("Those emails automatically become issues (with the comments becoming the email conversation) listed here.") + = link_to _('Read more'), help_page_path('user/project/service_desk') + + - if can_edit_project_settings && !service_desk_enabled + .text-center + = link_to _("Turn on Service Desk"), edit_project_path(@project), class: 'btn btn-success' +- else + .empty-state + .svg-content + = render 'shared/empty_states/icons/service_desk_setup.svg' + .text-content + %h4= _('Service Desk is enabled but not yet active') + %p + = _("You must set up incoming email before it becomes active.") + = link_to _('More information'), help_page_path('administration/incoming_email', anchor: 'set-it-up') diff --git a/app/views/projects/issues/_service_desk_info_content.html.haml b/app/views/projects/issues/_service_desk_info_content.html.haml index ddd8e545043..7fa2f3fab00 100644 --- a/app/views/projects/issues/_service_desk_info_content.html.haml +++ b/app/views/projects/issues/_service_desk_info_content.html.haml @@ -1,39 +1,23 @@ -- is_empty_state = @issues.blank? - service_desk_enabled = @project.service_desk_enabled? -- callout_selector = is_empty_state ? 'empty-state' : 'non-empty-state media' -- svg_path = !is_empty_state ? 'shared/empty_states/icons/service_desk_callout.svg' : 'shared/empty_states/icons/service_desk_empty_state.svg' - can_edit_project_settings = can?(current_user, :admin_project, @project) - title_text = _("Use Service Desk to connect with your users (e.g. to offer customer support) through email right inside GitLab") -- if Gitlab::ServiceDesk.supported? - %div{ class: "#{callout_selector}" } - .svg-content - = render svg_path +.non-empty-state.media + .svg-content + = render 'shared/empty_states/icons/service_desk_callout.svg' - %div{ class: is_empty_state ? "text-content" : "prepend-top-10 gl-ml-3" } - - if is_empty_state - %h4= title_text - - else - %h5= title_text + .gl-mt-3.gl-ml-3 + %h5= title_text - - if can_edit_project_settings && service_desk_enabled - %p - = _("Have your users email") - %code= @project.service_desk_address + - if can_edit_project_settings && service_desk_enabled + %p + = _("Have your users email") + %code= @project.service_desk_address - %span= _("Those emails automatically become issues (with the comments becoming the email conversation) listed here.") - = link_to _('Read more'), help_page_path('user/project/service_desk') + %span= _("Those emails automatically become issues (with the comments becoming the email conversation) listed here.") + = link_to _('Read more'), help_page_path('user/project/service_desk') - - if can_edit_project_settings && !service_desk_enabled - %div{ class: is_empty_state ? "text-center" : "prepend-top-10" } - = link_to _("Turn on Service Desk"), edit_project_path(@project), class: 'btn btn-success' -- else - .empty-state - .svg-content - = render 'shared/empty_states/icons/service_desk_setup.svg' - .text-content - %h4= _('Service Desk is enabled but not yet active') - %p - = _("You must set up incoming email before it becomes active.") - = link_to _('More information'), help_page_path('administration/incoming_email', anchor: 'set-it-up') + - if can_edit_project_settings && !service_desk_enabled + .gl-mt-3 + = link_to _("Turn on Service Desk"), edit_project_path(@project), class: 'btn btn-success' diff --git a/app/views/projects/issues/export_csv/_modal.html.haml b/app/views/projects/issues/export_csv/_modal.html.haml index 342c3ba27bb..793e43da935 100644 --- a/app/views/projects/issues/export_csv/_modal.html.haml +++ b/app/views/projects/issues/export_csv/_modal.html.haml @@ -8,7 +8,7 @@ .svg-content.import-export-svg-container = image_tag 'illustrations/export-import.svg', alt: _('Import/Export illustration'), class: 'illustration' %a.close{ href: '#', 'data-dismiss' => 'modal' } - = sprite_icon('close', size: 16, css_class: 'gl-icon') + = sprite_icon('close', css_class: 'gl-icon') .modal-body .modal-subheader = icon('check', { class: 'checkmark' }) @@ -16,6 +16,6 @@ - issues_count = issuables_count_for_state(:issues, params[:state]) = n_('%d issue selected', '%d issues selected', issues_count) % issues_count .modal-text - = _('The CSV export will be created in the background. Once finished, it will be sent to <strong>%{email}</strong> in an attachment.').html_safe % { email: @current_user.notification_email } + = 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 = link_to _('Export issues'), export_csv_project_issues_path(@project, request.query_parameters), method: :post, class: 'btn btn-success float-left', title: _('Export issues'), data: { track_label: "export_issues_csv", track_event: "click_button", track_value: "", qa_selector: "export_issues_button" } diff --git a/app/views/projects/issues/service_desk.html.haml b/app/views/projects/issues/service_desk.html.haml index 9b0b3ebc9e0..bd260bdf143 100644 --- a/app/views/projects/issues/service_desk.html.haml +++ b/app/views/projects/issues/service_desk.html.haml @@ -5,9 +5,11 @@ - content_for :breadcrumbs_extra do = render "projects/issues/nav_btns", show_export_button: false, show_rss_button: false -- support_bot_attrs = UserSerializer.new.represent(User.support_bot).to_json +- support_bot_attrs = { service_desk_enabled: @project.service_desk_enabled?, **UserSerializer.new.represent(User.support_bot) }.to_json -%div{ class: "js-service-desk-issues service-desk-issues", data: { support_bot: support_bot_attrs } } +- data_endpoint = "#{expose_path(api_v4_projects_issues_path(id: @project.id))}?author_id=#{User.support_bot.id}" + +%div{ class: "js-service-desk-issues service-desk-issues", data: { support_bot: support_bot_attrs, service_desk_meta: service_desk_meta(@project) } } .top-area = render 'shared/issuable/nav', type: :issues .nav-controls.d-block.d-sm-none @@ -15,7 +17,15 @@ - if @issues.present? = render 'shared/issuable/search_bar', type: :issues - = render 'service_desk_info_content' + - if Gitlab::ServiceDesk.supported? + = render 'service_desk_info_content' + -# TODO Remove empty_state_path once vue_issuables_list FF is removed. + -# https://gitlab.com/gitlab-org/gitlab/-/issues/235652 + -# `empty_state_path` is used to render the empty state in the HAML version of issuables list. .issues-holder - = render 'projects/issues/issues', empty_state_path: 'service_desk_info_content' + = render 'projects/issues/issues', + empty_state_path: 'service_desk_empty_state', + data_endpoint: data_endpoint, + data_empty_state_meta: service_desk_meta(@project), + type: 'service_desk' diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml index 2a0dc5e30b9..a7817ad5552 100644 --- a/app/views/projects/issues/show.html.haml +++ b/app/views/projects/issues/show.html.haml @@ -9,6 +9,7 @@ - can_reopen_issue = can?(current_user, :reopen_issue, @issue) - can_report_spam = @issue.submittable_as_spam_by?(current_user) - can_create_issue = show_new_issue_link?(@project) +- related_branches_path = related_branches_project_issue_path(@project, @issue) = render_if_exists "projects/issues/alert_blocked", issue: @issue, current_user: current_user = render "projects/issues/alert_moved_from_service_desk", issue: @issue @@ -16,11 +17,11 @@ .detail-page-header .detail-page-header-body .issuable-status-box.status-box.status-box-issue-closed{ class: issue_status_visibility(@issue, status_box: :closed) } - = sprite_icon('mobile-issue-close', size: 16, css_class: 'd-block d-sm-none') + = sprite_icon('mobile-issue-close', css_class: 'd-block d-sm-none') .d-none.d-sm-block = issue_closed_text(@issue, current_user) .issuable-status-box.status-box.status-box-open{ class: issue_status_visibility(@issue, status_box: :open) } - = sprite_icon('issue-open-m', size: 16, css_class: 'd-block d-sm-none') + = sprite_icon('issue-open-m', css_class: 'd-block d-sm-none') %span.d-none.d-sm-block Open .issuable-meta @@ -82,7 +83,8 @@ #js-related-merge-requests{ data: { endpoint: expose_path(api_v4_projects_issues_related_merge_requests_path(id: @project.id, issue_iid: @issue.iid)), project_namespace: @project.namespace.path, project_path: @project.path } } - if can?(current_user, :download_code, @project) - #related-branches{ data: { url: related_branches_project_issue_path(@project, @issue) } } + - add_page_startup_api_call related_branches_path + #related-branches{ data: { url: related_branches_path } } -# This element is filled in using JavaScript. .content-block.emoji-block.emoji-block-sticky diff --git a/app/views/projects/issues/verify.html.haml b/app/views/projects/issues/verify.html.haml index 6da7c317f3a..935a3493a37 100644 --- a/app/views/projects/issues/verify.html.haml +++ b/app/views/projects/issues/verify.html.haml @@ -1,5 +1,3 @@ -- form = [@project.namespace.becomes(Namespace), @project, @issue] - -= render layout: 'layouts/recaptcha_verification', locals: { spammable: @issue, form: form } do += render layout: 'layouts/recaptcha_verification', locals: { spammable: @issue } do = hidden_field_tag(:merge_request_to_resolve_discussions_of, params[:merge_request_to_resolve_discussions_of]) = hidden_field_tag(:discussion_to_resolve, params[:discussion_to_resolve]) |