Support Skill in manifest (#18092)

# Introduction
Support skill in manifest, pre-requisite for the twenty standard app
migration
This commit is contained in:
Paul Rastoin
2026-02-20 11:45:42 +01:00
committed by GitHub
parent 6ad581d178
commit 175df59c21
29 changed files with 402 additions and 11 deletions
@@ -6,6 +6,7 @@ export const APPLICATION_MANIFEST_METADATA_NAMES = [
'logicFunction',
'frontComponent',
'role',
'skill',
'view',
'viewField',
'viewFieldGroup',
@@ -11,6 +11,7 @@ import { fromPageLayoutManifestToUniversalFlatPageLayout } from 'src/engine/core
import { fromPageLayoutTabManifestToUniversalFlatPageLayoutTab } from 'src/engine/core-modules/application/utils/from-page-layout-tab-manifest-to-universal-flat-page-layout-tab.util';
import { fromPageLayoutWidgetManifestToUniversalFlatPageLayoutWidget } from 'src/engine/core-modules/application/utils/from-page-layout-widget-manifest-to-universal-flat-page-layout-widget.util';
import { fromRoleManifestToUniversalFlatRole } from 'src/engine/core-modules/application/utils/from-role-manifest-to-universal-flat-role.util';
import { fromSkillManifestToUniversalFlatSkill } from 'src/engine/core-modules/application/utils/from-skill-manifest-to-universal-flat-skill.util';
import { fromViewFieldGroupManifestToUniversalFlatViewFieldGroup } from 'src/engine/core-modules/application/utils/from-view-field-group-manifest-to-universal-flat-view-field-group.util';
import { fromViewFieldManifestToUniversalFlatViewField } from 'src/engine/core-modules/application/utils/from-view-field-manifest-to-universal-flat-view-field.util';
import { fromViewFilterGroupManifestToUniversalFlatViewFilterGroup } from 'src/engine/core-modules/application/utils/from-view-filter-group-manifest-to-universal-flat-view-filter-group.util';
@@ -153,6 +154,20 @@ export const computeApplicationManifestAllUniversalFlatEntityMaps = ({
);
}
for (const skillManifest of manifest.skills ?? []) {
addUniversalFlatEntityToUniversalFlatEntityAndRelatedEntityMapsThroughMutationOrThrow(
{
metadataName: 'skill',
universalFlatEntity: fromSkillManifestToUniversalFlatSkill({
skillManifest,
applicationUniversalIdentifier,
now,
}),
universalFlatEntityAndRelatedMapsToMutate: allUniversalFlatEntityMaps,
},
);
}
for (const viewManifest of manifest.views ?? []) {
addUniversalFlatEntityToUniversalFlatEntityAndRelatedEntityMapsThroughMutationOrThrow(
{
@@ -0,0 +1,27 @@
import { type SkillManifest } from 'twenty-shared/application';
import { type UniversalFlatSkill } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-skill.type';
export const fromSkillManifestToUniversalFlatSkill = ({
skillManifest,
applicationUniversalIdentifier,
now,
}: {
skillManifest: SkillManifest;
applicationUniversalIdentifier: string;
now: string;
}): UniversalFlatSkill => {
return {
universalIdentifier: skillManifest.universalIdentifier,
applicationUniversalIdentifier,
name: skillManifest.name,
label: skillManifest.label,
icon: skillManifest.icon ?? null,
description: skillManifest.description ?? null,
content: skillManifest.content,
isCustom: false,
isActive: true,
createdAt: now,
updatedAt: now,
};
};