diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index aedb7df9e4f..7970151d603 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -336,7 +336,7 @@ module SearchHelper link_to search_path(search_params) do concat label concat ' ' - concat content_tag(:span, count, class: ['badge badge-pill gl-badge badge-muted sm', badge_class], data: badge_data) + concat gl_badge_tag(count, { size: :sm }, { class: badge_class, data: badge_data }) end end end diff --git a/app/presenters/project_presenter.rb b/app/presenters/project_presenter.rb index ec66f9bdd4f..64cd54953e2 100644 --- a/app/presenters/project_presenter.rb +++ b/app/presenters/project_presenter.rb @@ -364,7 +364,7 @@ class ProjectPresenter < Gitlab::View::Presenter::Delegated if clusters.empty? AnchorData.new(false, statistic_icon + _('Add Kubernetes cluster'), - new_project_cluster_path(project)) + project_clusters_path(project)) else cluster_link = clusters.count == 1 ? project_cluster_path(project, clusters.first) : project_clusters_path(project) diff --git a/doc/user/project/index.md b/doc/user/project/index.md index 07e8ea1dc06..bee097cdcbe 100644 --- a/doc/user/project/index.md +++ b/doc/user/project/index.md @@ -1,8 +1,7 @@ --- stage: Manage group: Workspace -info: "To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments" -type: reference +info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments --- # Organize work with projects **(FREE)** @@ -43,9 +42,9 @@ Projects include the following [features](https://about.gitlab.com/features/): - [Issue tracker](issues/index.md): Discuss implementations with your team. - [Issue boards](issue_board.md): Organize and prioritize your workflow. - [Multiple issue boards](issue_board.md#multiple-issue-boards): Create team-specific workflows (issue boards) for a project. -- [Merge Requests](merge_requests/index.md): Apply a branching +- [Merge requests](merge_requests/index.md): Apply a branching strategy and get reviewed by your team. - - [Merge Request Approvals](merge_requests/approvals/index.md): Ask for approval before + - [Merge request approvals](merge_requests/approvals/index.md): Ask for approval before implementing a change. - [Fix merge conflicts from the UI](merge_requests/conflicts.md): View Git diffs from the GitLab UI. - [Review Apps](../../ci/review_apps/index.md): By branch, preview the results @@ -144,7 +143,7 @@ There are numerous [APIs](../../api/index.md) to use with your projects: - [Issue board](../../api/boards.md) - [Labels](../../api/labels.md) - [Markdown](../../api/markdown.md) -- [Merge Requests](../../api/merge_requests.md) +- [Merge requests](../../api/merge_requests.md) - [Milestones](../../api/milestones.md) - [Services](../../api/integrations.md) - [Snippets](../../api/project_snippets.md) diff --git a/qa/qa/page/component/invite_members_modal.rb b/qa/qa/page/component/invite_members_modal.rb index 138224cee9e..ca6862ccb02 100644 --- a/qa/qa/page/component/invite_members_modal.rb +++ b/qa/qa/page/component/invite_members_modal.rb @@ -47,40 +47,43 @@ module QA fill_element :members_token_select_input, username Support::WaitForRequests.wait_for_requests click_button username - - # Guest option is selected by default, skipping these steps if desired option is 'Guest' - unless access_level == 'Guest' - click_element :access_level_dropdown - click_button access_level - end - - click_element :invite_button + set_access_level(access_level) end - Support::WaitForRequests.wait_for_requests - - page.refresh + send_invite end - def invite_group(group_name, group_access = Resource::Members::AccessLevel::GUEST) + def invite_group(group_name, access_level = 'Guest') open_invite_group_modal - fill_element :access_level_dropdown, with: group_access + within_element(:invite_members_modal_content) do + click_button 'Select a group' - click_button 'Select a group' + # Helps stabilize race condition with concurrent group API calls while searching + # TODO: Replace with `fill_element :group_select_dropdown_search_field, group_name` when this bug is resolved: https://gitlab.com/gitlab-org/gitlab/-/issues/349379 + send_keys_to_element(:group_select_dropdown_search_field, group_name) - # Helps stabilize race condition with concurrent group API calls while searching - # TODO: Replace with `fill_element :group_select_dropdown_search_field, group_name` when this bug is resolved: https://gitlab.com/gitlab-org/gitlab/-/issues/349379 - send_keys_to_element(:group_select_dropdown_search_field, group_name) + Support::WaitForRequests.wait_for_requests + click_button group_name + set_access_level(access_level) + end - Support::WaitForRequests.wait_for_requests + send_invite + end - click_button group_name + private + def set_access_level(access_level) + # Guest option is selected by default, skipping these steps if desired option is 'Guest' + unless access_level == 'Guest' + click_element :access_level_dropdown + click_button access_level + end + end + + def send_invite click_element :invite_button - Support::WaitForRequests.wait_for_requests - page.refresh end end diff --git a/qa/qa/specs/features/browser_ui/1_manage/project/invite_group_to_project_spec.rb b/qa/qa/specs/features/browser_ui/1_manage/project/invite_group_to_project_spec.rb index fd1e8fee280..6997447411a 100644 --- a/qa/qa/specs/features/browser_ui/1_manage/project/invite_group_to_project_spec.rb +++ b/qa/qa/specs/features/browser_ui/1_manage/project/invite_group_to_project_spec.rb @@ -5,10 +5,10 @@ module QA RSpec.describe 'Manage', :requires_admin, :transient, issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/349379' do describe 'Invite group' do shared_examples 'invites group to project' do - it 'verifies group is added and members can access project' do + it 'verifies group is added and members can access project with correct access level' do Page::Project::Menu.perform(&:click_members) Page::Project::Members.perform do |project_members| - project_members.invite_group(group.path) + project_members.invite_group(group.path, 'Developer') expect(project_members).to have_group(group.path) end @@ -16,7 +16,7 @@ module QA Flow::Login.sign_in(as: @user) Page::Dashboard::Projects.perform do |projects| - expect(projects).to have_project_with_access_role(project.name, 'Guest') + expect(projects).to have_project_with_access_role(project.name, 'Developer') end project.visit! @@ -28,13 +28,13 @@ module QA end before(:context) do + Runtime::Feature.enable(:invite_members_group_modal) @user = Resource::User.fabricate_or_use(Runtime::Env.gitlab_qa_username_1, Runtime::Env.gitlab_qa_password_1) end before do - Runtime::Feature.enable(:invite_members_group_modal) Flow::Login.sign_in - group.add_member(@user, Resource::Members::AccessLevel::GUEST) + group.add_member(@user, Resource::Members::AccessLevel::MAINTAINER) project.visit! end @@ -78,6 +78,9 @@ module QA after do project&.remove_via_api! group&.remove_via_api! + end + + after(:context) do Runtime::Feature.disable(:invite_members_group_modal) end end diff --git a/qa/qa/specs/features/browser_ui/4_verify/pipeline/update_ci_file_with_pipeline_editor_spec.rb b/qa/qa/specs/features/browser_ui/4_verify/pipeline/update_ci_file_with_pipeline_editor_spec.rb index b0667005b3a..966bdb78ff8 100644 --- a/qa/qa/specs/features/browser_ui/4_verify/pipeline/update_ci_file_with_pipeline_editor_spec.rb +++ b/qa/qa/specs/features/browser_ui/4_verify/pipeline/update_ci_file_with_pipeline_editor_spec.rb @@ -11,6 +11,14 @@ module QA end end + let!(:runner) do + Resource::Runner.fabricate_via_api! do |runner| + runner.project = project + runner.name = random_test_string + runner.tags = [random_test_string] + end + end + let!(:commit) do Resource::Repository::Commit.fabricate_via_api! do |commit| commit.project = project @@ -21,6 +29,7 @@ module QA file_path: '.gitlab-ci.yml', content: <<~YAML test_job: + tags: ['#{random_test_string}'] script: - echo "Simple test!" YAML @@ -33,11 +42,12 @@ module QA before do Flow::Login.sign_in project.visit! + Support::Waiter.wait_until { project.pipelines.first[:status] == 'success' } Page::Project::Menu.perform(&:go_to_pipeline_editor) end after do - project.remove_via_api! + [runner, project].each(&:remove_via_api!) end it 'creates new pipeline and target branch', testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/349005' do @@ -50,7 +60,7 @@ module QA expect(show.target_branch_name).to eq(random_test_string) expect(show.current_branch).to eq(random_test_string) expect(show.editing_content).to have_content(random_test_string) - expect(show.pipeline_id).to eq(project.pipelines.first[:id]) + expect { show.pipeline_id }.to eventually_eq(project.pipelines.pluck(:id).max).within(max_duration: 60, sleep_interval: 3) end end diff --git a/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb b/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb index dc551158895..89f6b4237a4 100644 --- a/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb +++ b/spec/features/projects/show/user_sees_setup_shortcut_buttons_spec.rb @@ -316,7 +316,7 @@ RSpec.describe 'Projects > Show > User sees setup shortcut buttons' do visit project_path(project) page.within('.project-buttons') do - expect(page).to have_link('Add Kubernetes cluster', href: new_project_cluster_path(project)) + expect(page).to have_link('Add Kubernetes cluster', href: project_clusters_path(project)) end end diff --git a/spec/helpers/search_helper_spec.rb b/spec/helpers/search_helper_spec.rb index 17dcbab09bb..457c9c0f5de 100644 --- a/spec/helpers/search_helper_spec.rb +++ b/spec/helpers/search_helper_spec.rb @@ -4,6 +4,7 @@ require 'spec_helper' RSpec.describe SearchHelper do include MarkupHelper + include BadgesHelper # Override simple_sanitize for our testing purposes def simple_sanitize(str) diff --git a/spec/presenters/project_presenter_spec.rb b/spec/presenters/project_presenter_spec.rb index 27b777dec5f..e4a08bd56c8 100644 --- a/spec/presenters/project_presenter_spec.rb +++ b/spec/presenters/project_presenter_spec.rb @@ -554,7 +554,7 @@ RSpec.describe ProjectPresenter do expect(presenter.kubernetes_cluster_anchor_data).to have_attributes( is_link: false, label: a_string_including('Add Kubernetes cluster'), - link: presenter.new_project_cluster_path(project) + link: presenter.project_clusters_path(project) ) end end