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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-08-18 13:50:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-08-18 13:50:51 +0300
commitdb384e6b19af03b4c3c82a5760d83a3fd79f7982 (patch)
tree34beaef37df5f47ccbcf5729d7583aae093cffa0 /lib/gitlab/repository_size_error_message.rb
parent54fd7b1bad233e3944434da91d257fa7f63c3996 (diff)
Add latest changes from gitlab-org/gitlab@16-3-stable-eev16.3.0-rc42
Diffstat (limited to 'lib/gitlab/repository_size_error_message.rb')
-rw-r--r--lib/gitlab/repository_size_error_message.rb32
1 files changed, 1 insertions, 31 deletions
diff --git a/lib/gitlab/repository_size_error_message.rb b/lib/gitlab/repository_size_error_message.rb
index e7d527dd4ce..fc700c3c62e 100644
--- a/lib/gitlab/repository_size_error_message.rb
+++ b/lib/gitlab/repository_size_error_message.rb
@@ -7,8 +7,7 @@ module Gitlab
delegate :current_size, :limit, :exceeded_size, :additional_repo_storage_available?, to: :@checker
# @param checker [RepositorySizeChecker]
- def initialize(checker, message_params = {})
- @message_params = message_params
+ def initialize(checker)
@checker = checker
end
@@ -20,14 +19,6 @@ module Gitlab
"This merge request cannot be merged, #{base_message}"
end
- def push_warning
- _("##### WARNING ##### You have used %{usage_percentage} of the storage quota for %{namespace_name} " \
- "(%{current_size} of %{size_limit}). If %{namespace_name} exceeds the storage quota, " \
- "all projects in the namespace will be locked and actions will be restricted. " \
- "To manage storage, or purchase additional storage, see %{manage_storage_url}. " \
- "To learn more about restricted actions, see %{restricted_actions_url}") % push_message_params
- end
-
def push_error(change_size = 0)
"Your push has been rejected, #{base_message(change_size)}. #{more_info_message}"
end
@@ -50,19 +41,6 @@ module Gitlab
private
- attr_reader :message_params
-
- def push_message_params
- {
- namespace_name: message_params[:namespace_name],
- manage_storage_url: help_page_url('user/usage_quotas', 'manage-your-storage-usage'),
- restricted_actions_url: help_page_url('user/read_only_namespaces', 'restricted-actions'),
- current_size: formatted(current_size),
- size_limit: formatted(limit),
- usage_percentage: usage_percentage
- }
- end
-
def base_message(change_size = 0)
"because this repository has exceeded its size limit of #{formatted(limit)} by #{formatted(exceeded_size(change_size))}"
end
@@ -70,13 +48,5 @@ module Gitlab
def formatted(number)
number_to_human_size(number, delimiter: ',', precision: 2)
end
-
- def usage_percentage
- number_to_percentage(@checker.usage_ratio * 100, precision: 0)
- end
-
- def help_page_url(path, anchor = nil)
- ::Gitlab::Routing.url_helpers.help_page_url(path, anchor: anchor)
- end
end
end