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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-08 13:33:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-08 13:33:01 +0300
commit6edb7e9bb152d919c215f35bd6cb7d52fd3d99be (patch)
treef12ef4b7953932f9b2b9c28313277bf636115bc8 /app
parent305ea394efd2d5afe16234406dede486d9ca37af (diff)
Add latest changes from gitlab-org/gitlab@14-4-stable-ee
Diffstat (limited to 'app')
-rw-r--r--app/assets/stylesheets/page_bundles/boards.scss2
-rw-r--r--app/models/legacy_diff_note.rb6
-rw-r--r--app/models/protected_branch.rb7
-rw-r--r--app/views/shared/boards/_show.html.haml2
4 files changed, 13 insertions, 4 deletions
diff --git a/app/assets/stylesheets/page_bundles/boards.scss b/app/assets/stylesheets/page_bundles/boards.scss
index 4806f4b054b..a3ec2167b13 100644
--- a/app/assets/stylesheets/page_bundles/boards.scss
+++ b/app/assets/stylesheets/page_bundles/boards.scss
@@ -430,7 +430,7 @@
height: $input-height;
}
-.issue-boards-content {
+.issue-boards-content:not(.breadcrumbs) {
isolation: isolate;
}
diff --git a/app/models/legacy_diff_note.rb b/app/models/legacy_diff_note.rb
index 25e90036a53..ede20578850 100644
--- a/app/models/legacy_diff_note.rb
+++ b/app/models/legacy_diff_note.rb
@@ -13,7 +13,7 @@ class LegacyDiffNote < Note
validates :line_code, presence: true, line_code: true
- before_create :set_diff
+ before_create :set_diff, unless: :skip_setting_st_diff?
def discussion_class(*)
LegacyDiffDiscussion
@@ -90,6 +90,10 @@ class LegacyDiffNote < Note
self.st_diff = diff.to_hash if diff
end
+ def skip_setting_st_diff?
+ st_diff.present? && importing?
+ end
+
def diff_for_line_code
attributes = {
noteable_type: noteable_type,
diff --git a/app/models/protected_branch.rb b/app/models/protected_branch.rb
index b4e2d17c3e5..96002c8668a 100644
--- a/app/models/protected_branch.rb
+++ b/app/models/protected_branch.rb
@@ -27,12 +27,17 @@ class ProtectedBranch < ApplicationRecord
# Check if branch name is marked as protected in the system
def self.protected?(project, ref_name)
return true if project.empty_repo? && project.default_branch_protected?
+ return false if ref_name.blank?
- Rails.cache.fetch("protected_ref-#{ref_name}-#{project.cache_key}") do
+ Rails.cache.fetch(protected_ref_cache_key(project, ref_name)) do
self.matching(ref_name, protected_refs: protected_refs(project)).present?
end
end
+ def self.protected_ref_cache_key(project, ref_name)
+ "protected_ref-#{project.cache_key}-#{Digest::SHA1.hexdigest(ref_name)}"
+ end
+
def self.allow_force_push?(project, ref_name)
project.protected_branches.allowing_force_push.matching(ref_name).any?
end
diff --git a/app/views/shared/boards/_show.html.haml b/app/views/shared/boards/_show.html.haml
index 165564c5666..98752345074 100644
--- a/app/views/shared/boards/_show.html.haml
+++ b/app/views/shared/boards/_show.html.haml
@@ -2,7 +2,7 @@
- @no_breadcrumb_container = true
- @no_container = true
- @content_wrapper_class = "#{@content_wrapper_class} gl-relative"
-- @content_class = "js-focus-mode-board"
+- @content_class = "issue-boards-content js-focus-mode-board"
- is_epic_board = board.to_type == "EpicBoard"
- if is_epic_board
- breadcrumb_title _("Epic Boards")