Skip to content
代码片段 群组 项目
提交 93af52eb 编辑于 作者: Vijay Hawoldar's avatar Vijay Hawoldar
浏览文件

Merge branch 'led/431395-use-dashboard-limit-on-storage-alerts' into 'master'

No related branches found
No related tags found
无相关合并请求
......@@ -131,6 +131,10 @@ def user_has_access?
end
end
def limit
root_storage_size.dashboard_limit
end
def namespace_has_additional_storage_purchased?
root_namespace.additional_purchased_storage_size > 0
end
......@@ -155,7 +159,7 @@ def show_purchase_link?
def free_tier_alert_title
text_args = {
namespace_name: root_namespace.name,
free_size_limit: formatted(root_namespace.actual_size_limit)
free_size_limit: formatted(limit)
}
s_(
......@@ -168,7 +172,7 @@ def usage_percentage_alert_title
usage_in_percent: used_storage_percentage(root_storage_size.usage_ratio),
namespace_name: root_namespace.name,
used_storage: formatted(root_storage_size.current_size),
storage_limit: formatted(root_storage_size.limit)
storage_limit: formatted(limit)
}
s_(
......
......@@ -45,7 +45,7 @@ def usage_percentage_alert_title
def free_tier_alert_title
text_args = {
readonly_project_count: root_namespace.repository_size_excess_project_count,
free_size_limit: formatted(root_namespace.actual_size_limit)
free_size_limit: formatted(limit)
}
ns_(
......@@ -59,7 +59,7 @@ def free_tier_alert_title
def alert_message_explanation
text_args = {
free_size_limit: formatted(root_namespace.actual_size_limit)
free_size_limit: formatted(limit)
}
if root_storage_size.above_size_limit?
......@@ -114,6 +114,10 @@ def alert_message_cta
s_("NamespaceStorageSize|To reduce storage usage, reduce git repository and git LFS storage.")
end
end
def limit
root_namespace.actual_size_limit
end
end
end
end
......@@ -21,7 +21,7 @@
let(:usage_ratio) { 0.8 }
let(:above_size_limit) { false }
let(:alert_title) { /You have used \d+% of the storage quota for #{group.name}/ }
let(:alert_title_free_tier) { "You have reached the free storage limit of 1,000 MiB for #{group.name}" }
let(:alert_title_free_tier) { "You have reached the free storage limit of 5 GiB for #{group.name}" }
let(:alert_message_below_limit) do
"If #{group.name} exceeds the storage quota, your ability to write new data to this namespace will be " \
......@@ -56,7 +56,7 @@
allow(size_checker).to receive(:above_size_limit?).and_return(above_size_limit)
end
allow(group).to receive(:actual_size_limit).and_return(1000.megabytes)
set_dashboard_limit(group, megabytes: 5120)
stub_member_access_level(group, owner: user)
end
......@@ -137,6 +137,17 @@
end
end
end
context 'and enforcement_limit is higher than dashboard_limit' do
before do
set_enforcement_limit(group, megabytes: 10240)
end
it 'renders the title with the dashboard_limit' do
render_inline(component)
expect(page).to have_content('5 GiB')
end
end
end
describe '#render?' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册