feat: show company storage usage in SaaS admin#4798
Merged
Conversation
Rockyy174
marked this pull request as ready for review
July 9, 2026 15:50
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In the frontend,
storageUsageBytesis declared optional onAdminApi.Companybut used directly informatStorageBytes(company.storageUsageBytes); consider either making it required or defaulting to0to avoid potentialundefinedhandling issues. - The
gridTemplateColumnsstring inCompanyTableis now shared between header and rows but still redefined on each render; consider hoisting it to a module-level constant to avoid unnecessary reallocation.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the frontend, `storageUsageBytes` is declared optional on `AdminApi.Company` but used directly in `formatStorageBytes(company.storageUsageBytes)`; consider either making it required or defaulting to `0` to avoid potential `undefined` handling issues.
- The `gridTemplateColumns` string in `CompanyTable` is now shared between header and rows but still redefined on each render; consider hoisting it to a module-level constant to avoid unnecessary reallocation.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Add a Storage column to the SaaS admin company table by batch-loading uploaded company_file blob sizes and exposing storage_usage_bytes through the admin API. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Adriano Lazzaretti <Rockyy174@users.noreply.github.com>
Rockyy174
force-pushed
the
cursor/saas-admin-storage-column-2a7d
branch
from
July 9, 2026 17:00
4feeffb to
0cd8365
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Storage column to the SaaS admin company table (
/admin) on both Active Companies and All Companies tabs, showing each company's total uploaded file storage.Backend
Company.load_storage_usage_bytes/1(list + single) summing uploaded:company_fileblobs:companytype extended withstorage_usage_bytesget_companies,get_active_companies, andget_companystorageUsageBytes)Frontend
SaasAdminPageCompanyTable (after Projects), formatted viaformatStorageBytesSaasAdminCompanyPagedetail pageTests
get_active_companies_testserialization assertionsget_companies_test.exsfor the all-companies endpointTest plan
make test FILE=app/ee/test/operately_ee/admin_api/queries/get_active_companies_test.exs(11 passed)make test FILE=app/ee/test/operately_ee/admin_api/queries/get_companies_test.exs(3 passed)/admin→ Active Companies and All Companies show Storage column0 B