diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-12 21:12:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-11-12 21:12:20 +0300 |
commit | 60aef5496ecea447e860786fe391eb45d2cf61e5 (patch) | |
tree | a20fdcc01a8d384e8b6d9c9cc6f58ad3177070d7 /app | |
parent | 76cbe9e688549d47b0055573380b908cf9a72ed1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app')
30 files changed, 49 insertions, 37 deletions
diff --git a/app/assets/images/auth_buttons/dingtalk_64.png b/app/assets/images/auth_buttons/dingtalk_64.png Binary files differnew file mode 100644 index 00000000000..77b3fa752bc --- /dev/null +++ b/app/assets/images/auth_buttons/dingtalk_64.png diff --git a/app/controllers/projects/blame_controller.rb b/app/controllers/projects/blame_controller.rb index 1df7b9ed165..0f87690bba5 100644 --- a/app/controllers/projects/blame_controller.rb +++ b/app/controllers/projects/blame_controller.rb @@ -10,6 +10,7 @@ class Projects::BlameController < Projects::ApplicationController before_action :authorize_download_code! feature_category :source_code_management + urgency :low, [:show] def show @blob = @repository.blob_at(@commit.id, @path) diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 17fd28ee06a..cd50c8cf5b1 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -40,6 +40,7 @@ class Projects::BlobController < Projects::ApplicationController track_redis_hll_event :create, :update, name: 'g_edit_by_sfe' feature_category :source_code_management + urgency :low, [:create, :show, :edit, :update, :diff] before_action do push_frontend_feature_flag(:refactor_blob_viewer, @project, default_enabled: :yaml) diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb index 3b9dde68ded..63ac5f97420 100644 --- a/app/controllers/projects/branches_controller.rb +++ b/app/controllers/projects/branches_controller.rb @@ -14,6 +14,7 @@ class Projects::BranchesController < Projects::ApplicationController before_action :limit_diverging_commit_counts!, only: [:diverging_commit_counts] feature_category :source_code_management + urgency :low, [:index, :diverging_commit_counts, :create, :destroy] def index respond_to do |format| diff --git a/app/controllers/projects/commit_controller.rb b/app/controllers/projects/commit_controller.rb index 6748be06ded..62935e133c5 100644 --- a/app/controllers/projects/commit_controller.rb +++ b/app/controllers/projects/commit_controller.rb @@ -24,6 +24,7 @@ class Projects::CommitController < Projects::ApplicationController COMMIT_DIFFS_PER_PAGE = 20 feature_category :source_code_management + urgency :low, [:pipelines, :merge_requests, :show] def show apply_diff_view_cookie! diff --git a/app/controllers/projects/commits_controller.rb b/app/controllers/projects/commits_controller.rb index 0132306dd90..1ca35903703 100644 --- a/app/controllers/projects/commits_controller.rb +++ b/app/controllers/projects/commits_controller.rb @@ -17,6 +17,7 @@ class Projects::CommitsController < Projects::ApplicationController before_action :set_commits, except: :commits_root feature_category :source_code_management + urgency :low, [:signatures, :show] def commits_root redirect_to project_commits_path(@project, @project.default_branch) diff --git a/app/controllers/projects/compare_controller.rb b/app/controllers/projects/compare_controller.rb index 99f62c18593..07f7c1cf7de 100644 --- a/app/controllers/projects/compare_controller.rb +++ b/app/controllers/projects/compare_controller.rb @@ -21,6 +21,7 @@ class Projects::CompareController < Projects::ApplicationController before_action :validate_refs! feature_category :source_code_management + urgency :low, [:show, :create, :signatures] # Diffs may be pretty chunky, the less is better in this endpoint. # Pagination design guides: https://design.gitlab.com/components/pagination/#behavior diff --git a/app/controllers/projects/find_file_controller.rb b/app/controllers/projects/find_file_controller.rb index 89e72d98a33..c6bc115e737 100644 --- a/app/controllers/projects/find_file_controller.rb +++ b/app/controllers/projects/find_file_controller.rb @@ -11,6 +11,7 @@ class Projects::FindFileController < Projects::ApplicationController before_action :authorize_download_code! feature_category :source_code_management + urgency :low, [:show, :list] def show return render_404 unless @repository.commit(@ref) diff --git a/app/controllers/projects/forks_controller.rb b/app/controllers/projects/forks_controller.rb index 7135c0d959e..5154f145b46 100644 --- a/app/controllers/projects/forks_controller.rb +++ b/app/controllers/projects/forks_controller.rb @@ -15,6 +15,7 @@ class Projects::ForksController < Projects::ApplicationController before_action :authorize_fork_namespace!, only: [:create] feature_category :source_code_management + urgency :low, [:index] before_action do push_frontend_feature_flag(:fork_project_form, @project, default_enabled: :yaml) diff --git a/app/controllers/projects/graphs_controller.rb b/app/controllers/projects/graphs_controller.rb index 7a7961c28bb..82eddd618a5 100644 --- a/app/controllers/projects/graphs_controller.rb +++ b/app/controllers/projects/graphs_controller.rb @@ -12,6 +12,7 @@ class Projects::GraphsController < Projects::ApplicationController track_redis_hll_event :charts, name: 'p_analytics_repo' feature_category :source_code_management + urgency :low, [:show] def show respond_to do |format| diff --git a/app/controllers/projects/network_controller.rb b/app/controllers/projects/network_controller.rb index f3a7bc7913e..84ac9fb01fd 100644 --- a/app/controllers/projects/network_controller.rb +++ b/app/controllers/projects/network_controller.rb @@ -11,6 +11,7 @@ class Projects::NetworkController < Projects::ApplicationController before_action :assign_commit feature_category :source_code_management + urgency :low, [:show] def show @url = project_network_path(@project, @ref, @options.merge(format: :json)) diff --git a/app/controllers/projects/refs_controller.rb b/app/controllers/projects/refs_controller.rb index 4d23c853334..73eb6bb2bf2 100644 --- a/app/controllers/projects/refs_controller.rb +++ b/app/controllers/projects/refs_controller.rb @@ -12,6 +12,7 @@ class Projects::RefsController < Projects::ApplicationController before_action :authorize_download_code! feature_category :source_code_management + urgency :low, [:switch, :logs_tree] def switch respond_to do |format| diff --git a/app/controllers/projects/settings/repository_controller.rb b/app/controllers/projects/settings/repository_controller.rb index 728231dbdbd..cc419bab687 100644 --- a/app/controllers/projects/settings/repository_controller.rb +++ b/app/controllers/projects/settings/repository_controller.rb @@ -12,6 +12,7 @@ module Projects feature_category :source_code_management, [:show, :cleanup] feature_category :continuous_delivery, [:create_deploy_token] + urgency :low, [:show] def show render_show diff --git a/app/controllers/projects/tags_controller.rb b/app/controllers/projects/tags_controller.rb index 00b0b791f01..de0faaca9c0 100644 --- a/app/controllers/projects/tags_controller.rb +++ b/app/controllers/projects/tags_controller.rb @@ -11,6 +11,7 @@ class Projects::TagsController < Projects::ApplicationController before_action :authorize_admin_tag!, only: [:new, :create, :destroy] feature_category :source_code_management + urgency :low, [:new, :show, :index] # rubocop: disable CodeReuse/ActiveRecord def index diff --git a/app/controllers/projects/templates_controller.rb b/app/controllers/projects/templates_controller.rb index 4bad6dc1b3d..6d06b05c1e9 100644 --- a/app/controllers/projects/templates_controller.rb +++ b/app/controllers/projects/templates_controller.rb @@ -6,6 +6,7 @@ class Projects::TemplatesController < Projects::ApplicationController before_action :get_template_class feature_category :source_code_management + urgency :low, [:names] def index templates = @template_type.template_subsets(project) diff --git a/app/controllers/projects/tree_controller.rb b/app/controllers/projects/tree_controller.rb index 72bb03b63a3..c36b30e198b 100644 --- a/app/controllers/projects/tree_controller.rb +++ b/app/controllers/projects/tree_controller.rb @@ -23,6 +23,7 @@ class Projects::TreeController < Projects::ApplicationController end feature_category :source_code_management + urgency :low, [:show] def show return render_404 unless @commit diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index bbf33865a26..a5fa1807cc9 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -52,6 +52,7 @@ class ProjectsController < Projects::ApplicationController feature_category :team_planning, [:preview_markdown, :new_issuable_address] feature_category :importers, [:export, :remove_export, :generate_new_export, :download_export] feature_category :code_review, [:unfoldered_environment_names] + urgency :low, [:refs] def index redirect_to(current_user ? root_path : explore_root_path) diff --git a/app/controllers/repositories/lfs_api_controller.rb b/app/controllers/repositories/lfs_api_controller.rb index a7719516cb6..30cafb6747e 100644 --- a/app/controllers/repositories/lfs_api_controller.rb +++ b/app/controllers/repositories/lfs_api_controller.rb @@ -13,6 +13,7 @@ module Repositories # added here as a part of the refactor, will be removed # https://gitlab.com/gitlab-org/gitlab/-/issues/328692 delegate :deploy_token, :user, to: :authentication_result, allow_nil: true + urgency :medium, [:batch] def batch unless objects.present? diff --git a/app/controllers/repositories/lfs_storage_controller.rb b/app/controllers/repositories/lfs_storage_controller.rb index 6ec63a0f939..252b604dcb0 100644 --- a/app/controllers/repositories/lfs_storage_controller.rb +++ b/app/controllers/repositories/lfs_storage_controller.rb @@ -11,6 +11,8 @@ module Repositories # added here as a part of the refactor, will be removed # https://gitlab.com/gitlab-org/gitlab/-/issues/328692 delegate :deploy_token, :user, to: :authentication_result, allow_nil: true + urgency :medium, [:download, :upload_authorize] + urgency :low, [:upload_finalize] def download lfs_object = LfsObject.find_by_oid(oid) diff --git a/app/helpers/auth_helper.rb b/app/helpers/auth_helper.rb index a0c3a6f2f52..6fe92a5a978 100644 --- a/app/helpers/auth_helper.rb +++ b/app/helpers/auth_helper.rb @@ -8,6 +8,7 @@ module AuthHelper azure_oauth2 bitbucket facebook + dingtalk github gitlab google_oauth2 diff --git a/app/models/concerns/integrations/reactively_cached.rb b/app/models/concerns/integrations/reactively_cached.rb new file mode 100644 index 00000000000..62eff06c8e2 --- /dev/null +++ b/app/models/concerns/integrations/reactively_cached.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Integrations + module ReactivelyCached + extend ActiveSupport::Concern + + included do + include ::ReactiveCaching + + # Default cache key: class name + project_id + self.reactive_cache_key = ->(integration) { [integration.class.model_name.singular, integration.project_id] } + self.reactive_cache_work_type = :external_dependency + end + end +end diff --git a/app/models/concerns/reactive_service.rb b/app/models/concerns/reactive_service.rb deleted file mode 100644 index c444f238944..00000000000 --- a/app/models/concerns/reactive_service.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -module ReactiveService - extend ActiveSupport::Concern - - included do - include ReactiveCaching - - # Default cache key: class name + project_id - self.reactive_cache_key = ->(service) { [service.class.model_name.singular, service.project_id] } - self.reactive_cache_work_type = :external_dependency - end -end diff --git a/app/models/integrations/bamboo.rb b/app/models/integrations/bamboo.rb index 1a7cbaa34c7..0774b84b69f 100644 --- a/app/models/integrations/bamboo.rb +++ b/app/models/integrations/bamboo.rb @@ -3,7 +3,7 @@ module Integrations class Bamboo < BaseCi include ActionView::Helpers::UrlHelper - include ReactiveService + include ReactivelyCached prop_accessor :bamboo_url, :build_key, :username, :password diff --git a/app/models/integrations/buildkite.rb b/app/models/integrations/buildkite.rb index 94a37f0c4f2..9fad3a42647 100644 --- a/app/models/integrations/buildkite.rb +++ b/app/models/integrations/buildkite.rb @@ -5,7 +5,7 @@ require "addressable/uri" module Integrations class Buildkite < BaseCi include HasWebHook - include ReactiveService + include ReactivelyCached extend Gitlab::Utils::Override ENDPOINT = "https://buildkite.com" diff --git a/app/models/integrations/drone_ci.rb b/app/models/integrations/drone_ci.rb index c93ae432fe9..6843aa21892 100644 --- a/app/models/integrations/drone_ci.rb +++ b/app/models/integrations/drone_ci.rb @@ -3,7 +3,7 @@ module Integrations class DroneCi < BaseCi include HasWebHook - include ReactiveService + include ReactivelyCached include ServicePushDataValidations extend Gitlab::Utils::Override diff --git a/app/models/integrations/teamcity.rb b/app/models/integrations/teamcity.rb index 3f868b57597..9da9c0d2909 100644 --- a/app/models/integrations/teamcity.rb +++ b/app/models/integrations/teamcity.rb @@ -2,7 +2,7 @@ module Integrations class Teamcity < BaseCi - include ReactiveService + include ReactivelyCached include ServicePushDataValidations prop_accessor :teamcity_url, :build_type, :username, :password diff --git a/app/views/dashboard/_snippets_head.html.haml b/app/views/dashboard/_snippets_head.html.haml index e96b5695ddc..8c468812e33 100644 --- a/app/views/dashboard/_snippets_head.html.haml +++ b/app/views/dashboard/_snippets_head.html.haml @@ -7,10 +7,6 @@ = link_to _("New snippet"), new_snippet_path, class: "gl-button btn btn-confirm", title: _("New snippet") .top-area - %ul.nav-links.nav.nav-tabs - = nav_link(page: dashboard_snippets_path, html_options: {class: 'home'}) do - = link_to dashboard_snippets_path, title: 'Your snippets', data: {placement: 'right'} do - Your snippets - = nav_link(page: explore_snippets_path) do - = link_to explore_snippets_path, title: 'Explore snippets', data: {placement: 'right'} do - Explore snippets + = gl_tabs_nav({ class: 'gl-border-0' }) do + = gl_tab_link_to _('Your snippets'), dashboard_snippets_path, { title: _('Your snippets') } + = gl_tab_link_to _('Explore snippets'), explore_snippets_path, { title: _('Explore snippets') } diff --git a/app/views/dashboard/projects/_nav.html.haml b/app/views/dashboard/projects/_nav.html.haml index f9b61bf1f3e..3e39872902d 100644 --- a/app/views/dashboard/projects/_nav.html.haml +++ b/app/views/dashboard/projects/_nav.html.haml @@ -14,8 +14,6 @@ = link_to s_('DashboardProjects|All'), dashboard_projects_path, class: params[:personal].present? ? inactive_class : active_class = link_to s_('DashboardProjects|Personal'), filter_projects_path(personal: true), class: params[:personal].present? ? active_class : inactive_class - else - %ul.nav-links.mobile-separator.nav.nav-tabs - = nav_link(html_options: { class: ("active" unless params[:personal].present?) }) do - = link_to s_('DashboardProjects|All'), dashboard_projects_path - = nav_link(html_options: { class: ("active" if params[:personal].present?) }) do - = link_to s_('DashboardProjects|Personal'), filter_projects_path(personal: true) + = gl_tabs_nav do + = gl_tab_link_to s_('DashboardProjects|All'), dashboard_projects_path, { item_active: params[:personal].blank? } + = gl_tab_link_to s_('DashboardProjects|Personal'), filter_projects_path(personal: true), { item_active: params[:personal].present? } diff --git a/app/views/explore/projects/topic.html.haml b/app/views/explore/projects/topic.html.haml index 9b6e4acb02a..aeb040ea61f 100644 --- a/app/views/explore/projects/topic.html.haml +++ b/app/views/explore/projects/topic.html.haml @@ -7,7 +7,7 @@ .gl-text-center.gl-bg-gray-10.gl-pb-2.gl-pt-6 .gl-pb-5.gl-align-items-center.gl-justify-content-center.gl-display-flex - .avatar-container.s60.gl-flex-shrink-0 + .avatar-container.rect-avatar.s60.gl-flex-shrink-0 = topic_icon(@topic, alt: _('Topic avatar'), class: 'avatar topic-avatar s60') - if @topic.name.length > max_topic_name_length %h1.gl-mt-3.str-truncated.has-tooltip{ title: @topic.name } diff --git a/app/views/shared/labels/_nav.html.haml b/app/views/shared/labels/_nav.html.haml index a0225e35c90..47e9d9b0e4a 100644 --- a/app/views/shared/labels/_nav.html.haml +++ b/app/views/shared/labels/_nav.html.haml @@ -1,14 +1,10 @@ - subscribed = params[:subscribed] .top-area.adjust - %ul.nav-links.nav.nav-tabs - %li{ class: active_when(subscribed != 'true') }> - = link_to labels_filter_path do - = _('All') + = gl_tabs_nav({ class: 'gl-flex-grow-1 gl-border-0' }) do + = gl_tab_link_to _('All'), labels_filter_path, { item_active: subscribed != 'true' } - if current_user - %li{ class: active_when(subscribed == 'true') }> - = link_to labels_filter_path(subscribed: 'true') do - = _('Subscribed') + = gl_tab_link_to _('Subscribed'), labels_filter_path(subscribed: 'true'), { item_active: subscribed == 'true' } .nav-controls = form_tag labels_filter_path, method: :get do = hidden_field_tag :subscribed, params[:subscribed] |