System view tooling explicit params key naming (#23506)

# Introduction
View field system always result from a field existence, the application
universal identifier should be the related field one
Same but for views and object

<!-- This is an auto-generated description by cubic. -->
<a
href="https://cubic.dev/pr/twentyhq/twenty/pull/23506?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->
This commit is contained in:
Paul Rastoin
2026-07-29 16:33:40 +02:00
committed by GitHub
parent 33970dd45d
commit 4ec65ed08d
22 changed files with 192 additions and 67 deletions
@@ -1,7 +1,7 @@
import {
getFieldUniversalIdentifier,
getSystemViewFieldUniversalIdentifier,
getSystemViewUniversalIdentifier,
getViewFieldUniversalIdentifier,
} from 'twenty-shared/application';
import { FieldMetadataType, ViewKey } from 'twenty-shared/types';
@@ -25,7 +25,8 @@ const PRIORITY_FIELD_UNIVERSAL_IDENTIFIER =
const DERIVED_INDEX_VIEW_UNIVERSAL_IDENTIFIER =
getSystemViewUniversalIdentifier({
applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
objectMetadataApplicationUniversalIdentifier:
APPLICATION_UNIVERSAL_IDENTIFIER,
objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
viewKey: ViewKey.INDEX,
});
@@ -37,8 +38,9 @@ const computeViewFieldUniversalIdentifier = ({
viewUniversalIdentifier: string;
fieldMetadataUniversalIdentifier: string;
}) =>
getViewFieldUniversalIdentifier({
applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
getSystemViewFieldUniversalIdentifier({
fieldMetadataApplicationUniversalIdentifier:
APPLICATION_UNIVERSAL_IDENTIFIER,
viewUniversalIdentifier,
fieldMetadataUniversalIdentifier,
});
@@ -1,8 +1,8 @@
import { Injectable } from '@nestjs/common';
import {
getSystemViewFieldUniversalIdentifier,
getSystemViewUniversalIdentifier,
getViewFieldUniversalIdentifier,
} from 'twenty-shared/application';
import { ViewKey } from 'twenty-shared/types';
import { isDefined } from 'twenty-shared/utils';
@@ -56,7 +56,7 @@ export class FieldIndexViewFieldOnCreateSideEffectHandlerService extends Metadat
}
const indexViewUniversalIdentifier = getSystemViewUniversalIdentifier({
applicationUniversalIdentifier:
objectMetadataApplicationUniversalIdentifier:
parentFlatObjectMetadata.applicationUniversalIdentifier,
objectUniversalIdentifier: objectMetadataUniversalIdentifier,
viewKey: ViewKey.INDEX,
@@ -255,8 +255,9 @@ export class FieldIndexViewFieldOnCreateSideEffectHandlerService extends Metadat
const { applicationUniversalIdentifier } = sourceFlatFieldMetadata;
return {
universalIdentifier: getViewFieldUniversalIdentifier({
applicationUniversalIdentifier,
universalIdentifier: getSystemViewFieldUniversalIdentifier({
fieldMetadataApplicationUniversalIdentifier:
applicationUniversalIdentifier,
viewUniversalIdentifier: indexViewUniversalIdentifier,
fieldMetadataUniversalIdentifier:
sourceFlatFieldMetadata.universalIdentifier,
@@ -10,7 +10,8 @@ const NAME_FIELD_UNIVERSAL_IDENTIFIER = 'd1d2d3d4-d5d6-4000-8000-000000000001';
const CODE_FIELD_UNIVERSAL_IDENTIFIER = 'd1d2d3d4-d5d6-4000-8000-000000000002';
const INDEX_VIEW_UNIVERSAL_IDENTIFIER = getSystemViewUniversalIdentifier({
applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
objectMetadataApplicationUniversalIdentifier:
APPLICATION_UNIVERSAL_IDENTIFIER,
objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
viewKey: ViewKey.INDEX,
});
@@ -1,7 +1,7 @@
import {
getFieldUniversalIdentifier,
getSystemViewFieldUniversalIdentifier,
getSystemViewUniversalIdentifier,
getViewFieldUniversalIdentifier,
} from 'twenty-shared/application';
import { FieldMetadataType, ViewKey } from 'twenty-shared/types';
@@ -46,7 +46,8 @@ const DISPLAYABLE_SYSTEM_FIELD_NAMES = [
const DERIVED_INDEX_VIEW_UNIVERSAL_IDENTIFIER =
getSystemViewUniversalIdentifier({
applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
objectMetadataApplicationUniversalIdentifier:
APPLICATION_UNIVERSAL_IDENTIFIER,
objectUniversalIdentifier: OBJECT_UNIVERSAL_IDENTIFIER,
viewKey: ViewKey.INDEX,
});
@@ -192,8 +193,9 @@ describe('ObjectSystemFieldsAndIndexViewOnCreateSideEffectHandlerService', () =>
for (const viewField of viewFields) {
expect(viewField.isSystemSideEffect).toBe(true);
expect(viewField.universalIdentifier).toBe(
getViewFieldUniversalIdentifier({
applicationUniversalIdentifier: APPLICATION_UNIVERSAL_IDENTIFIER,
getSystemViewFieldUniversalIdentifier({
fieldMetadataApplicationUniversalIdentifier:
APPLICATION_UNIVERSAL_IDENTIFIER,
viewUniversalIdentifier: DERIVED_INDEX_VIEW_UNIVERSAL_IDENTIFIER,
fieldMetadataUniversalIdentifier:
viewField.fieldMetadataUniversalIdentifier,
@@ -66,7 +66,7 @@ export class ObjectIndexViewLabelIdentifierOnUpdateSideEffectHandlerService exte
}
const indexViewUniversalIdentifier = getSystemViewUniversalIdentifier({
applicationUniversalIdentifier:
objectMetadataApplicationUniversalIdentifier:
updatedFlatObjectMetadata.applicationUniversalIdentifier,
objectUniversalIdentifier: updatedFlatObjectMetadata.universalIdentifier,
viewKey: ViewKey.INDEX,
@@ -15,7 +15,8 @@ describe('computeFlatIndexViewToCreate', () => {
expect(result.universalIdentifier).toBe(
getSystemViewUniversalIdentifier({
applicationUniversalIdentifier,
objectMetadataApplicationUniversalIdentifier:
applicationUniversalIdentifier,
objectUniversalIdentifier,
viewKey: ViewKey.INDEX,
}),
@@ -43,7 +43,8 @@ export const computeFlatIndexViewToCreate = ({
openRecordIn: ViewOpenRecordIn.SIDE_PANEL,
position: 0,
universalIdentifier: getSystemViewUniversalIdentifier({
applicationUniversalIdentifier,
objectMetadataApplicationUniversalIdentifier:
applicationUniversalIdentifier,
objectUniversalIdentifier: objectMetadata.universalIdentifier,
viewKey: ViewKey.INDEX,
}),