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>
This commit is contained in:
+2
-1
@@ -37,7 +37,8 @@ export const ActivityTargetsInlineCell = ({
|
||||
|
||||
const { closeInlineCell } = useInlineCell(componentInstanceId);
|
||||
|
||||
const { fieldDefinition, isReadOnly } = useContext(FieldContext);
|
||||
const { fieldDefinition, isRecordFieldReadOnly: isReadOnly } =
|
||||
useContext(FieldContext);
|
||||
|
||||
const { openActivityTargetCellEditMode } =
|
||||
useOpenActivityTargetCellEditMode();
|
||||
|
||||
Reference in New Issue
Block a user