+
+ List Companies
+
+
+
+ Queried via CoreApiClient
+
+
+ {loading &&
Loading companies…
}
+
+ {error && (
+
+ Error: {error}
+
+ )}
+
+ {!loading && !error && (
+
+ {companies.length === 0 && - No companies found
}
+ {companies.map((company) => (
+ - {company.name}
+ ))}
+
+ )}
+
+ );
+};
+
+export default defineFrontComponent({
+ universalIdentifier: 'seed-front-component-list-companies',
+ name: 'List Companies',
+ description:
+ 'A sample visual front component that queries companies through the SDK client',
+ component: ListCompanies,
+});
diff --git a/packages/twenty-server/src/engine/workspace-manager/standard-objects-prefill-data/utils/prefill-front-component-definitions.util.ts b/packages/twenty-server/src/engine/workspace-manager/standard-objects-prefill-data/utils/prefill-front-component-definitions.util.ts
index 4224dce09d..33e1cc6029 100644
--- a/packages/twenty-server/src/engine/workspace-manager/standard-objects-prefill-data/utils/prefill-front-component-definitions.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/standard-objects-prefill-data/utils/prefill-front-component-definitions.util.ts
@@ -36,12 +36,16 @@ export const getSeedFrontComponentIds = (workspaceId: string) => ({
`${workspaceId}:seed-front-component:show-notification`,
SEED_FRONT_COMPONENT_ID_NAMESPACE,
),
+ listCompaniesId: uuidv5(
+ `${workspaceId}:seed-front-component:list-companies`,
+ SEED_FRONT_COMPONENT_ID_NAMESPACE,
+ ),
});
export const getSeedFrontComponentDefinitions = (
workspaceId: string,
): SeedFrontComponentDefinition[] => {
- const { helloWorldId, showNotificationId } =
+ const { helloWorldId, showNotificationId, listCompaniesId } =
getSeedFrontComponentIds(workspaceId);
return [
@@ -73,13 +77,27 @@ export const getSeedFrontComponentDefinitions = (
usesSdkClient: false,
seedProjectSubdir: 'show-notification',
},
+ {
+ id: listCompaniesId,
+ universalIdentifier: uuidv5(
+ `${workspaceId}:seed-front-component-uid:list-companies`,
+ SEED_FRONT_COMPONENT_ID_NAMESPACE,
+ ),
+ name: 'List Companies',
+ description:
+ 'A sample visual front component that queries companies through the SDK client',
+ componentName: 'ListCompanies',
+ isHeadless: false,
+ usesSdkClient: true,
+ seedProjectSubdir: 'list-companies',
+ },
];
};
export const getSeedFrontComponentCommandMenuItemDefinitions = (
workspaceId: string,
): SeedFrontComponentCommandMenuItemDefinition[] => {
- const { helloWorldId, showNotificationId } =
+ const { helloWorldId, showNotificationId, listCompaniesId } =
getSeedFrontComponentIds(workspaceId);
return [
@@ -118,5 +136,15 @@ export const getSeedFrontComponentCommandMenuItemDefinitions = (
PAGE_LAYOUT_SEEDS.DOCUMENTATION_STANDALONE_PAGE,
),
},
+ {
+ universalIdentifier: uuidv5(
+ `${workspaceId}:seed-front-component-command:list-companies`,
+ SEED_FRONT_COMPONENT_ID_NAMESPACE,
+ ),
+ frontComponentId: listCompaniesId,
+ label: 'List Companies',
+ icon: 'IconBuildingSkyscraper',
+ position: 203,
+ },
];
};
diff --git a/packages/twenty-front/src/modules/command-menu-item/confirmation-modal/constants/CommandMenuItemConfirmationModalResultBrowserEventName.ts b/packages/twenty-shared/src/constants/CommandMenuConfirmationModalResultBrowserEventName.ts
similarity index 100%
rename from packages/twenty-front/src/modules/command-menu-item/confirmation-modal/constants/CommandMenuItemConfirmationModalResultBrowserEventName.ts
rename to packages/twenty-shared/src/constants/CommandMenuConfirmationModalResultBrowserEventName.ts
diff --git a/packages/twenty-shared/src/constants/index.ts b/packages/twenty-shared/src/constants/index.ts
index e1c1359b0a..f026c6f730 100644
--- a/packages/twenty-shared/src/constants/index.ts
+++ b/packages/twenty-shared/src/constants/index.ts
@@ -14,6 +14,7 @@ export { AUTO_SELECT_FAST_MODEL_ID } from './AutoSelectFastModelId';
export { AUTO_SELECT_SMART_MODEL_ID } from './AutoSelectSmartModelId';
export { BACKEND_BATCH_REQUEST_MAX_COUNT } from './BackendBatchRequestMaxCount';
export { CalendarStartDay } from './CalendarStartDay';
+export { COMMAND_MENU_CONFIRMATION_MODAL_RESULT_BROWSER_EVENT_NAME } from './CommandMenuConfirmationModalResultBrowserEventName';
export { COMPOSITE_FIELD_TYPE_SUB_FIELDS_NAMES } from './CompositeFieldTypeSubFieldsNames';
export { CurrencyCode } from './CurrencyCode';
export { CURRENCY_CODE_LABELS } from './CurrencyCodeLabels';
diff --git a/packages/twenty-shared/src/types/CommandMenuConfirmationModalResult.ts b/packages/twenty-shared/src/types/CommandMenuConfirmationModalResult.ts
new file mode 100644
index 0000000000..45a0f8ad2d
--- /dev/null
+++ b/packages/twenty-shared/src/types/CommandMenuConfirmationModalResult.ts
@@ -0,0 +1 @@
+export type CommandMenuConfirmationModalResult = 'confirm' | 'cancel';
diff --git a/packages/twenty-shared/src/types/CommandMenuConfirmationModalResultBrowserEventDetail.ts b/packages/twenty-shared/src/types/CommandMenuConfirmationModalResultBrowserEventDetail.ts
new file mode 100644
index 0000000000..82d9ffc14c
--- /dev/null
+++ b/packages/twenty-shared/src/types/CommandMenuConfirmationModalResultBrowserEventDetail.ts
@@ -0,0 +1,7 @@
+import { type CommandMenuConfirmationModalResult } from './CommandMenuConfirmationModalResult';
+import { type ConfirmationModalCaller } from './ConfirmationModalCaller';
+
+export type CommandMenuConfirmationModalResultBrowserEventDetail = {
+ caller: ConfirmationModalCaller;
+ confirmationResult: CommandMenuConfirmationModalResult;
+};
diff --git a/packages/twenty-shared/src/types/index.ts b/packages/twenty-shared/src/types/index.ts
index 7fa8a4a438..f007e0ecea 100644
--- a/packages/twenty-shared/src/types/index.ts
+++ b/packages/twenty-shared/src/types/index.ts
@@ -19,6 +19,8 @@ export { CalendarChannelContactAutoCreationPolicy } from './CalendarChannelConta
export { CalendarChannelSyncStage } from './CalendarChannelSyncStage';
export { CalendarChannelSyncStatus } from './CalendarChannelSyncStatus';
export { CalendarChannelVisibility } from './CalendarChannelVisibility';
+export type { CommandMenuConfirmationModalResult } from './CommandMenuConfirmationModalResult';
+export type { CommandMenuConfirmationModalResultBrowserEventDetail } from './CommandMenuConfirmationModalResultBrowserEventDetail';
export type { CommandMenuContextApi } from './CommandMenuContextApi';
export { CommandMenuItemViewType } from './CommandMenuItemViewType';
export type { ActorMetadata } from './composite-types/actor.composite-type';