diff options
40 files changed, 167 insertions, 72 deletions
diff --git a/Gemfile.lock b/Gemfile.lock index d1293de6221..ac4ac547276 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -74,7 +74,7 @@ PATH remote: gems/rspec_flaky specs: rspec_flaky (0.1.0) - activesupport (>= 6.1, < 7.1) + activesupport (>= 6.1, < 8) rspec (~> 3.0) PATH diff --git a/app/assets/javascripts/search/sidebar/components/app.vue b/app/assets/javascripts/search/sidebar/components/app.vue index 532a66affd8..2ff138cabe5 100644 --- a/app/assets/javascripts/search/sidebar/components/app.vue +++ b/app/assets/javascripts/search/sidebar/components/app.vue @@ -15,6 +15,7 @@ import { SCOPE_PROJECTS, SCOPE_NOTES, SCOPE_COMMITS, + SCOPE_MILESTONES, SEARCH_TYPE_ADVANCED, } from '../constants'; import IssuesFilters from './issues_filters.vue'; @@ -23,6 +24,7 @@ import BlobsFilters from './blobs_filters.vue'; import ProjectsFilters from './projects_filters.vue'; import NotesFilters from './notes_filters.vue'; import CommitsFilters from './commits_filters.vue'; +import MilestonesFilters from './milestones_filters.vue'; export default { name: 'GlobalSearchSidebar', @@ -38,6 +40,7 @@ export default { DomElementListener, SmallScreenDrawerNavigation, CommitsFilters, + MilestonesFilters, }, mixins: [glFeatureFlagsMixin()], computed: { @@ -57,18 +60,20 @@ export default { return this.currentScope === SCOPE_PROJECTS; }, showNotesFilters() { - return ( - this.currentScope === SCOPE_NOTES && - this.searchType === SEARCH_TYPE_ADVANCED && - this.glFeatures.searchNotesHideArchivedProjects - ); + // for now, the feature flag is placed here. Since we have only one filter in notes scope + return this.currentScope === SCOPE_NOTES && this.glFeatures.searchNotesHideArchivedProjects; }, showCommitsFilters() { // for now, the feature flag is placed here. Since we have only one filter in commits scope return ( - this.currentScope === SCOPE_COMMITS && - this.searchType === SEARCH_TYPE_ADVANCED && - this.glFeatures.searchCommitsHideArchivedProjects + this.currentScope === SCOPE_COMMITS && this.glFeatures.searchCommitsHideArchivedProjects + ); + }, + showMilestonesFilters() { + // for now, the feature flag is placed here. Since we have only one filter in milestones scope + return ( + this.currentScope === SCOPE_MILESTONES && + this.glFeatures.searchMilestonesHideArchivedProjects ); }, showScopeNavigation() { @@ -97,6 +102,7 @@ export default { <projects-filters v-if="showProjectsFilters" /> <notes-filters v-if="showNotesFilters" /> <commits-filters v-if="showCommitsFilters" /> + <milestones-filters v-if="showMilestonesFilters" /> </sidebar-portal> </section> @@ -112,6 +118,7 @@ export default { <projects-filters v-if="showProjectsFilters" /> <notes-filters v-if="showNotesFilters" /> <commits-filters v-if="showCommitsFilters" /> + <milestones-filters v-if="showMilestonesFilters" /> </div> <small-screen-drawer-navigation class="gl-lg-display-none"> <scope-legacy-navigation /> @@ -121,6 +128,7 @@ export default { <projects-filters v-if="showProjectsFilters" /> <notes-filters v-if="showNotesFilters" /> <commits-filters v-if="showCommitsFilters" /> + <milestones-filters v-if="showMilestonesFilters" /> </small-screen-drawer-navigation> </section> </template> diff --git a/app/assets/javascripts/search/sidebar/components/archived_filter/data.js b/app/assets/javascripts/search/sidebar/components/archived_filter/data.js index 5cddf5e744f..ed90e2aaded 100644 --- a/app/assets/javascripts/search/sidebar/components/archived_filter/data.js +++ b/app/assets/javascripts/search/sidebar/components/archived_filter/data.js @@ -5,14 +5,7 @@ const checkboxLabel = s__('GlobalSearch|Include archived'); export const TRACKING_NAMESPACE = 'search:archived:select'; export const TRACKING_LABEL_CHECKBOX = 'checkbox'; -const scopes = { - PROJECTS: 'projects', - ISSUES: 'issues', - MERGE_REQUESTS: 'merge_requests', - NOTES: 'notes', - BLOBS: 'blobs', - COMMITS: 'commits', -}; +const scopes = ['projects', 'issues', 'merge_requests', 'notes', 'blobs', 'commits', 'milestones']; const filterParam = 'include_archived'; diff --git a/app/assets/javascripts/search/sidebar/components/issues_filters.vue b/app/assets/javascripts/search/sidebar/components/issues_filters.vue index dbd52978163..4a2d3df6921 100644 --- a/app/assets/javascripts/search/sidebar/components/issues_filters.vue +++ b/app/assets/javascripts/search/sidebar/components/issues_filters.vue @@ -42,9 +42,8 @@ export default { }, showArchivedFilter() { return ( - Object.values(archivedFilterData.scopes).includes(this.currentScope) && - this.glFeatures.searchIssuesHideArchivedProjects && - this.searchType === SEARCH_TYPE_ADVANCED + archivedFilterData.scopes.includes(this.currentScope) && + this.glFeatures.searchIssuesHideArchivedProjects ); }, showDivider() { diff --git a/app/assets/javascripts/search/sidebar/components/merge_requests_filters.vue b/app/assets/javascripts/search/sidebar/components/merge_requests_filters.vue index 2845eb2049b..6e476ef7935 100644 --- a/app/assets/javascripts/search/sidebar/components/merge_requests_filters.vue +++ b/app/assets/javascripts/search/sidebar/components/merge_requests_filters.vue @@ -2,7 +2,7 @@ // eslint-disable-next-line no-restricted-imports import { mapGetters, mapState } from 'vuex'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; -import { HR_DEFAULT_CLASSES, SEARCH_TYPE_ADVANCED } from '../constants'; +import { HR_DEFAULT_CLASSES } from '../constants'; import { statusFilterData } from './status_filter/data'; import StatusFilter from './status_filter/index.vue'; import FiltersTemplate from './filters_template.vue'; @@ -22,9 +22,8 @@ export default { ...mapState(['useSidebarNavigation', 'searchType']), showArchivedFilter() { return ( - Object.values(archivedFilterData.scopes).includes(this.currentScope) && - this.glFeatures.searchMergeRequestsHideArchivedProjects && - this.searchType === SEARCH_TYPE_ADVANCED + archivedFilterData.scopes.includes(this.currentScope) && + this.glFeatures.searchMergeRequestsHideArchivedProjects ); }, showStatusFilter() { diff --git a/app/assets/javascripts/search/sidebar/components/milestones_filters.vue b/app/assets/javascripts/search/sidebar/components/milestones_filters.vue new file mode 100644 index 00000000000..098e2980c3f --- /dev/null +++ b/app/assets/javascripts/search/sidebar/components/milestones_filters.vue @@ -0,0 +1,18 @@ +<script> +import ArchivedFilter from './archived_filter/index.vue'; +import FiltersTemplate from './filters_template.vue'; + +export default { + name: 'MilestonesFilters', + components: { + ArchivedFilter, + FiltersTemplate, + }, +}; +</script> + +<template> + <filters-template> + <archived-filter class="gl-mb-5" /> + </filters-template> +</template> diff --git a/app/assets/javascripts/search/sidebar/constants/index.js b/app/assets/javascripts/search/sidebar/constants/index.js index 19df875c292..b5446ecbb42 100644 --- a/app/assets/javascripts/search/sidebar/constants/index.js +++ b/app/assets/javascripts/search/sidebar/constants/index.js @@ -4,6 +4,7 @@ export const SCOPE_BLOB = 'blobs'; export const SCOPE_PROJECTS = 'projects'; export const SCOPE_NOTES = 'notes'; export const SCOPE_COMMITS = 'commits'; +export const SCOPE_MILESTONES = 'milestones'; export const LABEL_DEFAULT_CLASSES = [ 'gl-display-flex', 'gl-flex-direction-row', diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 656e4fdaefb..fc7865c949d 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -456,7 +456,7 @@ class Projects::IssuesController < Projects::ApplicationController def redirect_if_work_item return unless use_work_items_path?(issue) - redirect_to project_work_items_path(project, issue.iid, params: request.query_parameters) + redirect_to project_work_item_path(project, issue.iid, params: request.query_parameters) end def require_incident_for_incident_routes diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index d247490402f..3f44aef3eda 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -35,6 +35,26 @@ class SearchController < ApplicationController update_scope_for_code_search end + before_action only: :show do + push_frontend_feature_flag(:search_notes_hide_archived_projects, current_user) + end + + before_action only: :show do + push_frontend_feature_flag(:search_issues_hide_archived_projects, current_user) + end + + before_action only: :show do + push_frontend_feature_flag(:search_merge_requests_hide_archived_projects, current_user) + end + + before_action only: :show do + push_frontend_feature_flag(:search_commits_hide_archived_projects, current_user) + end + + before_action only: :show do + push_frontend_feature_flag(:search_milestones_hide_archived_projects, current_user) + end + rescue_from ActiveRecord::QueryCanceled, with: :render_timeout layout 'search' diff --git a/app/helpers/routing/projects_helper.rb b/app/helpers/routing/projects_helper.rb index 760f461b0a1..1f00d283a30 100644 --- a/app/helpers/routing/projects_helper.rb +++ b/app/helpers/routing/projects_helper.rb @@ -48,7 +48,7 @@ module Routing if use_issue_path?(entity) project_issue_url(entity.project, entity.iid, *args) else - project_work_items_url(entity.project, entity.iid, *args) + project_work_item_url(entity.project, entity.iid, *args) end end diff --git a/app/views/projects/work_items/index.html.haml b/app/views/projects/work_items/show.html.haml index 01b27eed267..7e0bddf1b5d 100644 --- a/app/views/projects/work_items/index.html.haml +++ b/app/views/projects/work_items/show.html.haml @@ -1,4 +1,4 @@ -- page_title "##{request.params['work_items_path']}" +- page_title "##{request.params['iid']}" - add_to_breadcrumbs _("Issues"), project_issues_path(@project) - add_page_specific_style 'page_bundles/work_items' - @gfm_form = true diff --git a/config/feature_flags/development/search_commits_hide_archived_projects.yml b/config/feature_flags/development/search_commits_hide_archived_projects.yml new file mode 100644 index 00000000000..068118bbcbc --- /dev/null +++ b/config/feature_flags/development/search_commits_hide_archived_projects.yml @@ -0,0 +1,8 @@ +--- +name: search_commits_hide_archived_projects +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/128080 +rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/420910 +milestone: '16.3' +type: development +group: group::global search +default_enabled: false diff --git a/config/routes/project.rb b/config/routes/project.rb index e7242f1ecee..83e59c8a61c 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -343,10 +343,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do get 'alert_management/:id', to: 'alert_management#details', as: 'alert_management_alert' - get 'work_items/*work_items_path' => 'work_items#index', as: :work_items - get 'work_items/*work_items_path' => 'work_items#index', as: :work_item - - resources :work_items, only: [] do + resources :work_items, only: [:show], param: :iid do collection do post :import_csv post 'import_csv/authorize', to: 'work_items#authorize' diff --git a/doc/administration/file_hooks.md b/doc/administration/file_hooks.md index 2748984b51d..d1b46a9fec1 100644 --- a/doc/administration/file_hooks.md +++ b/doc/administration/file_hooks.md @@ -12,8 +12,8 @@ to introduce custom integrations without modifying the GitLab source code. A file hook runs on each event. You can filter events or projects in a file hook's code, and create many file hooks as you need. Each file hook is -triggered by GitLab asynchronously in case of an event. For a list of events -see the [system hooks](system_hooks.md) documentation. +triggered by GitLab asynchronously in case of an event. For a list of events, +see the [system hooks](system_hooks.md) and [webhooks](../user/project/integrations/webhook_events.md) documentation. NOTE: File hooks must be configured on the file system of the GitLab server. Only GitLab diff --git a/gems/rspec_flaky/Gemfile.lock b/gems/rspec_flaky/Gemfile.lock index 547dc24e375..3f40a41483e 100644 --- a/gems/rspec_flaky/Gemfile.lock +++ b/gems/rspec_flaky/Gemfile.lock @@ -9,7 +9,7 @@ PATH remote: . specs: rspec_flaky (0.1.0) - activesupport (>= 6.1, < 7.1) + activesupport (>= 6.1, < 8) rspec (~> 3.0) GEM diff --git a/gems/rspec_flaky/rspec_flaky.gemspec b/gems/rspec_flaky/rspec_flaky.gemspec index 5c0a434218f..6ddbe4afd1e 100644 --- a/gems/rspec_flaky/rspec_flaky.gemspec +++ b/gems/rspec_flaky/rspec_flaky.gemspec @@ -20,7 +20,7 @@ Gem::Specification.new do |spec| spec.files = Dir["lib/**/*.rb"] spec.require_paths = ["lib"] - spec.add_runtime_dependency "activesupport", ">= 6.1", "< 7.1" + spec.add_runtime_dependency "activesupport", ">= 6.1", "< 8" spec.add_runtime_dependency "rspec", "~> 3.0" spec.add_development_dependency "gitlab-styles", "~> 10.1.0" diff --git a/package.json b/package.json index b41de2ef062..e13816a1d00 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "@gitlab/cluster-client": "^1.3.0", "@gitlab/favicon-overlay": "2.0.0", "@gitlab/fonts": "^1.3.0", - "@gitlab/svgs": "3.65.0", + "@gitlab/svgs": "3.66.0", "@gitlab/ui": "66.20.0", "@gitlab/visual-review-tools": "1.7.3", "@gitlab/web-ide": "0.0.1-dev-20231004090414", diff --git a/qa/qa/runtime/env.rb b/qa/qa/runtime/env.rb index e6d5ae1cf79..2f9812a30ba 100644 --- a/qa/qa/runtime/env.rb +++ b/qa/qa/runtime/env.rb @@ -473,10 +473,6 @@ module QA ENV.fetch("WORKSPACES_OAUTH_APP_SECRET") end - def workspaces_oauth_redirect_uri - ENV.fetch("WORKSPACES_OAUTH_REDIRECT_URI") - end - def workspaces_oauth_signing_key ENV.fetch("WORKSPACES_OAUTH_SIGNING_KEY") end diff --git a/qa/qa/service/cluster_provider/gcloud.rb b/qa/qa/service/cluster_provider/gcloud.rb index 3ee851753f9..71ba3623e91 100644 --- a/qa/qa/service/cluster_provider/gcloud.rb +++ b/qa/qa/service/cluster_provider/gcloud.rb @@ -95,10 +95,10 @@ module QA --set="auth.signing_key=#{Runtime::Env.workspaces_oauth_signing_key}" \ --set="ingress.host.workspaceDomain=#{Runtime::Env.workspaces_proxy_domain}" \ --set="ingress.host.wildcardDomain=*.#{Runtime::Env.workspaces_proxy_domain}" \ - --set="ingress.tls.workspaceDomainCert=$(cat #{Runtime::Env.workspaces_domain_cert})" \ - --set="ingress.tls.workspaceDomainKey=$(cat #{Runtime::Env.workspaces_domain_key})" \ - --set="ingress.tls.wildcardDomainCert=$(cat #{Runtime::Env.workspaces_wildcard_cert})" \ - --set="ingress.tls.wildcardDomainKey=$(cat #{Runtime::Env.workspaces_wildcard_key})" \ + --set="ingress.tls.workspaceDomainCert=#{Runtime::Env.workspaces_domain_cert}" \ + --set="ingress.tls.workspaceDomainKey=#{Runtime::Env.workspaces_domain_key}" \ + --set="ingress.tls.wildcardDomainCert=#{Runtime::Env.workspaces_wildcard_cert}" \ + --set="ingress.tls.wildcardDomainKey=#{Runtime::Env.workspaces_wildcard_key}" \ --set="ingress.className=nginx" CMD diff --git a/qa/qa/specs/features/api/1_manage/import/import_large_github_repo_spec.rb b/qa/qa/specs/features/api/1_manage/import/import_large_github_repo_spec.rb index 959d691bad7..26a3dabd308 100644 --- a/qa/qa/specs/features/api/1_manage/import/import_large_github_repo_spec.rb +++ b/qa/qa/specs/features/api/1_manage/import/import_large_github_repo_spec.rb @@ -184,7 +184,16 @@ module QA status: "failed", importer: :github, import_finished: false, - import_time: Time.now - @start + import_time: Time.now - @start, + source: { + name: "GitHub", + project_name: github_repo, + address: "https://github.com" + }, + target: { + name: "GitLab", + address: gitlab_address + } } ) end diff --git a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_large_project_spec.rb b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_large_project_spec.rb index 6d35795a032..293960efe61 100644 --- a/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_large_project_spec.rb +++ b/qa/qa/specs/features/api/1_manage/migration/gitlab_migration_large_project_spec.rb @@ -82,7 +82,16 @@ module QA status: "failed", importer: :gitlab, import_finished: false, - import_time: Time.now - @start + import_time: Time.now - @start, + source: { + name: "GitLab Source", + project_name: source_project.path_with_namespace, + address: source_gitlab_address + }, + target: { + name: "GitLab Target", + address: QA::Runtime::Scenario.gitlab_address + } } ) end diff --git a/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_spec.rb b/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_spec.rb index 8d6f3343e9c..e4c118755c8 100644 --- a/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_spec.rb +++ b/qa/qa/specs/features/browser_ui/3_create/merge_request/create_merge_request_spec.rb @@ -14,6 +14,11 @@ module QA it( 'creates a basic merge request', :smoke, :skip_fips_env, + quarantine: { + only: { job: 'update-ee-to-ce' }, + issue: 'https://gitlab.com/gitlab-org/gitlab/-/issues/412361', + type: :investigating + }, testcase: 'https://gitlab.com/gitlab-org/gitlab/-/quality/test_cases/347738' ) do Resource::MergeRequest.fabricate_via_browser_ui! do |merge_request| diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb index 96840e09ccf..5024698a769 100644 --- a/spec/controllers/projects/issues_controller_spec.rb +++ b/spec/controllers/projects/issues_controller_spec.rb @@ -191,7 +191,7 @@ RSpec.describe Projects::IssuesController, :request_store, feature_category: :te it 'redirects to work item page using iid' do make_request - expect(response).to redirect_to(project_work_items_path(project, task.iid, query)) + expect(response).to redirect_to(project_work_item_path(project, task.iid, query)) end end diff --git a/spec/controllers/projects/work_items_controller_spec.rb b/spec/controllers/projects/work_items_controller_spec.rb index e0f61a4977b..fc5ac77c96c 100644 --- a/spec/controllers/projects/work_items_controller_spec.rb +++ b/spec/controllers/projects/work_items_controller_spec.rb @@ -34,10 +34,10 @@ RSpec.describe Projects::WorkItemsController, feature_category: :team_planning d end end - describe 'GET index' do + describe 'GET show' do specify do expect( - get(:index, params: { namespace_id: project.namespace, project_id: project, work_items_path: work_item.id }) + get(:show, params: { namespace_id: project.namespace, project_id: project, iid: work_item.iid }) ).to have_request_urgency(:low) end end diff --git a/spec/factories/packages/package_protection_rules.rb b/spec/factories/packages/protection/rules.rb index 3038fb847e7..3038fb847e7 100644 --- a/spec/factories/packages/package_protection_rules.rb +++ b/spec/factories/packages/protection/rules.rb diff --git a/spec/features/projects/work_items/linked_work_items_spec.rb b/spec/features/projects/work_items/linked_work_items_spec.rb index 1fa2f66e71e..66016cf8b7b 100644 --- a/spec/features/projects/work_items/linked_work_items_spec.rb +++ b/spec/features/projects/work_items/linked_work_items_spec.rb @@ -7,7 +7,7 @@ RSpec.describe 'Work item linked items', :js, feature_category: :team_planning d let_it_be(:project) { create(:project, :public, namespace: group) } let_it_be(:user) { create(:user) } let_it_be(:work_item) { create(:work_item, project: project) } - let(:work_items_path) { project_work_items_path(project, work_items_path: work_item.iid) } + let(:work_items_path) { project_work_item_path(project, work_item.iid) } let_it_be(:task) { create(:work_item, :task, project: project, title: 'Task 1') } context 'for signed in user' do diff --git a/spec/features/projects/work_items/work_item_spec.rb b/spec/features/projects/work_items/work_item_spec.rb index a1f5466f5bf..d5e3fd253b6 100644 --- a/spec/features/projects/work_items/work_item_spec.rb +++ b/spec/features/projects/work_items/work_item_spec.rb @@ -12,7 +12,7 @@ RSpec.describe 'Work item', :js, feature_category: :team_planning do let_it_be(:milestone) { create(:milestone, project: project) } let_it_be(:milestones) { create_list(:milestone, 25, project: project) } let_it_be(:note) { create(:note, noteable: work_item, project: work_item.project) } - let(:work_items_path) { project_work_items_path(project, work_items_path: work_item.iid) } + let(:work_items_path) { project_work_item_path(project, work_item.iid) } context 'for signed in user' do before do diff --git a/spec/fixtures/markdown.md.erb b/spec/fixtures/markdown.md.erb index 37376713355..8e11f95be8b 100644 --- a/spec/fixtures/markdown.md.erb +++ b/spec/fixtures/markdown.md.erb @@ -203,7 +203,7 @@ Note: work item references use `#`, which get built as an issue link. - Ignored in code: `<%= work_item.to_reference %>` - Ignored in links: [Link to <%= work_item.to_reference %>](#work_item-link) - Ignored when backslash escaped: \<%= work_item.to_reference %> -- Work item by URL: <%= urls.project_work_item_url(work_item.project, work_item) %> +- Work item by URL: <%= urls.project_work_item_url(work_item.project, work_item.iid) %> - Link to work item by reference (counted as an issue reference): [Work item](<%= work_item.to_reference %>) - Link to work item by URL: [Work item](<%= urls.project_work_item_url(work_item.project, work_item) %>) diff --git a/spec/frontend/search/sidebar/components/app_spec.js b/spec/frontend/search/sidebar/components/app_spec.js index 8e23f9c1680..d8d2492209e 100644 --- a/spec/frontend/search/sidebar/components/app_spec.js +++ b/spec/frontend/search/sidebar/components/app_spec.js @@ -16,6 +16,7 @@ import BlobsFilters from '~/search/sidebar/components/blobs_filters.vue'; import ProjectsFilters from '~/search/sidebar/components/projects_filters.vue'; import NotesFilters from '~/search/sidebar/components/notes_filters.vue'; import CommitsFilters from '~/search/sidebar/components/commits_filters.vue'; +import MilestonesFilters from '~/search/sidebar/components/milestones_filters.vue'; import ScopeLegacyNavigation from '~/search/sidebar/components/scope_legacy_navigation.vue'; import SmallScreenDrawerNavigation from '~/search/sidebar/components/small_screen_drawer_navigation.vue'; import ScopeSidebarNavigation from '~/search/sidebar/components/scope_sidebar_navigation.vue'; @@ -47,6 +48,7 @@ describe('GlobalSearchSidebar', () => { glFeatures: { searchNotesHideArchivedProjects: true, searchCommitsHideArchivedProjects: true, + searchMilestonesHideArchivedProjects: true, }, }, }); @@ -59,6 +61,7 @@ describe('GlobalSearchSidebar', () => { const findProjectsFilters = () => wrapper.findComponent(ProjectsFilters); const findNotesFilters = () => wrapper.findComponent(NotesFilters); const findCommitsFilters = () => wrapper.findComponent(CommitsFilters); + const findMilestonesFilters = () => wrapper.findComponent(MilestonesFilters); const findScopeLegacyNavigation = () => wrapper.findComponent(ScopeLegacyNavigation); const findSmallScreenDrawerNavigation = () => wrapper.findComponent(SmallScreenDrawerNavigation); const findScopeSidebarNavigation = () => wrapper.findComponent(ScopeSidebarNavigation); @@ -83,10 +86,12 @@ describe('GlobalSearchSidebar', () => { ${'blobs'} | ${findBlobsFilters} | ${SEARCH_TYPE_BASIC} | ${false} ${'blobs'} | ${findBlobsFilters} | ${SEARCH_TYPE_ADVANCED} | ${true} ${'blobs'} | ${findBlobsFilters} | ${SEARCH_TYPE_ZOEKT} | ${false} - ${'notes'} | ${findNotesFilters} | ${SEARCH_TYPE_BASIC} | ${false} + ${'notes'} | ${findNotesFilters} | ${SEARCH_TYPE_BASIC} | ${true} ${'notes'} | ${findNotesFilters} | ${SEARCH_TYPE_ADVANCED} | ${true} - ${'commits'} | ${findCommitsFilters} | ${SEARCH_TYPE_BASIC} | ${false} + ${'commits'} | ${findCommitsFilters} | ${SEARCH_TYPE_BASIC} | ${true} ${'commits'} | ${findCommitsFilters} | ${SEARCH_TYPE_ADVANCED} | ${true} + ${'milestones'} | ${findMilestonesFilters} | ${SEARCH_TYPE_BASIC} | ${true} + ${'milestones'} | ${findMilestonesFilters} | ${SEARCH_TYPE_ADVANCED} | ${true} `('with sidebar $scope scope:', ({ scope, filter, searchType, isShown }) => { beforeEach(() => { getterSpies.currentScope = jest.fn(() => scope); diff --git a/spec/frontend/search/sidebar/components/issues_filters_spec.js b/spec/frontend/search/sidebar/components/issues_filters_spec.js index 39d10cbb8b4..c3b3a93e362 100644 --- a/spec/frontend/search/sidebar/components/issues_filters_spec.js +++ b/spec/frontend/search/sidebar/components/issues_filters_spec.js @@ -111,11 +111,11 @@ describe('GlobalSearch IssuesFilters', () => { }); it("doesn't render ArchivedFilter", () => { - expect(findArchivedFilter().exists()).toBe(false); + expect(findArchivedFilter().exists()).toBe(true); }); it('renders 1 divider', () => { - expect(findDividers()).toHaveLength(1); + expect(findDividers()).toHaveLength(2); }); }); diff --git a/spec/frontend/search/sidebar/components/merge_requests_filters_spec.js b/spec/frontend/search/sidebar/components/merge_requests_filters_spec.js index b50f348be69..278249c2660 100644 --- a/spec/frontend/search/sidebar/components/merge_requests_filters_spec.js +++ b/spec/frontend/search/sidebar/components/merge_requests_filters_spec.js @@ -79,12 +79,12 @@ describe('GlobalSearch MergeRequestsFilters', () => { expect(findStatusFilter().exists()).toBe(true); }); - it("doesn't render ArchivedFilter", () => { - expect(findArchivedFilter().exists()).toBe(false); + it('renders render ArchivedFilter', () => { + expect(findArchivedFilter().exists()).toBe(true); }); it('renders 1 divider', () => { - expect(findDividers()).toHaveLength(0); + expect(findDividers()).toHaveLength(1); }); }); diff --git a/spec/frontend/search/sidebar/components/milestones_filters_spec.js b/spec/frontend/search/sidebar/components/milestones_filters_spec.js new file mode 100644 index 00000000000..e7fcfb030f4 --- /dev/null +++ b/spec/frontend/search/sidebar/components/milestones_filters_spec.js @@ -0,0 +1,28 @@ +import { shallowMount } from '@vue/test-utils'; +import MilestonesFilters from '~/search/sidebar/components/milestones_filters.vue'; +import ArchivedFilter from '~/search/sidebar/components/archived_filter/index.vue'; +import FiltersTemplate from '~/search/sidebar/components/filters_template.vue'; + +describe('GlobalSearch MilestonesFilters', () => { + let wrapper; + + const findArchivedFilter = () => wrapper.findComponent(ArchivedFilter); + const findFiltersTemplate = () => wrapper.findComponent(FiltersTemplate); + + const createComponent = () => { + wrapper = shallowMount(MilestonesFilters); + }; + + describe('Renders correctly', () => { + beforeEach(() => { + createComponent(); + }); + it('renders ArchivedFilter', () => { + expect(findArchivedFilter().exists()).toBe(true); + }); + + it('renders FiltersTemplate', () => { + expect(findFiltersTemplate().exists()).toBe(true); + }); + }); +}); diff --git a/spec/presenters/issue_presenter_spec.rb b/spec/presenters/issue_presenter_spec.rb index 99ab8582f77..07a9f8015e9 100644 --- a/spec/presenters/issue_presenter_spec.rb +++ b/spec/presenters/issue_presenter_spec.rb @@ -37,7 +37,7 @@ RSpec.describe IssuePresenter do it 'returns a work item url using iid for the task' do expect(presenter.web_url).to eq( - project_work_items_url(project, work_items_path: presented_issue.iid) + project_work_item_url(project, presented_issue.iid) ) end end @@ -67,7 +67,7 @@ RSpec.describe IssuePresenter do it 'returns a work item path using iid for the task' do expect(presenter.issue_path).to eq( - project_work_items_path(project, work_items_path: presented_issue.iid) + project_work_item_path(project, presented_issue.iid) ) end end diff --git a/spec/requests/projects/issue_links_controller_spec.rb b/spec/requests/projects/issue_links_controller_spec.rb index c242f762cde..ea73b733285 100644 --- a/spec/requests/projects/issue_links_controller_spec.rb +++ b/spec/requests/projects/issue_links_controller_spec.rb @@ -33,7 +33,7 @@ RSpec.describe Projects::IssueLinksController, feature_category: :team_planning expect(json_response.count).to eq(1) expect(json_response.first).to include( - 'path' => project_work_items_path(issue_b.project, issue_b.iid), + 'path' => project_work_item_path(issue_b.project, issue_b.iid), 'type' => 'TASK' ) end diff --git a/spec/requests/projects/work_items_spec.rb b/spec/requests/projects/work_items_spec.rb index ee9a0ff0a4e..5e9d340de64 100644 --- a/spec/requests/projects/work_items_spec.rb +++ b/spec/requests/projects/work_items_spec.rb @@ -40,8 +40,8 @@ RSpec.describe 'Work Items', feature_category: :team_planning do sign_in(current_user) end - it 'renders index' do - get project_work_items_url(work_item.project, work_items_path: work_item.iid) + it 'renders show' do + get project_work_item_url(work_item.project, work_item.iid) expect(response).to have_gitlab_http_status(:ok) end diff --git a/spec/requests/users_controller_spec.rb b/spec/requests/users_controller_spec.rb index f96d7864782..d4e7dc1542a 100644 --- a/spec/requests/users_controller_spec.rb +++ b/spec/requests/users_controller_spec.rb @@ -528,7 +528,7 @@ RSpec.describe UsersController, feature_category: :user_management do get user_calendar_activities_url public_user.username - expect(response.body).to include(project_work_items_path(project, work_item.iid)) + expect(response.body).to include(project_work_item_path(project, work_item.iid)) expect(response.body).to include(project_issue_path(project, issue)) end diff --git a/spec/serializers/issue_board_entity_spec.rb b/spec/serializers/issue_board_entity_spec.rb index 6042dea249f..04c283ddc2c 100644 --- a/spec/serializers/issue_board_entity_spec.rb +++ b/spec/serializers/issue_board_entity_spec.rb @@ -62,7 +62,7 @@ RSpec.describe IssueBoardEntity do let(:resource) { create(:issue, :task, project: project) } it 'has a work item path with iid' do - expect(subject[:real_path]).to eq(project_work_items_path(project, resource.iid)) + expect(subject[:real_path]).to eq(project_work_item_path(project, resource.iid)) end end end diff --git a/spec/serializers/issue_entity_spec.rb b/spec/serializers/issue_entity_spec.rb index 38c81257a7d..a8fd96a03bb 100644 --- a/spec/serializers/issue_entity_spec.rb +++ b/spec/serializers/issue_entity_spec.rb @@ -19,7 +19,7 @@ RSpec.describe IssueEntity do # This was already a path and not a url when the work items change was introduced it 'has a work item path with iid' do - expect(subject[:web_url]).to eq(project_work_items_path(project, resource.iid)) + expect(subject[:web_url]).to eq(project_work_item_path(project, resource.iid)) end end end diff --git a/spec/serializers/linked_project_issue_entity_spec.rb b/spec/serializers/linked_project_issue_entity_spec.rb index 2f7fb912115..070ddda2a8b 100644 --- a/spec/serializers/linked_project_issue_entity_spec.rb +++ b/spec/serializers/linked_project_issue_entity_spec.rb @@ -49,7 +49,7 @@ RSpec.describe LinkedProjectIssueEntity do it 'returns a work items path using iid' do expect(serialized_entity).to include( - path: project_work_items_path(related_issue.project, related_issue.iid) + path: project_work_item_path(related_issue.project, related_issue.iid) ) end end diff --git a/yarn.lock b/yarn.lock index dcb42515e39..2c09a7dfbdb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1269,10 +1269,10 @@ stylelint-declaration-strict-value "1.9.2" stylelint-scss "5.1.0" -"@gitlab/svgs@3.65.0": - version "3.65.0" - resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.65.0.tgz#0dace141f1dcac339ae5fc145176ea36f7774c64" - integrity sha512-hv7k48brF1xi2JaQ6WkQoSYZyuHx1h1YkX+AAzDRWyugDW0oePe0h9kpsBlggDo843Ae/Vm+4uC6oA9TPgh2dw== +"@gitlab/svgs@3.66.0": + version "3.66.0" + resolved "https://registry.yarnpkg.com/@gitlab/svgs/-/svgs-3.66.0.tgz#5dbe98f9811001942d78395756b9d7c588300c01" + integrity sha512-FdkoMAprxjJJnl90GJYoCMeIpvCaYPNAnRkrlsmo7NY3Ce8fpRb/XE/ZakqULeadj82S7R1IRuTHYfWB06vVtA== "@gitlab/ui@66.20.0": version "66.20.0" |