-
Notifications
You must be signed in to change notification settings - Fork 4.8k
feat: add "Created by: Me" filter for ACTOR workspaceMemberId subfield #16639
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
base: main
Are you sure you want to change the base?
feat: add "Created by: Me" filter for ACTOR workspaceMemberId subfield #16639
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.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
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.
No issues found across 16 files
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.
Pull request overview
This PR adds a "Created by: Me" filter feature for the ACTOR field's workspaceMemberId subfield, allowing users to filter records based on the workspace member who created them, with a convenient "Me" option for the current user.
- Added filtering capability for ACTOR field's
workspaceMemberIdsubfield - Implemented a new workspace member selector component with a pinned "Me" option
- Extended GraphQL filter generation to handle workspace member filtering with IS/IS_NOT operands
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
turnRecordFilterIntoGqlOperationFilter.ts |
Adds GQL filter generation logic for workspaceMemberId with support for current workspace member selection |
turnRecordFilterIntoGqlOperationFilter.actorWorkspaceMemberId.test.ts |
Comprehensive test suite (9 test cases) covering IS/IS_NOT operands, "Me" selection, and edge cases |
RecordGqlOperationFilter.ts |
Extends ActorFilter type definition to include workspaceMemberId field |
SettingsCompositeFieldTypeConfigs.test.ts |
Config validation tests ensuring workspaceMemberId is properly marked as filterable |
SettingsCompositeFieldTypeConfigs.ts |
Enables filtering for workspaceMemberId subfield in ACTOR field configuration |
CompositeFieldSubFieldLabel.ts |
Updates label from "Workspace Member ID" to "Workspace Member" for better UX |
getRecordFilterOperands.ts |
Adds IS/IS_NOT operands for workspaceMemberId filters |
getRecordFilterOperands.test.ts |
Test coverage (6 test cases) for new operands on ACTOR workspaceMemberId subfield |
IconNameBySubField.ts |
Maps IconUser icon to workspaceMemberId subfield |
isFilterOnActorWorkspaceMemberSubField.ts |
Helper utility to identify workspaceMemberId subfield filters |
isFilterOnActorWorkspaceMemberSubField.test.ts |
Test coverage (7 test cases) for helper function |
getSubMenuOptions.ts |
Adds "Workspace Member" option to ACTOR field submenu |
getSubMenuOptions.test.ts |
Test coverage (10 test cases) for submenu options including new workspace member option |
ObjectFilterDropdownWorkspaceMemberSelect.tsx |
New component implementing workspace member selection with pinned "Me" option |
ObjectFilterDropdownFilterInput.tsx |
Integrates workspace member selector for ACTOR workspaceMemberId filters |
AdvancedFilterDropdownFilterInput.tsx |
Adds workspace member selector support to advanced filters |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export const EMPTY_FILTER_VALUE: string = JSON.stringify({ | ||
| isCurrentWorkspaceMemberSelected: false, | ||
| selectedRecordIds: [], | ||
| } satisfies RelationFilterValue); | ||
|
|
Copilot
AI
Dec 17, 2025
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.
The constant EMPTY_FILTER_VALUE is exported but never used in this component. On line 186, an empty string is hardcoded instead of using this constant. Either use the constant for consistency or remove it if it's not needed.
| export const EMPTY_FILTER_VALUE: string = JSON.stringify({ | |
| isCurrentWorkspaceMemberSelected: false, | |
| selectedRecordIds: [], | |
| } satisfies RelationFilterValue); |
…ean up test files
Summary
Adds the ability to filter records by the
createdByfield'sworkspaceMemberId, with a special "Me" option for the current user. This allows users to quickly find records they created.Changes
Implementation
SettingsCompositeFieldTypeConfigs.ts- EnabledisFilterable: trueforworkspaceMemberIdsubfieldCompositeFieldSubFieldLabel.ts- Changed label to "Workspace Member" for better UXIconNameBySubField.ts- AddedIconUsericon for the new filter optionObjectFilterDropdownWorkspaceMemberSelect.tsx- New component with "Me" pinned optionisFilterOnActorWorkspaceMemberSubField.ts- Helper utility functiongetSubMenuOptions.ts- Added "Workspace Member" option to ACTOR submenugetRecordFilterOperands.ts- Added IS/IS_NOT operands for workspaceMemberIdObjectFilterDropdownFilterInput.tsx- Renders workspace member select for ACTOR filterAdvancedFilterDropdownFilterInput.tsx- Same handling for advanced filtersturnRecordFilterIntoGqlOperationFilter.ts- Added GQL filter generation withisCurrentWorkspaceMemberSelectedsupportTests (42 test cases)
SettingsCompositeFieldTypeConfigs.test.ts- Config tests to ensure workspaceMemberId is filterableisFilterOnActorWorkspaceMemberSubField.test.ts- Helper function testsgetSubMenuOptions.test.ts- Submenu options testsgetRecordFilterOperands.test.ts- Filter operands teststurnRecordFilterIntoGqlOperationFilter.actorWorkspaceMemberId.test.ts- GQL filter generation testsUI Flow
Screenshots
GraphQL Filter Output
{ createdBy: { workspaceMemberId: { in: ["member-id-1", "current-user-id"] } } }How to Test
# Run unit tests npx jest --config=packages/twenty-front/jest.config.mjs \ packages/twenty-front/src/modules/settings/data-model/constants/__tests__/SettingsCompositeFieldTypeConfigs.test.ts \ packages/twenty-front/src/modules/object-record/object-filter-dropdown/utils/__tests__/isFilterOnActorWorkspaceMemberSubField.test.ts \ packages/twenty-front/src/modules/object-record/object-filter-dropdown/utils/__tests__/getSubMenuOptions.test.ts \ packages/twenty-front/src/modules/object-record/record-filter/utils/__tests__/getRecordFilterOperands.test.ts npx jest --config=packages/twenty-shared/jest.config.mjs \ packages/twenty-shared/src/utils/filter/__tests__/turnRecordFilterIntoGqlOperationFilter.actorWorkspaceMemberId.test.tsthis solves: #16619
#16619
Checklist