fix: fixed the update of field metadata label, icon & object (#13064)

This PR is raised to close the issue #13044 

But there are some doubts that needs to be approved.
If the fields are not custom then we were saving the changes in
**standardOverrides** obj in which only three fields are
overridableFields **label, icon & description** can be updated for a
field.

You can see this in _before-update-one-field.hook.ts_ on line 85 
```ts
    const overridableFields = ['label', 'icon', 'description'];
```
If the field to be updated are from these three we are putting this in a
**standardOverrides** obj and passing it

However in our _field-metadata.service.ts_ file. We have **updateOne**
function inside it we have wrote a condition if **isCustom** is false
then the purpose was to build the updatableFields from the
**standardOverrides** obj that we got in **fieldMetadataInput** but
there was an error in it. As you can see below
```ts
 const updatableFieldInput =
        existingFieldMetadata.isCustom === false
          ? this.buildUpdatableStandardFieldInput(
              fieldMetadataInput,
              existingFieldMetadata,
            )
          : fieldMetadataInput;
```
However, the issue was that we were placing the entire
**standardOverrides** object inside **updatableFieldInput** again —
instead of merging its individual fields (label, icon, description)
directly into the update payload.

This PR fixes that by correctly applying the overrides into the
top-level object.

Please refer to the file changes for the full context.

But the thing i don't know. 
[ ] - Is this the correct expected flow?? 
[ ]- Will this change break anything elsewhere?

I still have doubts on these two. Let me know if I missed something.

---------

Co-authored-by: Jagss24 <btwitsjagannat12@gmail.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Jagannath Samantra
2025-07-06 16:17:33 +05:30
committed by GitHub
parent f65db49514
commit ee8e223aed
2 changed files with 3 additions and 3 deletions

View File

@ -528,8 +528,7 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
if ('standardOverrides' in fieldMetadataInput) {
updatableStandardFieldInput.standardOverrides =
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(fieldMetadataInput as any).standardOverrides;
fieldMetadataInput.standardOverrides as FieldStandardOverridesDTO;
}
if (