twenty/packages
pau-not-paul ae4fb7d113
fix: soft deleted records are read only (#8198)
TODO:
- [ ] It should not be possible to add tasks, notes, files, etc.

Fix for https://github.com/twentyhq/twenty/issues/7172

Note for reviewer:
- With these changes, `deletedAt` is now always included in
`recordGqlFields`.

--- Edit from Charles --
In this PR:
1) As mentionned by @pau-not-paul, we are adding deletedAt to our
recordGqlFields for board and table
2) I'm removing cellReadOnly logic, it is now fully computed using
useIsFieldValueReadonly like it's done in other places, there is no need
to maintain two read only systems
3) refactoring useIsFieldValueReadonly to take all the business logics
into one place together. It's now a function of the 5 factors (isRemote,
isDeleted, objectName, fieldName, etc...). Later it's likely to get back
to a function of Pick<FieldMetadata>, Pick<ObjectMetadata>,
record.isDeleted but we are not there yet

Note: as all cells are listening to the record (for isDeleted), updating
a field will trigger a re-rendering of the row which is not an issue
right now. It will be if we introduce bulk edition. In this case we
would need to use a selector on fields on top of record store

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2024-11-21 14:02:09 +01:00
..
twenty-chrome-extension Settings Option Card component (#8456) 2024-11-18 09:22:33 +00:00
twenty-docker Improve docker compose (#8637) 2024-11-21 11:51:42 +01:00
twenty-e2e-testing Begin moving to postgres spilo + adding pgvector (#8309) 2024-11-15 09:38:30 +01:00
twenty-emails Fix typo in branch name (#8480) 2024-11-13 19:35:15 +01:00
twenty-front fix: soft deleted records are read only (#8198) 2024-11-21 14:02:09 +01:00
twenty-server Improve object metadata maps size (#8635) 2024-11-21 11:49:19 +01:00
twenty-tinybird refactor webhookAnalytics call and enrich analytics module (#8253) 2024-11-08 10:00:51 +01:00
twenty-ui Fix version status colored tag + fix trash icon hover (#8618) 2024-11-20 18:42:57 +01:00
twenty-utils Fix docs build in CI (#5826) 2024-06-11 19:06:37 +02:00
twenty-website Add missing example URLs (#8640) 2024-11-21 13:48:33 +01:00
twenty-zapier Update zapier trigger payload (#8464) 2024-11-12 17:58:36 +01:00