diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:10:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 12:10:20 +0300 |
commit | 3f96425b0b9f0b4885b70db01dcd76b311ea87ab (patch) | |
tree | 0f42e42ca0876d9deca1d9cda83165ec510876e5 /app | |
parent | ba2e4183d9b07237657595821cd06689667e6762 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
17 files changed, 82 insertions, 66 deletions
diff --git a/app/assets/javascripts/packages_and_registries/package_registry/constants.js b/app/assets/javascripts/packages_and_registries/package_registry/constants.js index 4e35176c757..006164fd462 100644 --- a/app/assets/javascripts/packages_and_registries/package_registry/constants.js +++ b/app/assets/javascripts/packages_and_registries/package_registry/constants.js @@ -177,6 +177,9 @@ export const PACKAGE_TYPES = [ s__('PackageRegistry|Helm'), ]; +export const HIDE_PACKAGE_MIGRATION_SURVEY_COOKIE = 'hide_package_registry_migration_survey'; +export const SURVEY_LINK = 'https://gitlab.fra1.qualtrics.com/jfe/form/SV_cHomH9FPzOaiDTU'; + // links export const EMPTY_LIST_HELP_URL = helpPagePath('user/packages/package_registry/index'); diff --git a/app/assets/javascripts/packages_and_registries/package_registry/pages/list.vue b/app/assets/javascripts/packages_and_registries/package_registry/pages/list.vue index ed9ab0367dd..ea1432299ce 100644 --- a/app/assets/javascripts/packages_and_registries/package_registry/pages/list.vue +++ b/app/assets/javascripts/packages_and_registries/package_registry/pages/list.vue @@ -1,16 +1,18 @@ <script> -import { GlEmptyState, GlLink, GlSprintf } from '@gitlab/ui'; +import { GlBanner, GlEmptyState, GlLink, GlSprintf } from '@gitlab/ui'; import { createAlert, VARIANT_INFO } from '~/flash'; -import { historyReplaceState } from '~/lib/utils/common_utils'; +import { getCookie, historyReplaceState, parseBoolean, setCookie } from '~/lib/utils/common_utils'; import { s__ } from '~/locale'; import { SHOW_DELETE_SUCCESS_ALERT } from '~/packages_and_registries/shared/constants'; import { PROJECT_RESOURCE_TYPE, GROUP_RESOURCE_TYPE, GRAPHQL_PAGE_SIZE, + HIDE_PACKAGE_MIGRATION_SURVEY_COOKIE, DELETE_PACKAGE_SUCCESS_MESSAGE, EMPTY_LIST_HELP_URL, PACKAGE_HELP_URL, + SURVEY_LINK, } from '~/packages_and_registries/package_registry/constants'; import getPackagesQuery from '~/packages_and_registries/package_registry/graphql/queries/get_packages.query.graphql'; @@ -21,6 +23,7 @@ import PackageList from '~/packages_and_registries/package_registry/components/l export default { components: { + GlBanner, GlEmptyState, GlLink, GlSprintf, @@ -36,6 +39,7 @@ export default { sort: '', filters: {}, mutationLoading: false, + showSurveyBanner: !parseBoolean(getCookie(HIDE_PACKAGE_MIGRATION_SURVEY_COOKIE)), }; }, apollo: { @@ -114,6 +118,10 @@ export default { this.sort = sort; this.filters = { ...filters }; }, + hideSurvey() { + this.showSurveyBanner = false; + setCookie(HIDE_PACKAGE_MIGRATION_SURVEY_COOKIE, 'true'); + }, updateQuery(_, { fetchMoreResult }) { return fetchMoreResult; }, @@ -151,16 +159,33 @@ export default { noResultsText: s__( 'PackageRegistry|Learn how to %{noPackagesLinkStart}publish and share your packages%{noPackagesLinkEnd} with GitLab.', ), + surveyBannerTitle: s__('PackageRegistry|Help us learn about your registry migration needs'), + surveyBannerDescription: s__( + 'PackageRegistry|If you are interested in migrating packages from your private registry to the GitLab Package Registry, take our survey and tell us more about your needs.', + ), + surveyBannerPrimaryButtonText: s__('PackageRegistry|Take survey'), }, links: { EMPTY_LIST_HELP_URL, PACKAGE_HELP_URL, }, + surveyLink: SURVEY_LINK, }; </script> <template> <div> + <gl-banner + v-if="showSurveyBanner" + :title="$options.i18n.surveyBannerTitle" + :button-text="$options.i18n.surveyBannerPrimaryButtonText" + :button-link="$options.surveyLink" + class="gl-mt-3" + @primary="hideSurvey" + @close="hideSurvey" + > + <p>{{ $options.i18n.surveyBannerDescription }}</p> + </gl-banner> <package-title :help-url="$options.links.PACKAGE_HELP_URL" :count="packagesCount" /> <package-search @update="handleSearchUpdate" /> diff --git a/app/controllers/projects/usage_quotas_controller.rb b/app/controllers/projects/usage_quotas_controller.rb index 07a3c010f4f..d3757eaf481 100644 --- a/app/controllers/projects/usage_quotas_controller.rb +++ b/app/controllers/projects/usage_quotas_controller.rb @@ -5,7 +5,7 @@ class Projects::UsageQuotasController < Projects::ApplicationController layout "project_settings" - feature_category :utilization + feature_category :subscription_cost_management urgency :low def index diff --git a/app/finders/work_items/work_items_finder.rb b/app/finders/work_items/work_items_finder.rb index 960272fe47e..62cca06bf5e 100644 --- a/app/finders/work_items/work_items_finder.rb +++ b/app/finders/work_items/work_items_finder.rb @@ -12,6 +12,30 @@ module WorkItems private + def filter_items(items) + items = super(items) + + by_widgets(items) + end + + def by_widgets(items) + WorkItems::Type.available_widgets.each do |widget_class| + widget_filter = widget_filter_for(widget_class) + + next unless widget_filter + + items = widget_filter.filter(items, params) + end + + items + end + + def widget_filter_for(widget_class) + "WorkItems::Widgets::Filters::#{widget_class.name.demodulize.camelize}".constantize + rescue NameError + nil + end + def model_class WorkItem end diff --git a/app/models/ci/build_metadata.rb b/app/models/ci/build_metadata.rb index 33092e881f0..b4f10758c1d 100644 --- a/app/models/ci/build_metadata.rb +++ b/app/models/ci/build_metadata.rb @@ -13,6 +13,7 @@ module Ci self.table_name = 'ci_builds_metadata' self.primary_key = 'id' + self.sequence_name = 'ci_builds_metadata_id_seq' partitionable scope: :build belongs_to :build, class_name: 'CommitStatus' diff --git a/app/models/work_item.rb b/app/models/work_item.rb index 05e45fa5b29..ed6f9d161a6 100644 --- a/app/models/work_item.rb +++ b/app/models/work_item.rb @@ -16,8 +16,14 @@ class WorkItem < Issue scope :inc_relations_for_permission_check, -> { includes(:author, project: :project_feature) } - def self.assignee_association_name - 'issue' + class << self + def assignee_association_name + 'issue' + end + + def test_reports_join_column + 'issues.id' + end end def noteable_target_type_name diff --git a/app/services/clusters/applications/check_uninstall_progress_service.rb b/app/services/clusters/applications/check_uninstall_progress_service.rb deleted file mode 100644 index cd213c3ebbf..00000000000 --- a/app/services/clusters/applications/check_uninstall_progress_service.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -module Clusters - module Applications - class CheckUninstallProgressService < CheckProgressService - private - - def operation_in_progress? - app.uninstalling? - end - - def on_success - app.post_uninstall - app.destroy! - rescue StandardError => e - app.make_errored!(_('Application uninstalled but failed to destroy: %{error_message}') % { error_message: e.message }) - ensure - remove_uninstallation_pod - end - - def check_timeout - if timed_out? - app.make_errored!(_('Operation timed out. Check pod logs for %{pod_name} for more details.') % { pod_name: pod_name }) - else - WaitForUninstallAppWorker.perform_in(WaitForUninstallAppWorker::INTERVAL, app.name, app.id) - end - end - - def pod_name - app.uninstall_command.pod_name - end - - def timed_out? - Time.current.utc - app.updated_at.utc > WaitForUninstallAppWorker::TIMEOUT - end - - def remove_uninstallation_pod - helm_api.delete_pod!(pod_name) - end - end - end -end diff --git a/app/views/layouts/_page.html.haml b/app/views/layouts/_page.html.haml index 014e26c7613..d668399b408 100644 --- a/app/views/layouts/_page.html.haml +++ b/app/views/layouts/_page.html.haml @@ -24,7 +24,7 @@ = yield :group_invite_members_banner - unless @hide_breadcrumbs = render "layouts/nav/breadcrumbs" - %div{ class: "#{(container_class unless @no_container)} #{@content_class}" } + %div{ class: "#{container_class unless @no_container} #{@content_class}" } %main.content{ id: "content-body", **page_itemtype } = render "layouts/flash", extra_flash_class: 'limit-container-width' = yield :after_flash_content diff --git a/app/views/layouts/header/_default.html.haml b/app/views/layouts/header/_default.html.haml index 0dbeebd0ad0..bbcfb9c1565 100644 --- a/app/views/layouts/header/_default.html.haml +++ b/app/views/layouts/header/_default.html.haml @@ -56,7 +56,7 @@ container: 'body' } do = sprite_icon('issues') - issues_count = assigned_issuables_count(:issues) - = gl_badge_tag({ size: :sm, variant: :success }, { class: "gl-ml-n2 #{(' gl-display-none' if issues_count == 0)}", "aria-label": n_("%d assigned issue", "%d assigned issues", issues_count) % issues_count }) do + = gl_badge_tag({ size: :sm, variant: :success }, { class: "gl-ml-n2 #{'gl-display-none' if issues_count == 0}", "aria-label": n_("%d assigned issue", "%d assigned issues", issues_count) % issues_count }) do = number_with_delimiter(issues_count) - if header_link?(:merge_requests) = nav_link(path: 'dashboard#merge_requests', html_options: { class: "user-counter dropdown" }) do @@ -70,7 +70,7 @@ track_property: 'navigation', container: 'body' } do = sprite_icon('git-merge') - = gl_badge_tag({ size: :sm, variant: :warning }, { class: "js-merge-requests-count gl-ml-n2#{(' gl-display-none' if user_merge_requests_counts[:total] == 0)}", "aria-label": n_("%d merge request", "%d merge requests", user_merge_requests_counts[:total]) % user_merge_requests_counts[:total] }) do + = gl_badge_tag({ size: :sm, variant: :warning }, { class: "js-merge-requests-count gl-ml-n2 #{'gl-display-none' if user_merge_requests_counts[:total] == 0}", "aria-label": n_("%d merge request", "%d merge requests", user_merge_requests_counts[:total]) % user_merge_requests_counts[:total] }) do = number_with_delimiter(user_merge_requests_counts[:total]) = sprite_icon('chevron-down', css_class: 'caret-down gl-mx-0!') .dropdown-menu.dropdown-menu-right @@ -98,7 +98,7 @@ = sprite_icon('todo-done') -# The todos' counter badge's visibility is being toggled by adding or removing the .hidden class in Js. -# We'll eventually migrate to .gl-display-none: https://gitlab.com/gitlab-org/gitlab/-/issues/351792. - = gl_badge_tag({ size: :sm, variant: :info }, { class: "js-todos-count gl-ml-n2#{(' hidden' if todos_pending_count == 0)}", "aria-label": _("Todos count") }) do + = gl_badge_tag({ size: :sm, variant: :info }, { class: "js-todos-count gl-ml-n2 #{'hidden' if todos_pending_count == 0}", "aria-label": _("Todos count") }) do = todos_count_format(todos_pending_count) %li.nav-item.header-help.dropdown.d-none.d-md-block{ data: { track_action: 'click_question_mark_link', track_label: 'main_navigation', track_property: 'navigation', track_experiment: 'cross_stage_fdm' } } = link_to help_path, class: 'header-help-dropdown-toggle gl-relative', data: { toggle: "dropdown" } do diff --git a/app/views/projects/merge_requests/dropdowns/_branch.html.haml b/app/views/projects/merge_requests/dropdowns/_branch.html.haml index a60c445aa51..d6af8b2f5a5 100644 --- a/app/views/projects/merge_requests/dropdowns/_branch.html.haml +++ b/app/views/projects/merge_requests/dropdowns/_branch.html.haml @@ -1,5 +1,5 @@ %ul - branches.each do |branch| %li - %a{ href: '#', class: "#{('is-active' if selected == branch)}", title: branch, data: { id: branch } } + %a{ href: '#', class: "#{'is-active' if selected == branch}", title: branch, data: { id: branch } } = branch diff --git a/app/views/projects/merge_requests/dropdowns/_project.html.haml b/app/views/projects/merge_requests/dropdowns/_project.html.haml index b3cf3c1d369..41c0b0ab55b 100644 --- a/app/views/projects/merge_requests/dropdowns/_project.html.haml +++ b/app/views/projects/merge_requests/dropdowns/_project.html.haml @@ -1,5 +1,5 @@ %ul - projects.each do |project| %li - %a{ href: "#", class: "#{('is-active' if selected == project.id)}", data: { id: project.id, 'refs-url': refs_project_path(project) } } + %a{ href: "#", class: "#{'is-active' if selected == project.id}", data: { id: project.id, 'refs-url': refs_project_path(project) } } = project.full_path diff --git a/app/views/shared/_flash_user_callout.html.haml b/app/views/shared/_flash_user_callout.html.haml index 7b2d59407b4..c549c4e6e4d 100644 --- a/app/views/shared/_flash_user_callout.html.haml +++ b/app/views/shared/_flash_user_callout.html.haml @@ -4,7 +4,7 @@ .flash-container.flash-container-page.user-callout{ data: callout_data } -# We currently only support `alert`, `warning`, `notice`, `success` %div{ class: "flash-#{flash_type}" } - %div{ class: "#{(container_class unless fluid_layout)} #{(extra_flash_class unless @no_container)} #{@content_class}" } + %div{ class: "#{container_class unless fluid_layout} #{extra_flash_class unless @no_container} #{@content_class}" } %span= message %button.btn.gl-button.btn-default.close.js-close{ type: 'button', 'aria-label' => _('Dismiss') } diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index c0bc50fef5b..1645c2695b5 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -42,7 +42,7 @@ - if current_user %li.gl-display-inline-block.label-subscription.js-label-subscription.gl-ml-3 - if label.can_subscribe_to_label_in_different_levels? - = render Pajamas::ButtonComponent.new(button_options: { class: "js-unsubscribe-button #{('hidden' if status.unsubscribed?)}", data: { url: toggle_subscription_path, toggle: 'tooltip', container: 'body' }, title: tooltip_title } ) do + = render Pajamas::ButtonComponent.new(button_options: { class: "js-unsubscribe-button #{'hidden' if status.unsubscribed?}", data: { url: toggle_subscription_path, toggle: 'tooltip', container: 'body' }, title: tooltip_title } ) do = _('Unsubscribe') .dropdown.dropdown-group-label{ class: ('hidden' unless status.unsubscribed?) } = render Pajamas::ButtonComponent.new(button_options: { class: 'gl-w-full', data: { toggle: 'dropdown' } }) do @@ -51,10 +51,10 @@ .dropdown-menu.dropdown-open-left %ul %li - = render Pajamas::ButtonComponent.new(category: :tertiary, button_options: { class: "js-subscribe-button #{('hidden' unless status.unsubscribed?)}", data: { status: status, url: toggle_subscription_project_label_path(@project, label) } } ) do + = render Pajamas::ButtonComponent.new(category: :tertiary, button_options: { class: "js-subscribe-button #{'hidden' unless status.unsubscribed?}", data: { status: status, url: toggle_subscription_project_label_path(@project, label) } } ) do = _('Subscribe at project level') %li - = render Pajamas::ButtonComponent.new(category: :tertiary, button_options: { class: "js-subscribe-button js-group-level #{('hidden' unless status.unsubscribed?)}", data: { status: status, url: toggle_subscription_group_label_path(label.group, label) } } ) do + = render Pajamas::ButtonComponent.new(category: :tertiary, button_options: { class: "js-subscribe-button js-group-level #{'hidden' unless status.unsubscribed?}", data: { status: status, url: toggle_subscription_group_label_path(label.group, label) } } ) do = _('Subscribe at group level') - else = render Pajamas::ButtonComponent.new(button_options: { class: 'js-subscribe-button gl-w-full', data: { status: status, url: toggle_subscription_path, toggle: 'tooltip', container: 'body' }, title: tooltip_title } ) do diff --git a/app/workers/all_queues.yml b/app/workers/all_queues.yml index a0f6da57f9e..c28f4a899b2 100644 --- a/app/workers/all_queues.yml +++ b/app/workers/all_queues.yml @@ -779,7 +779,7 @@ :tags: [] - :name: cronjob:users_deactivate_dormant_users :worker_name: Users::DeactivateDormantUsersWorker - :feature_category: :utilization + :feature_category: :subscription_cost_management :has_external_dependencies: false :urgency: :low :resource_boundary: :unknown @@ -3236,7 +3236,7 @@ :tags: [] - :name: update_highest_role :worker_name: UpdateHighestRoleWorker - :feature_category: :utilization + :feature_category: :subscription_usage_reports :has_external_dependencies: false :urgency: :high :resource_boundary: :unknown diff --git a/app/workers/clusters/applications/wait_for_uninstall_app_worker.rb b/app/workers/clusters/applications/wait_for_uninstall_app_worker.rb index 510ea8e7b17..974d99139a1 100644 --- a/app/workers/clusters/applications/wait_for_uninstall_app_worker.rb +++ b/app/workers/clusters/applications/wait_for_uninstall_app_worker.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# DEPRECATED +# +# To be removed by https://gitlab.com/gitlab-org/gitlab/-/issues/366573 module Clusters module Applications class WaitForUninstallAppWorker # rubocop:disable Scalability/IdempotentWorker @@ -18,11 +21,7 @@ module Clusters worker_resource_boundary :cpu loggable_arguments 0 - def perform(app_name, app_id) - find_application(app_name, app_id) do |app| - Clusters::Applications::CheckUninstallProgressService.new(app).execute - end - end + def perform(app_name, app_id); end end end end diff --git a/app/workers/update_highest_role_worker.rb b/app/workers/update_highest_role_worker.rb index 064b8203d4d..a05c9c7a1e7 100644 --- a/app/workers/update_highest_role_worker.rb +++ b/app/workers/update_highest_role_worker.rb @@ -7,7 +7,7 @@ class UpdateHighestRoleWorker sidekiq_options retry: 3 - feature_category :utilization + feature_category :subscription_usage_reports urgency :high weight 2 diff --git a/app/workers/users/deactivate_dormant_users_worker.rb b/app/workers/users/deactivate_dormant_users_worker.rb index b14b7e67450..c3799480b12 100644 --- a/app/workers/users/deactivate_dormant_users_worker.rb +++ b/app/workers/users/deactivate_dormant_users_worker.rb @@ -8,7 +8,7 @@ module Users include CronjobQueue - feature_category :utilization + feature_category :subscription_cost_management def perform return if Gitlab.com? |