From 687bfbe9324776e9d215b3791d4913d0c418c78f Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 19 Oct 2022 09:10:46 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .gitlab/CODEOWNERS | 295 +++--------------- .../javascripts/lib/utils/common_utils.js | 6 +- .../notes/mixins/discussion_navigation.js | 156 +-------- .../components/sidebar_editable_item.vue | 4 +- app/views/shared/issuable/_sidebar.html.haml | 2 +- doc/integration/jira/index.md | 5 + lib/gitlab/usage/metric_definition.rb | 2 +- locale/gitlab.pot | 9 +- qa/Gemfile | 4 +- qa/Gemfile.lock | 6 +- .../issues/user_interacts_with_awards_spec.rb | 2 +- .../user_jumps_to_discussion_spec.rb | 29 -- .../mixins/discussion_navigation_spec.js | 147 ++------- .../assignees/sidebar_editable_item_spec.js | 32 +- .../helpers/stub_method_calls_spec.rb | 4 +- 15 files changed, 129 insertions(+), 574 deletions(-) delete mode 100644 spec/features/merge_request/user_jumps_to_discussion_spec.rb diff --git a/.gitlab/CODEOWNERS b/.gitlab/CODEOWNERS index ae28f64a215..1ea65fe4de5 100644 --- a/.gitlab/CODEOWNERS +++ b/.gitlab/CODEOWNERS @@ -390,48 +390,30 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/administration/lfs/ @aqualls /doc/administration/libravatar.md @axil /doc/administration/load_balancer.md @axil +/doc/administration/logs/ @axil /doc/administration/logs/index.md @msedlakjakubowski -/doc/administration/logs/log_parsing.md @axil -/doc/administration/logs/tracing_correlation_id.md @axil /doc/administration/maintenance_mode/ @axil /doc/administration/merge_request_diffs.md @ashrafkhamis -/doc/administration/monitoring/github_imports.md @msedlakjakubowski +/doc/administration/monitoring/ @msedlakjakubowski /doc/administration/monitoring/gitlab_self_monitoring_project/ @msedlakjakubowski -/doc/administration/monitoring/index.md @msedlakjakubowski /doc/administration/monitoring/ip_allowlist.md @sselhorn /doc/administration/monitoring/performance/ @msedlakjakubowski -/doc/administration/monitoring/prometheus/gitlab_exporter.md @msedlakjakubowski -/doc/administration/monitoring/prometheus/gitlab_metrics.md @msedlakjakubowski +/doc/administration/monitoring/prometheus/ @msedlakjakubowski /doc/administration/monitoring/prometheus/index.md @axil -/doc/administration/monitoring/prometheus/node_exporter.md @msedlakjakubowski -/doc/administration/monitoring/prometheus/pgbouncer_exporter.md @msedlakjakubowski -/doc/administration/monitoring/prometheus/postgres_exporter.md @msedlakjakubowski -/doc/administration/monitoring/prometheus/redis_exporter.md @msedlakjakubowski -/doc/administration/monitoring/prometheus/registry_exporter.md @msedlakjakubowski /doc/administration/monitoring/prometheus/web_exporter.md @sselhorn /doc/administration/nfs.md @axil /doc/administration/object_storage.md @axil +/doc/administration/operations/ @axil /doc/administration/operations/fast_ssh_key_lookup.md @aqualls -/doc/administration/operations/filesystem_benchmarking.md @axil -/doc/administration/operations/index.md @axil /doc/administration/operations/moving_repositories.md @eread -/doc/administration/operations/puma.md @axil -/doc/administration/operations/rails_console.md @axil -/doc/administration/operations/ssh_certificates.md @axil /doc/administration/package_information/ @axil /doc/administration/packages/ @claytoncornell /doc/administration/pages/ @ashrafkhamis /doc/administration/polling.md @axil /doc/administration/postgresql/ @aqualls -/doc/administration/raketasks/check.md @axil -/doc/administration/raketasks/geo.md @axil -/doc/administration/raketasks/github_import.md @axil -/doc/administration/raketasks/ldap.md @eread -/doc/administration/raketasks/maintenance.md @axil +/doc/administration/raketasks/ @axil +/doc/administration/raketasks/ldap.md @jglassman1 /doc/administration/raketasks/praefect.md @eread -/doc/administration/raketasks/project_import_export.md @axil -/doc/administration/raketasks/smtp.md @axil -/doc/administration/raketasks/storage.md @axil /doc/administration/raketasks/uploads/ @axil /doc/administration/read_only_gitlab.md @axil /doc/administration/redis/ @axil @@ -443,25 +425,16 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/administration/repository_storage_types.md @eread /doc/administration/restart_gitlab.md @axil /doc/administration/server_hooks.md @eread -/doc/administration/sidekiq/extra_sidekiq_processes.md @axil -/doc/administration/sidekiq/extra_sidekiq_routing.md @axil -/doc/administration/sidekiq/index.md @axil -/doc/administration/sidekiq/sidekiq_health_check.md @axil +/doc/administration/sidekiq/ @axil /doc/administration/sidekiq/sidekiq_memory_killer.md @sselhorn -/doc/administration/sidekiq/sidekiq_troubleshooting.md @axil /doc/administration/smime_signing_email.md @axil /doc/administration/snippets/ @ashrafkhamis /doc/administration/static_objects_external_storage.md @ashrafkhamis /doc/administration/system_hooks.md @ashrafkhamis /doc/administration/terraform_state.md @phillipwells /doc/administration/timezone.md @axil -/doc/administration/troubleshooting/diagnostics_tools.md @axil -/doc/administration/troubleshooting/gitlab_rails_cheat_sheet.md @axil -/doc/administration/troubleshooting/index.md @axil -/doc/administration/troubleshooting/linux_cheat_sheet.md @axil +/doc/administration/troubleshooting/ @axil /doc/administration/troubleshooting/postgresql.md @aqualls -/doc/administration/troubleshooting/ssl.md @axil -/doc/administration/troubleshooting/test_environments.md @axil /doc/administration/uploads.md @axil /doc/administration/user_settings.md @jglassman1 /doc/administration/wikis/ @ashrafkhamis @@ -568,6 +541,7 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/api/pipeline_triggers.md @marcel.amirault /doc/api/pipelines.md @marcel.amirault /doc/api/plan_limits.md @jglassman1 +/doc/api/product_analytics.md @lciutacu /doc/api/project_access_tokens.md @jglassman1 /doc/api/project_aliases.md @aqualls /doc/api/project_badges.md @aqualls @@ -596,6 +570,7 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/api/resource_state_events.md @msedlakjakubowski /doc/api/resource_weight_events.md @msedlakjakubowski /doc/api/runners.md @sselhorn +/doc/api/saml.md @jglassman1 /doc/api/scim.md @jglassman1 /doc/api/search.md @ashrafkhamis /doc/api/secure_files.md @marcel.amirault @@ -639,17 +614,14 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/ci/cloud_services/azure/ @marcel.amirault /doc/ci/cloud_services/google_cloud/ @marcel.amirault /doc/ci/directed_acyclic_graph/ @marcel.amirault -/doc/ci/docker/index.md @marcel.amirault -/doc/ci/docker/using_docker_build.md @marcel.amirault +/doc/ci/docker/ @marcel.amirault /doc/ci/docker/using_docker_images.md @sselhorn -/doc/ci/docker/using_kaniko.md @marcel.amirault /doc/ci/environments/ @rdickenson +/doc/ci/examples/ @marcel.amirault /doc/ci/examples/authenticating-with-hashicorp-vault/ @marcel.amirault /doc/ci/examples/deployment/ @rdickenson /doc/ci/examples/end_to_end_testing_webdriverio/ @marcel.amirault -/doc/ci/examples/index.md @marcel.amirault /doc/ci/examples/laravel_with_gitlab_and_envoy/ @marcel.amirault -/doc/ci/examples/php.md @marcel.amirault /doc/ci/examples/semantic-release.md @claytoncornell /doc/ci/interactive_web_terminal/ @sselhorn /doc/ci/introduction/ @marcel.amirault @@ -669,16 +641,8 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/ci/services/ @sselhorn /doc/ci/ssh_keys/ @marcel.amirault /doc/ci/test_cases/ @msedlakjakubowski -/doc/ci/testing/accessibility_testing.md @marcel.amirault -/doc/ci/testing/browser_performance_testing.md @marcel.amirault +/doc/ci/testing/ @marcel.amirault /doc/ci/testing/code_quality.md @rdickenson -/doc/ci/testing/fail_fast_testing.md @marcel.amirault -/doc/ci/testing/index.md @marcel.amirault -/doc/ci/testing/load_performance_testing.md @marcel.amirault -/doc/ci/testing/metrics_reports.md @marcel.amirault -/doc/ci/testing/test_coverage_visualization.md @marcel.amirault -/doc/ci/testing/unit_test_report_examples.md @marcel.amirault -/doc/ci/testing/unit_test_reports.md @marcel.amirault /doc/ci/triggers/ @marcel.amirault /doc/ci/variables/ @marcel.amirault /doc/ci/yaml/ @marcel.amirault @@ -696,57 +660,9 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/development/cicd/ @marcel.amirault /doc/development/code_intelligence/ @aqualls /doc/development/contributing/ @sselhorn -/doc/development/database/add_foreign_key_to_existing_column.md @aqualls -/doc/development/database/adding_database_indexes.md @aqualls -/doc/development/database/avoiding_downtime_in_migrations.md @aqualls -/doc/development/database/background_migrations.md @aqualls -/doc/development/database/batched_background_migrations.md @aqualls -/doc/development/database/ci_mirrored_tables.md @aqualls -/doc/development/database/client_side_connection_pool.md @aqualls -/doc/development/database/constraint_naming_convention.md @aqualls -/doc/development/database/creating_enums.md @aqualls -/doc/development/database/database_debugging.md @aqualls -/doc/development/database/database_dictionary.md @aqualls -/doc/development/database/database_lab.md @aqualls -/doc/development/database/database_migration_pipeline.md @aqualls -/doc/development/database/database_query_comments.md @aqualls -/doc/development/database/database_reviewer_guidelines.md @aqualls -/doc/development/database/db_dump.md @aqualls -/doc/development/database/dbcheck-migrations-job.md @aqualls -/doc/development/database/deleting_migrations.md @aqualls -/doc/development/database/efficient_in_operator_queries.md @aqualls +/doc/development/database/ @aqualls /doc/development/database/filtering_by_label.md @msedlakjakubowski -/doc/development/database/foreign_keys.md @aqualls -/doc/development/database/hash_indexes.md @aqualls -/doc/development/database/index.md @aqualls -/doc/development/database/insert_into_tables_in_batches.md @aqualls -/doc/development/database/iterating_tables_in_batches.md @aqualls -/doc/development/database/keyset_pagination.md @aqualls -/doc/development/database/layout_and_access_patterns.md @aqualls -/doc/development/database/loose_foreign_keys.md @aqualls -/doc/development/database/maintenance_operations.md @aqualls -/doc/development/database/migrations_for_multiple_databases.md @aqualls /doc/development/database/multiple_databases.md @sselhorn -/doc/development/database/not_null_constraints.md @aqualls -/doc/development/database/ordering_table_columns.md @aqualls -/doc/development/database/pagination_guidelines.md @aqualls -/doc/development/database/pagination_performance_guidelines.md @aqualls -/doc/development/database/polymorphic_associations.md @aqualls -/doc/development/database/post_deployment_migrations.md @aqualls -/doc/development/database/query_count_limits.md @aqualls -/doc/development/database/query_performance.md @aqualls -/doc/development/database/query_recorder.md @aqualls -/doc/development/database/rename_database_tables.md @aqualls -/doc/development/database/serializing_data.md @aqualls -/doc/development/database/setting_multiple_values.md @aqualls -/doc/development/database/sha1_as_binary.md @aqualls -/doc/development/database/single_table_inheritance.md @aqualls -/doc/development/database/strings_and_the_text_data_type.md @aqualls -/doc/development/database/swapping_tables.md @aqualls -/doc/development/database/table_partitioning.md @aqualls -/doc/development/database/transaction_guidelines.md @aqualls -/doc/development/database/understanding_explain_plans.md @aqualls -/doc/development/database/verifying_database_capabilities.md @aqualls /doc/development/database_review.md @aqualls /doc/development/developing_with_solargraph.md @aqualls /doc/development/development_processes.md @sselhorn @@ -759,6 +675,7 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/development/experiment_guide/ @phillipwells /doc/development/export_csv.md @eread /doc/development/fe_guide/content_editor.md @ashrafkhamis +/doc/development/fe_guide/customizable_dashboards.md @lciutacu /doc/development/fe_guide/dark_mode.md @sselhorn /doc/development/fe_guide/graphql.md @sselhorn /doc/development/fe_guide/merge_request_widget_extensions.md @aqualls @@ -774,11 +691,8 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/development/gitaly.md @eread /doc/development/gitlab_flavored_markdown/ @ashrafkhamis /doc/development/gitlab_flavored_markdown/specification_guide/ @ashrafkhamis +/doc/development/graphql_guide/ @ashrafkhamis /doc/development/graphql_guide/batchloader.md @aqualls -/doc/development/graphql_guide/graphql_pro.md @ashrafkhamis -/doc/development/graphql_guide/index.md @ashrafkhamis -/doc/development/graphql_guide/monitoring.md @ashrafkhamis -/doc/development/graphql_guide/pagination.md @ashrafkhamis /doc/development/i18n/ @eread /doc/development/image_scaling.md @sselhorn /doc/development/import_export.md @eread @@ -801,7 +715,7 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/development/omnibus.md @axil /doc/development/packages/ @claytoncornell /doc/development/pages/ @ashrafkhamis -/doc/development/permissions.md @eread +/doc/development/permissions.md @jglassman1 /doc/development/policies.md @jglassman1 /doc/development/product_qualified_lead_guide/ @phillipwells /doc/development/project_templates.md @fneill @@ -827,40 +741,27 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/drawers/ @ashrafkhamis /doc/gitlab-basics/ @aqualls /doc/install/ @axil +/doc/install/aws/ @axil +/doc/install/azure/ @axil +/doc/install/google_cloud_platform/ @axil +/doc/install/migrate/ @axil +/doc/install/openshift_and_gitlab/ @axil +/doc/integration/ @jglassman1 /doc/integration/advanced_search/ @ashrafkhamis /doc/integration/akismet.md @phillipwells -/doc/integration/alicloud.md @jglassman1 /doc/integration/arkose.md @phillipwells -/doc/integration/auth0.md @jglassman1 -/doc/integration/azure.md @jglassman1 -/doc/integration/bitbucket.md @jglassman1 -/doc/integration/cas.md @jglassman1 /doc/integration/datadog.md @ashrafkhamis -/doc/integration/ding_talk.md @jglassman1 /doc/integration/external-issue-tracker.md @ashrafkhamis -/doc/integration/facebook.md @jglassman1 -/doc/integration/github.md @jglassman1 -/doc/integration/gitlab.md @jglassman1 /doc/integration/gitpod.md @ashrafkhamis /doc/integration/gmail_action_buttons_for_gitlab.md @ashrafkhamis -/doc/integration/google.md @jglassman1 /doc/integration/index.md @ashrafkhamis /doc/integration/jenkins.md @ashrafkhamis /doc/integration/jira/ @ashrafkhamis -/doc/integration/kerberos.md @jglassman1 /doc/integration/mattermost/ @axil -/doc/integration/oauth2_generic.md @jglassman1 -/doc/integration/oauth_provider.md @jglassman1 -/doc/integration/omniauth.md @jglassman1 -/doc/integration/openid_connect_provider.md @jglassman1 -/doc/integration/recaptcha.md @jglassman1 -/doc/integration/salesforce.md @jglassman1 -/doc/integration/saml.md @jglassman1 /doc/integration/security_partners/ @rdickenson /doc/integration/slash_commands.md @ashrafkhamis /doc/integration/sourcegraph.md @aqualls /doc/integration/trello_power_up.md @ashrafkhamis -/doc/integration/twitter.md @jglassman1 /doc/integration/vault.md @phillipwells /doc/operations/error_tracking.md msedlakjakubowski /doc/operations/feature_flags.md @rdickenson @@ -868,21 +769,13 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/operations/index.md @msedlakjakubowski /doc/operations/metrics/ @msedlakjakubowski /doc/operations/metrics/dashboards/ @msedlakjakubowski -/doc/operations/product_analytics.md @claytoncornell +/doc/operations/product_analytics.md @lciutacu /doc/operations/tracing.md @msedlakjakubowski /doc/policy/ @axil -/doc/raketasks/backup_gitlab.md @axil -/doc/raketasks/backup_restore.md @axil -/doc/raketasks/cleanup.md @axil +/doc/raketasks/ @axil /doc/raketasks/generate_sample_prometheus_data.md @msedlakjakubowski -/doc/raketasks/import.md @axil -/doc/raketasks/index.md @axil -/doc/raketasks/list_repos.md @axil /doc/raketasks/migrate_snippets.md @ashrafkhamis -/doc/raketasks/restore_gitlab.md @axil /doc/raketasks/spdx.md @rdickenson -/doc/raketasks/user_management.md @axil -/doc/raketasks/web_hooks.md @axil /doc/raketasks/x509_signatures.md @aqualls /doc/security/ @jglassman1 /doc/subscriptions/ @fneill @@ -892,6 +785,7 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/topics/authentication/ @jglassman1 /doc/topics/autodevops/ @phillipwells /doc/topics/autodevops/cloud_deployments/ @phillipwells +/doc/topics/awesome_co.md @rdickenson /doc/topics/git/ @aqualls /doc/topics/git/how_to_install_git/ @aqualls /doc/topics/git/lfs/ @aqualls @@ -900,17 +794,10 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/topics/offline/ @axil /doc/topics/plan_and_track.md @msedlakjakubowski /doc/tutorials/ @kpaizee -/doc/update/index.md @axil +/doc/update/ @axil /doc/update/mysql_to_postgresql.md @aqualls /doc/update/package/ @axil -/doc/update/patch_versions.md @axil -/doc/update/plan_your_upgrade.md @axil -/doc/update/restore_after_failure.md @axil -/doc/update/upgrading_from_ce_to_ee.md @axil -/doc/update/upgrading_from_source.md @axil /doc/update/upgrading_postgresql_using_slony.md @aqualls -/doc/update/with_downtime.md @axil -/doc/update/zero_downtime.md @axil /doc/user/admin_area/analytics/ @fneill /doc/user/admin_area/broadcast_messages.md @phillipwells /doc/user/admin_area/credentials_inventory.md @jglassman1 @@ -949,14 +836,8 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/user/admin_area/settings/third_party_offers.md @fneill /doc/user/admin_area/settings/usage_statistics.md @claytoncornell /doc/user/admin_area/settings/visibility_and_access_controls.md @aqualls +/doc/user/analytics/ @fneill /doc/user/analytics/ci_cd_analytics.md @rdickenson -/doc/user/analytics/code_review_analytics.md @fneill -/doc/user/analytics/index.md @fneill -/doc/user/analytics/issue_analytics.md @fneill -/doc/user/analytics/merge_request_analytics.md @fneill -/doc/user/analytics/productivity_analytics.md @fneill -/doc/user/analytics/repository_analytics.md @fneill -/doc/user/analytics/value_stream_analytics.md @fneill /doc/user/application_security/api_fuzzing/ @rdickenson /doc/user/application_security/configuration/ @rdickenson /doc/user/application_security/container_scanning/ @rdickenson @@ -992,23 +873,22 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/user/discussions/ @aqualls /doc/user/feature_flags.md @sselhorn /doc/user/free_user_limit.md @phillipwells -/doc/user/group/access_and_permissions.md @fneill +/doc/user/group/ @fneill /doc/user/group/clusters/ @phillipwells /doc/user/group/contribution_analytics/ @fneill /doc/user/group/custom_project_templates.md @eread /doc/user/group/devops_adoption/ @fneill /doc/user/group/epics/ @msedlakjakubowski /doc/user/group/import/ @eread -/doc/user/group/index.md @fneill /doc/user/group/insights/ @fneill /doc/user/group/issues_analytics/ @msedlakjakubowski /doc/user/group/iterations/ @msedlakjakubowski -/doc/user/group/manage.md @fneill /doc/user/group/planning_hierarchy/ @msedlakjakubowski /doc/user/group/repositories_analytics/ @marcel.amirault /doc/user/group/roadmap/ @msedlakjakubowski /doc/user/group/saml_sso/ @jglassman1 -/doc/user/group/settings/ @eread +/doc/user/group/settings/group_access_tokens.md @jglassman1 +/doc/user/group/settings/import_export.md @eread /doc/user/group/subgroups/ @fneill /doc/user/group/value_stream_analytics/ @fneill /doc/user/infrastructure/ @phillipwells @@ -1016,10 +896,8 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/user/infrastructure/clusters/connect/ @phillipwells /doc/user/infrastructure/clusters/deploy/ @phillipwells /doc/user/infrastructure/clusters/manage/ @phillipwells -/doc/user/infrastructure/clusters/manage/management_project_applications/certmanager.md @phillipwells -/doc/user/infrastructure/clusters/manage/management_project_applications/ingress.md @phillipwells +/doc/user/infrastructure/clusters/manage/management_project_applications/ @phillipwells /doc/user/infrastructure/clusters/manage/management_project_applications/runner.md @sselhorn -/doc/user/infrastructure/clusters/manage/management_project_applications/vault.md @phillipwells /doc/user/infrastructure/iac/ @phillipwells /doc/user/markdown.md @aqualls /doc/user/namespace/ @fneill @@ -1043,142 +921,55 @@ lib/gitlab/checks/** @proglottis @toon @zj-gitlab /doc/user/packages/terraform_module_registry/ @phillipwells /doc/user/packages/workflows/ @claytoncornell /doc/user/permissions.md @jglassman1 -/doc/user/profile/account/ @eread -/doc/user/profile/index.md @jglassman1 +/doc/user/profile/ @jglassman1 +/doc/user/profile/account/ @jglassman1 /doc/user/profile/notifications.md @msedlakjakubowski -/doc/user/profile/personal_access_tokens.md @jglassman1 -/doc/user/profile/unknown_sign_in_notification.md @jglassman1 -/doc/user/profile/wrong_two_factor_authentication_code_notification.md @jglassman1 -/doc/user/project/autocomplete_characters.md @aqualls -/doc/user/project/badges.md @aqualls +/doc/user/project/ @aqualls /doc/user/project/clusters/ @phillipwells /doc/user/project/clusters/runbooks/ @phillipwells -/doc/user/project/code_intelligence.md @aqualls -/doc/user/project/code_owners.md @aqualls /doc/user/project/deploy_boards.md @rdickenson /doc/user/project/deploy_keys/ @rdickenson /doc/user/project/deploy_tokens/ @rdickenson /doc/user/project/description_templates.md @msedlakjakubowski -/doc/user/project/file_lock.md @aqualls -/doc/user/project/git_attributes.md @aqualls -/doc/user/project/highlighting.md @aqualls -/doc/user/project/import/bitbucket.md @eread -/doc/user/project/import/bitbucket_server.md @eread -/doc/user/project/import/clearcase.md @eread -/doc/user/project/import/cvs.md @eread -/doc/user/project/import/fogbugz.md @eread -/doc/user/project/import/gitea.md @eread -/doc/user/project/import/github.md @eread -/doc/user/project/import/gitlab_com.md @eread -/doc/user/project/import/index.md @eread +/doc/user/project/import/ @eread /doc/user/project/import/jira.md @msedlakjakubowski -/doc/user/project/import/manifest.md @eread -/doc/user/project/import/perforce.md @eread -/doc/user/project/import/phabricator.md @eread -/doc/user/project/import/repo_by_url.md @eread -/doc/user/project/import/svn.md @eread -/doc/user/project/import/tfvc.md @eread /doc/user/project/index.md @fneill /doc/user/project/insights/ @fneill -/doc/user/project/integrations/asana.md @ashrafkhamis -/doc/user/project/integrations/bamboo.md @ashrafkhamis -/doc/user/project/integrations/bugzilla.md @ashrafkhamis -/doc/user/project/integrations/custom_issue_tracker.md @ashrafkhamis -/doc/user/project/integrations/discord_notifications.md @ashrafkhamis -/doc/user/project/integrations/emails_on_push.md @ashrafkhamis -/doc/user/project/integrations/ewm.md @ashrafkhamis -/doc/user/project/integrations/github.md @ashrafkhamis -/doc/user/project/integrations/gitlab_slack_application.md @ashrafkhamis -/doc/user/project/integrations/hangouts_chat.md @ashrafkhamis -/doc/user/project/integrations/harbor.md @ashrafkhamis -/doc/user/project/integrations/index.md @ashrafkhamis -/doc/user/project/integrations/irker.md @ashrafkhamis -/doc/user/project/integrations/mattermost.md @ashrafkhamis -/doc/user/project/integrations/mattermost_slash_commands.md @ashrafkhamis -/doc/user/project/integrations/microsoft_teams.md @ashrafkhamis -/doc/user/project/integrations/mock_ci.md @ashrafkhamis -/doc/user/project/integrations/pipeline_status_emails.md @ashrafkhamis -/doc/user/project/integrations/pivotal_tracker.md @ashrafkhamis +/doc/user/project/integrations/ @ashrafkhamis /doc/user/project/integrations/prometheus.md @msedlakjakubowski /doc/user/project/integrations/prometheus_library/ @msedlakjakubowski -/doc/user/project/integrations/pumble.md @ashrafkhamis -/doc/user/project/integrations/redmine.md @ashrafkhamis -/doc/user/project/integrations/servicenow.md @ashrafkhamis -/doc/user/project/integrations/shimo.md @ashrafkhamis -/doc/user/project/integrations/slack.md @ashrafkhamis -/doc/user/project/integrations/slack_slash_commands.md @ashrafkhamis -/doc/user/project/integrations/unify_circuit.md @ashrafkhamis -/doc/user/project/integrations/webex_teams.md @ashrafkhamis -/doc/user/project/integrations/webhook_events.md @ashrafkhamis -/doc/user/project/integrations/webhooks.md @ashrafkhamis -/doc/user/project/integrations/youtrack.md @ashrafkhamis -/doc/user/project/integrations/zentao.md @ashrafkhamis /doc/user/project/issue_board.md @msedlakjakubowski -/doc/user/project/issues/associate_zoom_meeting.md @msedlakjakubowski -/doc/user/project/issues/confidential_issues.md @msedlakjakubowski -/doc/user/project/issues/crosslinking_issues.md @msedlakjakubowski +/doc/user/project/issues/ @msedlakjakubowski /doc/user/project/issues/csv_import.md @eread -/doc/user/project/issues/design_management.md @msedlakjakubowski -/doc/user/project/issues/due_dates.md @msedlakjakubowski -/doc/user/project/issues/index.md @msedlakjakubowski -/doc/user/project/issues/issue_weight.md @msedlakjakubowski -/doc/user/project/issues/managing_issues.md @msedlakjakubowski -/doc/user/project/issues/multiple_assignees_for_issues.md @msedlakjakubowski -/doc/user/project/issues/related_issues.md @msedlakjakubowski -/doc/user/project/issues/sorting_issue_lists.md @msedlakjakubowski /doc/user/project/labels.md @msedlakjakubowski /doc/user/project/members/ @fneill -/doc/user/project/merge_requests/allow_collaboration.md @aqualls +/doc/user/project/merge_requests/ @aqualls /doc/user/project/merge_requests/approvals/ @aqualls -/doc/user/project/merge_requests/authorization_for_merge_requests.md @aqualls -/doc/user/project/merge_requests/changes.md @aqualls -/doc/user/project/merge_requests/cherry_pick_changes.md @aqualls -/doc/user/project/merge_requests/commit_templates.md @aqualls -/doc/user/project/merge_requests/commits.md @aqualls -/doc/user/project/merge_requests/confidential.md @aqualls -/doc/user/project/merge_requests/conflicts.md @aqualls -/doc/user/project/merge_requests/creating_merge_requests.md @aqualls /doc/user/project/merge_requests/csv_export.md @eread -/doc/user/project/merge_requests/dependencies.md @aqualls -/doc/user/project/merge_requests/drafts.md @aqualls -/doc/user/project/merge_requests/getting_started.md @aqualls -/doc/user/project/merge_requests/index.md @aqualls -/doc/user/project/merge_requests/merge_when_pipeline_succeeds.md @aqualls /doc/user/project/merge_requests/methods/ @aqualls -/doc/user/project/merge_requests/revert_changes.md @aqualls /doc/user/project/merge_requests/reviews/ @aqualls -/doc/user/project/merge_requests/squash_and_merge.md @aqualls /doc/user/project/merge_requests/status_checks.md @eread -/doc/user/project/merge_requests/versions.md @aqualls -/doc/user/project/merge_requests/widgets.md @aqualls /doc/user/project/milestones/ @msedlakjakubowski /doc/user/project/pages/ @ashrafkhamis -/doc/user/project/protected_branches.md @aqualls -/doc/user/project/protected_tags.md @aqualls -/doc/user/project/push_options.md @aqualls +/doc/user/project/pages/custom_domains_ssl_tls_certification/ @ashrafkhamis +/doc/user/project/pages/getting_started/ @ashrafkhamis /doc/user/project/quick_actions.md @msedlakjakubowski /doc/user/project/releases/ @rdickenson +/doc/user/project/repository/ @aqualls /doc/user/project/repository/branches/ @aqualls -/doc/user/project/repository/csv.md @aqualls /doc/user/project/repository/file_finder.md @ashrafkhamis -/doc/user/project/repository/forking_workflow.md @aqualls -/doc/user/project/repository/git_blame.md @aqualls -/doc/user/project/repository/git_history.md @aqualls /doc/user/project/repository/gpg_signed_commits/ @aqualls -/doc/user/project/repository/index.md @aqualls /doc/user/project/repository/jupyter_notebooks/ @aqualls /doc/user/project/repository/managing_large_repositories.md @axil /doc/user/project/repository/mirror/ @aqualls -/doc/user/project/repository/push_rules.md @aqualls /doc/user/project/repository/reducing_the_repo_size_using_git.md @eread -/doc/user/project/repository/vscode.md @aqualls /doc/user/project/repository/web_editor.md @ashrafkhamis /doc/user/project/repository/x509_signed_commits/ @aqualls /doc/user/project/requirements/ @msedlakjakubowski /doc/user/project/service_desk.md @msedlakjakubowski /doc/user/project/settings/import_export.md @eread /doc/user/project/settings/index.md @fneill -/doc/user/project/settings/project_access_tokens.md @eread +/doc/user/project/settings/project_access_tokens.md @jglassman1 /doc/user/project/time_tracking.md @msedlakjakubowski /doc/user/project/web_ide/ @ashrafkhamis /doc/user/project/wiki/ @ashrafkhamis diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js index c39e4562c14..4448a106bb6 100644 --- a/app/assets/javascripts/lib/utils/common_utils.js +++ b/app/assets/javascripts/lib/utils/common_utils.js @@ -167,7 +167,7 @@ export const contentTop = () => { return size; }, - () => getOuterHeight('.merge-request-tabs'), + () => getOuterHeight('.merge-request-sticky-header, .merge-request-tabs'), () => getOuterHeight('.js-diff-files-changed'), () => getOuterHeight('.issue-sticky-header.gl-fixed'), ({ desktop }) => { @@ -175,7 +175,9 @@ export const contentTop = () => { let size; if (desktop && diffsTabIsActive) { - size = getOuterHeight('.diff-file .file-title-flex-parent:not([style="display:none"])'); + size = getOuterHeight( + '.diffs .diff-file .file-title-flex-parent:not([style="display:none"])', + ); } return size; diff --git a/app/assets/javascripts/notes/mixins/discussion_navigation.js b/app/assets/javascripts/notes/mixins/discussion_navigation.js index db5f9ebf3f0..d75a4158440 100644 --- a/app/assets/javascripts/notes/mixins/discussion_navigation.js +++ b/app/assets/javascripts/notes/mixins/discussion_navigation.js @@ -1,136 +1,12 @@ import { mapGetters, mapActions, mapState } from 'vuex'; -import { scrollToElementWithContext, scrollToElement, contentTop } from '~/lib/utils/common_utils'; -import { updateHistory } from '~/lib/utils/url_utility'; -import eventHub from '../event_hub'; - -/** - * @param {string} selector - * @returns {boolean} - */ -function scrollTo(selector, { withoutContext = false, offset = 0 } = {}) { - const el = document.querySelector(selector); - const scrollFunction = withoutContext ? scrollToElement : scrollToElementWithContext; - - if (el) { - scrollFunction(el, { - behavior: 'auto', - offset, - }); - return true; - } - - return false; -} - -function updateUrlWithNoteId(noteId) { - const newHistoryEntry = { - state: null, - title: window.title, - url: `#note_${noteId}`, - replace: true, - }; - - if (noteId) { - // Temporarily mask the ID to avoid the browser default - // scrolling taking over which is broken with virtual - // scrolling enabled. - const note = document.querySelector(`#note_${noteId}`); - note?.setAttribute('id', `masked::${note.id}`); - - // Update the hash now that the ID "doesn't exist" in the page - updateHistory(newHistoryEntry); - - // Unmask the note's ID - note?.setAttribute('id', `note_${noteId}`); - } -} - -/** - * @param {object} self Component instance with mixin applied - * @param {string} id Discussion id we are jumping to - */ -function diffsJump({ expandDiscussion }, id, firstNoteId) { - const selector = `ul.notes[data-discussion-id="${id}"]`; - - eventHub.$once('scrollToDiscussion', () => { - scrollTo(selector); - // Wait for the discussion scroll before updating to the more specific ID - setTimeout(() => updateUrlWithNoteId(firstNoteId), 0); - }); - expandDiscussion({ discussionId: id }); -} - -/** - * @param {object} self Component instance with mixin applied - * @param {string} id Discussion id we are jumping to - * @returns {boolean} - */ -function discussionJump({ expandDiscussion }, id) { - const selector = `div.discussion[data-discussion-id="${id}"]`; - expandDiscussion({ discussionId: id }); - return scrollTo(selector, { - withoutContext: true, - offset: window.gon?.features?.movedMrSidebar ? -28 : 0, - }); -} - -/** - * @param {object} self Component instance with mixin applied - * @param {string} id Discussion id we are jumping to - */ -function switchToDiscussionsTabAndJumpTo(self, id) { - window.mrTabs.eventHub.$once('MergeRequestTabChange', () => { - setTimeout(() => discussionJump(self, id), 0); - }); - - window.mrTabs.tabShown('show'); -} - -/** - * @param {object} self Component instance with mixin applied - * @param {object} discussion Discussion we are jumping to - */ -function jumpToDiscussion(self, discussion) { - const { id, diff_discussion: isDiffDiscussion, notes } = discussion; - const firstNoteId = notes?.[0]?.id; - if (id) { - const activeTab = window.mrTabs.currentAction; - - if (activeTab === 'diffs' && isDiffDiscussion) { - diffsJump(self, id, firstNoteId); - } else { - switchToDiscussionsTabAndJumpTo(self, id); - } - } -} - -/** - * @param {object} self Component instance with mixin applied - * @param {function} fn Which function used to get the target discussion's id - */ -function handleDiscussionJump(self, fn) { - const isDiffView = window.mrTabs.currentAction === 'diffs'; - const targetId = fn(self.currentDiscussionId, isDiffView); - const discussion = self.getDiscussion(targetId); - const discussionFilePath = discussion?.diff_file?.file_path; - - window.location.hash = ''; - - if (discussionFilePath) { - self.scrollToFile({ - path: discussionFilePath, - }); - } - - self.$nextTick(() => { - jumpToDiscussion(self, discussion); - self.setCurrentDiscussionId(targetId); - }); -} +import { scrollToElement, contentTop } from '~/lib/utils/common_utils'; function getAllDiscussionElements() { + const containerEl = window.mrTabs?.currentAction === 'diffs' ? '.diffs' : '.notes'; return Array.from( - document.querySelectorAll('[data-discussion-id]:not([data-discussion-resolved])'), + document.querySelectorAll( + `${containerEl} div[data-discussion-id]:not([data-discussion-resolved])`, + ), ); } @@ -182,14 +58,10 @@ function getPreviousDiscussion() { } function handleJumpForBothPages(getDiscussion, ctx, fn, scrollOptions) { - if (window.mrTabs.currentAction !== 'show') { - handleDiscussionJump(ctx, fn); - } else { - const discussion = getDiscussion(); - const id = discussion.dataset.discussionId; - ctx.expandDiscussion({ discussionId: id }); - scrollToElement(discussion, scrollOptions); - } + const discussion = getDiscussion(); + const id = discussion.dataset.discussionId; + ctx.expandDiscussion({ discussionId: id }); + scrollToElement(discussion, scrollOptions); } export default { @@ -205,9 +77,11 @@ export default { }, methods: { ...mapActions(['expandDiscussion', 'setCurrentDiscussionId']), - ...mapActions('diffs', ['scrollToFile']), + ...mapActions('diffs', ['scrollToFile', 'disableVirtualScroller']), + + async jumpToNextDiscussion(scrollOptions) { + await this.disableVirtualScroller(); - jumpToNextDiscussion(scrollOptions) { handleJumpForBothPages( getNextDiscussion, this, @@ -216,7 +90,9 @@ export default { ); }, - jumpToPreviousDiscussion(scrollOptions) { + async jumpToPreviousDiscussion(scrollOptions) { + await this.disableVirtualScroller(); + handleJumpForBothPages( getPreviousDiscussion, this, diff --git a/app/assets/javascripts/sidebar/components/sidebar_editable_item.vue b/app/assets/javascripts/sidebar/components/sidebar_editable_item.vue index e9d67d12329..1680e42e5e4 100644 --- a/app/assets/javascripts/sidebar/components/sidebar_editable_item.vue +++ b/app/assets/javascripts/sidebar/components/sidebar_editable_item.vue @@ -89,7 +89,9 @@ export default { return; } - this.edit = true; + if (this.canEdit && this.canUpdate) { + this.edit = true; + } this.$emit('open'); window.addEventListener('click', this.collapseWhenOffClick); window.addEventListener('keyup', this.collapseOnEscape); diff --git a/app/views/shared/issuable/_sidebar.html.haml b/app/views/shared/issuable/_sidebar.html.haml index 281623bdd3c..4199b7e870b 100644 --- a/app/views/shared/issuable/_sidebar.html.haml +++ b/app/views/shared/issuable/_sidebar.html.haml @@ -65,7 +65,7 @@ = gl_loading_icon(inline: true) - if issuable_sidebar.dig(:features_available, :health_status) - .js-sidebar-status-entry-point{ data: sidebar_status_data(issuable_sidebar, @project) } + .js-sidebar-health-status-entry-point{ data: sidebar_status_data(issuable_sidebar, @project) } - if issuable_sidebar.has_key?(:confidential) -# haml-lint:disable InlineJavaScript diff --git a/doc/integration/jira/index.md b/doc/integration/jira/index.md index 3db897fbb94..5daad4094f4 100644 --- a/doc/integration/jira/index.md +++ b/doc/integration/jira/index.md @@ -173,3 +173,8 @@ p.each do |project| project.jira_integration.update_attribute(:password, '') end ``` + +### `500 Whoops` when accessing a Jira issue in GitLab + +When accessing a Jira issue in GitLab, you might get a `500 Whoops, something went wrong on our end` error. +Check [`production.log`](../../administration/logs/index.md#productionlog) to see if it contains a `:NoMethodError (undefined method 'duedate' for #)` exception. If that's the case, ensure the **Due date** field is visible for issues in the integrated Jira project. diff --git a/lib/gitlab/usage/metric_definition.rb b/lib/gitlab/usage/metric_definition.rb index 2c50678c6bf..d6b1e62c84f 100644 --- a/lib/gitlab/usage/metric_definition.rb +++ b/lib/gitlab/usage/metric_definition.rb @@ -5,7 +5,7 @@ module Gitlab class MetricDefinition METRIC_SCHEMA_PATH = Rails.root.join('config', 'metrics', 'schema.json') SKIP_VALIDATION_STATUSES = %w[deprecated removed].to_set.freeze - AVAILABLE_STATUSES = %w[active data_available implemented deprecated].to_set.freeze + AVAILABLE_STATUSES = %w[active data_available implemented deprecated broken].to_set.freeze VALID_SERVICE_PING_STATUSES = %w[active data_available implemented deprecated broken].to_set.freeze InvalidError = Class.new(RuntimeError) diff --git a/locale/gitlab.pot b/locale/gitlab.pot index c48f1b974bd..545a2ca4855 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -4252,6 +4252,9 @@ msgstr "" msgid "An error occurred while fetching terraform reports." msgstr "" +msgid "An error occurred while fetching the health status." +msgstr "" + msgid "An error occurred while fetching the job log." msgstr "" @@ -15550,9 +15553,6 @@ msgstr "" msgid "Error occurred when saving reviewers" msgstr "" -msgid "Error occurred while updating the %{issuableType} status" -msgstr "" - msgid "Error occurred while updating the issue status" msgstr "" @@ -19779,9 +19779,6 @@ msgstr "" msgid "Health status" msgstr "" -msgid "Health status cannot be edited because this issue is closed" -msgstr "" - msgid "HealthCheck|Access token is" msgstr "" diff --git a/qa/Gemfile b/qa/Gemfile index 37794f63844..c3eb348ece8 100644 --- a/qa/Gemfile +++ b/qa/Gemfile @@ -27,7 +27,7 @@ gem "faraday-retry", "~> 2.0" gem 'webdrivers', '~> 5.2' gem 'zeitwerk', '~> 2.4' gem 'influxdb-client', '~> 1.17' -gem 'terminal-table', '~> 3.0.0', require: false +gem 'terminal-table', '~> 3.0.2', require: false gem 'slack-notifier', '~> 2.4', require: false gem 'fog-google', '~> 1.19', require: false gem 'fog-core', '2.1.0', require: false # fog-google generates a ton of warnings with latest core @@ -39,7 +39,7 @@ gem 'chemlab', '~> 0.10' gem 'chemlab-library-www-gitlab-com', '~> 0.1' # dependencies for jenkins client -gem 'nokogiri', '~> 1.13', '>= 1.13.8' +gem 'nokogiri', '~> 1.13', '>= 1.13.9' gem 'deprecation_toolkit', '~> 2.0.0', require: false diff --git a/qa/Gemfile.lock b/qa/Gemfile.lock index 7eaa407bb4f..bc41490dcf1 100644 --- a/qa/Gemfile.lock +++ b/qa/Gemfile.lock @@ -176,7 +176,7 @@ GEM multi_json (1.15.0) multi_xml (0.6.0) netrc (0.11.0) - nokogiri (1.13.8) + nokogiri (1.13.9) mini_portile2 (~> 2.8.0) racc (~> 1.4) octokit (5.6.1) @@ -313,7 +313,7 @@ DEPENDENCIES gitlab-qa (~> 8, >= 8.7.0) influxdb-client (~> 1.17) knapsack (~> 4.0) - nokogiri (~> 1.13, >= 1.13.8) + nokogiri (~> 1.13, >= 1.13.9) octokit (~> 5.6.1) parallel (~> 1.19) parallel_tests (~> 3.13) @@ -329,7 +329,7 @@ DEPENDENCIES ruby-debug-ide (~> 0.7.3) selenium-webdriver (~> 4.5) slack-notifier (~> 2.4) - terminal-table (~> 3.0.0) + terminal-table (~> 3.0.2) timecop (~> 0.9.5) warning (~> 1.3) webdrivers (~> 5.2) diff --git a/spec/features/issues/user_interacts_with_awards_spec.rb b/spec/features/issues/user_interacts_with_awards_spec.rb index 8ed56108f00..47b28b88108 100644 --- a/spec/features/issues/user_interacts_with_awards_spec.rb +++ b/spec/features/issues/user_interacts_with_awards_spec.rb @@ -218,7 +218,7 @@ RSpec.describe 'User interacts with awards' do expect(first('[data-testid="award-button"]')).to have_content '1' end - it 'removes award from issue' do + it 'removes award from issue', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/375241' do first('[data-testid="award-button"]').click find('[data-testid="award-button"].selected').click diff --git a/spec/features/merge_request/user_jumps_to_discussion_spec.rb b/spec/features/merge_request/user_jumps_to_discussion_spec.rb deleted file mode 100644 index 9bded1c5572..00000000000 --- a/spec/features/merge_request/user_jumps_to_discussion_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe 'User jumps to the next unresolved discussion', :js do - let(:project) { create(:project, :repository) } - let(:merge_request) do - create(:merge_request_with_diffs, source_project: project, target_project: project, source_branch: 'merge-test') - end - - let(:user) { create(:user) } - - before do - create(:discussion_note, noteable: merge_request, project: project, author: user) - - project.add_maintainer(user) - sign_in(user) - - visit(diffs_project_merge_request_path(project, merge_request)) - - wait_for_requests - end - - it 'jumps to overview tab' do - find('.discussion-next-btn').click - - expect(page).to have_css('.notes-tab.active') - end -end diff --git a/spec/frontend/notes/mixins/discussion_navigation_spec.js b/spec/frontend/notes/mixins/discussion_navigation_spec.js index 1b4e8026d84..45625d0a23f 100644 --- a/spec/frontend/notes/mixins/discussion_navigation_spec.js +++ b/spec/frontend/notes/mixins/discussion_navigation_spec.js @@ -4,7 +4,6 @@ import Vuex from 'vuex'; import { setHTMLFixture } from 'helpers/fixtures'; import createEventHub from '~/helpers/event_hub_factory'; import * as utils from '~/lib/utils/common_utils'; -import eventHub from '~/notes/event_hub'; import discussionNavigation from '~/notes/mixins/discussion_navigation'; import notesModule from '~/notes/stores/modules'; @@ -35,13 +34,15 @@ describe('Discussion navigation mixin', () => { beforeEach(() => { setHTMLFixture( - [...'abcde'] + `
+ ${[...'abcde'] .map( (id) => `
    `, ) - .join(''), + .join('')} +
    `, ); jest.spyOn(utils, 'scrollToElementWithContext'); @@ -58,7 +59,7 @@ describe('Discussion navigation mixin', () => { }, diffs: { namespaced: true, - actions: { scrollToFile }, + actions: { scrollToFile, disableVirtualScroller: () => {} }, state: { diffFiles: [] }, }, }, @@ -73,9 +74,6 @@ describe('Discussion navigation mixin', () => { jest.clearAllMocks(); }); - const findDiscussion = (selector, id) => - document.querySelector(`${selector}[data-discussion-id="${id}"]`); - describe('jumpToFirstUnresolvedDiscussion method', () => { let vm; @@ -110,14 +108,14 @@ describe('Discussion navigation mixin', () => { }); describe.each` - fn | args | currentId | expected - ${'jumpToNextDiscussion'} | ${[]} | ${null} | ${'a'} - ${'jumpToNextDiscussion'} | ${[]} | ${'a'} | ${'c'} - ${'jumpToNextDiscussion'} | ${[]} | ${'e'} | ${'a'} - ${'jumpToPreviousDiscussion'} | ${[]} | ${null} | ${'e'} - ${'jumpToPreviousDiscussion'} | ${[]} | ${'e'} | ${'c'} - ${'jumpToPreviousDiscussion'} | ${[]} | ${'c'} | ${'a'} - `('$fn (args = $args, currentId = $currentId)', ({ fn, args, currentId, expected }) => { + fn | args | currentId + ${'jumpToNextDiscussion'} | ${[]} | ${null} + ${'jumpToNextDiscussion'} | ${[]} | ${'a'} + ${'jumpToNextDiscussion'} | ${[]} | ${'e'} + ${'jumpToPreviousDiscussion'} | ${[]} | ${null} + ${'jumpToPreviousDiscussion'} | ${[]} | ${'e'} + ${'jumpToPreviousDiscussion'} | ${[]} | ${'c'} + `('$fn (args = $args, currentId = $currentId)', ({ fn, args, currentId }) => { beforeEach(() => { store.state.notes.currentDiscussionId = currentId; }); @@ -130,125 +128,18 @@ describe('Discussion navigation mixin', () => { await nextTick(); }); - it('expands discussion', () => { + it('expands discussion', async () => { + await nextTick(); + expect(expandDiscussion).toHaveBeenCalled(); }); - it('scrolls to element', () => { + it('scrolls to element', async () => { + await nextTick(); + expect(utils.scrollToElement).toHaveBeenCalled(); }); }); - - describe('on `diffs` active tab', () => { - beforeEach(async () => { - window.mrTabs.currentAction = 'diffs'; - wrapper.vm[fn](...args); - - await nextTick(); - }); - - it('sets current discussion', () => { - expect(store.state.notes.currentDiscussionId).toEqual(expected); - }); - - it('expands discussion', () => { - expect(expandDiscussion).toHaveBeenCalled(); - }); - - it('scrolls when scrollToDiscussion is emitted', () => { - expect(utils.scrollToElementWithContext).not.toHaveBeenCalled(); - - eventHub.$emit('scrollToDiscussion'); - - expect(utils.scrollToElementWithContext).toHaveBeenCalledWith( - findDiscussion('ul.notes', expected), - { behavior: 'auto', offset: 0 }, - ); - }); - }); - - describe('on `other` active tab', () => { - beforeEach(async () => { - window.mrTabs.currentAction = 'other'; - wrapper.vm[fn](...args); - - await nextTick(); - }); - - it('sets current discussion', () => { - expect(store.state.notes.currentDiscussionId).toEqual(expected); - }); - - it('does not expand discussion yet', () => { - expect(expandDiscussion).not.toHaveBeenCalled(); - }); - - it('shows mrTabs', () => { - expect(window.mrTabs.tabShown).toHaveBeenCalledWith('show'); - }); - - describe('when tab is changed', () => { - beforeEach(() => { - window.mrTabs.eventHub.$emit('MergeRequestTabChange'); - - jest.runAllTimers(); - }); - - it('expands discussion', () => { - expect(expandDiscussion).toHaveBeenCalledWith(expect.anything(), { - discussionId: expected, - }); - }); - - it('scrolls to discussion', () => { - expect(utils.scrollToElement).toHaveBeenCalledWith( - findDiscussion('div.discussion', expected), - { behavior: 'auto', offset: 0 }, - ); - }); - }); - }); - }); - - describe('virtual scrolling feature', () => { - beforeEach(() => { - jest.spyOn(store, 'dispatch'); - - store.state.notes.currentDiscussionId = 'a'; - window.location.hash = 'test'; - }); - - afterEach(() => { - window.gon = {}; - window.location.hash = ''; - }); - - it('resets location hash', async () => { - wrapper.vm.jumpToNextDiscussion(); - - await nextTick(); - - expect(window.location.hash).toBe(''); - }); - - it.each` - tabValue - ${'diffs'} - ${'other'} - `( - 'calls scrollToFile with setHash as $hashValue when the tab is $tabValue', - async ({ tabValue }) => { - window.mrTabs.currentAction = tabValue; - - wrapper.vm.jumpToNextDiscussion(); - - await nextTick(); - - expect(store.dispatch).toHaveBeenCalledWith('diffs/scrollToFile', { - path: 'test.js', - }); - }, - ); }); }); }); diff --git a/spec/frontend/sidebar/components/assignees/sidebar_editable_item_spec.js b/spec/frontend/sidebar/components/assignees/sidebar_editable_item_spec.js index 724fba62479..6c22d2f687d 100644 --- a/spec/frontend/sidebar/components/assignees/sidebar_editable_item_spec.js +++ b/spec/frontend/sidebar/components/assignees/sidebar_editable_item_spec.js @@ -67,15 +67,33 @@ describe('boards sidebar remove issue', () => { expect(findLoader().exists()).toBe(true); }); - it('shows expanded content and hides collapsed content when clicking edit button', async () => { - const slots = { default: '
    Select item
    ' }; - createComponent({ canUpdate: true, slots }); - findEditButton().vm.$emit('click'); + describe('when clicking edit button', () => { + describe('when can edit', () => { + it('shows expanded (editable) content', async () => { + const slots = { default: '
    Select item
    ' }; + createComponent({ canUpdate: true, slots }); + findEditButton().vm.$emit('click'); - await nextTick(); + await nextTick(); - expect(findCollapsed().isVisible()).toBe(false); - expect(findExpanded().isVisible()).toBe(true); + expect(findCollapsed().isVisible()).toBe(false); + expect(findExpanded().isVisible()).toBe(true); + }); + }); + + describe('when cannot edit', () => { + it('shows collapsed (non-editable) content', async () => { + const slots = { default: '
    Select item
    ' }; + createComponent({ canUpdate: false, slots }); + // Simulate parent component calling `expand` method when user + // clicks on collapsed sidebar (e.g. in sidebar_weight_widget.vue) + wrapper.vm.expand(); + await nextTick(); + + expect(findCollapsed().isVisible()).toBe(true); + expect(findExpanded().isVisible()).toBe(false); + }); + }); }); }); diff --git a/spec/support_specs/helpers/stub_method_calls_spec.rb b/spec/support_specs/helpers/stub_method_calls_spec.rb index 837a2162bcd..7a842f83cd2 100644 --- a/spec/support_specs/helpers/stub_method_calls_spec.rb +++ b/spec/support_specs/helpers/stub_method_calls_spec.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true -require 'spec_helper' +require 'fast_spec_helper' + +require_relative '../../support/helpers/stub_method_calls' RSpec.describe StubMethodCalls do include described_class