-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Force readonly for deletedAt field #12840
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
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
Forces readonly mode for deletedAt datepicker field to ensure proper handling of record deletion through the UI trash icon instead of direct field modification.
- Added readonly condition in
packages/twenty-front/src/modules/object-record/record-show/record-detail-section/components/RecordDetailRelationRecordsListItem.tsx
to prevent direct modification of deletedAt field - Directs users to use the trash icon for soft deleting records instead of manually setting deletedAt date
- Implements safeguard against potential permission handling issues with deletedAt field modifications
1 file reviewed, 1 comment
Edit PR Review Bot Settings | Greptile
isReadOnly: | ||
fieldMetadataItem.name === 'deletedAt' || isFieldReadOnly, |
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: Consider extracting special field names like 'deletedAt' into a constant or enum to avoid magic strings and improve maintainability
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.
modify isFieldValueReadOnly
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.
- add a test
🚀 Preview Environment Ready! Your preview environment is available at: http://bore.pub:17707 This environment will automatically shut down when the PR is closed or after 5 hours. |
Fixes twentyhq#12839 ## Context We now force readonly mode for deletedAt datepicker as permissions don't handle well this use case. The frontend should call softDelete endpoint in this case. For a user, they should select the record and click on the trash icon instead <img width="467" alt="Screenshot 2025-06-24 at 17 30 03" src="https://github.com/user-attachments/assets/0a8a0709-305b-440f-91c2-d5e3f23ca213" />
Fixes #12839
Context
We now force readonly mode for deletedAt datepicker as permissions don't handle well this use case. The frontend should call softDelete endpoint in this case. For a user, they should select the record and click on the trash icon instead