You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GridCore - Fix eslint and add types to leaf helpers (m_aggregate_calculator, m_utils, m_accessibility, m_export) - #35464
The reason will be displayed to describe this comment to others. Learn more.
By checking usage of _data in source code its type should be: RawItemData[] | GroupData<RawItemData>[]
However, I have chosen to type unknown instead, because of this reasons:
Data items are just passed to handler: aggregate.selector(item) to extract needed value and their props are never directly read. Only the .items prop is read if data item is actually a group item: line of code
aggregateCalculator.tests.ts and dataSource.tests.ts have tests in which _data has number type. Defining type of _data would also require us to update these tests. (This is doable actually, not a lot of such tests)
The reason will be displayed to describe this comment to others. Learn more.
we already typed data in calculateTotalAggregates that calls constructor of that class, the only issue is tests then, we can add ts-expect-error directive to tests, if there are too many of them, but if not better fix
The reason will be displayed to describe this comment to others. Learn more.
I think unknown is the accurate type here, because custom accumulator can return any value. We would need to define a broad type: number | string | object | etc for it, but it wouldn't be useful anyways, because grid already treats summary results as unknowns.
The reason will be displayed to describe this comment to others. Learn more.
The existing filter types don't fit here. The group selector can be a function (e.g. calculateGroupValue), and a group key can be any value. DataFilter expects a string selector and a scalar value, so DataFilter[] fails with TS2345. The public FilterDescriptor is just any. combineFilters takes unknown[] anyway, so I'd keep unknown[] here.
This annotation excludes supported primitive rows because RawItemData is Record<string, unknown>. The calculator explicitly supports stores of primitives (for example, numeric rows with the this selector), so this private boundary should preserve that input instead of narrowing it to objects.
The reason will be displayed to describe this comment to others. Learn more.
we already typed data in calculateTotalAggregates that calls constructor of that class, the only issue is tests then, we can add ts-expect-error directive to tests, if there are too many of them, but if not better fix
This annotation also excludes primitive items produced by DataSource.map, although aggregation supports them (dataSource.tests.js:357-384 exercises a mapped number). Keep this method's data type aligned with the calculator's supported generic/unknown row type rather than restricting it to RawItemData.
NativeEventInfo does not match the callback payload
fireKeyDownEvent invokes this callback with only { event, handled } (ui/shared/accessibility.ts:71-78), so NativeEventInfo incorrectly promises component and element fields that are not present. Model the actual callback payload instead; otherwise future code can access fields that are always undefined.
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
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.
No description provided.