Skip to content

ref: wrap BILLED_DATA_CATEGORY_INFO behind getBilledDataCategoryInfo()#118078

Open
volokluev wants to merge 3 commits into
masterfrom
wrap-billed-data-category-info-in-function
Open

ref: wrap BILLED_DATA_CATEGORY_INFO behind getBilledDataCategoryInfo()#118078
volokluev wants to merge 3 commits into
masterfrom
wrap-billed-data-category-info-in-function

Conversation

@volokluev

Copy link
Copy Markdown
Member

Summary

  • Wraps the BILLED_DATA_CATEGORY_INFO constant behind a getBilledDataCategoryInfo() function to prepare for moving this data to a backend API call.
  • The constant is now private to the module; all 6 consumer files have been updated to use the function.
  • No behavioral changes — the function returns the same static data for now.

Test plan

  • All pre-commit hooks pass (eslint, stylelint, format)
  • TypeScript compiles without errors
  • Existing tests for affected components continue to pass in CI

Prepare for moving billed data category info to a backend call by
hiding the static constant behind a function. All consumers now call
getBilledDataCategoryInfo() instead of importing the constant directly.
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 18, 2026
Comment thread static/gsApp/constants.tsx Outdated
Address review feedback: the function is not a constant, so move it
out of constants.tsx into utils/dataCategory.tsx where related helpers
already live. The constant remains exported from constants.tsx and the
function imports it from there.
Move the entire constant definition out of constants.tsx into
utils/dataCategory.tsx alongside getBilledDataCategoryInfo(). The
constant is now private to dataCategory.tsx and only accessible
through the function.
@github-actions

Copy link
Copy Markdown
Contributor

📊 Type Coverage Diff

Metric Before After Delta
Coverage 93.70% 93.70% ±0%
Typed 133,113 133,113 ±0
Untyped 8,952 8,952 ±0
🔍 2 new type safety issues introduced

Type assertions (as) (2 new)

File Line Detail
static/gsApp/utils/dataCategory.tsx 25 as Record<DataCategoryExact, BilledDataCategoryInfo>{ ...DATA_CATEGORY_INFO, } as Record<DataCategoryExact, BilledDataCategoryInfo>
static/gsApp/utils/dataCategory.tsx 30 as DataCategoryExactcategoryExact as DataCategoryExact

This is informational only and does not block the PR.

@volokluev volokluev marked this pull request as ready for review June 18, 2026 23:29
@volokluev volokluev requested a review from a team as a code owner June 18, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants