diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /app/views/projects | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'app/views/projects')
45 files changed, 128 insertions, 125 deletions
diff --git a/app/views/projects/_commit_button.html.haml b/app/views/projects/_commit_button.html.haml index 987ec74e4ba..2c18921d874 100644 --- a/app/views/projects/_commit_button.html.haml +++ b/app/views/projects/_commit_button.html.haml @@ -1,7 +1,7 @@ .form-actions.gl-display-flex = button_tag 'Commit changes', id: 'commit-changes', class: 'gl-button btn btn-confirm js-commit-button qa-commit-button' - = link_to 'Cancel', cancel_path, + = link_to _('Cancel'), cancel_path, class: 'gl-button btn btn-default gl-ml-3', data: {confirm: leave_edit_message} = render 'shared/projects/edit_information' diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index 8909536a1ec..f2cee618849 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -15,13 +15,13 @@ %span.visibility-icon.text-secondary.gl-ml-2.has-tooltip{ data: { container: 'body' }, title: visibility_icon_description(@project) } = visibility_level_icon(@project.visibility_level, options: { class: 'icon' }) = render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: @project - .home-panel-metadata.d-flex.flex-wrap.text-secondary.gl-font-base.gl-font-weight-normal.gl-line-height-normal + .home-panel-metadata.text-secondary.gl-font-base.gl-font-weight-normal.gl-line-height-normal - if can?(current_user, :read_project, @project) - button_class = "btn gl-button btn-sm btn-tertiary btn-default-tertiary home-panel-metadata" - button_text = s_('ProjectPage|Project ID: %{project_id}') % { project_id: @project.id } = clipboard_button(title: s_('ProjectPage|Copy project ID'), text: @project.id, hide_button_icon: true, button_text: button_text, class: button_class, qa_selector: 'project_id_content', itemprop: 'identifier') - if current_user - %span.access-request-links.gl-ml-3 + %span.gl-display-inline-block.gl-vertical-align-middle.gl-ml-3 = render 'shared/members/access_request_links', source: @project .gl-mt-3.gl-pl-3.gl-w-full @@ -31,7 +31,7 @@ .project-repo-buttons.gl-display-flex.gl-justify-content-md-end.gl-align-items-start.gl-flex-wrap.gl-mt-5 - if current_user - if current_user.admin? - = link_to [:admin, @project], class: 'btn gl-button btn-icon gl-align-self-start gl-py-2! gl-mr-3', title: s_('View project in admin area'), + = link_to [:admin, @project], class: 'btn gl-button btn-icon gl-align-self-start gl-py-2! gl-mr-3', title: _('View project in admin area'), data: {toggle: 'tooltip', placement: 'bottom', container: 'body'} do = sprite_icon('admin') .gl-display-flex.gl-align-items-start.gl-mr-3 diff --git a/app/views/projects/_import_project_pane.html.haml b/app/views/projects/_import_project_pane.html.haml index 2055f1c7f60..815a3cf6966 100644 --- a/app/views/projects/_import_project_pane.html.haml +++ b/app/views/projects/_import_project_pane.html.haml @@ -76,7 +76,7 @@ - if phabricator_import_enabled? %div - = link_to new_import_phabricator_path, class: 'gl-button btn-default btn import_phabricator', data: { track_label: "#{track_label}", track_event: "click_button", track_property: "phabricator" } do + = link_to new_import_phabricator_path, class: 'gl-button btn-default btn import_phabricator', data: { track_label: "#{track_label}", track_action: "click_button", track_property: "phabricator" } do .gl-button-icon = custom_icon('issues') = _("Phabricator Tasks") diff --git a/app/views/projects/_invite_members_empty_project.html.haml b/app/views/projects/_invite_members_empty_project.html.haml index ee2215b0fbb..5bc53339bf0 100644 --- a/app/views/projects/_invite_members_empty_project.html.haml +++ b/app/views/projects/_invite_members_empty_project.html.haml @@ -1,6 +1,6 @@ %h4.gl-mt-0.gl-mb-3{ data: { testid: 'invite-member-section', track_label: 'invite_members_empty_project', - track_event: 'render' } } + track_action: 'render' } } = s_('InviteMember|Invite your team') %p= s_('InviteMember|Add members to this project and start collaborating with your team.') .js-invite-members-trigger{ data: { variant: 'confirm', diff --git a/app/views/projects/_new_project_fields.html.haml b/app/views/projects/_new_project_fields.html.haml index 026c7a0d79d..fb7a7ef8985 100644 --- a/app/views/projects/_new_project_fields.html.haml +++ b/app/views/projects/_new_project_fields.html.haml @@ -8,23 +8,25 @@ .form-group.project-name.col-sm-12 = f.label :name, class: 'label-bold' do %span= _("Project name") - = f.text_field :name, placeholder: "My awesome project", class: "form-control gl-form-input input-lg", autofocus: true, data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "project_name", track_value: "" }, required: true, aria: { required: true } + = f.text_field :name, placeholder: "My awesome project", class: "form-control gl-form-input input-lg", data: { track_label: "#{track_label}", track_action: "activate_form_input", track_property: "project_name", track_value: "" }, required: true, aria: { required: true } .form-group.project-path.col-sm-6 = f.label :namespace_id, class: 'label-bold' do - %span= s_("Project URL") + %span= _('Project URL') .input-group.gl-flex-nowrap - if current_user.can_select_namespace? - .input-group-prepend.flex-shrink-0.has-tooltip{ title: root_url } - .input-group-text - = root_url - namespace_id = namespace_id_from(params) - = f.select(:namespace_id, - namespaces_options_with_developer_maintainer_access(selected: namespace_id, - display_path: true, - extra_group: namespace_id), - {}, - { class: 'select2 js-select-namespace qa-project-namespace-select block-truncated', data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "project_path", track_value: "", qa_selector: "select_namespace_dropdown" }}) - + - if Feature.enabled?(:paginatable_namespace_drop_down_for_project_creation, current_user, default_enabled: :yaml) + .js-vue-new-project-url-select{ data: { namespace_full_path: GroupFinder.new(current_user).execute(id: namespace_id)&.full_path, namespace_id: namespace_id, root_url: root_url, track_label: track_label } } + - else + .input-group-prepend.flex-shrink-0.has-tooltip{ title: root_url } + .input-group-text + = root_url + = f.select(:namespace_id, + namespaces_options_with_developer_maintainer_access(selected: namespace_id, + display_path: true, + extra_group: namespace_id), + {}, + { class: 'select2 js-select-namespace qa-project-namespace-select block-truncated', data: { track_label: "#{track_label}", track_action: "activate_form_input", track_property: "project_path", track_value: "", qa_selector: "select_namespace_dropdown" }}) - else .input-group-prepend.static-namespace.flex-shrink-0.has-tooltip{ title: user_url(current_user.username) + '/' } .input-group-text.border-0 @@ -43,7 +45,7 @@ .form-group = f.label :description, class: 'label-bold' do = s_('ProjectsNew|Project description %{tag_start}(optional)%{tag_end}').html_safe % { tag_start: '<span>'.html_safe, tag_end: '</span>'.html_safe } - = f.text_area :description, placeholder: s_('ProjectsNew|Description format'), class: "form-control gl-form-input", rows: 3, maxlength: 250, data: { track_label: "#{track_label}", track_event: "activate_form_input", track_property: "project_description", track_value: "" } + = f.text_area :description, placeholder: s_('ProjectsNew|Description format'), class: "form-control gl-form-input", rows: 3, maxlength: 250, data: { track_label: "#{track_label}", track_action: "activate_form_input", track_property: "project_description", track_value: "" } = f.label :visibility_level, class: 'label-bold' do = s_('ProjectsNew|Visibility Level') @@ -54,12 +56,12 @@ .form-group.row.initialize-with-readme-setting %div{ :class => "col-sm-12" } .form-check - = check_box_tag 'project[initialize_with_readme]', '1', true, class: 'form-check-input', data: { qa_selector: "initialize_with_readme_checkbox", track_label: "#{track_label}", track_event: "activate_form_input", track_property: "init_with_readme", track_value: "" } + = check_box_tag 'project[initialize_with_readme]', '1', true, class: 'form-check-input', data: { qa_selector: "initialize_with_readme_checkbox", track_label: "#{track_label}", track_action: "activate_form_input", track_property: "init_with_readme", track_value: "" } = label_tag 'project[initialize_with_readme]', class: 'form-check-label' do .option-title %strong= s_('ProjectsNew|Initialize repository with a README') .option-description = s_('ProjectsNew|Allows you to immediately clone this project’s repository. Skip this if you plan to push up an existing repository.') -= f.submit _('Create project'), class: "btn gl-button btn-confirm", data: { track_label: "#{track_label}", track_event: "click_button", track_property: "create_project", track_value: "" } -= link_to _('Cancel'), dashboard_projects_path, class: 'btn gl-button btn-default btn-cancel', data: { track_label: "#{track_label}", track_event: "click_button", track_property: "cancel", track_value: "" } += f.submit _('Create project'), class: "btn gl-button btn-confirm", data: { track_label: "#{track_label}", track_action: "click_button", track_property: "create_project", track_value: "" } += link_to _('Cancel'), dashboard_projects_path, class: 'btn gl-button btn-default btn-cancel', data: { track_label: "#{track_label}", track_action: "click_button", track_property: "cancel", track_value: "" } diff --git a/app/views/projects/blob/_new_dir.html.haml b/app/views/projects/blob/_new_dir.html.haml index 905dc2a49ec..3cc9fea56e2 100644 --- a/app/views/projects/blob/_new_dir.html.haml +++ b/app/views/projects/blob/_new_dir.html.haml @@ -16,6 +16,6 @@ .form-actions = submit_tag _("Create directory"), class: 'btn gl-button btn-confirm' - = link_to "Cancel", '#', class: "btn gl-button btn-default btn-cancel", "data-dismiss" => "modal" + = link_to _('Cancel'), '#', class: "btn gl-button btn-default btn-cancel", "data-dismiss" => "modal" = render 'shared/projects/edit_information' diff --git a/app/views/projects/blob/_remove.html.haml b/app/views/projects/blob/_remove.html.haml index 298a36e28ec..1463fcf8052 100644 --- a/app/views/projects/blob/_remove.html.haml +++ b/app/views/projects/blob/_remove.html.haml @@ -13,4 +13,4 @@ .form-group.row .offset-sm-2.col-sm-10 = button_tag 'Delete file', class: 'btn gl-button btn-danger btn-remove-file' - = link_to "Cancel", '#', class: "btn gl-button btn-cancel", "data-dismiss" => "modal" + = link_to _('Cancel'), '#', class: "btn gl-button btn-cancel", "data-dismiss" => "modal" diff --git a/app/views/projects/blob/show.html.haml b/app/views/projects/blob/show.html.haml index 1ba38808937..66e9badbafb 100644 --- a/app/views/projects/blob/show.html.haml +++ b/app/views/projects/blob/show.html.haml @@ -1,4 +1,4 @@ -- breadcrumb_title "Repository" +- breadcrumb_title _('Repository') - page_title @blob.path, @ref - signatures_path = namespace_project_signatures_path(namespace_id: @project.namespace.full_path, project_id: @project.path, id: @last_commit, limit: 1) - content_for :prefetch_asset_tags do diff --git a/app/views/projects/blob/viewers/_notebook.html.haml b/app/views/projects/blob/viewers/_notebook.html.haml index eb4ca1b9816..b537a48e087 100644 --- a/app/views/projects/blob/viewers/_notebook.html.haml +++ b/app/views/projects/blob/viewers/_notebook.html.haml @@ -1 +1 @@ -.file-content#js-notebook-viewer{ data: { endpoint: blob_raw_path } } +.file-content#js-notebook-viewer{ data: { endpoint: blob_raw_path, relative_raw_path: parent_dir_raw_path } } diff --git a/app/views/projects/branches/new.html.haml b/app/views/projects/branches/new.html.haml index 6de50d48721..27858932e5e 100644 --- a/app/views/projects/branches/new.html.haml +++ b/app/views/projects/branches/new.html.haml @@ -9,7 +9,7 @@ .gl-alert-body = @error %h3.page-title - New Branch + = _('New Branch') %hr = form_tag namespace_project_branches_path, method: :post, id: "new-branch-form", class: "js-create-branch-form js-requires-input" do @@ -30,5 +30,5 @@ .form-text.text-muted Existing branch name, tag, or commit SHA .form-actions = button_tag 'Create branch', class: 'gl-button btn btn-confirm' - = link_to 'Cancel', project_branches_path(@project), class: 'gl-button btn btn-default btn-cancel' + = link_to _('Cancel'), project_branches_path(@project), class: 'gl-button btn btn-default btn-cancel' %script#availableRefs{ type: "application/json" }= @project.repository.ref_names.to_json.html_safe diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml index 1a3813ba99f..437529c3608 100644 --- a/app/views/projects/ci/builds/_build.html.haml +++ b/app/views/projects/ci/builds/_build.html.haml @@ -7,10 +7,14 @@ - pipeline_link = local_assigns.fetch(:pipeline_link, false) - stage = local_assigns.fetch(:stage, false) - allow_retry = local_assigns.fetch(:allow_retry, false) +-# This prevents initializing another Ci::Status object where 'status' is used +- status = job.detailed_status(current_user) %tr.build.commit{ class: ('retried' if retried) } %td.status - = render "ci/status/badge", status: job.detailed_status(current_user), title: job.status_title + -# Sending 'status' prevents calling the user relation inside the presenter, generating N+1, + -# see https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68743 + = render "ci/status/badge", status: status, title: job.status_title(status) %td - if can?(current_user, :read_build, job) diff --git a/app/views/projects/cycle_analytics/show.html.haml b/app/views/projects/cycle_analytics/show.html.haml index 3c9762e200a..f398ac6ede7 100644 --- a/app/views/projects/cycle_analytics/show.html.haml +++ b/app/views/projects/cycle_analytics/show.html.haml @@ -1,6 +1,4 @@ - page_title _("Value Stream Analytics") - add_page_specific_style 'page_bundles/cycle_analytics' -- svgs = { empty_state_svg_path: image_path("illustrations/analytics/cycle-analytics-empty-chart.svg"), no_data_svg_path: image_path("illustrations/analytics/cycle-analytics-empty-chart.svg"), no_access_svg_path: image_path("illustrations/analytics/no-access.svg") } -- initial_data = { project_id: @project.id, group_path: @project.group&.path, request_path: project_cycle_analytics_path(@project), full_path: @project.full_path }.merge!(svgs) -#js-cycle-analytics{ data: initial_data } +#js-cycle-analytics{ data: cycle_analytics_initial_data(@project, @group) } diff --git a/app/views/projects/diffs/_stats.html.haml b/app/views/projects/diffs/_stats.html.haml index 8edaacf7552..fe9658a440a 100644 --- a/app/views/projects/diffs/_stats.html.haml +++ b/app/views/projects/diffs/_stats.html.haml @@ -1,41 +1 @@ -- sum_added_lines = diff_files.sum(&:added_lines) -- sum_removed_lines = diff_files.sum(&:removed_lines) -.commit-stat-summary.dropdown - Showing - %button.diff-stats-summary-toggler.js-diff-stats-dropdown{ type: "button", data: { toggle: "dropdown", display: "static" } }< - = pluralize(diff_files.size, "changed file") - = sprite_icon("chevron-down", css_class: "gl-ml-2") - %span.diff-stats-additions-deletions-expanded#diff-stats - with - %strong.cgreen= pluralize(sum_added_lines, 'addition') - and - %strong.cred= pluralize(sum_removed_lines, 'deletion') - .diff-stats-additions-deletions-collapsed.float-right.d-none{ "aria-hidden": "true", "aria-describedby": "diff-stats" } - %strong.cgreen< - +#{sum_added_lines} - %strong.cred< - \-#{sum_removed_lines} - .dropdown-menu.diff-file-changes - = dropdown_filter("Search files") - .dropdown-content - %ul - - diff_files.each do |diff_file| - %li - %a.diff-changed-file{ href: "##{hexdigest(diff_file.file_path)}", title: diff_file.new_path } - = sprite_icon(diff_file_changed_icon(diff_file), css_class: "#{diff_file_changed_icon_color(diff_file)} diff-file-changed-icon gl-mr-3") - %span.diff-changed-file-content.gl-mr-3 - - if diff_file.file_path - %strong.diff-changed-file-name - = diff_file.file_path - - else - %strong.diff-changed-blank-file-name - = s_('Diffs|No file name available') - %span.diff-changed-file-path.gl-mt-2= diff_file_path_text(diff_file) - %span.diff-changed-stats - %span.cgreen< - +#{diff_file.added_lines} - %span.cred< - \-#{diff_file.removed_lines} - %li.dropdown-menu-empty-item.hidden - %a - = _("No files found.") +.js-diff-stats-dropdown{ data: { changed: diff_files.size, added: diff_files.sum(&:added_lines), deleted: diff_files.sum(&:removed_lines), files: diff_files_data(diff_files) } } diff --git a/app/views/projects/error_tracking/details.html.haml b/app/views/projects/error_tracking/details.html.haml index 4a14e34cbf1..eb26a299a66 100644 --- a/app/views/projects/error_tracking/details.html.haml +++ b/app/views/projects/error_tracking/details.html.haml @@ -1,5 +1,5 @@ - page_title _('Error Details') -- add_to_breadcrumbs 'Errors', project_error_tracking_index_path(@project) +- add_to_breadcrumbs _('Errors'), project_error_tracking_index_path(@project) - add_page_specific_style 'page_bundles/error_tracking_details' #js-error_details{ data: error_details_data(@project, @issue_id) } diff --git a/app/views/projects/hooks/edit.html.haml b/app/views/projects/hooks/edit.html.haml index 226cd7d89b6..e8ea4ad90dc 100644 --- a/app/views/projects/hooks/edit.html.haml +++ b/app/views/projects/hooks/edit.html.haml @@ -10,7 +10,7 @@ = form_for [@project, @hook], as: :hook, url: project_hook_path(@project, @hook) do |f| = render partial: 'shared/web_hooks/form', locals: { form: f, hook: @hook } - = f.submit 'Save changes', class: 'btn gl-button btn-confirm gl-mr-3' + = f.submit _('Save changes'), class: 'btn gl-button btn-confirm gl-mr-3' = render 'shared/web_hooks/test_button', hook: @hook = link_to _('Delete'), project_hook_path(@project, @hook), method: :delete, class: 'btn gl-button btn-danger float-right', data: { confirm: _('Are you sure?') } diff --git a/app/views/projects/imports/new.html.haml b/app/views/projects/imports/new.html.haml index e2d8791b5d2..77c715aa376 100644 --- a/app/views/projects/imports/new.html.haml +++ b/app/views/projects/imports/new.html.haml @@ -1,6 +1,6 @@ - page_title _("Import repository") %h3.page-title - Import repository + = _('Import repository') %hr diff --git a/app/views/projects/issues/_issue.html.haml b/app/views/projects/issues/_issue.html.haml index ee3aaee6dbb..2de2c2cba6c 100644 --- a/app/views/projects/issues/_issue.html.haml +++ b/app/views/projects/issues/_issue.html.haml @@ -12,9 +12,7 @@ - if issue.confidential? %span.has-tooltip{ title: _('Confidential') } = confidential_icon(issue) - - if Feature.enabled?(:ban_user_feature_flag) && issue.hidden? - %span.has-tooltip{ title: _('This issue is hidden because its author has been banned') } - = hidden_issue_icon(issue) + = hidden_issue_icon(issue) = link_to issue.title, issue_path(issue) = render_if_exists 'projects/issues/subepic_flag', issue: issue - if issue.tasks? diff --git a/app/views/projects/issues/_nav_btns.html.haml b/app/views/projects/issues/_nav_btns.html.haml index 1289f7aa0c4..0d69f6f69aa 100644 --- a/app/views/projects/issues/_nav_btns.html.haml +++ b/app/views/projects/issues/_nav_btns.html.haml @@ -3,7 +3,7 @@ - show_export_button = local_assigns.fetch(:show_export_button, true) - issuable_type = 'issues' - can_edit = can?(current_user, :admin_project, @project) -- notification_email = @current_user.present? ? @current_user.notification_email : nil +- notification_email = @current_user.present? ? @current_user.notification_email_or_default : nil .nav-controls.issues-nav-controls - if show_feed_buttons diff --git a/app/views/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml index ecf10cd4821..53c2052bfab 100644 --- a/app/views/projects/issues/index.html.haml +++ b/app/views/projects/issues/index.html.haml @@ -13,8 +13,8 @@ issues_path: project_issues_path(@project), project_path: @project.full_path } } -- if Feature.enabled?(:vue_issues_list, @project) - .js-issues-list{ data: issues_list_data(@project, current_user, finder) } +- if Feature.enabled?(:vue_issues_list, @project&.group, default_enabled: :yaml) + .js-issues-list{ data: project_issues_list_data(@project, current_user, finder) } - if @can_bulk_update = render 'shared/issuable/bulk_update_sidebar', type: :issues - elsif project_issues(@project).exists? diff --git a/app/views/projects/jobs/index.html.haml b/app/views/projects/jobs/index.html.haml index 1da3881c104..c58c6ab8287 100644 --- a/app/views/projects/jobs/index.html.haml +++ b/app/views/projects/jobs/index.html.haml @@ -1,8 +1,9 @@ - page_title _("Jobs") - add_page_specific_style 'page_bundles/ci_status' +- admin = local_assigns.fetch(:admin, false) - if Feature.enabled?(:jobs_table_vue, @project, default_enabled: :yaml) - #js-jobs-table{ data: { full_path: @project.full_path, job_counts: job_counts.to_json, job_statuses: job_statuses.to_json, pipeline_editor_path: project_ci_pipeline_editor_path(@project), empty_state_svg_path: image_path('jobs-empty-state.svg') } } + #js-jobs-table{ data: { admin: admin, full_path: @project.full_path, job_counts: job_counts.to_json, job_statuses: job_statuses.to_json, pipeline_editor_path: project_ci_pipeline_editor_path(@project), empty_state_svg_path: image_path('jobs-empty-state.svg') } } - else .top-area - build_path_proc = ->(scope) { project_jobs_path(@project, scope: scope) } diff --git a/app/views/projects/labels/edit.html.haml b/app/views/projects/labels/edit.html.haml index 343900359b4..8023fb93c64 100644 --- a/app/views/projects/labels/edit.html.haml +++ b/app/views/projects/labels/edit.html.haml @@ -3,6 +3,6 @@ - page_title _("Edit"), @label.name, _("Labels") %h3.page-title - Edit Label + = _('Edit Label') %hr = render 'shared/labels/form', url: project_label_path(@project, @label), back_path: project_labels_path(@project) diff --git a/app/views/projects/labels/new.html.haml b/app/views/projects/labels/new.html.haml index 38bd6102437..1ae87bf93d1 100644 --- a/app/views/projects/labels/new.html.haml +++ b/app/views/projects/labels/new.html.haml @@ -3,6 +3,6 @@ - page_title _("New Label") %h3.page-title - New Label + = _('New Label') %hr = render 'shared/labels/form', url: project_labels_path(@project), back_path: project_labels_path(@project) diff --git a/app/views/projects/mattermosts/_team_selection.html.haml b/app/views/projects/mattermosts/_team_selection.html.haml index 4109fdfc13b..4832880eefc 100644 --- a/app/views/projects/mattermosts/_team_selection.html.haml +++ b/app/views/projects/mattermosts/_team_selection.html.haml @@ -42,5 +42,5 @@ %hr .clearfix .float-right - = link_to 'Cancel', edit_project_service_path(@project, @integration), class: 'gl-button btn btn-lg' + = link_to _('Cancel'), edit_project_service_path(@project, @integration), class: 'gl-button btn btn-lg' = f.submit 'Install', class: 'gl-button btn btn-success btn-lg' diff --git a/app/views/projects/merge_requests/_merge_request.atom.builder b/app/views/projects/merge_requests/_merge_request.atom.builder new file mode 100644 index 00000000000..e27cf93bb97 --- /dev/null +++ b/app/views/projects/merge_requests/_merge_request.atom.builder @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +xml.entry do + xml.id project_merge_request_url(merge_request.project, merge_request) + xml.link href: project_merge_request_url(merge_request.project, merge_request) + # using the shovel operator (xml <<) would make us lose indentation, so we do this (https://github.com/rails/rails/issues/7036) + render(partial: 'shared/issuable/issuable', object: merge_request, locals: { builder: xml }) +end diff --git a/app/views/projects/merge_requests/_merge_requests.html.haml b/app/views/projects/merge_requests/_merge_requests.html.haml index e2123e36e67..0abbf953fc7 100644 --- a/app/views/projects/merge_requests/_merge_requests.html.haml +++ b/app/views/projects/merge_requests/_merge_requests.html.haml @@ -2,7 +2,7 @@ - if @merge_requests.present? = render @merge_requests - else - = render 'shared/empty_states/merge_requests' + = render 'shared/empty_states/merge_requests', button_path: new_merge_request_path - if @merge_requests.present? = paginate_collection @merge_requests, total_pages: @total_pages diff --git a/app/views/projects/merge_requests/_nav_btns.html.haml b/app/views/projects/merge_requests/_nav_btns.html.haml index 511e53b192f..b34cf23634c 100644 --- a/app/views/projects/merge_requests/_nav_btns.html.haml +++ b/app/views/projects/merge_requests/_nav_btns.html.haml @@ -1,6 +1,7 @@ - issuable_type = 'merge-requests' -- notification_email = @current_user.present? ? @current_user.notification_email : nil +- notification_email = @current_user.present? ? @current_user.notification_email_or_default : nil += render 'shared/issuable/feed_buttons', show_calendar_button: false .js-csv-import-export-buttons{ data: { show_export_button: "true", issuable_type: issuable_type, issuable_count: issuables_count_for_state(issuable_type.to_sym, params[:state]), email: notification_email, export_csv_path: export_csv_project_merge_requests_path(@project, request.query_parameters), container_class: 'gl-mr-3' } } - if @can_bulk_update diff --git a/app/views/projects/merge_requests/_widget.html.haml b/app/views/projects/merge_requests/_widget.html.haml index 5f2cb1cfcc4..47a0d05fc65 100644 --- a/app/views/projects/merge_requests/_widget.html.haml +++ b/app/views/projects/merge_requests/_widget.html.haml @@ -18,5 +18,7 @@ window.gl.mrWidgetData.approvals_help_path = '#{help_page_path("user/project/merge_requests/merge_request_approvals")}'; window.gl.mrWidgetData.pipelines_empty_svg_path = '#{image_path('illustrations/pipelines_empty.svg')}'; window.gl.mrWidgetData.codequality_help_path = '#{help_page_path("user/project/merge_requests/code_quality", anchor: "code-quality-reports")}'; + window.gl.mrWidgetData.false_positive_doc_url = '#{help_page_path('user/application_security/vulnerabilities/index')}'; + window.gl.mrWidgetData.can_view_false_positive = '#{(Feature.enabled?(:vulnerability_flags, default_enabled: :yaml) && @merge_request.project.licensed_feature_available?(:sast_fp_reduction)).to_s}'; #js-vue-mr-widget.mr-widget diff --git a/app/views/projects/merge_requests/creations/_new_compare.html.haml b/app/views/projects/merge_requests/creations/_new_compare.html.haml index b99714c1794..ea778517374 100644 --- a/app/views/projects/merge_requests/creations/_new_compare.html.haml +++ b/app/views/projects/merge_requests/creations/_new_compare.html.haml @@ -1,5 +1,5 @@ %h3.page-title - New merge request + = _('New merge request') = form_for [@project, @merge_request], url: project_new_merge_request_path(@project), method: :get, html: { class: "merge-request-form js-requires-input" } do |f| - if params[:nav_source].present? diff --git a/app/views/projects/merge_requests/creations/_new_submit.html.haml b/app/views/projects/merge_requests/creations/_new_submit.html.haml index 4aca13ae74a..eb5d052ec19 100644 --- a/app/views/projects/merge_requests/creations/_new_submit.html.haml +++ b/app/views/projects/merge_requests/creations/_new_submit.html.haml @@ -1,5 +1,5 @@ %h3.page-title - New merge request + = _('New merge request') = form_for [@project, @merge_request], html: { class: 'merge-request-form common-note-form js-requires-input js-quick-submit' } do |f| = render 'shared/issuable/form', f: f, issuable: @merge_request, commits: @commits, presenter: @mr_presenter = f.hidden_field :source_project_id diff --git a/app/views/projects/merge_requests/index.atom.builder b/app/views/projects/merge_requests/index.atom.builder new file mode 100644 index 00000000000..36fe6bf759b --- /dev/null +++ b/app/views/projects/merge_requests/index.atom.builder @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +# rubocop: disable CodeReuse/ActiveRecord +xml.title "#{@project.name} merge requests" +xml.link href: url_for(safe_params), rel: "self", type: "application/atom+xml" +xml.link href: project_merge_requests_url(@project), rel: "alternate", type: "text/html" +xml.id project_merge_requests_url(@project) +xml.updated @merge_requests.first.updated_at.xmlschema if @merge_requests.reorder(nil).any? + +xml << render(partial: 'projects/merge_requests/merge_request', collection: @merge_requests) if @merge_requests.reorder(nil).any? +# rubocop: enable CodeReuse/ActiveRecord diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml index 289f88c9705..41c6696789d 100644 --- a/app/views/projects/merge_requests/index.html.haml +++ b/app/views/projects/merge_requests/index.html.haml @@ -6,6 +6,9 @@ - page_title _("Merge requests") - new_merge_request_email = @project.new_issuable_address(current_user, 'merge_request') += content_for :meta_tags do + = auto_discovery_link_tag(:atom, safe_params.merge(rss_url_options).to_h, title: "#{@project.name} merge requests") + = render 'projects/last_push' - if @project.merge_requests.exists? @@ -20,7 +23,7 @@ = render 'shared/issuable/bulk_update_sidebar', type: :merge_requests .merge-requests-holder - = render 'merge_requests' + = render 'merge_requests', new_merge_request_path: new_merge_request_path - if new_merge_request_email .gl-text-center.gl-pt-5.gl-pb-7 .js-issueable-by-email{ data: { initial_email: new_merge_request_email, issuable_type: issuable_type, emails_help_page_path: help_page_path('development/emails', anchor: 'email-namespace'), quick_actions_help_path: help_page_path('user/project/quick_actions'), markdown_help_path: help_page_path('user/markdown'), reset_path: new_issuable_address_project_path(@project, issuable_type: issuable_type) } } diff --git a/app/views/projects/merge_requests/show.html.haml b/app/views/projects/merge_requests/show.html.haml index 6d1ba9e693b..7e260a03c5d 100644 --- a/app/views/projects/merge_requests/show.html.haml +++ b/app/views/projects/merge_requests/show.html.haml @@ -6,7 +6,6 @@ - page_description @merge_request.description_html - page_card_attributes @merge_request.card_attributes - suggest_changes_help_path = help_page_path('user/project/merge_requests/reviews/suggestions.md') -- number_of_pipelines = @pipelines.size - mr_action = j(params[:tab].presence || 'show') - add_page_specific_style 'page_bundles/merge_requests' - add_page_specific_style 'page_bundles/pipelines' @@ -32,11 +31,11 @@ = tab_link_for @merge_request, :commits do = _("Commits") %span.badge.badge-pill.gl-badge.badge-muted.sm= @commits_count - - if number_of_pipelines.nonzero? + - if @number_of_pipelines.nonzero? = render "projects/merge_requests/tabs/tab", name: "pipelines", class: "pipelines-tab" do = tab_link_for @merge_request, :pipelines do = _("Pipelines") - %span.badge.badge-pill.gl-badge.badge-muted.sm.js-pipelines-mr-count= number_of_pipelines + %span.badge.badge-pill.gl-badge.badge-muted.sm.js-pipelines-mr-count= @number_of_pipelines = render "projects/merge_requests/tabs/tab", name: "diffs", class: "diffs-tab", id: "diffs-tab", qa_selector: "diffs_tab" do = tab_link_for @merge_request, :diffs do = _("Changes") @@ -76,7 +75,7 @@ = render "projects/merge_requests/tabs/pane", name: "commits", id: "commits", class: "commits" do -# This tab is always loaded via AJAX = render "projects/merge_requests/tabs/pane", name: "pipelines", id: "pipelines", class: "pipelines" do - - if number_of_pipelines.nonzero? + - if @number_of_pipelines.nonzero? = render 'projects/commit/pipelines_list', disable_initialization: true, endpoint: pipelines_project_merge_request_path(@project, @merge_request) - params = request.query_parameters - if Feature.enabled?(:default_merge_ref_for_diffs, @project, default_enabled: :yaml) diff --git a/app/views/projects/packages/packages/show.html.haml b/app/views/projects/packages/packages/show.html.haml index 42c31b3272f..ebdc9e654f6 100644 --- a/app/views/projects/packages/packages/show.html.haml +++ b/app/views/projects/packages/packages/show.html.haml @@ -6,7 +6,4 @@ .row .col-12 - - if Feature.enabled?(:package_details_apollo, default_enabled: :yaml) - #js-vue-packages-detail-new{ data: package_details_data(@project, @package) } - - else - #js-vue-packages-detail{ data: package_details_data(@project, @package, true) } + #js-vue-packages-detail-new{ data: package_details_data(@project, @package) } diff --git a/app/views/projects/pipeline_schedules/_pipeline_schedule.html.haml b/app/views/projects/pipeline_schedules/_pipeline_schedule.html.haml index 190bf9bf071..f6a0638ccd0 100644 --- a/app/views/projects/pipeline_schedules/_pipeline_schedule.html.haml +++ b/app/views/projects/pipeline_schedules/_pipeline_schedule.html.haml @@ -27,7 +27,7 @@ %td .float-right.btn-group - if can?(current_user, :play_pipeline_schedule, pipeline_schedule) - = link_to play_pipeline_schedule_path(pipeline_schedule), method: :post, title: s_('Play'), class: 'btn gl-button btn-default btn-icon' do + = link_to play_pipeline_schedule_path(pipeline_schedule), method: :post, title: _('Play'), class: 'btn gl-button btn-default btn-icon' do = sprite_icon('play') - if can?(current_user, :take_ownership_pipeline_schedule, pipeline_schedule) = link_to take_ownership_pipeline_schedule_path(pipeline_schedule), method: :post, title: s_('PipelineSchedules|Take ownership'), class: 'btn gl-button btn-default' do diff --git a/app/views/projects/pipeline_schedules/new.html.haml b/app/views/projects/pipeline_schedules/new.html.haml index a2652304768..1b50090e445 100644 --- a/app/views/projects/pipeline_schedules/new.html.haml +++ b/app/views/projects/pipeline_schedules/new.html.haml @@ -1,4 +1,4 @@ -- breadcrumb_title "Schedules" +- breadcrumb_title _('Schedules') - @breadcrumb_link = namespace_project_pipeline_schedules_path(@project.namespace, @project) - page_title _("New Pipeline Schedule") - add_page_specific_style 'page_bundles/pipeline_schedules' diff --git a/app/views/projects/pipelines/_with_tabs.html.haml b/app/views/projects/pipelines/_with_tabs.html.haml index c1d48992500..23606e24563 100644 --- a/app/views/projects/pipelines/_with_tabs.html.haml +++ b/app/views/projects/pipelines/_with_tabs.html.haml @@ -34,8 +34,8 @@ %thead %tr %th= _('Status') - %th= _('Job ID') %th= _('Name') + %th= _('Job ID') %th %th= _('Coverage') %th diff --git a/app/views/projects/pipelines/show.html.haml b/app/views/projects/pipelines/show.html.haml index 30ebe4f20b6..8fd8d3cf540 100644 --- a/app/views/projects/pipelines/show.html.haml +++ b/app/views/projects/pipelines/show.html.haml @@ -28,4 +28,4 @@ = render "projects/pipelines/with_tabs", pipeline: @pipeline, stages: @stages, pipeline_has_errors: pipeline_has_errors -.js-pipeline-details-vue{ data: { endpoint: project_pipeline_path(@project, @pipeline, format: :json), metrics_path: namespace_project_ci_prometheus_metrics_histograms_path(namespace_id: @project.namespace, project_id: @project, format: :json), pipeline_project_path: @project.full_path, pipeline_iid: @pipeline.iid, graphql_resource_etag: graphql_etag_pipeline_path(@pipeline) } } +.js-pipeline-details-vue{ data: { metrics_path: namespace_project_ci_prometheus_metrics_histograms_path(namespace_id: @project.namespace, project_id: @project, format: :json), pipeline_project_path: @project.full_path, pipeline_iid: @pipeline.iid, graphql_resource_etag: graphql_etag_pipeline_path(@pipeline) } } diff --git a/app/views/projects/project_members/index.html.haml b/app/views/projects/project_members/index.html.haml index 0239e408e87..12b2b33e364 100644 --- a/app/views/projects/project_members/index.html.haml +++ b/app/views/projects/project_members/index.html.haml @@ -3,7 +3,7 @@ .row.gl-mt-3 .col-lg-12 - - if can_invite_members_for_project?(@project) || can_invite_group_for_project?(@project) + - if can_invite_members_for_project?(@project) .row .col-md-12.col-lg-6.gl-display-flex .gl-flex-direction-column.gl-flex-wrap.align-items-baseline @@ -18,10 +18,7 @@ .col-md-12.col-lg-6 .gl-display-flex.gl-flex-wrap.gl-justify-content-end - if can_admin_project_member?(@project) - = link_to _("Import a project"), - import_project_project_members_path(@project), - class: "btn btn-default btn-md gl-button gl-mt-3 gl-sm-w-auto gl-w-full", - title: _("Import members from another project") + .js-import-a-project-modal{ data: { project_id: @project.id, project_name: @project.name } } - if @project.allowed_to_share_with_group? .js-invite-group-trigger{ data: { classes: 'gl-mt-3 gl-sm-w-auto gl-w-full gl-sm-ml-3', display_text: _('Invite a group') } } - if can_admin_project_member?(@project) diff --git a/app/views/projects/project_templates/_template.html.haml b/app/views/projects/project_templates/_template.html.haml index 827ff62f8c3..5e4b1397dd3 100644 --- a/app/views/projects/project_templates/_template.html.haml +++ b/app/views/projects/project_templates/_template.html.haml @@ -8,9 +8,9 @@ .text-muted = template.description .controls.d-flex.align-items-center - %a.btn.gl-button.btn-default.gl-mr-3{ href: template.preview, rel: 'noopener noreferrer', target: '_blank', data: { track_label: "template_preview", track_property: template.name, track_event: "click_button", track_value: "" } } + %a.btn.gl-button.btn-default.gl-mr-3{ href: template.preview, rel: 'noopener noreferrer', target: '_blank', data: { track_label: "template_preview", track_property: template.name, track_action: "click_button", track_value: "" } } = _("Preview") %label.btn.gl-button.btn-confirm.template-button.choose-template.gl-mb-0{ for: template.name } - %input{ type: "radio", autocomplete: "off", name: "project[template_name]", id: template.name, value: template.name, data: { track_label: "template_use", track_property: template.name, track_event: "click_button", track_value: "" } } + %input{ type: "radio", autocomplete: "off", name: "project[template_name]", id: template.name, value: template.name, data: { track_label: "template_use", track_property: template.name, track_action: "click_button", track_value: "" } } %span{ data: { qa_selector: 'use_template_button' } } = _("Use template") diff --git a/app/views/projects/services/slack_slash_commands/_help.html.haml b/app/views/projects/services/slack_slash_commands/_help.html.haml index 9702f9b08f2..fee0ca15808 100644 --- a/app/views/projects/services/slack_slash_commands/_help.html.haml +++ b/app/views/projects/services/slack_slash_commands/_help.html.haml @@ -4,22 +4,21 @@ .info-well .well-segment %p - = s_("SlackService|This service allows users to perform common operations on this project by entering slash commands in Slack.") + = s_("SlackService|Perform common operations in this project by entering slash commands in Slack.") = link_to help_page_path('user/project/integrations/slack_slash_commands.md'), target: '_blank' do - = _("View documentation") + = _("Learn more.") = sprite_icon('external-link') %p.inline - = s_("SlackService|See list of available commands in Slack after setting up this service, by entering") - %kbd.inline /<command> help + = s_("SlackService|After setup, get a list of available Slack slash commands by entering") + %kbd.inline /<command> help - if integration.project_level? - %p= _("To set up this service:") + %p= _("To set up this integration:") %ul.list-unstyled.indent-list %li - 1. - = link_to 'https://my.slack.com/services/new/slash-commands', target: '_blank', rel: 'noreferrer noopener nofollow' do - Add a slash command - = sprite_icon('external-link') - in your Slack team with these options: + - slash_command_link_url = 'https://my.slack.com/services/new/slash-commands' + - slash_command_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: slash_command_link_url } + - slash_command_link_end = ' %{external_link_icon}</a>'.html_safe % { external_link_icon: sprite_icon('external-link') } + = html_escape(s_('SlackService|1. %{slash_command_link_start}Add a slash command%{slash_command_link_end} in your Slack team using this information:')) % { slash_command_link_start: slash_command_link_start, slash_command_link_end: slash_command_link_end } %hr @@ -89,6 +88,6 @@ %ul.list-unstyled.indent-list %li - = html_escape(s_("SlackService|2. Paste the %{strong_open}Token%{strong_close} into the field below")) % { strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe } + = html_escape(s_("SlackService|2. Paste the token from Slack in the %{strong_open}Token%{strong_close} field below.")) % { strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe } %li - = html_escape(s_("SlackService|3. Select the %{strong_open}Active%{strong_close} checkbox, press %{strong_open}Save changes%{strong_close} and start using GitLab inside Slack!")) % { strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe } + = html_escape(s_("SlackService|3. Select the %{strong_open}Active%{strong_close} checkbox, select %{strong_open}Save changes%{strong_close}, and start using slash commands in Slack!")) % { strong_open: '<strong>'.html_safe, strong_close: '</strong>'.html_safe } diff --git a/app/views/projects/settings/ci_cd/show.html.haml b/app/views/projects/settings/ci_cd/show.html.haml index 70626636ac0..75bd985560b 100644 --- a/app/views/projects/settings/ci_cd/show.html.haml +++ b/app/views/projects/settings/ci_cd/show.html.haml @@ -105,6 +105,6 @@ = expanded ? _('Collapse') : _('Expand') %p = _("Control which projects can be accessed by API requests authenticated with this project's CI_JOB_TOKEN CI/CD variable. It is a security risk to disable this feature, because unauthorized projects might attempt to retrieve an active token and access the API.") - = link_to _('Learn more'), help_page_path('api/index', anchor: 'limit-gitlab-cicd-job-token-access'), target: '_blank', rel: 'noopener noreferrer' + = link_to _('Learn more'), help_page_path('ci/jobs/ci_job_token'), target: '_blank', rel: 'noopener noreferrer' .settings-content = render 'ci/token_access/index' diff --git a/app/views/projects/settings/operations/_error_tracking.html.haml b/app/views/projects/settings/operations/_error_tracking.html.haml index 4ef9e1bd6fb..6b2a1468eec 100644 --- a/app/views/projects/settings/operations/_error_tracking.html.haml +++ b/app/views/projects/settings/operations/_error_tracking.html.haml @@ -17,4 +17,5 @@ project: error_tracking_setting_project_json, api_host: setting.api_host, enabled: setting.enabled.to_json, + integrated: setting.integrated.to_json, token: setting.token.present? ? '*' * 12 : nil } } diff --git a/app/views/projects/tags/releases/edit.html.haml b/app/views/projects/tags/releases/edit.html.haml index 88594209c3b..c99f146ea7a 100644 --- a/app/views/projects/tags/releases/edit.html.haml +++ b/app/views/projects/tags/releases/edit.html.haml @@ -15,5 +15,5 @@ = render 'shared/notes/hints' .error-alert .gl-mt-5.gl-display-flex - = f.submit 'Save changes', class: 'btn gl-button btn-confirm gl-mr-3' - = link_to "Cancel", project_tag_path(@project, @tag.name), class: "btn gl-button btn-default btn-cancel" + = f.submit _('Save changes'), class: 'btn gl-button btn-confirm gl-mr-3' + = link_to _('Cancel'), project_tag_path(@project, @tag.name), class: "btn gl-button btn-default btn-cancel" diff --git a/app/views/projects/usage_quotas/index.html.haml b/app/views/projects/usage_quotas/index.html.haml new file mode 100644 index 00000000000..dfd46af0499 --- /dev/null +++ b/app/views/projects/usage_quotas/index.html.haml @@ -0,0 +1,19 @@ +- page_title s_("UsageQuota|Usage") + +%h3.page-title + = s_('UsageQuota|Usage Quotas') + +.row + .col-sm-12 + = s_('UsageQuota|Usage of project resources across the %{strong_start}%{project_name}%{strong_end} project').html_safe % { strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe, project_name: @project.name } + '.' + %a{ href: help_page_path('user/usage_quotas.md') } + = s_('UsageQuota|Learn more about usage quotas') + '.' + +.top-area.scrolling-tabs-container.inner-page-scroll-tabs + %ul.nav.nav-tabs.nav-links.scrolling-tabs.separator.js-usage-quota-tabs{ role: 'tablist' } + %li.nav-item + %a.nav-link#storage-quota{ data: { toggle: "tab", action: '#storage-quota-tab' }, href: '#storage-quota-tab', 'aria-controls': '#storage-quota-tab', 'aria-selected': 'true' } + = s_('UsageQuota|Storage') +.tab-content + .tab-pane#storage-quota-tab + #js-project-storage-count-app{ data: @storage_app_data } diff --git a/app/views/projects/work_items/index.html.haml b/app/views/projects/work_items/index.html.haml new file mode 100644 index 00000000000..052db598571 --- /dev/null +++ b/app/views/projects/work_items/index.html.haml @@ -0,0 +1,3 @@ +- page_title s_('WorkItem|Work Items') + +#js-work-items |