Revert "Add 1GB storage cap with self-host notice"

This commit is contained in:
Jorge Manrubia
2026-03-17 17:51:07 +01:00
committed by GitHub
parent 0b0f1c4891
commit 0be8041953
22 changed files with 52 additions and 369 deletions
@@ -1,8 +0,0 @@
module Card::StorageLimited
extend ActiveSupport::Concern
private
def ensure_within_storage_limit
head :forbidden if Current.account.exceeding_storage_limit?
end
end
@@ -1,9 +0,0 @@
module Card::StorageLimited::Commenting
extend ActiveSupport::Concern
included do
include Card::StorageLimited
before_action :ensure_within_storage_limit, only: :create
end
end
@@ -1,9 +0,0 @@
module Card::StorageLimited::Creation
extend ActiveSupport::Concern
included do
include Card::StorageLimited
before_action :ensure_within_storage_limit, only: :create, if: -> { request.format.json? }
end
end
@@ -1,9 +0,0 @@
module Card::StorageLimited::Publishing
extend ActiveSupport::Concern
included do
include Card::StorageLimited
before_action :ensure_within_storage_limit, only: :create
end
end
@@ -1,14 +0,0 @@
module Account::StorageLimited
extend ActiveSupport::Concern
STORAGE_LIMIT = 1.gigabyte
NEAR_STORAGE_LIMIT_THRESHOLD = 500.megabytes
def exceeding_storage_limit?
bytes_used > STORAGE_LIMIT
end
def nearing_storage_limit?
!exceeding_storage_limit? && bytes_used > STORAGE_LIMIT - NEAR_STORAGE_LIMIT_THRESHOLD
end
end
@@ -1,5 +0,0 @@
<% if Current.account.exceeding_storage_limit? %>
<%= render "cards/comments/saas/storage_limit_exceeded" %>
<% else %>
<%= render "cards/comments/new", card: card %>
<% end %>
@@ -1,12 +0,0 @@
<div class="comment-by-system comment-by-system--account-limit">
<div class="comment align-start full-width">
<div class="comment__content flex flex-column flex-item-grow full-width">
<div class="comment__body lexxy-content">
<div class="action-text-content">
<strong>This account has used all the included free storage (<%= number_to_human_size(Account::StorageLimited::STORAGE_LIMIT) %>).</strong>
<div><%= link_to "Self-host Fizzy", "https://github.com/basecamp/fizzy", target: "_blank" %> for unlimited storage.</div>
</div>
</div>
</div>
</div>
</div>
@@ -1,5 +0,0 @@
<% if Current.account.exceeding_storage_limit? %>
<%= render "cards/container/footer/saas/storage_limit_exceeded" %>
<% else %>
<%= render "cards/container/footer/create", card: card %>
<% end %>
@@ -1,8 +0,0 @@
<div class="card-perma__notch card-perma__notch--bottom">
<div class="card-perma__account-limit-message">
<strong>This account has used all the included free storage (<%= number_to_human_size(Account::StorageLimited::STORAGE_LIMIT) %>).</strong>
<div>
<%= link_to "Self-host Fizzy", "https://github.com/basecamp/fizzy", target: "_blank" %> for unlimited storage.
</div>
</div>
</div>
@@ -1,6 +0,0 @@
<% if Current.account.nearing_storage_limit? %>
<div class="txt-small">
This account has used <strong><%= number_to_human_size(Current.account.bytes_used) %></strong> of <strong><%= number_to_human_size(Account::StorageLimited::STORAGE_LIMIT) %></strong> storage.
<div><%= link_to "Self-host Fizzy", "https://github.com/basecamp/fizzy", class: "txt-current txt-underline", target: "_blank" %> for unlimited storage.</div>
</div>
<% end %>