Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/finders/users_finder.rb14
-rw-r--r--app/helpers/application_helper.rb10
-rw-r--r--app/helpers/search_helper.rb15
-rw-r--r--app/views/layouts/_head.html.haml12
-rw-r--r--app/views/layouts/_startup_css.haml9
-rw-r--r--app/views/layouts/_startup_css_activation.haml7
6 files changed, 13 insertions, 54 deletions
diff --git a/app/finders/users_finder.rb b/app/finders/users_finder.rb
index 57dbeca5c51..13c4aae5b25 100644
--- a/app/finders/users_finder.rb
+++ b/app/finders/users_finder.rb
@@ -80,15 +80,11 @@ class UsersFinder
def by_search(users)
return users unless params[:search].present?
- if Feature.enabled?(:autocomplete_users_use_search_service)
- users.search(
- params[:search],
- with_private_emails: current_user&.can_admin_all_resources?,
- use_minimum_char_limit: params[:use_minimum_char_limit]
- )
- else
- users.search(params[:search], with_private_emails: current_user&.can_admin_all_resources?)
- end
+ users.search(
+ params[:search],
+ with_private_emails: current_user&.can_admin_all_resources?,
+ use_minimum_char_limit: params[:use_minimum_char_limit]
+ )
end
def by_blocked(users)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 7f1c28de8a7..3aca413ed45 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -274,15 +274,7 @@ module ApplicationHelper
end
def stylesheet_link_tag_defer(path)
- if startup_css_enabled?
- stylesheet_link_tag(path, media: "print", crossorigin: ActionController::Base.asset_host ? 'anonymous' : nil)
- else
- stylesheet_link_tag(path, media: "all", crossorigin: ActionController::Base.asset_host ? 'anonymous' : nil)
- end
- end
-
- def startup_css_enabled?
- !Feature.enabled?(:remove_startup_css) && !params.has_key?(:no_startup_css)
+ stylesheet_link_tag(path, media: "all", crossorigin: ActionController::Base.asset_host ? 'anonymous' : nil)
end
def sign_in_with_redirect?
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 8fbbd18c9ae..64a5c28de86 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -373,17 +373,10 @@ module SearchHelper
def users_autocomplete(term, limit = 5)
return [] unless current_user && Ability.allowed?(current_user, :read_users_list)
- users = if Feature.enabled?(:autocomplete_users_use_search_service)
- ::SearchService
- .new(current_user, { scope: 'users', per_page: limit, search: term })
- .search_objects
- else
- is_current_user_admin = current_user.can_admin_all_resources?
- scope = is_current_user_admin ? User.all : User.without_forbidden_states
- scope.search(term, with_private_emails: is_current_user_admin, use_minimum_char_limit: false).limit(limit)
- end
-
- users.map do |user|
+ ::SearchService
+ .new(current_user, { scope: 'users', per_page: limit, search: term })
+ .search_objects
+ .map do |user|
{
category: "Users",
id: user.id,
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml
index d3a4c5c5ba8..69a36e6c2e3 100644
--- a/app/views/layouts/_head.html.haml
+++ b/app/views/layouts/_head.html.haml
@@ -20,12 +20,9 @@
= favicon_link_tag favicon, id: 'favicon', data: { original_href: favicon }, type: 'image/png'
- - if startup_css_enabled?
- = render 'layouts/startup_css', { startup_filename: local_assigns.fetch(:startup_filename, nil) }
- - else
- - diffs_colors = user_diffs_colors
- = stylesheet_link_tag "themes/#{user_application_theme_css_filename}" if user_application_theme_css_filename
- = render 'layouts/diffs_colors_css', diffs_colors if diffs_colors.present? || request.path == profile_preferences_path
+ - diffs_colors = user_diffs_colors
+ = stylesheet_link_tag "themes/#{user_application_theme_css_filename}" if user_application_theme_css_filename
+ = render 'layouts/diffs_colors_css', diffs_colors if diffs_colors.present? || request.path == profile_preferences_path
- if user_application_theme == 'gl-dark'
%meta{ name: 'color-scheme', content: 'dark light' }
@@ -43,9 +40,6 @@
= stylesheet_link_tag_defer "highlight/themes/#{user_color_scheme}"
- - if startup_css_enabled?
- = render 'layouts/startup_css_activation'
-
= stylesheet_link_tag 'performance_bar' if performance_bar_enabled?
= render 'layouts/snowplow'
diff --git a/app/views/layouts/_startup_css.haml b/app/views/layouts/_startup_css.haml
deleted file mode 100644
index 64a86cf319e..00000000000
--- a/app/views/layouts/_startup_css.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-- startup_filename_default = user_application_theme == 'gl-dark' ? 'dark' : 'general'
-- startup_filename = local_assigns.fetch(:startup_filename, nil) || startup_filename_default
-- diffs_colors = user_diffs_colors
-
-%style
- = Rails.application.assets_manifest.find_sources("themes/#{user_application_theme_css_filename}.css").first.to_s.html_safe if user_application_theme_css_filename
- = Rails.application.assets_manifest.find_sources("startup/startup-#{startup_filename}.css").first.to_s.html_safe
-
-= render 'layouts/diffs_colors_css', diffs_colors if diffs_colors.present? || request.path == profile_preferences_path
diff --git a/app/views/layouts/_startup_css_activation.haml b/app/views/layouts/_startup_css_activation.haml
deleted file mode 100644
index 7dfb9cd1530..00000000000
--- a/app/views/layouts/_startup_css_activation.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-= javascript_tag do
- :plain
- document.querySelectorAll('link[media="print"]').forEach(linkTag => {
- linkTag.setAttribute('data-startupcss', 'loading');
- const startupLinkLoadedEvent = new CustomEvent('CSSStartupLinkLoaded');
- linkTag.addEventListener('load',function(){this.media='all';this.setAttribute('data-startupcss', 'loaded');document.dispatchEvent(startupLinkLoadedEvent);},{once: true});
- })