Revert 21949 (#22081)

#21949 introduced deterministic uuid utils with usage in the same PR. 
Usage was not uniform and expected a backfill command as well. 
Since we want to release I'm reverting all the changes from that PR that
concerns twenty-server and only keeping the unused utils in
twenty-shared and I'll introduce usages within the same PR as backfill
command
This commit is contained in:
Weiko
2026-06-24 15:37:16 +02:00
committed by GitHub
parent b5a1aed24b
commit 56e20a81ea
26 changed files with 514 additions and 402 deletions
@@ -202,7 +202,6 @@ export class RefactorNavigationCommandsCommand extends ActiveOrSuspendedWorkspac
workspaceId,
position: nextPosition++,
now,
universalIdentifier,
}),
);
}
@@ -13,6 +13,8 @@ import { type FlatPageLayoutTab } from 'src/engine/metadata-modules/flat-page-la
import { type FlatPageLayoutWidget } from 'src/engine/metadata-modules/flat-page-layout-widget/types/flat-page-layout-widget.type';
import { type FlatPageLayout } from 'src/engine/metadata-modules/flat-page-layout/types/flat-page-layout.type';
import { computeFlatDefaultRecordPageLayoutToCreate } from 'src/engine/metadata-modules/object-metadata/utils/compute-flat-default-record-page-layout-to-create.util';
import { computeFlatRecordPageFieldsViewToCreate } from 'src/engine/metadata-modules/object-metadata/utils/compute-flat-record-page-fields-view-to-create.util';
import { computeFlatViewFieldsToCreate } from 'src/engine/metadata-modules/object-metadata/utils/compute-flat-view-fields-to-create.util';
import { WidgetConfigurationType } from 'src/engine/metadata-modules/page-layout-widget/enums/widget-configuration-type.type';
import { PageLayoutType } from 'src/engine/metadata-modules/page-layout/enums/page-layout-type.enum';
import { WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
@@ -506,32 +508,39 @@ export class BackfillRecordPageLayoutsCommand extends ActiveOrSuspendedWorkspace
const allViewFields: UniversalFlatViewField[] = [];
for (const customObject of customObjectsWithoutPageLayout) {
const fieldsView = computeFlatRecordPageFieldsViewToCreate({
objectMetadata: customObject,
flatApplication: twentyStandardFlatApplication,
});
const objectFieldMetadatas = Object.values(
flatFieldMetadataMaps.byUniversalIdentifier,
)
.filter(isDefined)
.filter((field) => field.objectMetadataId === customObject.id);
const {
pageLayouts,
pageLayoutTabs,
pageLayoutWidgets,
recordPageFieldsView,
recordPageFieldsViewFields,
} = computeFlatDefaultRecordPageLayoutToCreate({
objectMetadata: customObject,
flatApplication: twentyStandardFlatApplication,
const viewFields = computeFlatViewFieldsToCreate({
objectFlatFieldMetadatas: objectFieldMetadatas,
viewUniversalIdentifier: fieldsView.universalIdentifier,
flatApplication: twentyStandardFlatApplication,
labelIdentifierFieldMetadataUniversalIdentifier:
customObject.labelIdentifierFieldMetadataUniversalIdentifier,
workspaceId,
excludeLabelIdentifier: true,
});
const { pageLayouts, pageLayoutTabs, pageLayoutWidgets } =
computeFlatDefaultRecordPageLayoutToCreate({
objectMetadata: customObject,
flatApplication: twentyStandardFlatApplication,
recordPageFieldsView: fieldsView,
workspaceId,
});
allPageLayouts.push(...pageLayouts);
allTabs.push(...pageLayoutTabs);
allWidgets.push(...pageLayoutWidgets);
allViews.push(recordPageFieldsView);
allViewFields.push(...recordPageFieldsViewFields);
allViews.push(fieldsView);
allViewFields.push(...viewFields);
}
const result =
@@ -57,10 +57,6 @@ const buildExistingNavigationItem = ({
workspaceId: WORKSPACE_ID,
position,
now: NOW,
universalIdentifier: v5(
objectUniversalIdentifier,
NAVIGATION_COMMAND_UUID_NAMESPACE,
),
});
describe('buildNavigationCommandMenuItemOperationsOrThrow', () => {
@@ -69,7 +69,6 @@ export const buildNavigationCommandMenuItemOperationsOrThrow = ({
workspaceId,
position: nextPosition++,
now,
universalIdentifier: commandMenuItemUniversalIdentifier,
}),
);
}