diff options
Diffstat (limited to 'app/views/projects')
55 files changed, 549 insertions, 241 deletions
diff --git a/app/views/projects/_activity.html.haml b/app/views/projects/_activity.html.haml index 00da6c73081..68e73a017a7 100644 --- a/app/views/projects/_activity.html.haml +++ b/app/views/projects/_activity.html.haml @@ -5,8 +5,8 @@ .controls.gl-display-flex = link_button_to nil, project_path(@project, rss_url_options), title: s_("ProjectActivityRSS|Subscribe"), class: 'd-none d-sm-inline-flex has-tooltip', icon: 'rss' - if is_project_overview && can?(current_user, :download_code, @project) - .project-clone-holder.d-none.d-md-inline-flex.gl-ml-2 - = render "projects/buttons/clone", dropdown_class: 'dropdown-menu-right' + .project-code-holder.d-none.d-md-inline-flex.gl-ml-2 + = render "projects/buttons/code", dropdown_class: 'dropdown-menu-right', ref: @ref .content_list.project-activity{ :"data-href" => activity_project_path(@project) } .loading diff --git a/app/views/projects/_files.html.haml b/app/views/projects/_files.html.haml index 7445a403865..5c9448a30a4 100644 --- a/app/views/projects/_files.html.haml +++ b/app/views/projects/_files.html.haml @@ -7,24 +7,28 @@ - if readme_path = @project.repository.readme_path - add_page_startup_api_call project_blob_path(@project, tree_join(@ref, readme_path), viewer: "rich", format: "json") -#tree-holder.tree-holder.clearfix.js-per-page{ data: { blame_per_page: Gitlab::Git::BlamePagination::PAGINATION_PER_PAGE } } +#tree-holder.tree-holder.clearfix.js-per-page.gl-mt-5{ data: { blame_per_page: Gitlab::Git::BlamePagination::PAGINATION_PER_PAGE } } + - if Feature.enabled?(:project_overview_reorg) + .nav-block.gl-display-flex.gl-flex-direction-column.gl-sm-flex-direction-row.gl-align-items-stretch + = render 'projects/tree/tree_header', tree: @tree + .info-well.gl-display-none.gl-sm-display-flex.project-last-commit.gl-flex-direction-column.gl-mt-5 #js-last-commit.gl-m-auto{ data: {ref_type: @ref_type.to_s} } = gl_loading_icon(size: 'md') - if project.licensed_feature_available?(:code_owners) #js-code-owners{ data: { branch: @ref, can_view_branch_rules: can_view_branch_rules?, branch_rules_path: branch_rules_path } } - .nav-block.gl-display-flex.gl-xs-flex-direction-column.gl-align-items-stretch - = render 'projects/tree/tree_header', tree: @tree + - if Feature.disabled?(:project_overview_reorg) + .nav-block.gl-display-flex.gl-flex-direction-column.gl-sm-flex-direction-row.gl-align-items-stretch + = render 'projects/tree/tree_header', tree: @tree - if project.forked? #js-fork-info{ data: vue_fork_divergence_data(project, ref) } - - if is_project_overview && has_project_shortcut_buttons + - if Feature.disabled?(:project_overview_reorg) && is_project_overview && has_project_shortcut_buttons .project-buttons.gl-mb-5.js-show-on-project-root{ data: { testid: 'project-buttons' } } = render 'stat_anchor_list', anchors: @project.statistics_buttons(show_auto_devops_callout: show_auto_devops_callout), project_buttons: true #js-tree-list{ data: vue_file_list_data(project, ref) } - if can_edit_tree? = render 'projects/blob/new_dir' - diff --git a/app/views/projects/_home_panel.html.haml b/app/views/projects/_home_panel.html.haml index e41a0d3d262..63226838166 100644 --- a/app/views/projects/_home_panel.html.haml +++ b/app/views/projects/_home_panel.html.haml @@ -1,29 +1,21 @@ - empty_repo = @project.empty_repo? -- show_auto_devops_callout = show_auto_devops_callout?(@project) - emails_disabled = @project.emails_disabled? +- ff_reorg_disabled = Feature.disabled?(:project_overview_reorg) -.project-home-panel.js-show-on-project-root.gl-mt-4.gl-mb-5{ class: [("empty-project" if empty_repo)] } - .gl-display-flex.gl-justify-content-space-between.gl-flex-wrap.gl-flex-direction-column.gl-md-flex-direction-row.gl-mb-3.gl-gap-5 +%header.project-home-panel.js-show-on-project-root.gl-mt-5{ class: [("empty-project" if empty_repo)] } + .gl-display-flex.gl-justify-content-space-between.gl-flex-wrap.gl-flex-direction-column.gl-md-flex-direction-row.gl-gap-5 .home-panel-title-row.gl-display-flex.gl-align-items-center - %div{ class: 'avatar-container rect-avatar s64 home-panel-avatar gl-flex-shrink-0 gl-w-11 gl-h-11 gl-mr-3! float-none' } - = project_icon(@project, alt: @project.name, class: 'avatar avatar-tile s64', width: 64, height: 64, itemprop: 'image') - %div - %h1.home-panel-title.gl-font-size-h1.gl-mt-3.gl-mb-2.gl-display-flex.gl-word-break-word{ data: { testid: 'project-name-content' }, itemprop: 'name' } - = @project.name - = visibility_level_content(@project, css_class: 'visibility-icon gl-text-secondary gl-mx-2', icon_css_class: 'icon') - = render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: @project, additional_classes: 'gl-align-self-center gl-mx-2' - - if @project.catalog_resource - = render partial: 'shared/ci_catalog_badge', locals: { href: project_ci_catalog_resource_path(@project, @project.catalog_resource), css_class: 'gl-mx-2' } - - if @project.group - = render_if_exists 'shared/tier_badge', source: @project, source_type: 'Project' - .home-panel-metadata.gl-font-sm.gl-text-secondary.gl-font-base.gl-font-weight-normal.gl-line-height-normal{ data: { testid: 'project-id-content' }, itemprop: 'identifier' } - - if can?(current_user, :read_project, @project) - %span.gl-display-inline-block.gl-vertical-align-middle - = s_('ProjectPage|Project ID: %{project_id}') % { project_id: @project.id } - = clipboard_button(title: s_('ProjectPage|Copy project ID'), text: @project.id) - - if current_user - %span.gl-ml-3.gl-mb-3 - = render 'shared/members/access_request_links', source: @project + = render Pajamas::AvatarComponent.new(@project, alt: @project.name, class: 'gl-align-self-start gl-flex-shrink-0 gl-mr-3', size: 48, avatar_options: { itemprop: 'image' }) + %h1.home-panel-title.gl-heading-1.gl-mt-3.gl-display-flex.gl-align-items-center.gl-flex-wrap.gl-gap-3.gl-word-break-word{ class: 'gl-mb-0!', data: { testid: 'project-name-content' }, itemprop: 'name' } + = @project.name + = visibility_level_content(@project, css_class: 'visibility-icon gl-display-inline-flex gl-text-secondary', icon_css_class: 'icon') + = render_if_exists 'compliance_management/compliance_framework/compliance_framework_badge', project: @project, additional_classes: 'gl-align-self-center' + - if @project.catalog_resource + = render partial: 'shared/ci_catalog_badge', locals: { href: explore_catalog_path(@project.catalog_resource), css_class: 'gl-mx-0' } + - if @project.group + = render_if_exists 'shared/tier_badge', source: @project, namespace_to_track: @project.namespace + .gl-text-secondary + = render_if_exists "projects/home_mirror" .project-repo-buttons.gl-display-flex.gl-justify-content-md-end.gl-align-items-center.gl-flex-wrap.gl-gap-3 - if current_user @@ -34,26 +26,31 @@ = render 'projects/buttons/star' = render 'projects/buttons/fork' + = render 'shared/groups_projects_more_actions_dropdown', source: @project - - if can?(current_user, :read_code, @project) - %nav.project-stats - - if @project.empty_repo? - = render 'stat_anchor_list', anchors: @project.empty_repo_statistics_anchors - - else - = render 'stat_anchor_list', anchors: @project.statistics_anchors(show_auto_devops_callout: show_auto_devops_callout) - .gl-my-3 - = render "shared/projects/topics", project: @project - .home-panel-home-desc.mt-1 - - if @project.description.present? - .home-panel-description.text-break - .home-panel-description-markdown.read-more-container{ itemprop: 'description' } - = markdown_field(@project, :description) - %button.btn.gl-button.btn-blank.btn-link.js-read-more-trigger.d-lg-none{ type: "button" } - = _("Read more") + - if ff_reorg_disabled + - if can?(current_user, :read_code, @project) + - show_auto_devops_callout = show_auto_devops_callout?(@project) + + %nav.project-stats.gl-mt-3 + - if @project.empty_repo? + = render 'stat_anchor_list', anchors: @project.empty_repo_statistics_anchors + - else + = render 'stat_anchor_list', anchors: @project.statistics_anchors(show_auto_devops_callout: show_auto_devops_callout) + .gl-my-3 + = render "shared/projects/topics", project: @project + + .home-panel-home-desc.mt-1 + - if @project.description.present? + .home-panel-description.text-break + .home-panel-description-markdown.read-more-container{ itemprop: 'description' } + = markdown_field(@project, :description) + = render Pajamas::ButtonComponent.new(category: :tertiary, variant: :link, button_options: { class: 'js-read-more-trigger gl-lg-display-none' }) do + = _("Read more") = render_if_exists "projects/home_mirror" - - if @project.badges.present? + - if ff_reorg_disabled && @project.badges.present? .project-badges.mb-2{ data: { testid: 'project-badges-content' } } - @project.badges.each do |badge| - badge_link_url = badge.rendered_link_url(@project) diff --git a/app/views/projects/_invite_members_empty_project.html.haml b/app/views/projects/_invite_members_empty_project.html.haml index 14b0e82e021..730021f345a 100644 --- a/app/views/projects/_invite_members_empty_project.html.haml +++ b/app/views/projects/_invite_members_empty_project.html.haml @@ -1,9 +1,20 @@ -%h4.gl-mt-0.gl-mb-3{ data: { testid: 'invite-member-section', - track_label: 'invite_members_empty_project', - 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', - classes: 'gl-mb-8 gl-w-full gl-sm-w-auto', - display_text: s_('InviteMember|Invite members'), - trigger_source: 'project_empty_page' } } +- if Feature.enabled?(:project_overview_reorg) + %p.gl-font-weight-bold.gl-text-gray-900.gl-mt-0.gl-mt-n1.gl-mb-3{ data: { testid: 'invite-member-section', + track_label: 'invite_members_empty_project', + track_action: 'render' } } + = s_('InviteMember|Invite your team') + %p.gl-mb-3= s_('InviteMember|Add members to this project and start collaborating with your team.') + .js-invite-members-trigger{ data: { variant: 'confirm', + classes: 'gl-mb-3 gl-w-full gl-sm-w-auto', + display_text: s_('InviteMember|Invite members'), + trigger_source: 'project_empty_page' } } +- else + %h4.gl-mt-0.gl-mb-3{ data: { testid: 'invite-member-section', + track_label: 'invite_members_empty_project', + 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', + classes: 'gl-mb-8 gl-w-full gl-sm-w-auto', + display_text: s_('InviteMember|Invite members'), + trigger_source: 'project_empty_page' } } diff --git a/app/views/projects/_new_project_fields.html.haml b/app/views/projects/_new_project_fields.html.haml index ca1fef6eb32..25001314c07 100644 --- a/app/views/projects/_new_project_fields.html.haml +++ b/app/views/projects/_new_project_fields.html.haml @@ -3,6 +3,7 @@ - hide_init_with_readme = local_assigns.fetch(:hide_init_with_readme, false) - include_description = local_assigns.fetch(:include_description, true) - track_label = local_assigns.fetch(:track_label, 'blank_project') +- display_sha256_repository = Feature.enabled?(:support_sha256_repositories, current_user) .row{ id: project_name_id } = f.hidden_field :ci_cd_only, value: ci_cd_only @@ -25,7 +26,7 @@ input_name: 'project[namespace_id]', root_url: root_url, track_label: track_label, - user_namespace_id: current_user.namespace.id } } + user_namespace_id: current_user.namespace_id } } - else .input-group-prepend.static-namespace.flex-shrink-0.has-tooltip{ title: user_url(current_user.username) + '/' } .input-group-text.border-0 @@ -95,6 +96,14 @@ = s_('ProjectsNew|Analyze your source code for known security vulnerabilities.') = link_to _('Learn more.'), help_page_path('user/application_security/sast/index'), target: '_blank', rel: 'noopener noreferrer', data: { track_action: 'followed' } + - if display_sha256_repository + .form-group + = render Pajamas::CheckboxTagComponent.new(name: 'project[use_sha256_repository]') do |c| + - c.with_label do + = s_('ProjectsNew|Use SHA-256 as the repository hashing algorithm') + - c.with_help_text do + = s_('ProjectsNew|Default hashing algorithm is SHA-1.') + -# this partial is from JiHu, see details in https://jihulab.com/gitlab-cn/gitlab/-/merge_requests/675 = render_if_exists 'shared/other_project_options', f: f, visibility_level: visibility_level, track_label: track_label = f.submit _('Create project'), class: "js-create-project-button", data: { testid: 'project-create-button', track_label: "#{track_label}", track_action: "click_button", track_property: "create_project", track_value: "" }, pajamas_button: true diff --git a/app/views/projects/_service_desk_settings.html.haml b/app/views/projects/_service_desk_settings.html.haml index aee61624f69..d6b28e94645 100644 --- a/app/views/projects/_service_desk_settings.html.haml +++ b/app/views/projects/_service_desk_settings.html.haml @@ -4,7 +4,7 @@ %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only= _('Service Desk') = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do = expanded ? _('Collapse') : _('Expand') - - link_start = "<a href='#{help_page_path('user/project/service_desk')}' target='_blank' rel='noopener noreferrer'>".html_safe + - link_start = "<a href='#{help_page_path('user/project/service_desk/index')}' target='_blank' rel='noopener noreferrer'>".html_safe %p.gl-text-secondary= _('Enable and disable Service Desk. Some additional configuration might be required. %{link_start}Learn more%{link_end}.').html_safe % { link_start: link_start, link_end: '</a>'.html_safe } .settings-content - if ::Gitlab::ServiceDesk.supported? @@ -18,6 +18,7 @@ selected_file_template_project_id: "#{@project.service_desk_setting&.file_template_project_id}", outgoing_name: "#{@project.service_desk_setting&.outgoing_name}", project_key: "#{@project.service_desk_setting&.project_key}", + reopen_issue_on_external_participant_note: "#{@project.service_desk_setting&.reopen_issue_on_external_participant_note}", add_external_participants_from_cc: "#{@project.service_desk_setting&.add_external_participants_from_cc}", templates: available_service_desk_templates_for(@project), public_project: "#{@project.public?}", diff --git a/app/views/projects/_sidebar.html.haml b/app/views/projects/_sidebar.html.haml new file mode 100644 index 00000000000..565f14d01d9 --- /dev/null +++ b/app/views/projects/_sidebar.html.haml @@ -0,0 +1,61 @@ +- has_project_shortcut_buttons = !current_user || current_user.project_shortcut_buttons +- show_auto_devops_callout = show_auto_devops_callout?(@project) + +%aside.project-page-sidebar + - if @project.description.present? || @project.badges.present? + .project-page-sidebar-block.home-panel-home-desc.gl-py-4.gl-border-b.gl-border-gray-50 + -# Project description + - if @project.description.present? + .gl-display-flex.gl-justify-content-space-between.gl-mt-1.gl-pr-2 + %p.gl-font-weight-bold.gl-text-gray-900.gl-m-0= s_('ProjectPage|Project information') + = render Pajamas::ButtonComponent.new(href: edit_project_path(@project), + category: :tertiary, + icon: 'settings', + size: :small, + button_options: { class: 'has-tooltip', title: s_('ProjectPage|Project settings'), 'aria-label' => s_('ProjectPage|Project settings') }) + .home-panel-description.text-break + .home-panel-description-markdown{ itemprop: 'description' } + = markdown_field(@project, :description) + + -# Topics + - if @project.topics.present? + .gl-mb-5 + = render "shared/projects/topics", project: @project + + -# Programming languages + - if can?(current_user, :read_code, @project) && @project.repository_languages.present? + .gl-mb-2{ class: ('gl-mb-4!' if @project.badges.present?) } + = repository_languages_bar(@project.repository_languages) + + -# Badges + - if @project.badges.present? + .project-badges.gl-mb-2{ data: { testid: 'project-badges-content' } } + - @project.badges.each do |badge| + - badge_link_url = badge.rendered_link_url(@project) + %a.gl-mr-3{ href: badge_link_url, + target: '_blank', + rel: 'noopener noreferrer', + data: { testid: 'badge-image-link', qa_link_url: badge_link_url } }> + %img.project-badge{ src: badge.rendered_image_url(@project), + 'aria-hidden': true, + alt: 'Project badge' }> + + -# Invite members + - if @project.empty_repo? + .project-page-sidebar-block.gl-py-4.gl-border-b.gl-border-gray-50 + = render "invite_members_empty_project" if can_admin_project_member?(@project) + + -# Buttons + - if can?(current_user, :read_code, @project) && !@project.empty_repo? + .project-page-sidebar-block.gl-py-4.gl-border-b.gl-border-gray-50 + %nav.project-stats + = render 'stat_anchor_list', anchors: @project.statistics_anchors(show_auto_devops_callout: show_auto_devops_callout) + + -# Buttons + - if has_project_shortcut_buttons + .project-page-sidebar-block.gl-py-4 + .project-buttons.gl-mb-2.js-show-on-project-root{ data: { testid: 'project-buttons' } } + - if @project.empty_repo? + = render 'stat_anchor_list', anchors: @project.empty_repo_statistics_buttons, project_buttons: true + - else + = render 'stat_anchor_list', anchors: @project.statistics_buttons(show_auto_devops_callout: show_auto_devops_callout), project_buttons: true diff --git a/app/views/projects/_stat_anchor_list.html.haml b/app/views/projects/_stat_anchor_list.html.haml index 1409b28e735..2f8ae788c01 100644 --- a/app/views/projects/_stat_anchor_list.html.haml +++ b/app/views/projects/_stat_anchor_list.html.haml @@ -1,9 +1,11 @@ - anchors = local_assigns.fetch(:anchors, []) - project_buttons = local_assigns.fetch(:project_buttons, false) +- ff_reorg_enabled = Feature.enabled?(:project_overview_reorg) - return unless anchors.any? -%ul.nav{ class: (project_buttons ? 'gl-gap-3' : 'gl-gap-5') } + +%ul.nav.gl-row-gap-2.gl-column-gap-5 - anchors.each do |anchor| %li.nav-item = link_to_if(anchor.link, anchor.label, anchor.link, stat_anchor_attrs(anchor)) do - .stat-text.d-flex.align-items-center{ class: ('btn gl-button btn-default disabled' if project_buttons) }= anchor.label + .stat-text.d-flex.align-items-center{ class: "#{'btn gl-button btn-default disabled' if project_buttons} #{'gl-px-0! gl-pb-2!' if ff_reorg_enabled}" }= anchor.label diff --git a/app/views/projects/_transfer.html.haml b/app/views/projects/_transfer.html.haml index 43bb3627c4f..d8b1931756e 100644 --- a/app/views/projects/_transfer.html.haml +++ b/app/views/projects/_transfer.html.haml @@ -8,14 +8,14 @@ .gl-new-card-title-wrapper %h4.gl-new-card-title.warning-title= _('Transfer project') %p.gl-new-card-description - - link = link_to('', help_page_path('user/project/settings/index', anchor: 'transfer-a-project-to-another-namespace'), target: '_blank', rel: 'noopener noreferrer') + - link = link_to('', help_page_path('user/project/settings/migrate_projects', anchor: 'transfer-a-project-to-another-namespace'), target: '_blank', rel: 'noopener noreferrer') = safe_format(_("Transfer your project into another namespace. %{link_start}Learn more.%{link_end}"), tag_pair(link, :link_start, :link_end)) - c.with_body do = form_for @project, url: transfer_project_path(@project), method: :put, html: { class: 'js-project-transfer-form', id: form_id } do |f| .form-group.gl-mb-0 %p - - link = link_to('', help_page_path('user/project/settings/index', anchor: 'rename-a-repository'), target: '_blank', rel: 'noopener noreferrer') + - link = link_to('', help_page_path('user/project/working_with_projects', anchor: 'rename-a-repository'), target: '_blank', rel: 'noopener noreferrer') = safe_format(_("A project’s repository name defines its URL (the one you use to access the project via a browser) and its place on the file disk where GitLab is installed. %{link_start}Learn more.%{link_end}"), tag_pair(link, :link_start, :link_end)) %p= _('When you transfer your project to a group, you can easily manage multiple projects, view usage quotas for storage, pipeline minutes, and users, and start a trial or upgrade to a paid tier.') %p diff --git a/app/views/projects/artifacts/external_file.html.haml b/app/views/projects/artifacts/external_file.html.haml index 67f6ccd5695..37faea3a86f 100644 --- a/app/views/projects/artifacts/external_file.html.haml +++ b/app/views/projects/artifacts/external_file.html.haml @@ -1,4 +1,7 @@ - external_url = @blob.external_url(@build) +- external_url_text = external_url +- if Gitlab.config.pages.namespace_in_path + - external_url_text = "#{external_url} (Experimental)" - page_title @path, _('Artifacts'), "#{@build.name} (##{@build.id})", _('Jobs') = render "projects/jobs/header" @@ -9,7 +12,7 @@ %h2= _("You are being redirected away from GitLab") %p= _("This page is hosted on GitLab pages but contains user-generated content and may contain malicious code. Do not accept unless you trust the author and source.") - = link_to external_url, + = link_to external_url_text, external_url, target: '_blank', title: _('Opens in a new window'), diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml index bd0f4577a32..8a11d4e9a84 100644 --- a/app/views/projects/blame/show.html.haml +++ b/app/views/projects/blame/show.html.haml @@ -12,7 +12,7 @@ url.searchParams.set('page', 2); return fetch(url).then(response => response.body); })(); -- dataset = { testid: 'blob-content-holder', qa_selector: 'blame_file_content', per_page: @blame_pagination.per_page, total_extra_pages: @blame_pagination.total_extra_pages - 1, pages_url: blame_streaming_url } +- dataset = { testid: 'blob-content-holder', per_page: @blame_pagination.per_page, total_extra_pages: @blame_pagination.total_extra_pages - 1, pages_url: blame_streaming_url } #blob-content-holder.tree-holder.js-per-page{ data: dataset } = render "projects/blob/breadcrumb", blob: @blob, blame: true diff --git a/app/views/projects/blob/_breadcrumb.html.haml b/app/views/projects/blob/_breadcrumb.html.haml index c140eecd8c1..ddea80a3983 100644 --- a/app/views/projects/blob/_breadcrumb.html.haml +++ b/app/views/projects/blob/_breadcrumb.html.haml @@ -17,7 +17,7 @@ - else = link_to title, project_tree_path(@project, tree_join(@ref, path), ref_type: @ref_type) - .tree-controls.gl-children-ml-sm-3< + .tree-controls.gl-display-flex.gl-flex-wrap.gl-sm-flex-nowrap.gl-align-items-baseline.gl-gap-3 = render 'projects/find_file_link' -# only show normal/blame view links for text files - if blob.readable_text? diff --git a/app/views/projects/blob/_editor.html.haml b/app/views/projects/blob/_editor.html.haml index 0753a021f1f..a08d17a3efa 100644 --- a/app/views/projects/blob/_editor.html.haml +++ b/app/views/projects/blob/_editor.html.haml @@ -1,17 +1,22 @@ -- action = current_action?(:edit) || current_action?(:update) ? 'edit' : 'create' +- action = current_action?(:edit, :update) ? 'edit' : 'create' - file_name = params[:id].split("/").last ||= "" - is_markdown = Gitlab::MarkupHelper.gitlab_markdown?(file_name) .file-holder.file.gl-mb-3 .js-file-title.file-title.gl-display-flex.gl-align-items-center.gl-rounded-top-base{ data: { current_action: action } } - .editor-ref.block-truncated.has-tooltip{ title: ref } + .editor-ref.block-truncated.has-tooltip{ title: current_action?(:edit, :update) ? ref : params[:id] } = sprite_icon('branch', size: 12) - = ref - - if current_action?(:edit) || current_action?(:update) + - if current_action?(:edit, :update) + %span#editor_ref + = ref + - if current_action?(:new, :create) + %span#editor_path + = params[:id] + - if current_action?(:edit, :update) - input_options = { id: 'file_path', name: 'file_path', value: (params[:file_path] || @path), class: 'new-file-path js-file-path-name-input' } = render 'filepath_form', input_options: input_options - - if current_action?(:new) || current_action?(:create) + - if current_action?(:new, :create) - input_options = { id: 'file_name', name: 'file_name', value: params[:file_name] || (should_suggest_gitlab_ci_yml? ? '.gitlab-ci.yml' : ''), required: true, placeholder: "Filename", testid: 'file-name-field', class: 'new-file-name js-file-path-name-input' } = render 'filepath_form', input_options: input_options - if should_suggest_gitlab_ci_yml? diff --git a/app/views/projects/branch_defaults/_default_branch_fields.html.haml b/app/views/projects/branch_defaults/_default_branch_fields.html.haml index 78ce43ca8c9..f3a7e93a5f7 100644 --- a/app/views/projects/branch_defaults/_default_branch_fields.html.haml +++ b/app/views/projects/branch_defaults/_default_branch_fields.html.haml @@ -1,3 +1,13 @@ +- change_default_disabled = @default_branch_blocked_by_security_policy +- popover_data = {} + +- if change_default_disabled + - tag_pair_security_policies_page = tag_pair(link_to('', namespace_project_security_policies_path, target: '_blank', rel: 'noopener noreferrer'), :security_policies_link_start, :security_policies_link_end) + - tag_pair_security_policies_docs = tag_pair(link_to('', help_page_path('user/application_security/policies/scan-result-policies'), target: '_blank', rel: 'noopener noreferrer'), :learn_more_link_start, :learn_more_link_end) + - popover_content = safe_format(s_("SecurityOrchestration|You can't change the default branch because its protection is enforced by one or more %{security_policies_link_start}security policies%{security_policies_link_end}. %{learn_more_link_start}Learn more%{learn_more_link_end}."), tag_pair_security_policies_docs, tag_pair_security_policies_page) + - popover_title = s_("SecurityOrchestration|Security policy overwrites this setting") + - popover_data = { container: 'body', toggle: 'popover', html: 'true', triggers: 'hover', title: popover_title, content: popover_content } + %fieldset#default-branch-settings - if @project.empty_repo? .text-secondary @@ -6,8 +16,8 @@ .form-group = f.label :default_branch, _("Default branch"), class: 'label-bold' %p= s_('ProjectSettings|All merge requests and commits are made against this branch unless you specify a different one.') - .gl-form-input-xl - .js-select-default-branch{ data: { default_branch: @project.default_branch, project_id: @project.id } } + .gl-form-input-xl{ data: { **popover_data } } + .js-select-default-branch{ data: { default_branch: @project.default_branch, project_id: @project.id, disabled: change_default_disabled.to_s } } .form-group - help_text = _("When merge requests and commits in the default branch close, any issues they reference also close.") diff --git a/app/views/projects/buttons/_clone.html.haml b/app/views/projects/buttons/_code.html.haml index 0e645eda678..a78e3861e94 100644 --- a/app/views/projects/buttons/_clone.html.haml +++ b/app/views/projects/buttons/_code.html.haml @@ -1,34 +1,35 @@ - project = project || @project - dropdown_class = local_assigns.fetch(:dropdown_class, '') +- ref = local_assigns.fetch(:ref) - if can?(current_user, :download_code, @project) .git-clone-holder.js-git-clone-holder - = render Pajamas::ButtonComponent.new(variant: :confirm, button_options: { id: 'clone-dropdown', class: 'clone-dropdown-btn', data: { toggle: 'dropdown', qa_selector: 'clone_dropdown' } }) do - %span.gl-mr-2.js-clone-dropdown-label - = _('Clone') + = render Pajamas::ButtonComponent.new(variant: :confirm, button_options: { id: 'clone-dropdown', class: 'clone-dropdown-btn', data: { toggle: 'dropdown', testid: 'clone-dropdown' } }) do + %span.js-clone-dropdown-label + = _('Code') = sprite_icon("chevron-down", css_class: "icon") - %ul.dropdown-menu.dropdown-menu-large.dropdown-menu-selectable.clone-options-dropdown{ class: dropdown_class, data: { qa_selector: 'clone_dropdown_content' } } + %ul.dropdown-menu.dropdown-menu-large.clone-options-dropdown{ class: dropdown_class, data: { testid: 'clone-dropdown-content' } } - if ssh_enabled? - %li{ class: 'gl-px-4!' } + %li.gl-dropdown-item.js-clone-links{ class: 'gl-px-4!' } %label.label-bold = _('Clone with SSH') .input-group.btn-group - = text_field_tag :ssh_project_clone, ssh_clone_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true, aria: { label: _('Repository clone URL') }, data: { qa_selector: 'ssh_clone_url_content' } + = text_field_tag :ssh_project_clone, ssh_clone_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true, aria: { label: _('Repository clone URL') }, data: { testid: 'ssh-clone-url-content' } .input-group-append = clipboard_button(target: '#ssh_project_clone', title: _("Copy URL"), category: :primary, size: :medium) = render_if_exists 'projects/buttons/geo' - if http_enabled? - %li.pt-2{ class: 'gl-px-4!' } + %li.pt-2.gl-dropdown-item.js-clone-links{ class: 'gl-px-4!' } %label.label-bold = _('Clone with %{http_label}') % { http_label: gitlab_config.protocol.upcase } .input-group.btn-group - = text_field_tag :http_project_clone, http_clone_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true, aria: { label: _('Repository clone URL') }, data: { qa_selector: 'http_clone_url_content' } + = text_field_tag :http_project_clone, http_clone_url_to_repo(project), class: "js-select-on-focus form-control", readonly: true, aria: { label: _('Repository clone URL') }, data: { testid: 'http-clone-url-content' } .input-group-append = clipboard_button(target: '#http_project_clone', title: _("Copy URL"), category: :primary, size: :medium) = render_if_exists 'projects/buttons/geo' = render_if_exists 'projects/buttons/kerberos_clone_field' %li.divider.mt-2 - %li.pt-2.gl-dropdown-item + %li.pt-2.gl-dropdown-item.js-clone-links %label.label-bold{ class: 'gl-px-4!' } = _('Open in your IDE') - if ssh_enabled? @@ -53,3 +54,6 @@ %a.dropdown-item.open-with-link{ href: xcode_uri_to_repo(@project) } .gl-dropdown-item-text-wrapper = _("Xcode") + - if !project.empty_repo? && can?(current_user, :download_code, project) + %li.divider.mt-2 + = render 'projects/buttons/download_menu_items', project: project, ref: ref diff --git a/app/views/projects/buttons/_download.html.haml b/app/views/projects/buttons/_download.html.haml index b3282742407..5091fd1c646 100644 --- a/app/views/projects/buttons/_download.html.haml +++ b/app/views/projects/buttons/_download.html.haml @@ -1,27 +1,12 @@ - project = local_assigns.fetch(:project) - ref = local_assigns.fetch(:ref) -- pipeline = local_assigns.fetch(:pipeline) { project.latest_successful_pipeline_for(ref) } - css_class = local_assigns.fetch(:css_class, '') - if !project.empty_repo? && can?(current_user, :download_code, project) - - archive_prefix = "#{project.path}-#{ref.tr('/', '-')}" .project-action-button.dropdown.gl-dropdown.inline{ class: css_class }> = render Pajamas::ButtonComponent.new(button_options: { class: 'dropdown-toggle gl-dropdown-toggle dropdown-icon-only has-tooltip', title: s_('DownloadSource|Download'), 'data-toggle' => 'dropdown', 'aria-label' => s_('DownloadSource|Download'), 'data-display' => 'static', data: { testid: 'download-source-code-button' } }) do = sprite_icon('download', css_class: 'gl-icon dropdown-icon') %span.sr-only= _('Select Archive Format') = sprite_icon('chevron-down', css_class: 'gl-icon dropdown-chevron') - .dropdown-menu.dropdown-menu-right{ role: 'menu' } - %section - %h5.m-0.dropdown-bold-header= _('Download source code') - .dropdown-menu-content - = render 'projects/buttons/download_links', project: project, ref: ref, archive_prefix: archive_prefix, path: nil - .js-directory-downloads{ data: { links: directory_download_links(project, ref, archive_prefix).to_json } } - - if pipeline && pipeline.latest_builds_with_artifacts.any? - %section.border-top.pt-1.mt-1 - %h5.m-0.dropdown-bold-header= _('Download artifacts') - - unless pipeline.latest? - %span.unclickable= ci_status_for_statuseable(project.latest_pipeline(ref)) - %h6.m-0.dropdown-header= _('Previous Artifacts') - %ul - - pipeline.latest_builds_with_artifacts.each do |job| - %li= link_to job.name, latest_succeeded_project_artifacts_path(project, "#{ref}/download", job: job.name), rel: 'nofollow', download: '' + %ul.dropdown-menu.dropdown-menu-right{ role: 'menu' } + = render 'projects/buttons/download_menu_items', project: project, ref: ref diff --git a/app/views/projects/buttons/_download_links.html.haml b/app/views/projects/buttons/_download_links.html.haml index 31185fc1532..7035f3b3792 100644 --- a/app/views/projects/buttons/_download_links.html.haml +++ b/app/views/projects/buttons/_download_links.html.haml @@ -1,4 +1,5 @@ -.btn-group.ml-0.w-100 - - Gitlab::Workhorse::ARCHIVE_FORMATS.each_with_index do |fmt, index| - - archive_path = project_archive_path(project, id: tree_join(ref, archive_prefix), path: path, format: fmt) - = link_button_to fmt, external_storage_url_or_path(archive_path), rel: 'nofollow', download: '', variant: index == 0 ? :confirm : :default, size: :small +- Gitlab::Workhorse::ARCHIVE_FORMATS.each_with_index do |fmt, index| + - archive_path = project_archive_path(project, id: tree_join(ref, archive_prefix), path: path, format: fmt) + + %a.dropdown-item.open-with-link{ href: external_storage_url_or_path(archive_path), rel: 'nofollow', download: '' } + .gl-dropdown-item-text-wrapper= fmt diff --git a/app/views/projects/buttons/_download_menu_items.html.haml b/app/views/projects/buttons/_download_menu_items.html.haml new file mode 100644 index 00000000000..f5f8efca073 --- /dev/null +++ b/app/views/projects/buttons/_download_menu_items.html.haml @@ -0,0 +1,8 @@ +- project = local_assigns.fetch(:project) +- ref = local_assigns.fetch(:ref) +- archive_prefix = "#{project.path}-#{ref.tr('/', '-')}" + +%li.gl-dropdown-item{ role: 'menuitem' } + %h3.h5.m-0.dropdown-bold-header= _('Download source code') + = render 'projects/buttons/download_links', project: project, ref: ref, archive_prefix: archive_prefix, path: nil +.js-directory-downloads{ data: { links: directory_download_links(project, ref, archive_prefix).to_json } } diff --git a/app/views/projects/commit/_commit_box.html.haml b/app/views/projects/commit/_commit_box.html.haml index 42482a773be..be0e5a428b4 100644 --- a/app/views/projects/commit/_commit_box.html.haml +++ b/app/views/projects/commit/_commit_box.html.haml @@ -19,7 +19,7 @@ #{time_ago_with_tooltip(@commit.committed_date)} #js-commit-comments-button{ data: { comments_count: @notes_count.to_i } } - = link_button_to _('Browse files'), project_tree_path(@project, @commit), class: 'gl-mr-3 gl-w-full gl-sm-w-auto gl-xs-mb-3' + = link_button_to _('Browse files'), project_tree_path(@project, @commit), class: 'gl-mr-3 gl-w-full gl-sm-w-auto gl-mb-3 gl-sm-mb-0' #js-commit-options-dropdown{ data: commit_options_dropdown_data(@project, @commit) } .commit-box{ data: { project_path: project_path(@project) } } diff --git a/app/views/projects/commit/x509/_certificate_details.html.haml b/app/views/projects/commit/x509/_certificate_details.html.haml index cea216d0d9d..22d297248f8 100644 --- a/app/views/projects/commit/x509/_certificate_details.html.haml +++ b/app/views/projects/commit/x509/_certificate_details.html.haml @@ -1,17 +1,18 @@ -.gpg-popover-certificate-details - %strong= _('Certificate Subject') - - if signature.x509_certificate.revoked? - %strong.cred= _('(revoked)') - %ul - - x509_subject(signature.x509_certificate.subject, ["CN", "O"]).map do |key, value| - %li= key + "=" + value - %li= _('Subject Key Identifier:') - %li.unstyled= signature.x509_certificate.subject_key_identifier.gsub(":", " ") +- if signature.x509_certificate + .gpg-popover-certificate-details + %strong= _('Certificate Subject') + - if signature.x509_certificate.revoked? + %strong.cred= _('(revoked)') + %ul + - x509_subject(signature.x509_certificate.subject, ["CN", "O"]).map do |key, value| + %li= key + "=" + value + %li= _('Subject Key Identifier:') + %li.unstyled= signature.x509_certificate.subject_key_identifier.gsub(":", " ") -.gpg-popover-certificate-details - %strong= _('Certificate Issuer') - %ul - - x509_subject(signature.x509_certificate.x509_issuer.subject, ["CN", "OU", "O"]).map do |key, value| - %li= key + "=" + value - %li= _('Subject Key Identifier:') - %li.unstyled= signature.x509_certificate.x509_issuer.subject_key_identifier.gsub(":", " ") + .gpg-popover-certificate-details + %strong= _('Certificate Issuer') + %ul + - x509_subject(signature.x509_certificate.x509_issuer.subject, ["CN", "OU", "O"]).map do |key, value| + %li= key + "=" + value + %li= _('Subject Key Identifier:') + %li.unstyled= signature.x509_certificate.x509_issuer.subject_key_identifier.gsub(":", " ") diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index fd0dc1178f7..9269369c83e 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -46,7 +46,7 @@ = render Pajamas::ButtonComponent.new(button_options: { class: 'js-settings-toggle' }) do = expanded ? _('Collapse') : _('Expand') %p.gl-text-secondary - = s_('ProjectSettings|Customize this project\'s badges.') + = s_('ProjectSettings|Add badges to display information about this project.') = link_to s_('ProjectSettings|What are badges?'), help_page_path('user/project/badges') .settings-content = render 'shared/badges/badge_settings' @@ -90,16 +90,18 @@ .gl-new-card-title-wrapper %h4.gl-new-card-title.warning-title= _('Change path') %p.gl-new-card-description - - link = link_to('', help_page_path('user/project/settings/index', anchor: 'rename-a-repository'), target: '_blank', rel: 'noopener noreferrer') + - link = link_to('', help_page_path('user/project/working_with_projects', anchor: 'rename-a-repository'), target: '_blank', rel: 'noopener noreferrer') = safe_format(_("A project’s repository name defines its URL (the one you use to access the project via a browser) and its place on the file disk where GitLab is installed. %{link_start}Learn more.%{link_end}"), tag_pair(link, :link_start, :link_end)) - c.with_body do = render 'projects/errors' = gitlab_ui_form_for @project do |f| .form-group - %p - %span.gl-font-weight-bold= _("Be careful. Renaming a project's repository can have unintended side effects.") - = _('You will need to update your local repositories to point to the new location.') + %ul + %li= _("Be careful. Renaming a project's repository can have unintended side effects.") + %li= _('You will need to update your local repositories to point to the new location.') + - if ContainerRegistry::GitlabApiClient.supports_gitlab_api? + %li= s_('ContainerRegistry|While the rename is in progress, new uploads to the container registry are blocked. Ongoing uploads may fail and need to be retried.') - if @project.deployment_platform.present? %p= _('Your deployment services will be broken, you will need to manually fix the services after renaming.') = f.label :path, _('Path'), class: 'label-bold' diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index 902a5df9394..684ea8242f7 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -1,3 +1,4 @@ +- add_page_specific_style 'page_bundles/projects' - default_branch_name = @project.default_branch_or_main - escaped_default_branch_name = default_branch_name.shellescape - @skip_current_level_breadcrumb = true @@ -8,68 +9,142 @@ = render "home_panel" = render "archived_notice", project: @project -= render "invite_members_empty_project" if can_admin_project_member?(@project) +- if Feature.enabled?(:project_overview_reorg) + - add_page_specific_style 'page_bundles/project' -%h4.gl-mt-0.gl-mb-3 - = _('The repository for this project is empty') + .project-page-indicator.js-show-on-project-root -- if @project.can_current_user_push_code? - %p - = _('You can get started by cloning the repository or start adding files to it with one of the following options.') + .project-page-layout + .project-page-layout-content.gl-mt-5 + .project-buttons.gl-mb-5{ data: { testid: 'quick-actions-container' } } + .project-clone-holder.d-block.d-sm-none + = render "shared/mobile_clone_panel" -.project-buttons{ data: { testid: 'quick-actions-container' } } - .project-clone-holder.d-block.d-md-none.gl-mt-3.gl-mr-3 - = render "shared/mobile_clone_panel" + .project-clone-holder.gl-display-none.gl-sm-display-flex.gl-justify-content-end.gl-w-full.gl-mt-2 + = render "projects/buttons/code", ref: @ref - .project-clone-holder.d-none.d-md-inline-block.gl-mb-3.gl-mr-3.float-left - = render "projects/buttons/clone" - = render 'stat_anchor_list', anchors: @project.empty_repo_statistics_buttons, project_buttons: true + = render Pajamas::CardComponent.new(card_options: { class: 'gl-mb-5' }, body_options: { class: 'gl-new-card-body gl-bg-gray-10 gl-p-5' }) do |c| + - c.with_body do + %h4.gl-font-lg.gl-mt-0.gl-mb-2= _('The repository for this project is empty') + - if @project.can_current_user_push_code? + %p.gl-m-0.gl-text-secondary= _('You can get started by cloning the repository or start adding files to it with one of the following options.') -- if can?(current_user, :push_code, @project) - .empty-wrapper.gl-mt-4 - %h3#repo-command-line-instructions.page-title-empty - = _('Command line instructions') + - if can?(current_user, :push_code, @project) + = render Pajamas::CardComponent.new(header_options: { class: 'gl-py-4' }) do |c| + - c.with_header do + %h5.gl-font-lg.gl-m-0= _('Command line instructions') + - c.with_body do + %p + = _('You can also upload existing files from your computer using the instructions below.') + .git-empty.js-git-empty + %h5= _('Git global setup') + %pre.gl-bg-gray-10 + :preserve + git config --global user.name "#{h git_user_name}" + git config --global user.email "#{h git_user_email}" + + %h5= _('Create a new repository') + %pre.gl-bg-gray-10 + :preserve + git clone #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} + cd #{h @project.path} + git switch --create #{h escaped_default_branch_name} + touch README.md + git add README.md + git commit -m "add README" + - if @project.can_current_user_push_to_default_branch? + %span>< + git push --set-upstream origin #{h escaped_default_branch_name } + + %h5= _('Push an existing folder') + %pre.gl-bg-gray-10 + :preserve + cd existing_folder + git init --initial-branch=#{h escaped_default_branch_name} + git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} + git add . + git commit -m "Initial commit" + - if @project.can_current_user_push_to_default_branch? + %span>< + git push --set-upstream origin #{h escaped_default_branch_name } + + %h5= _('Push an existing Git repository') + %pre.gl-bg-gray-10 + :preserve + cd existing_repo + git remote rename origin old-origin + git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} + - if @project.can_current_user_push_to_default_branch? + %span>< + git push --set-upstream origin --all + git push --set-upstream origin --tags + + .project-page-layout-sidebar.js-show-on-project-root.gl-mt-5 + = render "sidebar" + +- else + = render "invite_members_empty_project" if can_admin_project_member?(@project) + + %h4.gl-mt-0.gl-mb-3 + = _('The repository for this project is empty') + + - if @project.can_current_user_push_code? %p - = _('You can also upload existing files from your computer using the instructions below.') - .git-empty.js-git-empty - %h5= _('Git global setup') - %pre.bg-light - :preserve - git config --global user.name "#{h git_user_name}" - git config --global user.email "#{h git_user_email}" - - %h5= _('Create a new repository') - %pre.bg-light - :preserve - git clone #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} - cd #{h @project.path} - git switch --create #{h escaped_default_branch_name} - touch README.md - git add README.md - git commit -m "add README" - - if @project.can_current_user_push_to_default_branch? - %span>< - git push --set-upstream origin #{h escaped_default_branch_name } - - %h5= _('Push an existing folder') - %pre.bg-light - :preserve - cd existing_folder - git init --initial-branch=#{h escaped_default_branch_name} - git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} - git add . - git commit -m "Initial commit" - - if @project.can_current_user_push_to_default_branch? - %span>< - git push --set-upstream origin #{h escaped_default_branch_name } - - %h5= _('Push an existing Git repository') - %pre.bg-light - :preserve - cd existing_repo - git remote rename origin old-origin - git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} - - if @project.can_current_user_push_to_default_branch? - %span>< - git push --set-upstream origin --all - git push --set-upstream origin --tags + = _('You can get started by cloning the repository or start adding files to it with one of the following options.') + + .project-buttons{ data: { testid: 'quick-actions-container' } } + .project-clone-holder.d-block.d-sm-none.gl-mt-3.gl-mr-3 + = render "shared/mobile_clone_panel" + + .project-clone-holder.d-none.d-sm-inline-block.gl-mb-3.gl-mr-3.float-left + = render "projects/buttons/code", ref: @ref + = render 'stat_anchor_list', anchors: @project.empty_repo_statistics_buttons, project_buttons: true + + - if can?(current_user, :push_code, @project) + .empty-wrapper.gl-mt-4 + %h3#repo-command-line-instructions.page-title-empty + = _('Command line instructions') + %p + = _('You can also upload existing files from your computer using the instructions below.') + .git-empty.js-git-empty + %h5= _('Git global setup') + %pre.bg-light + :preserve + git config --global user.name "#{h git_user_name}" + git config --global user.email "#{h git_user_email}" + + %h5= _('Create a new repository') + %pre.bg-light + :preserve + git clone #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} + cd #{h @project.path} + git switch --create #{h escaped_default_branch_name} + touch README.md + git add README.md + git commit -m "add README" + - if @project.can_current_user_push_to_default_branch? + %span>< + git push --set-upstream origin #{h escaped_default_branch_name } + + %h5= _('Push an existing folder') + %pre.bg-light + :preserve + cd existing_folder + git init --initial-branch=#{h escaped_default_branch_name} + git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} + git add . + git commit -m "Initial commit" + - if @project.can_current_user_push_to_default_branch? + %span>< + git push --set-upstream origin #{h escaped_default_branch_name } + + %h5= _('Push an existing Git repository') + %pre.bg-light + :preserve + cd existing_repo + git remote rename origin old-origin + git remote add origin #{ content_tag(:span, default_url_to_repo, class: 'js-clone')} + - if @project.can_current_user_push_to_default_branch? + %span>< + git push --set-upstream origin --all + git push --set-upstream origin --tags diff --git a/app/views/projects/find_file/show.html.haml b/app/views/projects/find_file/show.html.haml index 997e7b7f24d..4f7fed2ac2c 100644 --- a/app/views/projects/find_file/show.html.haml +++ b/app/views/projects/find_file/show.html.haml @@ -6,7 +6,7 @@ - blob_path = project_blob_path(@project, @ref) .file-finder-holder.tree-holder.clearfix.js-file-finder.gl-pt-4{ data: { file_find_url: "#{escape_javascript(project_files_path(@project, @ref, ref_type: @ref_type, format: :json))}", find_tree_url: escape_javascript(tree_path), blob_url_template: escape_javascript(blob_path), ref_type: @ref_type } } .nav-block.gl-xs-mr-0 - .tree-ref-holder.gl-xs-mb-3.gl-max-w-26 + .tree-ref-holder.gl-mb-3.gl-sm-mb-0.gl-max-w-26 #js-blob-ref-switcher{ data: { project_id: @project.id, ref: @ref, ref_type: @ref_type, namespace: "/-/find_file" } } %ul.breadcrumb.repo-breadcrumb.gl-flex-nowrap %li.breadcrumb-item.gl-white-space-nowrap diff --git a/app/views/projects/forks/index.html.haml b/app/views/projects/forks/index.html.haml index fe7d2c9d198..98055534a27 100644 --- a/app/views/projects/forks/index.html.haml +++ b/app/views/projects/forks/index.html.haml @@ -1,3 +1,4 @@ +- page_title _("Forks") - sort_value = @sort || sort_value_recently_created - excluded_filters = [:state, :scope, :label_name, :milestone_id, :assignee_id, :author_id] - created_at = { value: sort_value_created_date, text: sort_title_created_date, href: page_filter_path(sort: sort_value_recently_created, without: excluded_filters) } diff --git a/app/views/projects/gcp/artifact_registry/docker_images/_docker_image.html.haml b/app/views/projects/gcp/artifact_registry/docker_images/_docker_image.html.haml new file mode 100644 index 00000000000..0118fe94810 --- /dev/null +++ b/app/views/projects/gcp/artifact_registry/docker_images/_docker_image.html.haml @@ -0,0 +1,33 @@ +.gl-display-flex.gl-flex-direction-column + .gl-display-flex.gl-flex-direction-column.gl-border-b-solid.gl-border-t-solid.gl-border-t-1.gl-border-b-1.gl-border-t-transparent.gl-border-b-gray-100 + .gl-display-flex.gl-align-items-center.gl-py-3 + .gl-display-flex.gl-flex-direction-column.gl-sm-flex-direction-row.gl-justify-content-space-between.gl-align-items-stretch.gl-flex-grow-1 + .gl-display-flex.gl-flex-direction-column.gl-mb-3.gl-sm-mb-0.gl-min-w-0.gl-flex-grow-1 + .gl-display-flex.gl-align-items-center.gl-text-body.gl-font-weight-bold.gl-font-size-h2 + %span.gl-text-body.gl-font-weight-bold= docker_image.short_name + .gl-bg-gray-50.gl-inset-border-1-gray-100.gl-rounded-base.gl-pt-6 + .gl-display-flex.gl-align-items-top.gl-font-monospace.gl-font-sm.gl-word-break-all.gl-p-4.gl-border-b-solid.gl-border-gray-100.gl-border-b-1 + = sprite_icon('information-o', css_class: 'gl-text-gray-500 gl-mr-3 gl-icon s16') + Full name: #{docker_image.name} + .gl-display-flex.gl-align-items-top.gl-font-monospace.gl-font-sm.gl-word-break-all.gl-p-4.gl-border-b-solid.gl-border-gray-100.gl-border-b-1 + = sprite_icon('earth', css_class: 'gl-text-gray-500 gl-mr-3 gl-icon s16') + URI: + %a{ href: docker_image.uri, target: 'blank', rel: 'noopener noreferrer' }= docker_image.uri + .gl-display-flex.gl-align-items-top.gl-font-monospace.gl-font-sm.gl-word-break-all.gl-p-4.gl-border-b-solid.gl-border-gray-100.gl-border-b-1 + = sprite_icon('doc-code', css_class: 'gl-text-gray-500 gl-mr-3 gl-icon s16') + Media Type: #{docker_image.media_type} + .gl-display-flex.gl-align-items-top.gl-font-monospace.gl-font-sm.gl-word-break-all.gl-p-4.gl-border-b-solid.gl-border-gray-100.gl-border-b-1 + = sprite_icon('archive', css_class: 'gl-text-gray-500 gl-mr-3 gl-icon s16') + Size: #{number_to_human_size(docker_image.image_size_bytes)} + .gl-display-flex.gl-align-items-top.gl-font-monospace.gl-font-sm.gl-word-break-all.gl-p-4.gl-border-b-solid.gl-border-gray-100.gl-border-b-1 + = sprite_icon('calendar', css_class: 'gl-text-gray-500 gl-mr-3 gl-icon s16') + Built at: #{docker_image.built_at&.to_fs} + .gl-display-flex.gl-align-items-top.gl-font-monospace.gl-font-sm.gl-word-break-all.gl-p-4.gl-border-b-solid.gl-border-gray-100.gl-border-b-1 + = sprite_icon('calendar', css_class: 'gl-text-gray-500 gl-mr-3 gl-icon s16') + Uploaded at: #{docker_image.uploaded_at&.to_fs} + .gl-display-flex.gl-align-items-top.gl-font-monospace.gl-font-sm.gl-word-break-all.gl-p-4.gl-border-b-solid.gl-border-gray-100.gl-border-b-1 + = sprite_icon('calendar', css_class: 'gl-text-gray-500 gl-mr-3 gl-icon s16') + Updated at: #{docker_image.updated_at&.to_fs} + - if docker_image.tags.present? + .gl-display-flex.gl-align-items-center.gl-text-gray-500.gl-min-h-6.gl-min-w-0.gl-flex-grow-1.gl-pt-4 + = render partial: 'docker_image_tag', collection: docker_image.tags diff --git a/app/views/projects/gcp/artifact_registry/docker_images/_docker_image_tag.html.haml b/app/views/projects/gcp/artifact_registry/docker_images/_docker_image_tag.html.haml new file mode 100644 index 00000000000..a030cd7d634 --- /dev/null +++ b/app/views/projects/gcp/artifact_registry/docker_images/_docker_image_tag.html.haml @@ -0,0 +1 @@ +%a.gl-button.btn.btn-md.btn-default.gl-mr-3!= docker_image_tag diff --git a/app/views/projects/gcp/artifact_registry/docker_images/_pagination.html.haml b/app/views/projects/gcp/artifact_registry/docker_images/_pagination.html.haml new file mode 100644 index 00000000000..df98ba8d68e --- /dev/null +++ b/app/views/projects/gcp/artifact_registry/docker_images/_pagination.html.haml @@ -0,0 +1,13 @@ +.gl-display-flex.gl-justify-content-center + %nav.gl-pagination.gl-mt-3 + .gl-keyset-pagination.btn-group + - if @page > 1 + = link_to 'Prev', namespace_project_gcp_artifact_registry_docker_images_path(params[:namespace_id], params[:project_id], page_token: @previous_page_token, page_tokens: @page_tokens, page: @page - 1, gcp_project_id: params[:gcp_project_id], gcp_location: params[:gcp_location], gcp_ar_repository: params[:gcp_ar_repository], gcp_wlif_url: params[:gcp_wlif_url]), class: 'btn btn-default btn-md gl-button' + - else + %span.btn.btn-default.btn-md.gl-button.disabled= 'Prev' + - if @next_page_token.present? + = link_to 'Next', namespace_project_gcp_artifact_registry_docker_images_path(params[:namespace_id], params[:project_id], page_token: @next_page_token, page_tokens: @page_tokens, page: @page + 1, gcp_project_id: params[:gcp_project_id], gcp_location: params[:gcp_location], gcp_ar_repository: params[:gcp_ar_repository], gcp_wlif_url: params[:gcp_wlif_url]), class: 'btn btn-default btn-md gl-button' + - else + %span.btn.btn-default.btn-md.gl-button.disabled= 'Next' + + diff --git a/app/views/projects/gcp/artifact_registry/docker_images/index.html.haml b/app/views/projects/gcp/artifact_registry/docker_images/index.html.haml new file mode 100644 index 00000000000..b487a175691 --- /dev/null +++ b/app/views/projects/gcp/artifact_registry/docker_images/index.html.haml @@ -0,0 +1,23 @@ +- page_title 'Artifact Registry Docker Images' + +- unless @error + .gl-display-flex.gl-flex-direction-column + .gl-display-flex.gl-justify-content-space-between.gl-py-3 + .gl-flex-direction-column.gl-flex-grow-1 + .gl-display-flex + .gl-display-flex.gl-flex-direction-column + %h2.gl-font-size-h1.gl-mt-3.gl-mb-0 Docker Images of #{@artifact_repository_name} + = render partial: 'pagination' + = render partial: 'docker_image', collection: @docker_images + = render partial: 'pagination' +- else + .flash-container.flash-container-page.sticky + .gl-alert.flash-notice.gl-alert-info + .gl-alert-icon-container + = sprite_icon('information-o', css_class: 's16 gl-alert-icon gl-alert-icon-no-title') + .gl-alert-content + .gl-alert-body + - if @error + = @error + - else + Nothing to show here. diff --git a/app/views/projects/gcp/artifact_registry/setup/new.html.haml b/app/views/projects/gcp/artifact_registry/setup/new.html.haml new file mode 100644 index 00000000000..39ce0093372 --- /dev/null +++ b/app/views/projects/gcp/artifact_registry/setup/new.html.haml @@ -0,0 +1,31 @@ +- page_title 'Artifact Registry Setup' + +- if @error.present? + .flash-container.flash-container-page.sticky + .gl-alert.flash-notice.gl-alert-info + .gl-alert-icon-container + = sprite_icon('information-o', css_class: 's16 gl-alert-icon gl-alert-icon-no-title') + .gl-alert-content + .gl-alert-body= @error +- else + %p + + = form_tag namespace_project_gcp_artifact_registry_docker_images_path , method: :get do + .form-group.row + = label_tag :gcp_project_id, 'Google Project ID', class: 'col-form-label col-md-2' + .col-md-4 + = text_field_tag :gcp_project_id, nil, class: 'form-control gl-form-input gl-mr-3' + .form-group.row + = label_tag :gcp_location, 'Google Project Location', class: 'col-form-label col-md-2' + .col-md-4 + = text_field_tag :gcp_location, nil, class: 'form-control gl-form-input gl-mr-3' + .form-group.row + = label_tag :gcp_ar_repository, 'Artifact Registry Repository Name', class: 'col-form-label col-md-2' + .col-md-4 + = text_field_tag :gcp_ar_repository, nil, class: 'form-control gl-form-input gl-mr-3' + .form-group.row + = label_tag :gcp_wlif_url, 'Worflow Identity Federation url', class: 'col-form-label col-md-2' + .col-md-4 + = text_field_tag :gcp_wlif_url, nil, class: 'form-control gl-form-input gl-mr-3' + .form-actions + = submit_tag 'Setup', class: 'gl-button btn btn-confirm' diff --git a/app/views/projects/graphs/show.html.haml b/app/views/projects/graphs/show.html.haml index 9d6f67bd190..97909dc8c18 100644 --- a/app/views/projects/graphs/show.html.haml +++ b/app/views/projects/graphs/show.html.haml @@ -1,4 +1,4 @@ -- page_title _('Contributor statistics') +- page_title _('Contributor analytics') - graph_path = project_graph_path(@project, current_ref, ref_type: @ref_type, format: :json) - commits_path = project_commits_path(@project, current_ref, ref_type: @ref_type) diff --git a/app/views/projects/integrations/shimos/show.html.haml b/app/views/projects/integrations/shimos/show.html.haml deleted file mode 100644 index 165e414f75b..00000000000 --- a/app/views/projects/integrations/shimos/show.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -- breadcrumb_title s_('Shimo|Shimo Workspace') -- page_title s_('Shimo|Shimo Workspace') -- add_page_specific_style 'page_bundles/wiki' -= render layout: 'shared/empty_states/wikis_layout', locals: { image_path: 'illustrations/empty-state/empty-wiki-md.svg' } do - %h4 - = s_('Shimo|Shimo Workspace integration is enabled') - %p - = s_("Shimo|You've enabled the Shimo Workspace integration. You can view your wiki directly in Shimo.") - = link_button_to @project.shimo_integration.external_wiki_url, target: '_blank', rel: 'noopener noreferrer', title: s_('Shimo|Go to Shimo Workspace'), variant: :confirm do - = s_('Shimo|Go to Shimo Workspace') diff --git a/app/views/projects/issues/service_desk/_alert_moved_from_service_desk.html.haml b/app/views/projects/issues/service_desk/_alert_moved_from_service_desk.html.haml index b087a1d0151..3af8bbafa0f 100644 --- a/app/views/projects/issues/service_desk/_alert_moved_from_service_desk.html.haml +++ b/app/views/projects/issues/service_desk/_alert_moved_from_service_desk.html.haml @@ -1,5 +1,5 @@ - return unless show_moved_service_desk_issue_warning?(issue) -- service_desk_link_url = help_page_path('user/project/service_desk') +- service_desk_link_url = help_page_path('user/project/service_desk/index') - service_desk_link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: service_desk_link_url } = render Pajamas::AlertComponent.new(variant: :warning, diff --git a/app/views/projects/issues/service_desk/_service_desk_empty_state.html.haml b/app/views/projects/issues/service_desk/_service_desk_empty_state.html.haml index 831bd107961..919810413cd 100644 --- a/app/views/projects/issues/service_desk/_service_desk_empty_state.html.haml +++ b/app/views/projects/issues/service_desk/_service_desk_empty_state.html.haml @@ -17,7 +17,7 @@ %code= @project.service_desk_address %span= s_("ServiceDesk|Issues created from Service Desk emails will appear here. Each comment becomes part of the email conversation.") - = link_to _('Learn more.'), help_page_path('user/project/service_desk') + = link_to _('Learn more.'), help_page_path('user/project/service_desk/index') - if can_edit_project_settings && !service_desk_enabled .text-center diff --git a/app/views/projects/issues/service_desk/_service_desk_info_content.html.haml b/app/views/projects/issues/service_desk/_service_desk_info_content.html.haml index 093a47e63be..97bfb2f9f62 100644 --- a/app/views/projects/issues/service_desk/_service_desk_info_content.html.haml +++ b/app/views/projects/issues/service_desk/_service_desk_info_content.html.haml @@ -17,7 +17,7 @@ %code= @project.service_desk_address %span= s_("ServiceDesk|Issues created from Service Desk emails will appear here. Each comment becomes part of the email conversation.") - = link_to _('Learn more.'), help_page_path('user/project/service_desk') + = link_to _('Learn more.'), help_page_path('user/project/service_desk/index') - if can_edit_project_settings && !service_desk_enabled .gl-mt-3 diff --git a/app/views/projects/merge_requests/_widget.html.haml b/app/views/projects/merge_requests/_widget.html.haml index 9ec4363fa9a..721446eb017 100644 --- a/app/views/projects/merge_requests/_widget.html.haml +++ b/app/views/projects/merge_requests/_widget.html.haml @@ -22,6 +22,7 @@ window.gl.mrWidgetData.can_view_false_positive = '#{@merge_request.project.licensed_feature_available?(:sast_fp_reduction).to_s}'; window.gl.mrWidgetData.user_preferences_gitpod_path = '#{profile_preferences_path(anchor: 'user_gitpod_enabled')}'; window.gl.mrWidgetData.user_profile_enable_gitpod_path = '#{profile_path(user: { gitpod_enabled: true })}'; + window.gl.mrWidgetData.saml_approval_path = window.gl.mrWidgetData.saml_approval_path %h2#merge-request-widgets-heading.gl-sr-only = _("Merge request reports") diff --git a/app/views/projects/missing_default_branch.html.haml b/app/views/projects/missing_default_branch.html.haml new file mode 100644 index 00000000000..66a466d8890 --- /dev/null +++ b/app/views/projects/missing_default_branch.html.haml @@ -0,0 +1,10 @@ +- @skip_current_level_breadcrumb = true + += render Pajamas::AlertComponent.new(alert_options: { class: 'gl-my-5' }, + variant: :danger, + dismissible: false, + title: s_('ProjectPage|Unable to load default branch')) do |c| + - c.with_body do + = s_('ProjectPage|The default branch was not able to be found. Please contact your administrator.') + += render 'home_panel' diff --git a/app/views/projects/ml/candidates/show.html.haml b/app/views/projects/ml/candidates/show.html.haml index 979bc107fd2..41b29d3c0b8 100644 --- a/app/views/projects/ml/candidates/show.html.haml +++ b/app/views/projects/ml/candidates/show.html.haml @@ -3,6 +3,6 @@ - add_to_breadcrumbs experiment.name, project_ml_experiment_path(@project, experiment.iid) - breadcrumb_title "Candidate #{@candidate.iid}" - add_page_specific_style 'page_bundles/ml_experiment_tracking' -- presenter = ::Ml::CandidateDetailsPresenter.new(@candidate, @include_ci_info) +- presenter = ::Ml::CandidateDetailsPresenter.new(@candidate, current_user) -#js-show-ml-candidate{ data: { view_model: presenter.present } } +#js-show-ml-candidate{ data: { view_model: presenter.present_as_json } } diff --git a/app/views/projects/ml/model_versions/show.html.haml b/app/views/projects/ml/model_versions/show.html.haml index 0b3d5462a89..1b4bdd29842 100644 --- a/app/views/projects/ml/model_versions/show.html.haml +++ b/app/views/projects/ml/model_versions/show.html.haml @@ -3,4 +3,4 @@ - breadcrumb_title @model_version.version - page_title "#{@model_version.name} / #{@model_version.version}" -= render(Projects::Ml::ShowMlModelVersionComponent.new(model_version: @model_version)) += render(Projects::Ml::ShowMlModelVersionComponent.new(model_version: @model_version, current_user: current_user)) diff --git a/app/views/projects/ml/models/show.html.haml b/app/views/projects/ml/models/show.html.haml index be611e55304..e0067143450 100644 --- a/app/views/projects/ml/models/show.html.haml +++ b/app/views/projects/ml/models/show.html.haml @@ -2,4 +2,4 @@ - breadcrumb_title @model.name - page_title @model.name -= render(Projects::Ml::ShowMlModelComponent.new(model: @model)) += render(Projects::Ml::ShowMlModelComponent.new(model: @model, current_user: current_user)) diff --git a/app/views/projects/pages/_access.html.haml b/app/views/projects/pages/_access.html.haml index 1e18e528665..53a4fb4389c 100644 --- a/app/views/projects/pages/_access.html.haml +++ b/app/views/projects/pages/_access.html.haml @@ -1,12 +1,15 @@ - if @project.pages_deployed? - pages_url = build_pages_url(@project, with_unique_domain: true) + - pages_url_text = pages_url + - if Gitlab.config.pages.namespace_in_path + - pages_url_text = "#{pages_url} (Experimental)" = render Pajamas::CardComponent.new(card_options: { class: 'gl-mb-5', data: { testid: 'access-page-container' } }, footer_options: { class: 'gl-alert-warning' }) do |c| - c.with_header do = s_('GitLabPages|Access pages') - c.with_body do %p - = external_link(pages_url, pages_url) + = external_link(pages_url_text, pages_url) - @project.pages_domains.each do |domain| %p diff --git a/app/views/projects/pages/_pages_settings.html.haml b/app/views/projects/pages/_pages_settings.html.haml index 1aa8148dfed..4c18609ad59 100644 --- a/app/views/projects/pages/_pages_settings.html.haml +++ b/app/views/projects/pages/_pages_settings.html.haml @@ -24,10 +24,12 @@ .form-group = f.fields_for :project_setting do |settings| = settings.gitlab_ui_checkbox_component :pages_multiple_versions_enabled, - s_('GitLabPages|Use multiple versions'), + s_('GitLabPages|Use multiple deployments'), label_options: { class: 'label-bold' } %p.gl-pl-6 - = s_("GitLabPages|When enabled, you can create multiple versions of your pages site.").html_safe + = safe_format(s_("GitLabPages|When enabled, you can create multiple deployments of your pages site. %{docs_link_start}Learn More.%{link_end}"), + tag_pair(tag.a(href: help_page_path('user/project/pages/index', anchor: 'create-multiple-deployments'), target: '_blank'), + :docs_link_start, :link_end)) .gl-mt-3 = f.submit s_('GitLabPages|Save changes'), pajamas_button: true diff --git a/app/views/projects/pipelines/charts.html.haml b/app/views/projects/pipelines/charts.html.haml index c3d6d0c5971..818184903d6 100644 --- a/app/views/projects/pipelines/charts.html.haml +++ b/app/views/projects/pipelines/charts.html.haml @@ -7,5 +7,5 @@ failed_pipelines_link: project_pipelines_path(@project, page: '1', scope: 'all', status: 'failed'), coverage_chart_path: charts_project_graph_path(@project, @project.default_branch), test_runs_empty_state_image_path: image_path('illustrations/pipeline.svg'), - project_quality_summary_feedback_image_path: image_path('illustrations/chat-bubble-sm.svg'), + project_quality_summary_feedback_image_path: image_path('illustrations/chat-sm.svg'), default_branch: @project.default_branch } } diff --git a/app/views/projects/settings/_archive.html.haml b/app/views/projects/settings/_archive.html.haml index dcb37541a04..10ba19591fe 100644 --- a/app/views/projects/settings/_archive.html.haml +++ b/app/views/projects/settings/_archive.html.haml @@ -1,6 +1,6 @@ - return unless can?(current_user, :archive_project, @project) -= render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card', data: { qa_selector: 'export_project_content' } }, header_options: { class: 'gl-new-card-header gl-flex-direction-column' }, body_options: { class: 'gl-new-card-body gl-px-5 gl-py-4' }) do |c| += render Pajamas::CardComponent.new(card_options: { class: 'gl-new-card' }, header_options: { class: 'gl-new-card-header gl-flex-direction-column' }, body_options: { class: 'gl-new-card-body gl-px-5 gl-py-4' }) do |c| - c.with_header do .gl-new-card-title-wrapper %h4.gl-new-card-title.warning-title @@ -11,12 +11,12 @@ - c.with_body do - if @project.archived? - - link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/project/settings/index', anchor: 'unarchive-a-project') } + - link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/project/settings/migrate_projects', anchor: 'unarchive-a-project') } %p= _("Unarchiving the project restores its members' ability to make commits, and create issues, comments, and other entities. %{strong_start}After you unarchive the project, it displays in the search and on the dashboard.%{strong_end} %{link_start}Learn more.%{link_end}").html_safe % { strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe, link_start: link_start, link_end: '</a>'.html_safe } = render Pajamas::ButtonComponent.new(method: :post, href: unarchive_project_path(@project), variant: :confirm, button_options: { aria: { label: _('Unarchive project') }, data: { confirm: _("Are you sure that you want to unarchive this project?"), testid: 'unarchive-project-link' } }) do = _('Unarchive project') - else - - link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/project/settings/index', anchor: 'archive-a-project') } + - link_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: help_page_path('user/project/settings/migrate_projects', anchor: 'archive-a-project') } %p= _("Archiving the project makes it entirely read-only. It is hidden from the dashboard and doesn't display in searches. %{strong_start}The repository cannot be committed to, and no issues, comments, or other entities can be created.%{strong_end} %{link_start}Learn more.%{link_end}").html_safe % { strong_start: '<strong>'.html_safe, strong_end: '</strong>'.html_safe, link_start: link_start, link_end: '</a>'.html_safe } = render Pajamas::ButtonComponent.new(method: :post, href: archive_project_path(@project), variant: :confirm, button_options: { aria: { label: _('Archive project') }, data: { confirm: _("Are you sure that you want to archive this project?"), testid: 'archive-project-link', 'confirm-btn-variant': 'confirm' } }) do = _('Archive project') diff --git a/app/views/projects/settings/ci_cd/_autodevops_form.html.haml b/app/views/projects/settings/ci_cd/_autodevops_form.html.haml index 7011595e075..f674bf3b43b 100644 --- a/app/views/projects/settings/ci_cd/_autodevops_form.html.haml +++ b/app/views/projects/settings/ci_cd/_autodevops_form.html.haml @@ -26,7 +26,7 @@ - auto_devops_badge = auto_devops_enabled ? (gl_badge_tag badge_for_auto_devops_scope(@project), { variant: :info }, { class: 'js-instance-default-badge gl-ml-3 gl-mt-n1'}) : '' = form.gitlab_ui_checkbox_component :enabled, (s_('CICD|Default to Auto DevOps pipeline') + auto_devops_badge).html_safe, - checkbox_options: { class: 'js-toggle-extra-settings', checked: auto_devops_enabled, data: { qa_selector: 'enable_autodevops_checkbox' } }, + checkbox_options: { class: 'js-toggle-extra-settings', checked: auto_devops_enabled, data: { testid: 'enable-autodevops-checkbox' } }, help_text: (s_('CICD|The Auto DevOps pipeline runs if no alternative CI configuration file is found.') + ' ' + autodevops_help_link).html_safe - c.with_footer do - if @project.all_clusters.empty? @@ -41,4 +41,4 @@ = form.gitlab_ui_radio_component :deploy_strategy, 'timed_incremental', (s_('CICD|Continuous deployment to production using timed incremental rollout') + ' ' + help_link_timed).html_safe = form.gitlab_ui_radio_component :deploy_strategy, 'manual', (s_('CICD|Automatic deployment to staging, manual deployment to production') + ' ' + help_link_incremental).html_safe - = f.submit _('Save changes'), class: "gl-mt-5", data: { qa_selector: 'save_changes_button' }, pajamas_button: true + = f.submit _('Save changes'), class: "gl-mt-5", data: { testid: 'save-changes-button' }, pajamas_button: true diff --git a/app/views/projects/settings/ci_cd/_form.html.haml b/app/views/projects/settings/ci_cd/_form.html.haml index d51acc5e708..0efd55f2e50 100644 --- a/app/views/projects/settings/ci_cd/_form.html.haml +++ b/app/views/projects/settings/ci_cd/_form.html.haml @@ -36,6 +36,8 @@ s_("CICD|Use separate caches for protected branches"), help_text: (s_('CICD|Unprotected branches will not have access to the cache from protected branches.') + ' ' + help_link_separated_caches).html_safe + = render_if_exists 'projects/settings/ci_cd/pipeline_cancelation', form: f + .form-group = f.label :ci_config_path, _('CI/CD configuration file'), class: 'label-bold' = f.text_field :ci_config_path, class: 'form-control', placeholder: '.gitlab-ci.yml' diff --git a/app/views/projects/settings/ci_cd/show.html.haml b/app/views/projects/settings/ci_cd/show.html.haml index 17953e3bc14..ab052a73ce0 100644 --- a/app/views/projects/settings/ci_cd/show.html.haml +++ b/app/views/projects/settings/ci_cd/show.html.haml @@ -16,7 +16,7 @@ .settings-content = render 'form' -%section.settings#autodevops-settings.no-animate{ class: ('expanded' if expanded), data: { qa_selector: 'autodevops_settings_content' } } +%section.settings#autodevops-settings.no-animate{ class: ('expanded' if expanded), data: { testid: 'autodevops-settings-content' } } .settings-header %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only = s_('CICD|Auto DevOps') @@ -34,7 +34,7 @@ = render_if_exists 'projects/settings/ci_cd/protected_environments', expanded: expanded - expand_runners = expanded || params[:expand_runners] -%section.settings.no-animate#js-runners-settings{ class: ('expanded' if expand_runners), data: { qa_selector: 'runners_settings_content' } } +%section.settings.no-animate#js-runners-settings{ class: ('expanded' if expand_runners), data: { testid: 'runners-settings-content' } } .settings-header %h4.settings-title.js-settings-toggle.js-settings-toggle-trigger-only = _("Runners") @@ -58,7 +58,7 @@ .settings-content #js-artifacts-settings-app{ data: { full_path: @project.full_path, help_page_path: help_page_path('ci/jobs/job_artifacts', anchor: 'keep-artifacts-from-most-recent-successful-jobs') } } -%section.settings.no-animate#js-cicd-variables-settings{ class: ('expanded' if expanded), data: { qa_selector: 'variables_settings_content' } } +%section.settings.no-animate#js-cicd-variables-settings{ class: ('expanded' if expanded), data: { testid: 'variables-settings-content' } } .settings-header = render 'ci/variables/header', expanded: expanded .settings-content diff --git a/app/views/projects/settings/packages_and_registries/show.html.haml b/app/views/projects/settings/packages_and_registries/show.html.haml index 6f38a3ace92..d6c2228a6c2 100644 --- a/app/views/projects/settings/packages_and_registries/show.html.haml +++ b/app/views/projects/settings/packages_and_registries/show.html.haml @@ -2,4 +2,4 @@ - page_title _('Packages and registries settings') - @force_desktop_expanded_sidebar = true -#js-registry-settings{ data: settings_data } +#js-registry-settings{ data: settings_data(@project) } diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index c76fa5e2220..26ef47e9a7a 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -15,15 +15,35 @@ = render "home_panel" -- if can?(current_user, :read_code, @project) && @project.repository_languages.present? - - add_page_startup_graphql_call('repository/path_last_commit', { projectPath: @project.full_path, ref: current_ref, path: current_route_path || "" }) - = repository_languages_bar(@project.repository_languages) +- if Feature.enabled?(:project_overview_reorg) + .project-page-indicator.js-show-on-project-root -= render "archived_notice", project: @project -= render_if_exists "projects/marked_for_deletion_notice", project: @project -= render_if_exists "projects/ancestor_group_marked_for_deletion_notice", project: @project + .project-page-layout + .project-page-layout-sidebar.js-show-on-project-root.gl-mt-5 + = render "sidebar" -- view_path = @project.default_view + .project-page-layout-content + - if can?(current_user, :read_code, @project) && @project.repository_languages.present? + - add_page_startup_graphql_call('repository/path_last_commit', { projectPath: @project.full_path, ref: current_ref, path: current_route_path || "" }) -%div{ class: project_child_container_class(view_path) } - = render view_path, is_project_overview: true + = render "archived_notice", project: @project + = render_if_exists "projects/marked_for_deletion_notice", project: @project + = render_if_exists "projects/ancestor_group_marked_for_deletion_notice", project: @project + + - view_path = @project.default_view + + %div{ class: project_child_container_class(view_path) } + = render view_path, is_project_overview: true +- else + - if can?(current_user, :read_code, @project) && @project.repository_languages.present? + - add_page_startup_graphql_call('repository/path_last_commit', { projectPath: @project.full_path, ref: current_ref, path: current_route_path || "" }) + = repository_languages_bar(@project.repository_languages) + + = render "archived_notice", project: @project + = render_if_exists "projects/marked_for_deletion_notice", project: @project + = render_if_exists "projects/ancestor_group_marked_for_deletion_notice", project: @project + + - view_path = @project.default_view + + %div{ class: project_child_container_class(view_path) } + = render view_path, is_project_overview: true diff --git a/app/views/projects/snippets/show.html.haml b/app/views/projects/snippets/show.html.haml index 7ff798d7324..da7afad041b 100644 --- a/app/views/projects/snippets/show.html.haml +++ b/app/views/projects/snippets/show.html.haml @@ -1,4 +1,3 @@ -- @content_class = "limit-container-width limited-inner-width-container" unless fluid_layout - add_to_breadcrumbs _("Snippets"), project_snippets_path(@project) - breadcrumb_title @snippet.to_reference - page_title "#{@snippet.title} (#{@snippet.to_reference})", _("Snippets") diff --git a/app/views/projects/starrers/_starrer.html.haml b/app/views/projects/starrers/_starrer.html.haml index 16ae003255c..68d283b70ad 100644 --- a/app/views/projects/starrers/_starrer.html.haml +++ b/app/views/projects/starrers/_starrer.html.haml @@ -1,11 +1,11 @@ - starrer = local_assigns.fetch(:starrer) .col-lg-3.col-md-4.col-sm-12 - = render Pajamas::CardComponent.new(body_options: { class: 'gl-display-flex' }) do |c| + = render Pajamas::CardComponent.new(card_options: { class: 'gl-mb-4' }, body_options: { class: 'gl-display-flex' }) do |c| - c.with_body do = render Pajamas::AvatarComponent.new(starrer.user, size: 48, alt: "", class: 'gl-mr-3') - .user-info + .user-info.gl-overflow-hidden .block-truncated = link_to starrer.user.name, user_path(starrer.user), class: 'user js-user-link', data: { user_id: starrer.user.id } @@ -15,5 +15,5 @@ - if starrer.user == current_user = gl_badge_tag _("It's you"), variant: :success, size: :sm, class: 'gl-ml-2' - .block-truncated + .block-truncated.gl-text-secondary.gl-font-sm = time_ago_with_tooltip(starrer.starred_since) diff --git a/app/views/projects/starrers/index.html.haml b/app/views/projects/starrers/index.html.haml index 2d5581fc1c5..38455f1022d 100644 --- a/app/views/projects/starrers/index.html.haml +++ b/app/views/projects/starrers/index.html.haml @@ -10,8 +10,8 @@ = form_tag request.original_url, method: :get, class: 'form-inline user-search-form flex-users-form' do .form-group .position-relative - = search_field_tag :search, params[:search], { placeholder: _('Search'), class: 'form-control', spellcheck: false } - %button.user-search-btn{ type: "submit", "aria-label" => _("Submit search") } + = search_field_tag :search, params[:search], { placeholder: _('Search'), class: 'form-control gl-pr-7', spellcheck: false } + %button.user-search-btn{ class: 'gl-p-2 gl-absolute gl-right-3', type: "submit", "aria-label" => _("Submit search") } = sprite_icon('search') - starrers_sort_options = starrers_sort_options_hash.map { |value, text| { value: value, text: text, href: filter_starrer_path(sort: value) } } = gl_redirect_listbox_tag starrers_sort_options, @sort, class: 'gl-ml-3', data: { placement: 'right' } diff --git a/app/views/projects/tags/index.html.haml b/app/views/projects/tags/index.html.haml index b0be748eb36..842e0744d4e 100644 --- a/app/views/projects/tags/index.html.haml +++ b/app/views/projects/tags/index.html.haml @@ -11,7 +11,7 @@ #js-tags-sort-dropdown{ data: { filter_tags_path: filter_tags_path(search: @search, sort: @sort), sort_options: tags_sort_options_hash.to_json } } = link_button_to nil, project_tags_path(@project, rss_url_options), title: _("Tags feed"), class: 'has-tooltip gl-ml-auto', icon: 'rss' - if can?(current_user, :admin_tag, @project) - = link_button_to new_project_tag_path(@project), data: { qa_selector: "new_tag_button" }, variant: :confirm do + = link_button_to new_project_tag_path(@project), data: { testid: "new-tag-button" }, variant: :confirm do = s_('TagsPage|New tag') = render_if_exists 'projects/commits/mirror_status' diff --git a/app/views/projects/tags/new.html.haml b/app/views/projects/tags/new.html.haml index 281eac6c773..9e5dd2cfb6d 100644 --- a/app/views/projects/tags/new.html.haml +++ b/app/views/projects/tags/new.html.haml @@ -18,7 +18,7 @@ .form-group.row .col-sm-12 = label_tag :tag_name, _('Tag name') - = text_field_tag :tag_name, params[:tag_name], required: true, autofocus: true, class: 'form-control', data: { qa_selector: "tag_name_field" } + = text_field_tag :tag_name, params[:tag_name], required: true, autofocus: true, class: 'form-control', data: { testid: 'tag-name-field' } .form-group.row .col-sm-auto.create-from = label_tag :ref, _('Create from') @@ -28,12 +28,12 @@ .form-group.row .col-sm-12 = label_tag :message, _('Message') - = text_area_tag :message, @message, required: false, class: 'form-control', rows: 5, data: { qa_selector: "tag_message_field" } + = text_area_tag :message, @message, required: false, class: 'form-control', rows: 5, data: { testid: 'tag-message-field' } .form-text.text-muted = tag_description_help_text .gl-display-flex - = render Pajamas::ButtonComponent.new(variant: :confirm, button_options: { class: 'gl-mr-3', data: { qa_selector: "create_tag_button" }, type: 'submit' }) do + = render Pajamas::ButtonComponent.new(variant: :confirm, button_options: { class: 'gl-mr-3', data: { testid: 'create-tag-button' }, type: 'submit' }) do = s_('TagsPage|Create tag') = render Pajamas::ButtonComponent.new(href: project_tags_path(@project)) do = s_('TagsPage|Cancel') diff --git a/app/views/projects/tags/show.html.haml b/app/views/projects/tags/show.html.haml index 1649e56043e..d76627f3337 100644 --- a/app/views/projects/tags/show.html.haml +++ b/app/views/projects/tags/show.html.haml @@ -9,7 +9,7 @@ .top-area.multi-line.flex-wrap .nav-text .title - %span.item-title.ref-name{ data: { qa_selector: 'tag_name_content' } } + %span.item-title.ref-name{ data: { testid: 'tag-name-content' } } = sprite_icon('tag') = @tag.name - if protected_tag?(@project, @tag) @@ -52,7 +52,7 @@ = render 'projects/buttons/remove_tag', project: @project, tag: @tag - if @tag.message.present? - %pre.wrap{ data: { qa_selector: 'tag_message_content' } } + %pre.wrap{ data: { testid: 'tag-message-content' } } = strip_signature(@tag.message) - if can?(current_user, :admin_tag, @project) diff --git a/app/views/projects/tree/_tree_header.html.haml b/app/views/projects/tree/_tree_header.html.haml index bed37d9cb63..0da6017419c 100644 --- a/app/views/projects/tree/_tree_header.html.haml +++ b/app/views/projects/tree/_tree_header.html.haml @@ -8,18 +8,18 @@ #js-blob-controls .tree-controls - .d-block.d-sm-flex.flex-wrap.align-items-start.gl-children-ml-sm-3.gl-first-child-ml-sm-0< + .gl-display-flex.gl-flex-wrap.gl-gap-3.gl-mb-3.gl-sm-mb-0 = render_if_exists 'projects/tree/lock_link' = render 'projects/buttons/compare', project: @project, ref: @ref, root_ref: @repository&.root_ref #js-tree-history-link{ data: { history_link: project_commits_path(@project, @ref) } } = render 'projects/find_file_link' - = render 'shared/web_ide_button', blob: nil - = render 'projects/buttons/download', project: @project, ref: @ref + = render 'shared/web_ide_button', blob: nil, css_classes: 'gl-w-full gl-sm-w-auto' - .project-clone-holder.d-none.d-md-inline-block> - = render "projects/buttons/clone", dropdown_class: 'dropdown-menu-right' + .project-code-holder.d-none.d-sm-inline-block + = render "projects/buttons/code", dropdown_class: 'dropdown-menu-right', ref: @ref - .project-clone-holder.d-block.d-md-none.mt-sm-2.mt-md-0.ml-md-2> - = render "shared/mobile_clone_panel" + .project-code-holder.gl-display-flex.gl-gap-3{ class: 'gl-sm-display-none!' } + = render 'projects/buttons/download', project: @project, ref: @ref + = render "shared/mobile_clone_panel", ref: @ref |