Commit Graph

7 Commits

Author SHA1 Message Date
Marie 932910e71e Refactor isReadOnly + introduce restrictedFields (#13533)
Closes https://github.com/twentyhq/core-team-issues/issues/1276 

We now need to take fields permissions into account when determining if
a cell is editable or not.

a record field (= a cell) is read only if one of the condition is met:
- the object of the record is read-only (can be determined at table
level) by permission setting
- the field of the object is read-only (can be determined at column
level) - either by permission settings or by system (some workflows
fields for intance)
- the record is deleted (can be determined at row level) 

we reorganized the code to avoid re-computing known information as much
as possible.

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
2025-08-04 18:42:27 +02:00
Charles Bochet 17474a0e1e Remove cell hotkey scope (#11435)
Remove FieldContext hotkey scope as:
- each Field should set its own hotkey scope (ex:
emails-field-input-{recordId} or emails-field-input for now)
- while opening a fieldInput, we should synchronously set the
corresponding hotkey scope

To cut this refactoring in half, I'm allowing all input to use
TableHotkeyScope.CellEditMode
2025-04-08 11:18:23 +02:00
Charles Bochet 2308091b13 Remove overlay-scroll-bar (#11258)
## What

- Deprecate overlayscrollbars as we decided to follow the native
behavior
- rework on performances (avoid calling recoil states too much at field
level which is quite expensive)
- Also implements:
https://github.com/twentyhq/core-team-issues/issues/569

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
2025-04-04 16:13:48 +02:00
Charles Bochet ccf60284cf Various fixes (#11108)
Fixes many bug regarding TableCell and InlineCells
2025-03-22 14:19:10 +01:00
Charles Bochet 57869d3c8c Fix broken chips on timelin eActivity on show pages (#9057)
We were using RecordIndexContext in FieldDisplays components which is
wrong as the FieldDisplays could be used in locations not providing this
context (not being indexes pages).

Instead, we are passing it within FieldContext which the context that
will always be there for FieldDisplays and we need indexes to fill this
FieldContext with their RecordIndexContext value when needed
2024-12-13 15:34:00 +01:00
nitin a7941315e7 Replace entityId by recordId in the front end. (#6355)
Hey @lucasbordeau, I replaced every `entityId` with `recordId` in the
frontend.

### Some clarifications:

1. At [this
line](https://github.com/ehconitin/twenty/commit/0b207d26b6e78da349af34cf44585d89cb59adb7#diff-b4f415dd1f060307ad61f64394ee96b2912f6015e26c7fd2eab4b8c6a84d2d07L14),
I changed `recordId` to `selectedRecordId` because that component has
`entityId` defined in code at [this
line](https://github.com/ehconitin/twenty/commit/0b207d26b6e78da349af34cf44585d89cb59adb7#diff-b4f415dd1f060307ad61f64394ee96b2912f6015e26c7fd2eab4b8c6a84d2d07L55)
which was to be changed to `recordId`. To avoid repeated constants, I
changed the arguments to `selectedRecordIds`.

2. At the following links:
- [File
1](https://github.com/ehconitin/twenty/commit/0b207d26b6e78da349af34cf44585d89cb59adb7#diff-52b780bdd4cfc582ca7e1b457dbbd63733bfbb7790fc421054bbd2dbf0389e16)
- [File
2](https://github.com/ehconitin/twenty/commit/0b207d26b6e78da349af34cf44585d89cb59adb7#diff-6d47cb9a59dfcf6b1495937084ae799a61da6afccb21208f04ce8e1f5afca0e4)
- [File
3](https://github.com/ehconitin/twenty/commit/0b207d26b6e78da349af34cf44585d89cb59adb7#diff-821815783f9968f1da3cd437fc9d1d1666d12dc331d279cc5fbd9817bc2df2bf)

It seems to be the tests. As I can see, it is checking for both
`objectFilterDropdownSelectedEntityIdState` and
`objectFilterDropdownSelectedRecordIdsState`. Since `entityIds` are
supposed to be removed and `recordedId` state is already being checked,
I commented out all the `entityidState` code. If they are to be removed
or uncommented, please let me know, and I will do as expected.

---------

Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
2024-08-07 08:52:57 +02:00
Lucas Bordeau 732e8912da Added Linaria for performance optimization (#5693)
- Added Linaria to have compiled CSS on our optimized field displays
- Refactored mocks for performance stories on fields
- Refactored generateRecordChipData into a global context, computed only
when we fetch object metadata items.
- Refactored ChipFieldDisplay 
- Refactored PhoneFieldDisplay
2024-06-12 16:31:07 +02:00