-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Aggregate queries for table views - #2] Add aggregate queries footer for simple views #9025
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR introduces aggregate query functionality (sum, count, etc.) for table views, adding a new footer component that displays aggregate calculations for columns, with the feature protected behind a flag.
- Added new
RecordTableFooter
component with sticky positioning and mobile responsiveness in/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/components/RecordTableFooter.tsx
- Added
useAggregateRecordsForRecordTableColumnFooter
hook in/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/hooks/useAggregateRecordsForRecordTableColumnFooter.tsx
for computing aggregate values - Extended
ColumnDefinition
type with optionalaggregateOperation
property in/packages/twenty-front/src/modules/object-record/record-table/types/ColumnDefinition.ts
- Added
buildRecordGqlFieldsAggregate
utility in/packages/twenty-front/src/modules/object-record/record-table/record-table-footer/utils/buildRecordGqlFieldsAggregate.ts
for constructing GraphQL aggregate queries - Added missing
aggregateOperation
field in view field update mutation in/packages/twenty-front/src/modules/views/hooks/internal/usePersistViewFieldRecords.ts
18 file(s) reviewed, 29 comment(s)
Edit PR Review Bot Settings | Greptile
...odules/object-record/record-board/record-board-column/utils/computeAggregateValueAndLabel.ts
Show resolved
Hide resolved
...odules/object-record/record-board/record-board-column/utils/computeAggregateValueAndLabel.ts
Show resolved
Hide resolved
...odules/object-record/record-board/record-board-column/utils/computeAggregateValueAndLabel.ts
Show resolved
Hide resolved
...record/record-table/record-table-footer/components/RecordTableColumnFooterAggregateValue.tsx
Outdated
Show resolved
Hide resolved
...bject-record/record-table/record-table-footer/components/RecordTableColumnFooterDropdown.tsx
Outdated
Show resolved
Hide resolved
import { FieldMetadataType } from "~/generated/graphql"; | ||
import { isDefined } from "~/utils/isDefined"; | ||
|
||
export const getAvailableAggregateOperationsForFieldMetadataType = ({fieldMetadataType}: {fieldMetadataType?: FieldMetadataType}) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Inconsistent spacing in type definition - there should be a space after the colon
...cord-table/record-table-footer/utils/getAvailableAggregateOperationsForFieldMetadataType.tsx
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/views/utils/mapColumnDefinitionToViewField.ts
Show resolved
Hide resolved
...ord/record-table/record-table-footer/hooks/useAggregateRecordsForRecordTableColumnFooter.tsx
Outdated
Show resolved
Hide resolved
...odules/object-record/record-table/record-table-footer/utils/buildRecordGqlFieldsAggregate.ts
Outdated
Show resolved
Hide resolved
...cord-table/record-table-footer/utils/getAvailableAggregateOperationsForFieldMetadataType.tsx
Outdated
Show resolved
Hide resolved
...odules/object-record/record-board/record-board-column/utils/computeAggregateValueAndLabel.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
In this PR, we are introducing aggregate queries on table views, behind a feature flag.
This does not work with view groups yet, nor with views that have records until the bottom. (both will be tackled next)