feat: aggregate statistics [ENG-2780, ENG-3139]#7751
feat: aggregate statistics [ENG-2780, ENG-3139]#7751speaker-ender wants to merge 7 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
884b3fc to
fea1609
Compare
| @@ -310,6 +296,20 @@ export const snakeCaseToTitleCase = ( | |||
| ) | |||
| .join(" "); | |||
|
|
|||
| /** | |||
| * Formats a number with a suffix for large numbers (K, M, etc.) | |||
| * @param num - The number to format | |||
| * @param digits - The number of digits to round to (default is 0) | |||
| * @returns The formatted number as a string | |||
| * | |||
| * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat | |||
| * | |||
| * @example | |||
| * nFormatter(1111); // returns "1K" | |||
| * nFormatter(1111, 0); // returns "1K" | |||
| * nFormatter(1111, 1); // returns "1.1K" | |||
| * nFormatter(1111, 2); // returns "1.11K" | |||
| */ | |||
There was a problem hiding this comment.
drive-by fixing of comments
c07ee8e to
92bb486
Compare
chore: more types chore: even more types chore: all the types wip: something that works chore: adding query hook chore: wip chore: more types chore: more type updates wip: more card stuff chore: update types wip: some labels and such chore: fix comments core: layout improvements and refactoring chore: linting and formatting chore: more responsiveness chore: further refactors wip: stuf chore: comment out refactor: compact variant chore: mostly there fix: formatting fix: donut chart fit feature fix: formatting chore: adding changelog
chore: update text fix: linting and formatting
64de1e1 to
86dd160
Compare
There was a problem hiding this comment.
Code Review — feat: aggregate statistics [ENG-2780, ENG-3139]
Overall this is a well-structured feature: clean component decomposition, proper feature-flag gating, and the DonutChart enhancements (thin variant, fit prop) are nicely done. A few things to fix before merge:
Suggestions (fix before merge)
- Typo in endpoint/hook names (
getAggretateStatistics→getAggregateStatistics): propagates to both exported hooks and all call sites — worth fixing now before the name spreads further. monitor_typeoptional but used in URL path: the query arg is typedmonitor_type?but interpolated directly into the URL. Either make it required or add a guard.- Duplicated
getMonitorUpdateName: identical function exists in bothMonitorResultDescription.tsxandProgressCard/utils.ts. Extract to a shared location. - Typo in user-facing string:
"accross"→"across"inMONITOR_TYPE_TO_EMPTY_TEXT. - Typo in constant name:
MONITOR_TYPE_TO_PERECENT_STATISTIC_LABEL→MONITOR_TYPE_TO_PERCENT_STATISTIC_LABEL.
Nice to Have
content-centervsitems-centerinDonutChart.tsx:content-centeronly affects multi-line flex containers;items-centeris likely what was intended.PropsWithChildrenwithout children:ProgressCardnever renderschildren, so thePropsWithChildrenwrapper is unnecessary.renderIcondefined inside component: pure function, no closure needed — move it outsideMonitorStats.- Overly complex
classNamesspread pattern:classNames(...["a", ...(cond ? ["b"] : [])])can be simplified toclassNames("a", cond && "b")throughout. heliosInsightstest flag istrue: most alpha flags usetest: false. Confirm existing tests that renderActionCenterLayoutor the website monitor page have been updated to account for the new stats widgets.ExtendedDatastoreMonitorUpdates.tsappears unused: not imported anywhere in the PR — remove if not needed yet.
clients/admin-ui/src/features/data-discovery-and-detection/action-center/action-center.slice.ts
Outdated
Show resolved
Hide resolved
clients/admin-ui/src/features/data-discovery-and-detection/action-center/action-center.slice.ts
Show resolved
Hide resolved
clients/admin-ui/src/features/data-discovery-and-detection/action-center/ProgressCard/utils.ts
Show resolved
Hide resolved
clients/admin-ui/src/features/data-discovery-and-detection/action-center/ProgressCard/utils.ts
Outdated
Show resolved
Hide resolved
clients/admin-ui/src/features/data-discovery-and-detection/action-center/ProgressCard/utils.ts
Outdated
Show resolved
Hide resolved
clients/admin-ui/src/features/data-discovery-and-detection/action-center/MonitorStats.tsx
Outdated
Show resolved
Hide resolved
clients/admin-ui/src/features/data-discovery-and-detection/action-center/MonitorStats.tsx
Show resolved
Hide resolved
clients/admin-ui/src/types/api/models/ExtendedDatastoreMonitorUpdates.ts
Outdated
Show resolved
Hide resolved
Greptile SummaryThis PR adds aggregate statistics widgets to the action center, introducing a new Key issues found:
Confidence Score: 4/5Safe to merge once the hook/endpoint typo and the minor style issues are addressed; the feature is fully gated behind a flag. All issues are cosmetic (typos, naming conventions, one duplicate helper) with no functional impact — the typo in the hook name is consistent across all usage sites so nothing is broken at runtime. The feature flag means no production exposure until explicitly enabled. A quick round of fixes brings this to merge-ready.
Important Files Changed
Reviews (1): Last reviewed commit: "refactor: flag naming" | Re-trigger Greptile |
Ticket [ENG-2780, ENG-3139]
Description Of Changes
Adding a progress indicator widget to the action center
Code Changes
Steps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works