From 112fe349cb75b79a0075f5d3f89cf847b7beaf2d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 28 Jul 2021 21:08:53 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- .rubocop_manual_todo.yml | 1 + .../groups/components/group_item.vue | 17 ++++ .../javascripts/groups/store/groups_store.js | 15 ++- app/assets/javascripts/main.js | 7 +- .../nav/components/responsive_app.vue | 14 +-- app/assets/javascripts/nav/event_hub.js | 5 - .../nav/utils/has_menu_expanded.js | 2 - app/assets/javascripts/nav/utils/index.js | 1 - .../registry/explorer/constants/details.js | 9 +- .../registry/explorer/pages/details.vue | 2 +- .../components/self_monitor_form.vue | 16 ++- app/assets/stylesheets/framework/header.scss | 50 ++++------ app/finders/lfs_pointers_finder.rb | 36 +++++++ .../members/effective_access_level_finder.rb | 10 +- .../effective_access_level_per_user_finder.rb | 20 ++++ .../project_recalculate_per_user_service.rb | 22 +++++ .../project_recalculate_service.rb | 13 ++- app/views/layouts/header/_default.html.haml | 2 +- .../background_verification.md | 2 +- .../runbooks/planned_failover_multi_node.md | 2 +- .../runbooks/planned_failover_single_node.md | 2 +- doc/administration/geo/index.md | 4 +- .../geo/replication/configuration.md | 4 +- .../geo/replication/datatypes.md | 2 +- .../geo/replication/multiple_servers.md | 6 +- .../geo/setup/external_database.md | 2 +- doc/administration/gitaly/configure_gitaly.md | 4 +- doc/administration/gitaly/praefect.md | 2 +- .../performance/grafana_configuration.md | 2 +- .../operations/fast_ssh_key_lookup.md | 2 +- doc/administration/pages/index.md | 2 +- doc/administration/pages/source.md | 2 +- .../postgresql/replication_and_failover.md | 4 +- doc/administration/raketasks/check.md | 2 +- .../redis/replication_and_failover.md | 4 +- .../reference_architectures/10k_users.md | 2 +- .../reference_architectures/25k_users.md | 2 +- .../reference_architectures/3k_users.md | 4 +- .../reference_architectures/50k_users.md | 2 +- .../reference_architectures/5k_users.md | 2 +- doc/administration/troubleshooting/debug.md | 4 +- .../gitlab_rails_cheat_sheet.md | 2 +- .../troubleshooting/kubernetes_cheat_sheet.md | 2 +- .../navigating_gitlab_via_rails_console.md | 2 +- doc/administration/troubleshooting/ssl.md | 2 +- doc/api/events.md | 4 +- doc/api/features.md | 2 +- doc/api/job_artifacts.md | 4 +- doc/api/repositories.md | 6 +- doc/api/repository_files.md | 2 +- doc/api/services.md | 2 +- doc/api/users.md | 4 +- .../database_scaling/size-limits.md | 4 +- .../blueprints/database_testing/index.md | 2 +- doc/ci/index.md | 2 +- .../documentation/styleguide/word_list.md | 28 ++++++ doc/integration/akismet.md | 13 ++- doc/legal/developer_certificate_of_origin.md | 35 +++++++ doc/user/admin_area/license.md | 22 ++--- doc/user/packages/nuget_repository/index.md | 15 +++ lib/extracts_path.rb | 10 -- lib/gitlab/ci/limit.rb | 11 ++- lib/gitlab/ci/pipeline/metrics.rb | 2 +- .../database/migrations/instrumentation.rb | 4 +- lib/gitlab/database/migrations/observation.rb | 3 +- .../migrations/observers/query_details.rb | 2 +- .../migrations/observers/query_log.rb | 2 +- lib/tasks/gitlab/db.rake | 2 +- spec/finders/lfs_pointers_finder_spec.rb | 44 +++++++++ ...ctive_access_level_per_user_finder_spec.rb | 38 +++++++ .../groups/components/group_item_spec.js | 5 +- .../nav/components/responsive_app_spec.js | 50 ---------- .../registry/explorer/pages/details_spec.js | 4 +- spec/lib/extracts_path_spec.rb | 16 --- .../pipeline/chain/limit/deployments_spec.rb | 2 +- .../migrations/instrumentation_spec.rb | 31 +++--- .../observers/query_details_spec.rb | 7 +- .../migrations/observers/query_log_spec.rb | 7 +- ...oject_recalculate_per_user_service_spec.rb | 99 +++++++++++++++++++ spec/tasks/gitlab/db_rake_spec.rb | 6 +- .../projects/tree/show.html.haml_spec.rb | 1 - 81 files changed, 548 insertions(+), 257 deletions(-) delete mode 100644 app/assets/javascripts/nav/event_hub.js delete mode 100644 app/assets/javascripts/nav/utils/has_menu_expanded.js create mode 100644 app/finders/lfs_pointers_finder.rb create mode 100644 app/finders/projects/members/effective_access_level_per_user_finder.rb create mode 100644 app/services/authorized_project_update/project_recalculate_per_user_service.rb create mode 100644 doc/legal/developer_certificate_of_origin.md create mode 100644 spec/finders/lfs_pointers_finder_spec.rb create mode 100644 spec/finders/projects/members/effective_access_level_per_user_finder_spec.rb create mode 100644 spec/services/authorized_project_update/project_recalculate_per_user_service_spec.rb diff --git a/.rubocop_manual_todo.yml b/.rubocop_manual_todo.yml index 78f6b0fa15c..7022335631b 100644 --- a/.rubocop_manual_todo.yml +++ b/.rubocop_manual_todo.yml @@ -1031,6 +1031,7 @@ Gitlab/NamespacedClass: - 'app/finders/joined_groups_finder.rb' - 'app/finders/keys_finder.rb' - 'app/finders/labels_finder.rb' + - 'app/finders/lfs_pointers_finder.rb' - 'app/finders/license_template_finder.rb' - 'app/finders/members_finder.rb' - 'app/finders/merge_request_target_project_finder.rb' diff --git a/app/assets/javascripts/groups/components/group_item.vue b/app/assets/javascripts/groups/components/group_item.vue index ad0b27c9693..10c45abbfa2 100644 --- a/app/assets/javascripts/groups/components/group_item.vue +++ b/app/assets/javascripts/groups/components/group_item.vue @@ -28,6 +28,10 @@ export default { GlLoadingIcon, GlIcon, UserAccessRoleBadge, + ComplianceFrameworkLabel: () => + import( + 'ee_component/vue_shared/components/compliance_framework_label/compliance_framework_label.vue' + ), itemCaret, itemTypeIcon, itemStats, @@ -67,6 +71,9 @@ export default { hasAvatar() { return this.group.avatarUrl !== null; }, + hasComplianceFramework() { + return Boolean(this.group.complianceFramework?.name); + }, isGroup() { return this.group.type === 'group'; }, @@ -82,6 +89,9 @@ export default { microdata() { return this.group.microdata || {}; }, + complianceFramework() { + return this.group.complianceFramework; + }, }, methods: { onClickRowGroup(e) { @@ -167,6 +177,13 @@ export default { {{ group.permission }} +
{ - // The order is important. The `menu-expanded` is used as a source of truth for now. - // This can be simplified when the :combined_menu feature flag is removed. - // https://gitlab.com/gitlab-org/gitlab/-/issues/333180 - $('.header-content').toggleClass('menu-expanded'); - navEventHub.$emit(EVENT_RESPONSIVE_TOGGLE); + document.body.classList.toggle('top-nav-responsive-open'); }); /** diff --git a/app/assets/javascripts/nav/components/responsive_app.vue b/app/assets/javascripts/nav/components/responsive_app.vue index d601586a3f8..68a39f862fc 100644 --- a/app/assets/javascripts/nav/components/responsive_app.vue +++ b/app/assets/javascripts/nav/components/responsive_app.vue @@ -2,8 +2,7 @@ import { FREQUENT_ITEMS_PROJECTS, FREQUENT_ITEMS_GROUPS } from '~/frequent_items/constants'; import { BV_DROPDOWN_SHOW, BV_DROPDOWN_HIDE } from '~/lib/utils/constants'; import KeepAliveSlots from '~/vue_shared/components/keep_alive_slots.vue'; -import eventHub, { EVENT_RESPONSIVE_TOGGLE } from '../event_hub'; -import { resetMenuItemsActive, hasMenuExpanded } from '../utils'; +import { resetMenuItemsActive } from '../utils'; import ResponsiveHeader from './responsive_header.vue'; import ResponsiveHome from './responsive_home.vue'; import TopNavContainerView from './top_nav_container_view.vue'; @@ -33,25 +32,14 @@ export default { }, }, created() { - eventHub.$on(EVENT_RESPONSIVE_TOGGLE, this.updateResponsiveOpen); this.$root.$on(BV_DROPDOWN_SHOW, this.showMobileOverlay); this.$root.$on(BV_DROPDOWN_HIDE, this.hideMobileOverlay); - - this.updateResponsiveOpen(); }, beforeDestroy() { - eventHub.$off(EVENT_RESPONSIVE_TOGGLE, this.onToggle); this.$root.$off(BV_DROPDOWN_SHOW, this.showMobileOverlay); this.$root.$off(BV_DROPDOWN_HIDE, this.hideMobileOverlay); }, methods: { - updateResponsiveOpen() { - if (hasMenuExpanded()) { - document.body.classList.add('top-nav-responsive-open'); - } else { - document.body.classList.remove('top-nav-responsive-open'); - } - }, onMenuItemClick({ view }) { if (view) { this.activeView = view; diff --git a/app/assets/javascripts/nav/event_hub.js b/app/assets/javascripts/nav/event_hub.js deleted file mode 100644 index 2c8b1371fe3..00000000000 --- a/app/assets/javascripts/nav/event_hub.js +++ /dev/null @@ -1,5 +0,0 @@ -import eventHubFactory from '~/helpers/event_hub_factory'; - -export const EVENT_RESPONSIVE_TOGGLE = 'top-nav-responsive-toggle'; - -export default eventHubFactory(); diff --git a/app/assets/javascripts/nav/utils/has_menu_expanded.js b/app/assets/javascripts/nav/utils/has_menu_expanded.js deleted file mode 100644 index 5f126bbdf76..00000000000 --- a/app/assets/javascripts/nav/utils/has_menu_expanded.js +++ /dev/null @@ -1,2 +0,0 @@ -export const hasMenuExpanded = () => - Boolean(document.querySelector('.header-content.menu-expanded')); diff --git a/app/assets/javascripts/nav/utils/index.js b/app/assets/javascripts/nav/utils/index.js index 4fa3d0910da..6d93818f0d3 100644 --- a/app/assets/javascripts/nav/utils/index.js +++ b/app/assets/javascripts/nav/utils/index.js @@ -1,2 +1 @@ -export * from './has_menu_expanded'; export * from './reset_menu_items_active'; diff --git a/app/assets/javascripts/registry/explorer/constants/details.js b/app/assets/javascripts/registry/explorer/constants/details.js index 1c4a28125e1..0836260b71e 100644 --- a/app/assets/javascripts/registry/explorer/constants/details.js +++ b/app/assets/javascripts/registry/explorer/constants/details.js @@ -162,6 +162,9 @@ export const IMAGE_STATUS_ALERT_TYPE = { [DELETE_FAILED]: 'warning', }; -export const PACKAGE_DELETE_HELP_PAGE_PATH = helpPagePath('user/packages/container_registry', { - anchor: 'delete-images', -}); +export const PACKAGE_DELETE_HELP_PAGE_PATH = helpPagePath( + 'user/packages/container_registry/index', + { + anchor: 'delete-images', + }, +); diff --git a/app/assets/javascripts/registry/explorer/pages/details.vue b/app/assets/javascripts/registry/explorer/pages/details.vue index 02d464e1eb0..feabc4f770b 100644 --- a/app/assets/javascripts/registry/explorer/pages/details.vue +++ b/app/assets/javascripts/registry/explorer/pages/details.vue @@ -188,7 +188,7 @@ export default { diff --git a/app/assets/javascripts/self_monitor/components/self_monitor_form.vue b/app/assets/javascripts/self_monitor/components/self_monitor_form.vue index 0cab90afb3c..2f31d8ef3fb 100644 --- a/app/assets/javascripts/self_monitor/components/self_monitor_form.vue +++ b/app/assets/javascripts/self_monitor/components/self_monitor_form.vue @@ -1,6 +1,13 @@