Skip to content

The open alternative to Salesforce, designed for AI.

Show app status instead of type on the workspace installed apps table (#29228)

nitind4fd19e3b9ec
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index e3e304a01cd..ff8d50195ab 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -1895,6 +1895,11 @@ export type ApplicationConnectionProvidersQueryVariables = Exact<{
export type ApplicationConnectionProvidersQuery = { applicationConnectionProviders: Array<{ __typename: 'ApplicationConnectionProvider', id: string, applicationId: string, type: string, name: string, displayName: string, scope: Types.ConnectionProviderScope, logoUrl: string | null, oauth: { __typename: 'ApplicationConnectionProviderOAuthConfig', scopes: Array<string>, isClientCredentialsConfigured: boolean } | null }> };
+export type FindManyApplicationsForStatusQueryVariables = Exact<{ [key: string]: never; }>;
+
+
+export type FindManyApplicationsForStatusQuery = { findManyApplications: Array<{ __typename: 'Application', id: string, applicationVariables: Array<{ __typename: 'ApplicationVariable', id: string, key: string, label: string, value: string, isRequired: boolean, isDeprecated: boolean, scope: Types.ApplicationVariableScope }> }> };
+
export type FindUninstallApplicationJobStatusQueryVariables = Exact<{
universalIdentifier: string;
jobId?: string | null | undefined;
@@ -3103,6 +3108,7 @@ export const UpdateApplicationDocument = {"kind":"Document","definitions":[{"kin
export const UpdateOneApplicationVariableDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateOneApplicationVariable"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"key"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"value"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateOneApplicationVariable"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"key"},"value":{"kind":"Variable","name":{"kind":"Name","value":"key"}}},{"kind":"Argument","name":{"kind":"Name","value":"value"},"value":{"kind":"Variable","name":{"kind":"Name","value":"value"}}},{"kind":"Argument","name":{"kind":"Name","value":"applicationId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}}}]}]}}]} as unknown as DocumentNode<UpdateOneApplicationVariableMutation, UpdateOneApplicationVariableMutationVariables>;
export const ApplicationConnectedAccountsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ApplicationConnectedAccounts"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"applicationConnectedAccounts"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"applicationId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"handle"}},{"kind":"Field","name":{"kind":"Name","value":"authFailedAt"}},{"kind":"Field","name":{"kind":"Name","value":"authFailedReason"}},{"kind":"Field","name":{"kind":"Name","value":"archivedAt"}},{"kind":"Field","name":{"kind":"Name","value":"scopes"}},{"kind":"Field","name":{"kind":"Name","value":"lastSignedInAt"}},{"kind":"Field","name":{"kind":"Name","value":"connectionProviderId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}},{"kind":"Field","name":{"kind":"Name","value":"lastCredentialsRefreshedAt"}},{"kind":"Field","name":{"kind":"Name","value":"createdAt"}},{"kind":"Field","name":{"kind":"Name","value":"updatedAt"}}]}}]}}]} as unknown as DocumentNode<ApplicationConnectedAccountsQuery, ApplicationConnectedAccountsQueryVariables>;
export const ApplicationConnectionProvidersDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"ApplicationConnectionProviders"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UUID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"applicationConnectionProviders"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"applicationId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"applicationId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"ApplicationConnectionProviderFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"ApplicationConnectionProviderFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"ApplicationConnectionProvider"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationId"}},{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"displayName"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}},{"kind":"Field","name":{"kind":"Name","value":"logoUrl"}},{"kind":"Field","name":{"kind":"Name","value":"oauth"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"scopes"}},{"kind":"Field","name":{"kind":"Name","value":"isClientCredentialsConfigured"}}]}}]}}]} as unknown as DocumentNode<ApplicationConnectionProvidersQuery, ApplicationConnectionProvidersQueryVariables>;
+export const FindManyApplicationsForStatusDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindManyApplicationsForStatus"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findManyApplications"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"applicationVariables"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"key"}},{"kind":"Field","name":{"kind":"Name","value":"label"}},{"kind":"Field","name":{"kind":"Name","value":"value"}},{"kind":"Field","name":{"kind":"Name","value":"isRequired"}},{"kind":"Field","name":{"kind":"Name","value":"isDeprecated"}},{"kind":"Field","name":{"kind":"Name","value":"scope"}}]}}]}}]}}]} as unknown as DocumentNode<FindManyApplicationsForStatusQuery, FindManyApplicationsForStatusQueryVariables>;
export const FindUninstallApplicationJobStatusDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"FindUninstallApplicationJobStatus"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"jobId"}},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"findUninstallApplicationJobStatus"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"universalIdentifier"},"value":{"kind":"Variable","name":{"kind":"Name","value":"universalIdentifier"}}},{"kind":"Argument","name":{"kind":"Name","value":"jobId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"jobId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"jobId"}},{"kind":"Field","name":{"kind":"Name","value":"state"}},{"kind":"Field","name":{"kind":"Name","value":"failedReason"}},{"kind":"Field","name":{"kind":"Name","value":"progress"}}]}}]}}]} as unknown as DocumentNode<FindUninstallApplicationJobStatusQuery, FindUninstallApplicationJobStatusQueryVariables>;
export const CancelSwitchBillingIntervalDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CancelSwitchBillingInterval"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cancelSwitchBillingInterval"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"collectionMethod"}},{"kind":"Field","name":{"kind":"Name","value":"hasUserCredits"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"unitAmount"}},{"kind":"Field","name":{"kind":"Name","value":"creditAmount"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}},{"kind":"Field","name":{"kind":"Name","value":"isLegacy"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<CancelSwitchBillingIntervalMutation, CancelSwitchBillingIntervalMutationVariables>;
export const CancelSwitchBillingPlanDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CancelSwitchBillingPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"cancelSwitchBillingPlan"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"currentBillingSubscription"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptions"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionFragment"}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItem"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"price"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhase"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"start_date"}},{"kind":"Field","name":{"kind":"Name","value":"end_date"}},{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseItemFragment"}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"CurrentBillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"interval"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"currentPeriodEnd"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"collectionMethod"}},{"kind":"Field","name":{"kind":"Name","value":"hasUserCredits"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}},{"kind":"Field","name":{"kind":"Name","value":"billingSubscriptionItems"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"hasReachedCurrentPeriodCap"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"stripePriceId"}},{"kind":"Field","name":{"kind":"Name","value":"unitAmount"}},{"kind":"Field","name":{"kind":"Name","value":"creditAmount"}},{"kind":"Field","name":{"kind":"Name","value":"billingProduct"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"description"}},{"kind":"Field","name":{"kind":"Name","value":"images"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productKey"}},{"kind":"Field","name":{"kind":"Name","value":"planKey"}},{"kind":"Field","name":{"kind":"Name","value":"priceUsageBased"}},{"kind":"Field","name":{"kind":"Name","value":"isLegacy"}}]}}]}}]}}]}},{"kind":"FragmentDefinition","name":{"kind":"Name","value":"BillingSubscriptionFragment"},"typeCondition":{"kind":"NamedType","name":{"kind":"Name","value":"BillingSubscription"}},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"status"}},{"kind":"Field","name":{"kind":"Name","value":"metadata"}},{"kind":"Field","name":{"kind":"Name","value":"cancelAt"}},{"kind":"Field","name":{"kind":"Name","value":"phases"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"FragmentSpread","name":{"kind":"Name","value":"BillingSubscriptionSchedulePhaseFragment"}}]}}]}}]} as unknown as DocumentNode<CancelSwitchBillingPlanMutation, CancelSwitchBillingPlanMutationVariables>;
diff --git a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppsSection.tsx b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppsSection.tsx
index 2e0c67ad5a4..4b03bdd1df2 100644
--- a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppsSection.tsx
+++ b/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppsSection.tsx
@@ -1,7 +1,7 @@
import { useApplicationsWithPreferences } from '@/settings/app-preferences/hooks/useApplicationsWithPreferences';
import { useEnabledBuiltInAccountApps } from '@/settings/app-preferences/hooks/useEnabledBuiltInAccountApps';
import { useMyAccountGroups } from '@/settings/app-preferences/hooks/useMyAccountGroups';
-import { getAppPreferencesAppStatusById } from '@/settings/app-preferences/utils/getAppPreferencesAppStatusById';
+import { getAppPreferencesAppStatusesById } from '@/settings/app-preferences/utils/getAppPreferencesAppStatusesById';
import { SettingsApplicationLoadErrorBanner } from '@/settings/applications/components/SettingsApplicationLoadErrorBanner';
import { SettingsApplicationsTable } from '@/settings/applications/components/SettingsApplicationsTable';
import { styled } from '@linaria/react';
@@ -32,10 +32,10 @@ export const SettingsAppPreferencesAppsSection = () => {
const isLoadingApplications =
loading && !hasLoadedApplicationsWithPreferences;
const hasAccountGroupsLoadError = isDefined(accountGroupsError);
- const statusById =
+ const statusesById =
accountGroupsLoading || hasAccountGroupsLoadError
? {}
- : getAppPreferencesAppStatusById({
+ : getAppPreferencesAppStatusesById({
groups,
builtInAccountApps: enabledBuiltInAccountApps,
applicationsWithPreferences,
@@ -67,8 +67,9 @@ export const SettingsAppPreferencesAppsSection = () => {
({ application }) => application,
)}
builtInAccountApps={enabledBuiltInAccountApps}
- variant="member"
- statusById={statusById}
+ linkTarget="applicationPreferences"
+ middleColumn="status"
+ statusesById={statusesById}
isLoading={isLoadingApplications}
/>
);
diff --git a/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getAppPreferencesAppStatusById.test.ts b/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getAppPreferencesAppStatusesById.test.ts
similarity index 73%
rename from packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getAppPreferencesAppStatusById.test.ts
rename to packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getAppPreferencesAppStatusesById.test.ts
index 9c945f7c17f..c84c04760e7 100644
--- a/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getAppPreferencesAppStatusById.test.ts
+++ b/packages/twenty-front/src/modules/settings/app-preferences/utils/__tests__/getAppPreferencesAppStatusesById.test.ts
@@ -1,4 +1,4 @@
-import { getAppPreferencesAppStatusById } from '@/settings/app-preferences/utils/getAppPreferencesAppStatusById';
+import { getAppPreferencesAppStatusesById } from '@/settings/app-preferences/utils/getAppPreferencesAppStatusesById';
import {
ConnectedAccountProvider,
MessageChannelSyncStage,
@@ -56,20 +56,20 @@ const buildApplication = ({
: [],
});
-const getStatusOfInstalledApplication = ({
+const getStatusesOfInstalledApplication = ({
application = buildApplication(),
appAccounts = [],
}: {
application?: ReturnType<typeof buildApplication>;
appAccounts?: ReturnType<typeof buildAccount>[];
}) =>
- getAppPreferencesAppStatusById({
+ getAppPreferencesAppStatusesById({
groups: [{ id: 'group', handle: '[email protected]', appAccounts }],
builtInAccountApps: [],
applicationsWithPreferences: [application],
})[APPLICATION_ID];
-describe('getAppPreferencesAppStatusById', () => {
+describe('getAppPreferencesAppStatusesById', () => {
it('flags a built-in app whose active account failed to sync', () => {
const failedAccount = buildAccount({
provider: ConnectedAccountProvider.GOOGLE,
@@ -78,7 +78,7 @@ describe('getAppPreferencesAppStatusById', () => {
});
expect(
- getAppPreferencesAppStatusById({
+ getAppPreferencesAppStatusesById({
groups: [
{
id: 'group',
@@ -91,58 +91,67 @@ describe('getAppPreferencesAppStatusById', () => {
applicationsWithPreferences: [],
}),
).toEqual({
- google: { type: 'accountSyncIssue', account: failedAccount },
+ google: [{ type: 'accountSyncIssue', account: failedAccount }],
});
});
it('asks to reconnect when an active connection failed to authenticate', () => {
expect(
- getStatusOfInstalledApplication({
+ getStatusesOfInstalledApplication({
appAccounts: [buildAccount({ authFailedAt: '2026-09-01' })],
}),
- ).toEqual({ type: 'reconnectNeeded' });
+ ).toEqual([{ type: 'reconnectNeeded' }]);
+ });
+
+ it('keeps missing configuration alongside a needed reconnect', () => {
+ expect(
+ getStatusesOfInstalledApplication({
+ application: buildApplication({ hasMissingRequiredVariable: true }),
+ appAccounts: [buildAccount({ authFailedAt: '2026-09-01' })],
+ }),
+ ).toEqual([{ type: 'reconnectNeeded' }, { type: 'missingConfiguration' }]);
});
it('flags missing configuration when the app is in use', () => {
expect(
- getStatusOfInstalledApplication({
+ getStatusesOfInstalledApplication({
application: buildApplication({ hasMissingRequiredVariable: true }),
appAccounts: [buildAccount()],
}),
- ).toEqual({ type: 'missingConfiguration' });
+ ).toEqual([{ type: 'missingConfiguration' }]);
expect(
- getStatusOfInstalledApplication({
+ getStatusesOfInstalledApplication({
application: buildApplication({
hasConnectionProvider: false,
hasMissingRequiredVariable: true,
}),
}),
- ).toEqual({ type: 'missingConfiguration' });
+ ).toEqual([{ type: 'missingConfiguration' }]);
});
it('hints at connecting when a provider can authorize and nothing is connected', () => {
- expect(getStatusOfInstalledApplication({})).toEqual({
- type: 'notConnected',
- });
+ expect(getStatusesOfInstalledApplication({})).toEqual([
+ { type: 'notConnected' },
+ ]);
expect(
- getStatusOfInstalledApplication({
+ getStatusesOfInstalledApplication({
application: buildApplication({ hasMissingRequiredVariable: true }),
appAccounts: [buildAccount({ archivedAt: '2026-09-01' })],
}),
- ).toEqual({ type: 'notConnected' });
+ ).toEqual([{ type: 'notConnected' }]);
});
it('shows nothing for a connected app, an app without providers or an unconfigured provider', () => {
expect(
- getStatusOfInstalledApplication({ appAccounts: [buildAccount()] }),
+ getStatusesOfInstalledApplication({ appAccounts: [buildAccount()] }),
).toBeUndefined();
expect(
- getStatusOfInstalledApplication({
+ getStatusesOfInstalledApplication({
application: buildApplication({ hasConnectionProvider: false }),
}),
).toBeUndefined();
expect(
- getStatusOfInstalledApplication({
+ getStatusesOfInstalledApplication({
application: buildApplication({
isClientCredentialsConfigured: false,
}),
diff --git a/packages/twenty-front/src/modules/settings/app-preferences/utils/getAppPreferencesAppStatusById.ts b/packages/twenty-front/src/modules/settings/app-preferences/utils/getAppPreferencesAppStatusesById.ts
similarity index 59%
rename from packages/twenty-front/src/modules/settings/app-preferences/utils/getAppPreferencesAppStatusById.ts
rename to packages/twenty-front/src/modules/settings/app-preferences/utils/getAppPreferencesAppStatusesById.ts
index 039682a6234..02362f7ecaa 100644
--- a/packages/twenty-front/src/modules/settings/app-preferences/utils/getAppPreferencesAppStatusById.ts
+++ b/packages/twenty-front/src/modules/settings/app-preferences/utils/getAppPreferencesAppStatusesById.ts
@@ -1,13 +1,13 @@
-import { type AppPreferencesAppStatus } from '@/settings/app-preferences/types/AppPreferencesAppStatus';
import { type AppPreferencesAppStatusAccount } from '@/settings/app-preferences/types/AppPreferencesAppStatusAccount';
import { type AppPreferencesAppStatusApplication } from '@/settings/app-preferences/types/AppPreferencesAppStatusApplication';
import { type BuiltInAccountApp } from '@/settings/app-preferences/types/BuiltInAccountApp';
import { type ConnectedAccountGroup } from '@/settings/app-preferences/types/ConnectedAccountGroup';
-import { getBuiltInAccountAppStatus } from '@/settings/app-preferences/utils/getBuiltInAccountAppStatus';
-import { getInstalledApplicationStatus } from '@/settings/app-preferences/utils/getInstalledApplicationStatus';
-import { isDefined } from 'twenty-shared/utils';
+import { getBuiltInAccountAppStatuses } from '@/settings/app-preferences/utils/getBuiltInAccountAppStatuses';
+import { getInstalledApplicationStatuses } from '@/settings/app-preferences/utils/getInstalledApplicationStatuses';
+import { type SettingsMemberApplicationStatus } from '@/settings/applications/types/SettingsMemberApplicationStatus';
+import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
-export const getAppPreferencesAppStatusById = <
+export const getAppPreferencesAppStatusesById = <
TConnectedAccount extends AppPreferencesAppStatusAccount,
>({
groups,
@@ -17,7 +17,7 @@ export const getAppPreferencesAppStatusById = <
groups: ConnectedAccountGroup<TConnectedAccount>[];
builtInAccountApps: Pick<BuiltInAccountApp, 'id'>[];
applicationsWithPreferences: AppPreferencesAppStatusApplication[];
-}): Record<string, AppPreferencesAppStatus<TConnectedAccount>> => {
+}): Record<string, SettingsMemberApplicationStatus<TConnectedAccount>[]> => {
const activeBuiltInAccounts = groups
.map((group) => group.builtInAccount)
.filter(isDefined)
@@ -26,32 +26,32 @@ export const getAppPreferencesAppStatusById = <
.flatMap((group) => group.appAccounts)
.filter((account) => !isDefined(account.archivedAt));
- const statusById: Record<
+ const statusesById: Record<
string,
- AppPreferencesAppStatus<TConnectedAccount>
+ SettingsMemberApplicationStatus<TConnectedAccount>[]
> = {};
for (const { id } of builtInAccountApps) {
- const status = getBuiltInAccountAppStatus({
+ const statuses = getBuiltInAccountAppStatuses({
builtInAccountAppId: id,
activeBuiltInAccounts,
});
- if (isDefined(status)) {
- statusById[id] = status;
+ if (isNonEmptyArray(statuses)) {
+ statusesById[id] = statuses;
}
}
for (const applicationWithPreferences of applicationsWithPreferences) {
- const status = getInstalledApplicationStatus({
+ const statuses = getInstalledApplicationStatuses({
applicationWithPreferences,
activeAppAccounts,
});
- if (isDefined(status)) {
- statusById[applicationWithPreferences.application.id] = status;
+ if (isNonEmptyArray(statuses)) {
+ statusesById[applicationWithPreferences.application.id] = statuses;
}
}
- return statusById;
+ return statusesById;
};
diff --git a/packages/twenty-front/src/modules/settings/app-preferences/utils/getBuiltInAccountAppStatus.ts b/packages/twenty-front/src/modules/settings/app-preferences/utils/getBuiltInAccountAppStatuses.ts
similarity index 81%
rename from packages/twenty-front/src/modules/settings/app-preferences/utils/getBuiltInAccountAppStatus.ts
rename to packages/twenty-front/src/modules/settings/app-preferences/utils/getBuiltInAccountAppStatuses.ts
index ac215aa04ad..788a83320cc 100644
--- a/packages/twenty-front/src/modules/settings/app-preferences/utils/getBuiltInAccountAppStatus.ts
+++ b/packages/twenty-front/src/modules/settings/app-preferences/utils/getBuiltInAccountAppStatuses.ts
@@ -1,12 +1,12 @@
import { SyncStatus } from '@/settings/accounts/constants/SyncStatus';
import { computeSyncStatus } from '@/settings/accounts/utils/computeSyncStatus';
-import { type AppPreferencesAppStatus } from '@/settings/app-preferences/types/AppPreferencesAppStatus';
import { type AppPreferencesAppStatusAccount } from '@/settings/app-preferences/types/AppPreferencesAppStatusAccount';
import { type BuiltInAccountApp } from '@/settings/app-preferences/types/BuiltInAccountApp';
import { getBuiltInAccountAppsUsingAccount } from '@/settings/app-preferences/utils/getBuiltInAccountAppsUsingAccount';
+import { type SettingsMemberApplicationStatus } from '@/settings/applications/types/SettingsMemberApplicationStatus';
import { isDefined } from 'twenty-shared/utils';
-export const getBuiltInAccountAppStatus = <
+export const getBuiltInAccountAppStatuses = <
TConnectedAccount extends AppPreferencesAppStatusAccount,
>({
builtInAccountAppId,
@@ -14,7 +14,7 @@ export const getBuiltInAccountAppStatus = <
}: {
builtInAccountAppId: BuiltInAccountApp['id'];
activeBuiltInAccounts: TConnectedAccount[];
-}): AppPreferencesAppStatus<TConnectedAccount> | undefined => {
+}): SettingsMemberApplicationStatus<TConnectedAccount>[] => {
const accountsUsingApp = activeBuiltInAccounts.filter((account) =>
getBuiltInAccountAppsUsingAccount(account).some(
(app) => app.id === builtInAccountAppId,
@@ -33,6 +33,6 @@ export const getBuiltInAccountAppStatus = <
findAccountWithStatus(SyncStatus.PENDING_CONFIGURATION);
return isDefined(brokenAccount)
- ? { type: 'accountSyncIssue', account: brokenAccount }
- : undefined;
+ ? [{ type: 'accountSyncIssue', account: brokenAccount }]
+ : [];
};
diff --git a/packages/twenty-front/src/modules/settings/app-preferences/utils/getInstalledApplicationStatus.ts b/packages/twenty-front/src/modules/settings/app-preferences/utils/getInstalledApplicationStatuses.ts
similarity index 64%
rename from packages/twenty-front/src/modules/settings/app-preferences/utils/getInstalledApplicationStatus.ts
rename to packages/twenty-front/src/modules/settings/app-preferences/utils/getInstalledApplicationStatuses.ts
index cda89f449e6..543cbb726b9 100644
--- a/packages/twenty-front/src/modules/settings/app-preferences/utils/getInstalledApplicationStatus.ts
+++ b/packages/twenty-front/src/modules/settings/app-preferences/utils/getInstalledApplicationStatuses.ts
@@ -1,11 +1,16 @@
-import { type AppPreferencesAppStatus } from '@/settings/app-preferences/types/AppPreferencesAppStatus';
import { type AppPreferencesAppStatusAccount } from '@/settings/app-preferences/types/AppPreferencesAppStatusAccount';
import { type AppPreferencesAppStatusApplication } from '@/settings/app-preferences/types/AppPreferencesAppStatusApplication';
+import { type SettingsMemberApplicationStatus } from '@/settings/applications/types/SettingsMemberApplicationStatus';
import { canStartConnectionProviderAuthorization } from '@/settings/applications/utils/canStartConnectionProviderAuthorization';
import { isApplicationConnectionReconnectNeeded } from '@/settings/applications/utils/isApplicationConnectionReconnectNeeded';
import { isNonEmptyArray } from 'twenty-shared/utils';
-export const getInstalledApplicationStatus = ({
+type InstalledApplicationStatus = Exclude<
+ SettingsMemberApplicationStatus,
+ { type: 'accountSyncIssue' }
+>;
+
+export const getInstalledApplicationStatuses = ({
applicationWithPreferences: {
application,
connectionProviders,
@@ -15,30 +20,30 @@ export const getInstalledApplicationStatus = ({
}: {
applicationWithPreferences: AppPreferencesAppStatusApplication;
activeAppAccounts: AppPreferencesAppStatusAccount[];
-}):
- | Exclude<AppPreferencesAppStatus, { type: 'accountSyncIssue' }>
- | undefined => {
+}): InstalledApplicationStatus[] => {
+ const statuses: InstalledApplicationStatus[] = [];
+
const activeConnections = activeAppAccounts.filter(
(account) => account.applicationId === application.id,
);
if (activeConnections.some(isApplicationConnectionReconnectNeeded)) {
- return { type: 'reconnectNeeded' };
+ statuses.push({ type: 'reconnectNeeded' });
}
const isAppInUse =
!isNonEmptyArray(connectionProviders) || isNonEmptyArray(activeConnections);
if (isAppInUse && isNonEmptyArray(missingRequiredVariables)) {
- return { type: 'missingConfiguration' };
+ statuses.push({ type: 'missingConfiguration' });
}
if (
- isNonEmptyArray(activeConnections) ||
- !connectionProviders.some(canStartConnectionProviderAuthorization)
+ !isNonEmptyArray(activeConnections) &&
+ connectionProviders.some(canStartConnectionProviderAuthorization)
) {
- return undefined;
+ statuses.push({ type: 'notConnected' });
}
- return { type: 'notConnected' };
+ return statuses;
};
diff --git a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppStatusCell.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationStatusCell.tsx
similarity index 54%
rename from packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppStatusCell.tsx
rename to packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationStatusCell.tsx
index 447619d7004..944fa5e2bd7 100644
--- a/packages/twenty-front/src/modules/settings/app-preferences/components/SettingsAppPreferencesAppStatusCell.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationStatusCell.tsx
@@ -1,16 +1,18 @@
import { SettingsConnectedAccountSyncStatus } from '@/settings/app-preferences/components/SettingsConnectedAccountSyncStatus';
-import { type AppPreferencesAppStatus } from '@/settings/app-preferences/types/AppPreferencesAppStatus';
+import { type SettingsApplicationStatus } from '@/settings/applications/types/SettingsApplicationStatus';
+import { getHighestPrioritySettingsApplicationStatus } from '@/settings/applications/utils/getHighestPrioritySettingsApplicationStatus';
import { useLingui } from '@lingui/react/macro';
import { Status, Tag } from 'twenty-ui/primitives/data-display';
-type SettingsAppPreferencesAppStatusCellProps = {
- status?: AppPreferencesAppStatus;
+type SettingsApplicationStatusCellProps = {
+ statuses?: SettingsApplicationStatus[];
};
-export const SettingsAppPreferencesAppStatusCell = ({
- status,
-}: SettingsAppPreferencesAppStatusCellProps) => {
+export const SettingsApplicationStatusCell = ({
+ statuses = [],
+}: SettingsApplicationStatusCellProps) => {
const { t } = useLingui();
+ const status = getHighestPrioritySettingsApplicationStatus(statuses);
switch (status?.type) {
case 'accountSyncIssue':
@@ -25,6 +27,12 @@ export const SettingsAppPreferencesAppStatusCell = ({
{t`Not connected`}
</Tag>
);
+ case 'updateAvailable':
+ return (
+ <Tag color="blue" weight="medium" truncate={false}>
+ {t`Update`}
+ </Tag>
+ );
default:
return null;
}
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationTableRow.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationTableRow.tsx
index 8817685abca..49d62b0eef2 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationTableRow.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationTableRow.tsx
@@ -3,8 +3,8 @@ import { type ReactNode } from 'react';
import { ApplicationDisplay } from '@/applications/components/ApplicationDisplay';
import { useResolvedApplicationDescription } from '@/applications/hooks/useResolvedApplicationDescription';
import { type ApplicationDisplayData } from '@/applications/types/ApplicationDisplayData';
-import { SettingsAppPreferencesAppStatusCell } from '@/settings/app-preferences/components/SettingsAppPreferencesAppStatusCell';
-import { type AppPreferencesAppStatus } from '@/settings/app-preferences/types/AppPreferencesAppStatus';
+import { SettingsApplicationStatusCell } from '@/settings/applications/components/SettingsApplicationStatusCell';
+import { type SettingsApplicationStatus } from '@/settings/applications/types/SettingsApplicationStatus';
import { StyledNameTableCell } from '@/settings/data-model/object-details/components/SettingsObjectItemTableRowStyledComponents';
import { TableCell } from '@/ui/layout/table/components/TableCell';
import { TableRow } from '@/ui/layout/table/components/TableRow';
@@ -25,11 +25,11 @@ export type SettingsApplicationTableRowProps = {
application: ApplicationDisplayData & {
description?: string | null;
};
- hasUpdate?: boolean;
+ shouldShowUpdateTag?: boolean;
link?: string;
middleColumn?: SettingsApplicationTableRowMiddleColumn;
sourceType?: ApplicationRegistrationSourceType;
- status?: AppPreferencesAppStatus;
+ statuses?: SettingsApplicationStatus[];
};
const SOURCE_TYPE_LABELS: Record<
@@ -48,11 +48,11 @@ const getSourceTypeLabel = (sourceType?: ApplicationRegistrationSourceType) =>
export const SettingsApplicationTableRow = ({
action,
application,
- hasUpdate,
+ shouldShowUpdateTag,
link,
middleColumn = 'type',
sourceType,
- status,
+ statuses,
}: SettingsApplicationTableRowProps) => {
const isMobile = useIsMobile();
const resolvedDescription = useResolvedApplicationDescription(application);
@@ -73,7 +73,7 @@ export const SettingsApplicationTableRow = ({
</StyledNameTableCell>
<TableCell color={themeCssVariables.font.color.tertiary}>
{middleColumn === 'status' ? (
- <SettingsAppPreferencesAppStatusCell status={status} />
+ <SettingsApplicationStatusCell statuses={statuses} />
) : (
getSourceTypeLabel(sourceType)
)}
@@ -81,7 +81,7 @@ export const SettingsApplicationTableRow = ({
{!isMobile && (
<TableCell gap={themeCssVariables.spacing[2]} minWidth="0">
<OverflowingTextWithTooltip text={descriptionSummary} />
- {hasUpdate && (
+ {shouldShowUpdateTag && (
<Tag color="blue" weight="medium" truncate={false}>
{t`Update`}
</Tag>
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationTableRowChevronIcon.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationTableRowChevronIcon.tsx
new file mode 100644
index 00000000000..898f28ba666
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationTableRowChevronIcon.tsx
@@ -0,0 +1,14 @@
+import { IconChevronRight } from 'twenty-ui/icon';
+import { useTheme } from 'twenty-ui/theme';
+
+export const SettingsApplicationTableRowChevronIcon = () => {
+ const theme = useTheme();
+
+ return (
+ <IconChevronRight
+ size={theme.icon.size.md}
+ stroke={theme.icon.stroke.sm}
+ color={theme.font.color.light}
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationsInstalledAppsSection.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationsInstalledAppsSection.tsx
new file mode 100644
index 00000000000..d2c468bf048
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationsInstalledAppsSection.tsx
@@ -0,0 +1,59 @@
+import { useInstalledApplications } from '@/applications/hooks/useInstalledApplications';
+import { SettingsApplicationLoadErrorBanner } from '@/settings/applications/components/SettingsApplicationLoadErrorBanner';
+import { SettingsApplicationsTable } from '@/settings/applications/components/SettingsApplicationsTable';
+import { useInstalledBuiltInAccountApps } from '@/settings/applications/hooks/useInstalledBuiltInAccountApps';
+import { useWorkspaceApplicationStatusesById } from '@/settings/applications/hooks/useWorkspaceApplicationStatusesById';
+import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
+import { styled } from '@linaria/react';
+import { useLingui } from '@lingui/react/macro';
+import { isDefined } from 'twenty-shared/utils';
+import { themeCssVariables } from 'twenty-ui/theme';
+import { FeatureFlagKey } from '~/generated-metadata/graphql';
+
+const StyledToolbar = styled.div`
+ padding-bottom: ${themeCssVariables.spacing[2]};
+`;
+
+export const SettingsApplicationsInstalledAppsSection = () => {
+ const { t } = useLingui();
+ const installedApplications = useInstalledApplications();
+ const installedBuiltInAccountApps = useInstalledBuiltInAccountApps();
+ const isAppPreferencesEnabled = useIsFeatureEnabled(
+ FeatureFlagKey.IS_APP_PREFERENCES_ENABLED,
+ );
+ const {
+ statusesById,
+ error: statusError,
+ refetch: refetchStatuses,
+ } = useWorkspaceApplicationStatusesById({
+ applications: installedApplications,
+ shouldSkip: !isAppPreferencesEnabled,
+ });
+
+ if (installedApplications.length === 0) {
+ return null;
+ }
+
+ return (
+ <SettingsApplicationsTable
+ title={t`Installed apps`}
+ description={t`All the applications currently installed on this workspace`}
+ toolbar={
+ isDefined(statusError) ? (
+ <StyledToolbar>
+ <SettingsApplicationLoadErrorBanner
+ message={t`App configuration could not be loaded. Check your connection and try again.`}
+ // A failed retry sets the query error again, so the banner stays
+ onRetry={() => refetchStatuses().catch(() => undefined)}
+ />
+ </StyledToolbar>
+ ) : undefined
+ }
+ applications={installedApplications}
+ builtInAccountApps={installedBuiltInAccountApps}
+ linkTarget="applicationDetail"
+ middleColumn={isAppPreferencesEnabled ? 'status' : 'type'}
+ statusesById={statusesById}
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationsTable.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationsTable.tsx
index 30dafef6345..b91fda50490 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationsTable.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationsTable.tsx
@@ -1,6 +1,13 @@
-import { type AppPreferencesAppStatus } from '@/settings/app-preferences/types/AppPreferencesAppStatus';
import { type BuiltInAccountApp } from '@/settings/app-preferences/types/BuiltInAccountApp';
-import { getBuiltInAccountAppLogoUrl } from '@/settings/app-preferences/utils/getBuiltInAccountAppLogoUrl';
+import { SettingsApplicationTableHeaderRow } from '@/settings/applications/components/SettingsApplicationTableHeaderRow';
+import { SettingsApplicationsTableApplicationRow } from '@/settings/applications/components/SettingsApplicationsTableApplicationRow';
+import { SettingsApplicationsTableBuiltInAccountAppRow } from '@/settings/applications/components/SettingsApplicationsTableBuiltInAccountAppRow';
+import { type SettingsApplicationsTableApplication } from '@/settings/applications/types/SettingsApplicationsTableApplication';
+import { type SettingsApplicationsTableLinkTarget } from '@/settings/applications/types/SettingsApplicationsTableLinkTarget';
+import { type SettingsApplicationTableRowMiddleColumn } from '@/settings/applications/types/SettingsApplicationTableRowMiddleColumn';
+import { type SettingsMemberApplicationStatus } from '@/settings/applications/types/SettingsMemberApplicationStatus';
+import { type SettingsWorkspaceApplicationStatus } from '@/settings/applications/types/SettingsWorkspaceApplicationStatus';
+import { sortApplicationsWithOAuthOnlyLast } from '@/settings/applications/utils/sortApplicationsWithOAuthOnlyLast';
import { splitApplicationsAroundBuiltInAccountApps } from '@/settings/applications/utils/splitApplicationsAroundBuiltInAccountApps';
import { SettingsEmptyPlaceholder } from '@/settings/components/SettingsEmptyPlaceholder';
import { SettingsSectionSkeletonLoader } from '@/settings/components/SettingsSectionSkeletonLoader';
@@ -8,18 +15,10 @@ import { Table } from '@/ui/layout/table/components/Table';
import { styled } from '@linaria/react';
import { useLingui } from '@lingui/react/macro';
import { type ReactNode, useState } from 'react';
-import { SettingsPath } from 'twenty-shared/types';
-import { getSettingsPath, isNonEmptyArray } from 'twenty-shared/utils';
+import { isNonEmptyArray } from 'twenty-shared/utils';
import { SearchInput } from 'twenty-ui/components/input';
import { Section } from 'twenty-ui/components/layout';
-import { IconChevronRight } from 'twenty-ui/icon';
-import { useTheme, themeCssVariables } from 'twenty-ui/theme';
-import { ApplicationRegistrationSourceType } from '~/generated-metadata/graphql';
-import { SettingsApplicationTableHeaderRow } from '@/settings/applications/components/SettingsApplicationTableHeaderRow';
-import { SettingsApplicationTableRow } from '@/settings/applications/components/SettingsApplicationTableRow';
-import { type SettingsApplicationTableRowMiddleColumn } from '@/settings/applications/types/SettingsApplicationTableRowMiddleColumn';
-import { type ApplicationWithoutRelation } from '@/applications/types/ApplicationWithoutRelation';
-import { hasApplicationUpdate } from '@/settings/applications/utils/hasApplicationUpdate';
+import { themeCssVariables } from 'twenty-ui/theme';
import { filterBySearchQuery } from '~/utils/filterBySearchQuery';
const StyledTableRowsContainer = styled.div`
@@ -32,64 +31,56 @@ const StyledSearchInputContainer = styled.div`
width: 100%;
`;
-type SettingsApplicationsTableApplication = Pick<
- ApplicationWithoutRelation,
- | 'id'
- | 'name'
- | 'description'
- | 'logoUrl'
- | 'universalIdentifier'
- | 'version'
- | 'applicationRegistration'
->;
-
type SettingsApplicationsTableProps = {
title: string;
description: string;
applications: SettingsApplicationsTableApplication[];
builtInAccountApps: BuiltInAccountApp[];
- variant: 'workspace' | 'member';
- statusById?: Record<string, AppPreferencesAppStatus>;
+ middleColumn: SettingsApplicationTableRowMiddleColumn;
isLoading?: boolean;
toolbar?: ReactNode;
-};
+} & (
+ | {
+ linkTarget: Extract<
+ SettingsApplicationsTableLinkTarget,
+ 'applicationDetail'
+ >;
+ statusesById?: Record<string, SettingsWorkspaceApplicationStatus[]>;
+ }
+ | {
+ linkTarget: Extract<
+ SettingsApplicationsTableLinkTarget,
+ 'applicationPreferences'
+ >;
+ statusesById?: Record<string, SettingsMemberApplicationStatus[]>;
+ }
+);
export const SettingsApplicationsTable = ({
title,
description,
applications,
builtInAccountApps,
- variant,
- statusById,
+ linkTarget,
+ middleColumn,
+ statusesById,
isLoading = false,
toolbar,
}: SettingsApplicationsTableProps) => {
- const theme = useTheme();
const { t } = useLingui();
const [searchTerm, setSearchTerm] = useState('');
- const filteredApplications = filterBySearchQuery({
- items: applications,
- searchQuery: searchTerm.trim(),
- getSearchableValues: (application) => [
- application.name,
- application.description ?? '',
- ],
- }).sort((firstApplication, secondApplication) => {
- const isFirstApplicationOAuthOnly =
- firstApplication.applicationRegistration?.sourceType ===
- ApplicationRegistrationSourceType.OAUTH_ONLY;
- const isSecondApplicationOAuthOnly =
- secondApplication.applicationRegistration?.sourceType ===
- ApplicationRegistrationSourceType.OAUTH_ONLY;
-
- if (isFirstApplicationOAuthOnly === isSecondApplicationOAuthOnly) {
- return 0;
- }
-
- return isFirstApplicationOAuthOnly ? 1 : -1;
- });
+ const filteredApplications = sortApplicationsWithOAuthOnlyLast(
+ filterBySearchQuery({
+ items: applications,
+ searchQuery: searchTerm.trim(),
+ getSearchableValues: (application) => [
+ application.name,
+ application.description ?? '',
+ ],
+ }),
+ );
const filteredBuiltInAccountApps = filterBySearchQuery({
items: builtInAccountApps,
@@ -108,58 +99,9 @@ export const SettingsApplicationsTable = ({
hasBuiltInAccountApps: isNonEmptyArray(builtInAccountApps),
});
- const chevronIcon = (
- <IconChevronRight
- size={theme.icon.size.md}
- stroke={theme.icon.stroke.sm}
- color={theme.font.color.light}
- />
- );
-
const hasApplications =
isNonEmptyArray(applications) || isNonEmptyArray(builtInAccountApps);
- const middleColumn: SettingsApplicationTableRowMiddleColumn =
- variant === 'member' ? 'status' : 'type';
-
- const getApplicationLink = (applicationId: string) =>
- variant === 'member'
- ? getSettingsPath(SettingsPath.ApplicationPreferences, { applicationId })
- : getSettingsPath(SettingsPath.ApplicationDetail, { applicationId });
-
- const getBuiltInAccountAppLink = (
- builtInAccountAppId: BuiltInAccountApp['id'],
- ) =>
- variant === 'member'
- ? getSettingsPath(SettingsPath.BuiltInAccountApp, { builtInAccountAppId })
- : getSettingsPath(SettingsPath.ApplicationDetail, {
- applicationId: builtInAccountAppId,
- });
-
- const renderApplicationRow = (
- application: SettingsApplicationsTableApplication,
- ) => {
- const hasUpdate = hasApplicationUpdate({
- sourceType: application.applicationRegistration?.sourceType,
- currentVersion: application.version,
- latestAvailableVersion:
- application.applicationRegistration?.latestAvailableVersion,
- });
-
- return (
- <SettingsApplicationTableRow
- key={application.id}
- application={application}
- hasUpdate={hasUpdate}
- sourceType={application.applicationRegistration?.sourceType}
- middleColumn={middleColumn}
- status={statusById?.[application.id]}
- action={chevronIcon}
- link={getApplicationLink(application.id)}
- />
- );
- };
-
return (
<Section.Root>
<Section.Header title={title} description={description} />
@@ -183,22 +125,33 @@ export const SettingsApplicationsTable = ({
<span role="status">{t`No application matches your search`}</span>
</SettingsEmptyPlaceholder>
)}
- {applicationsBeforeBuiltInAccountApps.map(renderApplicationRow)}
+ {applicationsBeforeBuiltInAccountApps.map((application) => (
+ <SettingsApplicationsTableApplicationRow
+ key={application.id}
+ application={application}
+ linkTarget={linkTarget}
+ middleColumn={middleColumn}
+ statuses={statusesById?.[application.id]}
+ />
+ ))}
{filteredBuiltInAccountApps.map((builtInAccountApp) => (
- <SettingsApplicationTableRow
+ <SettingsApplicationsTableBuiltInAccountAppRow
key={builtInAccountApp.id}
- application={{
- name: t(builtInAccountApp.name),
- description: t(builtInAccountApp.description),
- logoUrl: getBuiltInAccountAppLogoUrl(builtInAccountApp),
- }}
+ builtInAccountApp={builtInAccountApp}
+ linkTarget={linkTarget}
+ middleColumn={middleColumn}
+ statuses={statusesById?.[builtInAccountApp.id]}
+ />
+ ))}
+ {applicationsAfterBuiltInAccountApps.map((application) => (
+ <SettingsApplicationsTableApplicationRow
+ key={application.id}
+ application={application}
+ linkTarget={linkTarget}
middleColumn={middleColumn}
- status={statusById?.[builtInAccountApp.id]}
- action={chevronIcon}
- link={getBuiltInAccountAppLink(builtInAccountApp.id)}
+ statuses={statusesById?.[application.id]}
/>
))}
- {applicationsAfterBuiltInAccountApps.map(renderApplicationRow)}
</StyledTableRowsContainer>
</Table>
</>
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationsTableApplicationRow.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationsTableApplicationRow.tsx
new file mode 100644
index 00000000000..7e80b1a95a4
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationsTableApplicationRow.tsx
@@ -0,0 +1,40 @@
+import { SettingsApplicationTableRow } from '@/settings/applications/components/SettingsApplicationTableRow';
+import { SettingsApplicationTableRowChevronIcon } from '@/settings/applications/components/SettingsApplicationTableRowChevronIcon';
+import { type SettingsApplicationStatus } from '@/settings/applications/types/SettingsApplicationStatus';
+import { type SettingsApplicationsTableApplication } from '@/settings/applications/types/SettingsApplicationsTableApplication';
+import { type SettingsApplicationsTableLinkTarget } from '@/settings/applications/types/SettingsApplicationsTableLinkTarget';
+import { type SettingsApplicationTableRowMiddleColumn } from '@/settings/applications/types/SettingsApplicationTableRowMiddleColumn';
+import { getSettingsApplicationLink } from '@/settings/applications/utils/getSettingsApplicationLink';
+
+type SettingsApplicationsTableApplicationRowProps = {
+ application: SettingsApplicationsTableApplication;
+ linkTarget: SettingsApplicationsTableLinkTarget;
+ middleColumn: SettingsApplicationTableRowMiddleColumn;
+ statuses?: SettingsApplicationStatus[];
+};
+
+export const SettingsApplicationsTableApplicationRow = ({
+ application,
+ linkTarget,
+ middleColumn,
+ statuses,
+}: SettingsApplicationsTableApplicationRowProps) => {
+ const shouldShowUpdateTag =
+ middleColumn === 'type' &&
+ (statuses ?? []).some((status) => status.type === 'updateAvailable');
+
+ return (
+ <SettingsApplicationTableRow
+ application={application}
+ shouldShowUpdateTag={shouldShowUpdateTag}
+ sourceType={application.applicationRegistration?.sourceType}
+ middleColumn={middleColumn}
+ statuses={statuses}
+ action={<SettingsApplicationTableRowChevronIcon />}
+ link={getSettingsApplicationLink({
+ linkTarget,
+ applicationId: application.id,
+ })}
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationsTableBuiltInAccountAppRow.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationsTableBuiltInAccountAppRow.tsx
new file mode 100644
index 00000000000..4afa2abf0a4
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationsTableBuiltInAccountAppRow.tsx
@@ -0,0 +1,42 @@
+import { type BuiltInAccountApp } from '@/settings/app-preferences/types/BuiltInAccountApp';
+import { getBuiltInAccountAppLogoUrl } from '@/settings/app-preferences/utils/getBuiltInAccountAppLogoUrl';
+import { SettingsApplicationTableRow } from '@/settings/applications/components/SettingsApplicationTableRow';
+import { SettingsApplicationTableRowChevronIcon } from '@/settings/applications/components/SettingsApplicationTableRowChevronIcon';
+import { type SettingsApplicationStatus } from '@/settings/applications/types/SettingsApplicationStatus';
+import { type SettingsApplicationsTableLinkTarget } from '@/settings/applications/types/SettingsApplicationsTableLinkTarget';
+import { type SettingsApplicationTableRowMiddleColumn } from '@/settings/applications/types/SettingsApplicationTableRowMiddleColumn';
+import { getSettingsBuiltInAccountAppLink } from '@/settings/applications/utils/getSettingsBuiltInAccountAppLink';
+import { useLingui } from '@lingui/react/macro';
+
+type SettingsApplicationsTableBuiltInAccountAppRowProps = {
+ builtInAccountApp: BuiltInAccountApp;
+ linkTarget: SettingsApplicationsTableLinkTarget;
+ middleColumn: SettingsApplicationTableRowMiddleColumn;
+ statuses?: SettingsApplicationStatus[];
+};
+
+export const SettingsApplicationsTableBuiltInAccountAppRow = ({
+ builtInAccountApp,
+ linkTarget,
+ middleColumn,
+ statuses,
+}: SettingsApplicationsTableBuiltInAccountAppRowProps) => {
+ const { t } = useLingui();
+
+ return (
+ <SettingsApplicationTableRow
+ application={{
+ name: t(builtInAccountApp.name),
+ description: t(builtInAccountApp.description),
+ logoUrl: getBuiltInAccountAppLogoUrl(builtInAccountApp),
+ }}
+ middleColumn={middleColumn}
+ statuses={statuses}
+ action={<SettingsApplicationTableRowChevronIcon />}
+ link={getSettingsBuiltInAccountAppLink({
+ linkTarget,
+ builtInAccountAppId: builtInAccountApp.id,
+ })}
+ />
+ );
+};
diff --git a/packages/twenty-front/src/modules/settings/applications/components/__stories__/SettingsApplicationsInstalledAppsSection.stories.tsx b/packages/twenty-front/src/modules/settings/applications/components/__stories__/SettingsApplicationsInstalledAppsSection.stories.tsx
new file mode 100644
index 00000000000..5bdbfa0d2ae
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/components/__stories__/SettingsApplicationsInstalledAppsSection.stories.tsx
@@ -0,0 +1,302 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+import { HttpResponse, graphql } from 'msw';
+import { getWorker } from 'msw-storybook-addon';
+import { expect, fn, userEvent, within } from 'storybook/test';
+
+import { currentWorkspaceState } from '@/auth/states/currentWorkspaceState';
+import { isGoogleMessagingEnabledState } from '@/client-config/states/isGoogleMessagingEnabledState';
+import { metadataStoreState } from '@/metadata-store/states/metadataStoreState';
+import { jotaiStore } from '@/ui/utilities/state/jotai/jotaiStore';
+import {
+ ApplicationRegistrationSourceType,
+ ApplicationVariableScope,
+ FeatureFlagKey,
+} from '~/generated-metadata/graphql';
+import { SettingsApplicationsInstalledAppsSection } from '@/settings/applications/components/SettingsApplicationsInstalledAppsSection';
+import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator';
+import { mockCurrentWorkspace } from '~/testing/mock-data/users';
+import { mockedApolloClient } from '~/testing/mockedApolloClient';
+
+const buildApplicationVariable = ({
+ key,
+ value,
+ scope,
+}: {
+ key: string;
+ value: string;
+ scope: ApplicationVariableScope;
+}) => ({
+ __typename: 'ApplicationVariable',
+ id: `${key}-id`,
+ key,
+ label: key,
+ value,
+ isRequired: true,
+ isDeprecated: false,
+ scope,
+});
+
+const buildApplication = ({
+ id,
+ name,
+ description,
+ latestAvailableVersion,
+}: {
+ id: string;
+ name: string;
+ description: string;
+ latestAvailableVersion: string;
+}) => ({
+ __typename: 'Application',
+ id,
+ name,
+ description,
+ logoUrl: null,
+ version: '1.0.0',
+ universalIdentifier: `${id}-universal-identifier`,
+ applicationRegistrationId: `${id}-registration-id`,
+ applicationRegistration: {
+ __typename: 'ApplicationRegistrationSummary',
+ id: `${id}-registration-id`,
+ latestAvailableVersion,
+ sourceType: ApplicationRegistrationSourceType.NPM,
+ },
+ defaultRoleId: null,
+});
+
+const RECORDER_APPLICATION = buildApplication({
+ id: 'recorder-application-id',
+ name: 'Recorder',
+ description: 'Records your meetings',
+ latestAvailableVersion: '1.1.0',
+});
+
+const ACME_APPLICATION = buildApplication({
+ id: 'acme-application-id',
+ name: 'Acme Sync',
+ description: 'Keeps Acme in sync',
+ latestAvailableVersion: '1.1.0',
+});
+
+const NOTES_APPLICATION = buildApplication({
+ id: 'notes-application-id',
+ name: 'Notes',
+ description: 'Shares meeting notes',
+ latestAvailableVersion: '1.0.0',
+});
+
+const APPLICATIONS = [
+ RECORDER_APPLICATION,
+ ACME_APPLICATION,
+ NOTES_APPLICATION,
+];
+
+const APPLICATIONS_FOR_STATUS = [
+ {
+ __typename: 'Application',
+ id: RECORDER_APPLICATION.id,
+ applicationVariables: [
+ buildApplicationVariable({
+ key: 'RECORDER_API_KEY',
+ value: '',
+ scope: ApplicationVariableScope.WORKSPACE,
+ }),
+ ],
+ },
+ {
+ __typename: 'Application',
+ id: ACME_APPLICATION.id,
+ applicationVariables: [],
+ },
+ {
+ __typename: 'Application',
+ id: NOTES_APPLICATION.id,
+ applicationVariables: [
+ buildApplicationVariable({
+ key: 'NOTES_API_KEY',
+ value: '********',
+ scope: ApplicationVariableScope.WORKSPACE,
+ }),
+ buildApplicationVariable({
+ key: 'PERSONAL_TOKEN',
+ value: '',
+ scope: ApplicationVariableScope.USER,
+ }),
+ ],
+ },
+];
+
+const findManyApplicationsForStatus = fn();
+
+const STATUS_LOAD_ERROR_MESSAGE =
+ 'App configuration could not be loaded. Check your connection and try again.';
+
+const failNextStatusRequest = () => {
+ getWorker().use(
+ graphql.query(
+ 'FindManyApplicationsForStatus',
+ () =>
+ HttpResponse.json({
+ errors: [
+ {
+ message: 'Internal server error',
+ extensions: { code: 'INTERNAL_SERVER_ERROR' },
+ },
+ ],
+ }),
+ { once: true },
+ ),
+ );
+};
+
+const seedInstalledTabStory = ({
+ isAppPreferencesEnabled,
+}: {
+ isAppPreferencesEnabled: boolean;
+}) => {
+ jotaiStore.set(isGoogleMessagingEnabledState.atom, true);
+ jotaiStore.set(currentWorkspaceState.atom, {
+ ...mockCurrentWorkspace,
+ featureFlags: [
+ {
+ key: FeatureFlagKey.IS_APP_PREFERENCES_ENABLED,
+ value: isAppPreferencesEnabled,
+ },
+ ],
+ });
+ jotaiStore.set(metadataStoreState.atomFamily('applications'), {
+ current: APPLICATIONS.map(
+ ({
+ id,
+ universalIdentifier,
+ name,
+ description,
+ version,
+ applicationRegistrationId,
+ }) => ({
+ id,
+ universalIdentifier,
+ name,
+ description,
+ version,
+ applicationRegistrationId,
+ }),
+ ),
+ draft: [],
+ status: 'up-to-date',
+ });
+};
+
+const meta: Meta<typeof SettingsApplicationsInstalledAppsSection> = {
+ title:
+ 'Modules/Settings/Applications/SettingsApplicationsInstalledAppsSection',
+ component: SettingsApplicationsInstalledAppsSection,
+ decorators: [ComponentWithRouterDecorator],
+ beforeEach: async () => {
+ findManyApplicationsForStatus.mockClear();
+ await mockedApolloClient.clearStore();
+ },
+ parameters: {
+ msw: {
+ handlers: [
+ graphql.query('FindManyApplications', () =>
+ HttpResponse.json({ data: { findManyApplications: APPLICATIONS } }),
+ ),
+ graphql.query('FindManyApplicationsForStatus', () => {
+ findManyApplicationsForStatus();
+
+ return HttpResponse.json({
+ data: { findManyApplications: APPLICATIONS_FOR_STATUS },
+ });
+ }),
+ ],
+ },
+ },
+};
+
+export default meta;
+
+type Story = StoryObj<typeof SettingsApplicationsInstalledAppsSection>;
+
+export const ShowsTypeAndUpdateTagWithoutAppPreferences: Story = {
+ beforeEach: () => seedInstalledTabStory({ isAppPreferencesEnabled: false }),
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+
+ const acmeRow = await canvas.findByRole('link', { name: /Acme Sync/ });
+
+ expect(await within(acmeRow).findByText('Update')).toBeVisible();
+ expect(acmeRow).toHaveTextContent('NPM');
+
+ const recorderRow = canvas.getByRole('link', { name: /Recorder/ });
+
+ expect(within(recorderRow).getByText('Update')).toBeVisible();
+ expect(recorderRow).toHaveTextContent('NPM');
+ expect(canvas.getByText('Type')).toBeVisible();
+ expect(canvas.queryByText('Status')).not.toBeInTheDocument();
+ expect(canvas.queryByText('Missing configuration')).not.toBeInTheDocument();
+ expect(canvas.queryByText('Gmail and Calendar')).not.toBeInTheDocument();
+ expect(findManyApplicationsForStatus).not.toHaveBeenCalled();
+ },
+};
+
+export const ShowsStatusWithAppPreferences: Story = {
+ beforeEach: () => seedInstalledTabStory({ isAppPreferencesEnabled: true }),
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+
+ const recorderRow = await canvas.findByRole('link', { name: /Recorder/ });
+
+ expect(
+ await within(recorderRow).findByText('Missing configuration'),
+ ).toBeVisible();
+ expect(recorderRow).not.toHaveTextContent('Update');
+ expect(canvas.getByText('Status')).toBeVisible();
+ expect(canvas.queryByText('Type')).not.toBeInTheDocument();
+
+ const acmeRow = canvas.getByRole('link', { name: /Acme Sync/ });
+
+ expect(within(acmeRow).getByText('Update')).toBeVisible();
+ expect(acmeRow).not.toHaveTextContent('NPM');
+
+ const notesRow = canvas.getByRole('link', { name: /Notes/ });
+
+ expect(notesRow).not.toHaveTextContent('Missing configuration');
+ expect(notesRow).not.toHaveTextContent('Update');
+
+ const gmailRow = canvas.getByRole('link', { name: /Gmail and Calendar/ });
+
+ expect(gmailRow).not.toHaveTextContent('Built-in');
+ expect(gmailRow).not.toHaveTextContent('Missing configuration');
+ },
+};
+
+export const KeepsUpdateAndShowsErrorWhenConfigurationFailsToLoad: Story = {
+ beforeEach: () => {
+ seedInstalledTabStory({ isAppPreferencesEnabled: true });
+ failNextStatusRequest();
+ },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+
+ expect(await canvas.findByText(STATUS_LOAD_ERROR_MESSAGE)).toBeVisible();
+ expect(canvas.queryByText('Missing configuration')).not.toBeInTheDocument();
+ expect(
+ await within(canvas.getByRole('link', { name: /Acme Sync/ })).findByText(
+ 'Update',
+ ),
+ ).toBeVisible();
+ expect(canvas.getByRole('link', { name: /Notes/ })).toBeVisible();
+
+ await userEvent.click(canvas.getByRole('button', { name: 'Retry' }));
+
+ expect(
+ await within(canvas.getByRole('link', { name: /Recorder/ })).findByText(
+ 'Missing configuration',
+ ),
+ ).toBeVisible();
+ expect(
+ canvas.queryByText(STATUS_LOAD_ERROR_MESSAGE),
+ ).not.toBeInTheDocument();
+ },
+};
diff --git a/packages/twenty-front/src/modules/settings/applications/components/__stories__/SettingsApplicationsTable.stories.tsx b/packages/twenty-front/src/modules/settings/applications/components/__stories__/SettingsApplicationsTable.stories.tsx
index 799a39961ea..4f9ffdaeb6e 100644
--- a/packages/twenty-front/src/modules/settings/applications/components/__stories__/SettingsApplicationsTable.stories.tsx
+++ b/packages/twenty-front/src/modules/settings/applications/components/__stories__/SettingsApplicationsTable.stories.tsx
@@ -1,45 +1,17 @@
import { type Meta, type StoryObj } from '@storybook/react-vite';
import { expect, userEvent, waitFor, within } from 'storybook/test';
-import { TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER } from 'twenty-shared/application';
-import { type ApplicationWithoutRelation } from '@/applications/types/ApplicationWithoutRelation';
import { BUILT_IN_ACCOUNT_APPS } from '@/settings/app-preferences/constants/BuiltInAccountApps';
-import { ApplicationRegistrationSourceType } from '~/generated-metadata/graphql';
import { SettingsApplicationsTable } from '@/settings/applications/components/SettingsApplicationsTable';
+import { getSettingsApplicationsTableRowLinks } from '@/settings/applications/testing/getSettingsApplicationsTableRowLinks';
+import {
+ NPM_APPLICATION,
+ OAUTH_ONLY_APPLICATION,
+ STANDARD_APPLICATION,
+ TARBALL_APPLICATION,
+} from '@/settings/applications/testing/settingsApplicationsTableFixtures';
import { ComponentWithRouterDecorator } from '~/testing/decorators/ComponentWithRouterDecorator';
-const STANDARD_APPLICATION: ApplicationWithoutRelation = {
- id: 'standard-application-id',
- name: 'Standard',
- universalIdentifier: TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
-};
-
-const NPM_APPLICATION: ApplicationWithoutRelation = {
- id: 'npm-application-id',
- name: 'Acme Sync',
- description: 'Keeps Acme in sync',
- universalIdentifier: 'npm-application-universal-identifier',
- applicationRegistration: {
- id: 'npm-registration-id',
- sourceType: ApplicationRegistrationSourceType.NPM,
- },
-};
-
-const OAUTH_APPLICATION: ApplicationWithoutRelation = {
- id: 'oauth-application-id',
- name: 'Zapier',
- universalIdentifier: 'oauth-application-universal-identifier',
- applicationRegistration: {
- id: 'oauth-registration-id',
- sourceType: ApplicationRegistrationSourceType.OAUTH_ONLY,
- },
-};
-
-const getRowLinks = (canvasElement: HTMLElement) =>
- within(canvasElement)
- .getAllByRole('link')
- .map((link) => link.getAttribute('href'));
-
const meta: Meta<typeof SettingsApplicationsTable> = {
title: 'Modules/Settings/Applications/SettingsApplicationsTable',
component: SettingsApplicationsTable,
@@ -47,9 +19,14 @@ const meta: Meta<typeof SettingsApplicationsTable> = {
args: {
title: 'Installed apps',
description: 'All the applications currently installed on this workspace',
- applications: [OAUTH_APPLICATION, NPM_APPLICATION, STANDARD_APPLICATION],
+ applications: [
+ OAUTH_ONLY_APPLICATION,
+ NPM_APPLICATION,
+ STANDARD_APPLICATION,
+ ],
builtInAccountApps: BUILT_IN_ACCOUNT_APPS,
- variant: 'workspace',
+ linkTarget: 'applicationDetail',
+ middleColumn: 'type',
},
};
@@ -62,7 +39,7 @@ export const BuiltInAccountAppsListedAfterStandardApp: Story = {
const canvas = within(canvasElement);
expect(await canvas.findByText('Gmail and Calendar')).toBeVisible();
- expect(getRowLinks(canvasElement)).toEqual([
+ expect(getSettingsApplicationsTableRowLinks(canvasElement)).toEqual([
'/settings/applications/standard-application-id',
'/settings/applications/google',
'/settings/applications/outlook',
@@ -86,7 +63,7 @@ export const SearchMatchesBuiltInAccountApps: Story = {
await userEvent.type(searchInput, 'microsoft');
await waitFor(() =>
- expect(getRowLinks(canvasElement)).toEqual([
+ expect(getSettingsApplicationsTableRowLinks(canvasElement)).toEqual([
'/settings/applications/outlook',
]),
);
@@ -95,13 +72,29 @@ export const SearchMatchesBuiltInAccountApps: Story = {
await userEvent.type(searchInput, 'outlook ');
await waitFor(() =>
- expect(getRowLinks(canvasElement)).toEqual([
+ expect(getSettingsApplicationsTableRowLinks(canvasElement)).toEqual([
'/settings/applications/outlook',
]),
);
},
};
+export const SearchWithNoMatchShowsAnEmptyState: Story = {
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+
+ await userEvent.type(
+ await canvas.findByPlaceholderText('Search an application'),
+ 'no such app',
+ );
+
+ expect(await canvas.findByRole('status')).toHaveTextContent(
+ 'No application matches your search',
+ );
+ expect(getSettingsApplicationsTableRowLinks(canvasElement)).toEqual([]);
+ },
+};
+
export const KeepsExistingOrderWithoutBuiltInAccountApps: Story = {
args: {
builtInAccountApps: [],
@@ -110,7 +103,7 @@ export const KeepsExistingOrderWithoutBuiltInAccountApps: Story = {
const canvas = within(canvasElement);
expect(await canvas.findByText('Acme Sync')).toBeVisible();
- expect(getRowLinks(canvasElement)).toEqual([
+ expect(getSettingsApplicationsTableRowLinks(canvasElement)).toEqual([
'/settings/applications/npm-application-id',
'/settings/applications/standard-application-id',
'/settings/applications/oauth-application-id',
@@ -118,6 +111,126 @@ export const KeepsExistingOrderWithoutBuiltInAccountApps: Story = {
},
};
+export const StatusColumnShowsTheMostUrgentStatus: Story = {
+ args: {
+ applications: [NPM_APPLICATION, TARBALL_APPLICATION, STANDARD_APPLICATION],
+ builtInAccountApps: [],
+ middleColumn: 'status',
+ statusesById: {
+ [NPM_APPLICATION.id]: [
+ { type: 'updateAvailable' },
+ { type: 'missingConfiguration' },
+ ],
+ [TARBALL_APPLICATION.id]: [{ type: 'updateAvailable' }],
+ },
+ },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+
+ expect(await canvas.findByText('Status')).toBeVisible();
+ expect(canvas.queryByText('Type')).not.toBeInTheDocument();
+
+ const acmeRow = canvas.getByRole('link', { name: /Acme Sync/ });
+
+ expect(within(acmeRow).getByText('Missing configuration')).toBeVisible();
+ expect(acmeRow).not.toHaveTextContent('Update');
+ expect(acmeRow).not.toHaveTextContent('NPM');
+
+ const weatherRow = canvas.getByRole('link', { name: /Weather Widget/ });
+
+ expect(within(weatherRow).getByText('Update')).toBeVisible();
+
+ const standardRow = canvas.getByRole('link', { name: /Standard/ });
+
+ expect(standardRow).not.toHaveTextContent('Missing configuration');
+ expect(standardRow).not.toHaveTextContent('Update');
+ },
+};
+
+export const TypeColumnShowsUpdateNextToTheDescription: Story = {
+ args: {
+ applications: [NPM_APPLICATION, TARBALL_APPLICATION],
+ builtInAccountApps: [],
+ middleColumn: 'type',
+ statusesById: {
+ [NPM_APPLICATION.id]: [
+ { type: 'missingConfiguration' },
+ { type: 'updateAvailable' },
+ ],
+ },
+ },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+
+ const acmeRow = await canvas.findByRole('link', { name: /Acme Sync/ });
+
+ expect(acmeRow).toHaveTextContent('NPM');
+ expect(within(acmeRow).getByText('Update')).toBeVisible();
+ expect(acmeRow).not.toHaveTextContent('Missing configuration');
+
+ const weatherRow = canvas.getByRole('link', { name: /Weather Widget/ });
+
+ expect(weatherRow).toHaveTextContent('Tarball');
+ expect(weatherRow).not.toHaveTextContent('Update');
+ },
+};
+
+export const MemberRowsLinkToTheirPreferences: Story = {
+ args: {
+ title: 'Apps',
+ description:
+ 'Choose your preferences for the apps installed on your workspace by the admin',
+ applications: [OAUTH_ONLY_APPLICATION, NPM_APPLICATION],
+ linkTarget: 'applicationPreferences',
+ middleColumn: 'status',
+ statusesById: {
+ [NPM_APPLICATION.id]: [
+ { type: 'missingConfiguration' },
+ { type: 'reconnectNeeded' },
+ ],
+ [OAUTH_ONLY_APPLICATION.id]: [{ type: 'notConnected' }],
+ },
+ },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+
+ expect(await canvas.findByText('Gmail and Calendar')).toBeVisible();
+ expect(getSettingsApplicationsTableRowLinks(canvasElement)).toEqual([
+ '/settings/accounts/apps/google',
+ '/settings/accounts/apps/outlook',
+ '/settings/accounts/apps/imap',
+ '/settings/accounts/applications/npm-application-id',
+ '/settings/accounts/applications/oauth-application-id',
+ ]);
+
+ const acmeRow = canvas.getByRole('link', { name: /Acme Sync/ });
+
+ expect(within(acmeRow).getByText('Reconnect needed')).toBeVisible();
+ expect(acmeRow).not.toHaveTextContent('Missing configuration');
+
+ expect(
+ within(canvas.getByRole('link', { name: /Zapier/ })).getByText(
+ 'Not connected',
+ ),
+ ).toBeVisible();
+ },
+};
+
+export const LoadingHidesSearchAndRows: Story = {
+ args: {
+ isLoading: true,
+ },
+ play: async ({ canvasElement }) => {
+ const canvas = within(canvasElement);
+
+ expect(await canvas.findByText('Installed apps')).toBeVisible();
+ expect(
+ canvas.queryByPlaceholderText('Search an application'),
+ ).not.toBeInTheDocument();
+ expect(getSettingsApplicationsTableRowLinks(canvasElement)).toEqual([]);
+ },
+};
+
export const HidesTheDescriptionOnMobile: Story = {
parameters: {
viewport: { defaultViewport: 'mobile1' },
diff --git a/packages/twenty-front/src/modules/settings/applications/constants/SettingsApplicationStatusUrgencyRank.ts b/packages/twenty-front/src/modules/settings/applications/constants/SettingsApplicationStatusUrgencyRank.ts
new file mode 100644
index 00000000000..02382d9b5c8
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/constants/SettingsApplicationStatusUrgencyRank.ts
@@ -0,0 +1,12 @@
+import { type SettingsApplicationStatus } from '@/settings/applications/types/SettingsApplicationStatus';
+
+export const SETTINGS_APPLICATION_STATUS_URGENCY_RANK: Record<
+ SettingsApplicationStatus['type'],
+ number
+> = {
+ reconnectNeeded: 0,
+ accountSyncIssue: 1,
+ missingConfiguration: 2,
+ notConnected: 3,
+ updateAvailable: 4,
+};
diff --git a/packages/twenty-front/src/modules/settings/applications/graphql/queries/findManyApplicationsForStatus.ts b/packages/twenty-front/src/modules/settings/applications/graphql/queries/findManyApplicationsForStatus.ts
new file mode 100644
index 00000000000..7c33d8e571e
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/graphql/queries/findManyApplicationsForStatus.ts
@@ -0,0 +1,18 @@
+import { gql } from '@apollo/client';
+
+export const FIND_MANY_APPLICATIONS_FOR_STATUS = gql`
+ query FindManyApplicationsForStatus {
+ findManyApplications {
+ id
+ applicationVariables {
+ id
+ key
+ label
+ value
+ isRequired
+ isDeprecated
+ scope
+ }
+ }
+ }
+`;
diff --git a/packages/twenty-front/src/modules/settings/applications/hooks/useWorkspaceApplicationStatusesById.ts b/packages/twenty-front/src/modules/settings/applications/hooks/useWorkspaceApplicationStatusesById.ts
new file mode 100644
index 00000000000..c79d0a14ed7
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/hooks/useWorkspaceApplicationStatusesById.ts
@@ -0,0 +1,32 @@
+import { getWorkspaceApplicationStatusesById } from '@/settings/applications/utils/getWorkspaceApplicationStatusesById';
+import { useQuery } from '@apollo/client/react';
+import { FindManyApplicationsForStatusDocument } from '~/generated-metadata/graphql';
+
+type UseWorkspaceApplicationStatusesByIdArgs = {
+ applications: Parameters<
+ typeof getWorkspaceApplicationStatusesById
+ >[0]['applications'];
+ shouldSkip: boolean;
+};
+
+export const useWorkspaceApplicationStatusesById = ({
+ applications,
+ shouldSkip,
+}: UseWorkspaceApplicationStatusesByIdArgs) => {
+ const { data, error, refetch } = useQuery(
+ FindManyApplicationsForStatusDocument,
+ {
+ skip: shouldSkip,
+ fetchPolicy: 'cache-and-network',
+ },
+ );
+
+ return {
+ statusesById: getWorkspaceApplicationStatusesById({
+ applications,
+ applicationsWithVariables: data?.findManyApplications,
+ }),
+ error,
+ refetch,
+ };
+};
diff --git a/packages/twenty-front/src/modules/settings/applications/testing/getSettingsApplicationsTableRowLinks.ts b/packages/twenty-front/src/modules/settings/applications/testing/getSettingsApplicationsTableRowLinks.ts
new file mode 100644
index 00000000000..088583cdc5d
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/testing/getSettingsApplicationsTableRowLinks.ts
@@ -0,0 +1,8 @@
+import { within } from 'storybook/test';
+
+export const getSettingsApplicationsTableRowLinks = (
+ canvasElement: HTMLElement,
+) =>
+ within(canvasElement)
+ .queryAllByRole('link')
+ .map((link) => link.getAttribute('href'));
diff --git a/packages/twenty-front/src/modules/settings/applications/testing/settingsApplicationsTableFixtures.ts b/packages/twenty-front/src/modules/settings/applications/testing/settingsApplicationsTableFixtures.ts
new file mode 100644
index 00000000000..0e241b48ba1
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/testing/settingsApplicationsTableFixtures.ts
@@ -0,0 +1,42 @@
+import { TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER } from 'twenty-shared/application';
+
+import { type SettingsApplicationsTableApplication } from '@/settings/applications/types/SettingsApplicationsTableApplication';
+import { ApplicationRegistrationSourceType } from '~/generated-metadata/graphql';
+
+export const STANDARD_APPLICATION: SettingsApplicationsTableApplication = {
+ id: 'standard-application-id',
+ name: 'Standard',
+ universalIdentifier: TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER,
+};
+
+export const NPM_APPLICATION: SettingsApplicationsTableApplication = {
+ id: 'npm-application-id',
+ name: 'Acme Sync',
+ description: 'Keeps Acme in sync',
+ universalIdentifier: 'npm-application-universal-identifier',
+ applicationRegistration: {
+ id: 'npm-registration-id',
+ sourceType: ApplicationRegistrationSourceType.NPM,
+ },
+};
+
+export const TARBALL_APPLICATION: SettingsApplicationsTableApplication = {
+ id: 'tarball-application-id',
+ name: 'Weather Widget',
+ description: 'Shows local weather on company records',
+ universalIdentifier: 'tarball-application-universal-identifier',
+ applicationRegistration: {
+ id: 'tarball-registration-id',
+ sourceType: ApplicationRegistrationSourceType.TARBALL,
+ },
+};
+
+export const OAUTH_ONLY_APPLICATION: SettingsApplicationsTableApplication = {
+ id: 'oauth-application-id',
+ name: 'Zapier',
+ universalIdentifier: 'oauth-application-universal-identifier',
+ applicationRegistration: {
+ id: 'oauth-registration-id',
+ sourceType: ApplicationRegistrationSourceType.OAUTH_ONLY,
+ },
+};
diff --git a/packages/twenty-front/src/modules/settings/app-preferences/types/AppPreferencesAppStatus.ts b/packages/twenty-front/src/modules/settings/applications/types/SettingsApplicationStatus.ts
similarity index 59%
rename from packages/twenty-front/src/modules/settings/app-preferences/types/AppPreferencesAppStatus.ts
rename to packages/twenty-front/src/modules/settings/applications/types/SettingsApplicationStatus.ts
index 943f9b719fc..8f840c0d657 100644
--- a/packages/twenty-front/src/modules/settings/app-preferences/types/AppPreferencesAppStatus.ts
+++ b/packages/twenty-front/src/modules/settings/applications/types/SettingsApplicationStatus.ts
@@ -1,7 +1,8 @@
import { type ConnectedAccount } from '@/accounts/types/ConnectedAccount';
-export type AppPreferencesAppStatus<TConnectedAccount = ConnectedAccount> =
+export type SettingsApplicationStatus<TConnectedAccount = ConnectedAccount> =
| { type: 'accountSyncIssue'; account: TConnectedAccount }
| { type: 'reconnectNeeded' }
| { type: 'missingConfiguration' }
- | { type: 'notConnected' };
+ | { type: 'notConnected' }
+ | { type: 'updateAvailable' };
diff --git a/packages/twenty-front/src/modules/settings/applications/types/SettingsApplicationsTableApplication.ts b/packages/twenty-front/src/modules/settings/applications/types/SettingsApplicationsTableApplication.ts
new file mode 100644
index 00000000000..f3f27951fcd
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/types/SettingsApplicationsTableApplication.ts
@@ -0,0 +1,12 @@
+import { type ApplicationWithoutRelation } from '@/applications/types/ApplicationWithoutRelation';
+
+export type SettingsApplicationsTableApplication = Pick<
+ ApplicationWithoutRelation,
+ | 'id'
+ | 'name'
+ | 'description'
+ | 'logoUrl'
+ | 'universalIdentifier'
+ | 'version'
+ | 'applicationRegistration'
+>;
diff --git a/packages/twenty-front/src/modules/settings/applications/types/SettingsApplicationsTableLinkTarget.ts b/packages/twenty-front/src/modules/settings/applications/types/SettingsApplicationsTableLinkTarget.ts
new file mode 100644
index 00000000000..b3b82987442
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/types/SettingsApplicationsTableLinkTarget.ts
@@ -0,0 +1,3 @@
+export type SettingsApplicationsTableLinkTarget =
+ | 'applicationDetail'
+ | 'applicationPreferences';
diff --git a/packages/twenty-front/src/modules/settings/applications/types/SettingsMemberApplicationStatus.ts b/packages/twenty-front/src/modules/settings/applications/types/SettingsMemberApplicationStatus.ts
new file mode 100644
index 00000000000..9016a9c0cb4
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/types/SettingsMemberApplicationStatus.ts
@@ -0,0 +1,10 @@
+import { type ConnectedAccount } from '@/accounts/types/ConnectedAccount';
+import { type SettingsApplicationStatus } from '@/settings/applications/types/SettingsApplicationStatus';
+
+// Members cannot upgrade apps, only users with the APPLICATIONS permission can
+export type SettingsMemberApplicationStatus<
+ TConnectedAccount = ConnectedAccount,
+> = Exclude<
+ SettingsApplicationStatus<TConnectedAccount>,
+ { type: 'updateAvailable' }
+>;
diff --git a/packages/twenty-front/src/modules/settings/applications/types/SettingsWorkspaceApplicationStatus.ts b/packages/twenty-front/src/modules/settings/applications/types/SettingsWorkspaceApplicationStatus.ts
new file mode 100644
index 00000000000..11673bad3d7
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/types/SettingsWorkspaceApplicationStatus.ts
@@ -0,0 +1,6 @@
+import { type SettingsApplicationStatus } from '@/settings/applications/types/SettingsApplicationStatus';
+
+export type SettingsWorkspaceApplicationStatus = Extract<
+ SettingsApplicationStatus,
+ { type: 'missingConfiguration' | 'updateAvailable' }
+>;
diff --git a/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getDisplayedWorkspaceApplicationVariables.test.ts b/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getDisplayedWorkspaceApplicationVariables.test.ts
new file mode 100644
index 00000000000..a9d440ca9a4
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getDisplayedWorkspaceApplicationVariables.test.ts
@@ -0,0 +1,30 @@
+import { getDisplayedWorkspaceApplicationVariables } from '@/settings/applications/utils/getDisplayedWorkspaceApplicationVariables';
+import { ApplicationVariableScope } from '~/generated-metadata/graphql';
+
+const buildApplicationVariable = ({
+ key,
+ value = '',
+ isDeprecated = false,
+ scope = ApplicationVariableScope.WORKSPACE,
+}: {
+ key: string;
+ value?: string;
+ isDeprecated?: boolean;
+ scope?: ApplicationVariableScope;
+}) => ({ key, value, isDeprecated, scope });
+
+describe('getDisplayedWorkspaceApplicationVariables', () => {
+ it('should keep only the displayed workspace variables, sorted by key', () => {
+ const result = getDisplayedWorkspaceApplicationVariables([
+ buildApplicationVariable({ key: 'ZONE' }),
+ buildApplicationVariable({
+ key: 'PERSONAL_TOKEN',
+ scope: ApplicationVariableScope.USER,
+ }),
+ buildApplicationVariable({ key: 'LEGACY_KEY', isDeprecated: true }),
+ buildApplicationVariable({ key: 'API_KEY' }),
+ ]);
+
+ expect(result.map(({ key }) => key)).toEqual(['API_KEY', 'ZONE']);
+ });
+});
diff --git a/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getHighestPrioritySettingsApplicationStatus.test.ts b/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getHighestPrioritySettingsApplicationStatus.test.ts
new file mode 100644
index 00000000000..a305838f179
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getHighestPrioritySettingsApplicationStatus.test.ts
@@ -0,0 +1,83 @@
+import { type SettingsApplicationStatus } from '@/settings/applications/types/SettingsApplicationStatus';
+import { getHighestPrioritySettingsApplicationStatus } from '@/settings/applications/utils/getHighestPrioritySettingsApplicationStatus';
+import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';
+
+describe('getHighestPrioritySettingsApplicationStatus', () => {
+ it('returns undefined when there is no status', () => {
+ expect(getHighestPrioritySettingsApplicationStatus([])).toBeUndefined();
+ });
+
+ it('shows missing configuration over an available update', () => {
+ expect(
+ getHighestPrioritySettingsApplicationStatus([
+ { type: 'updateAvailable' },
+ { type: 'missingConfiguration' },
+ ]),
+ ).toEqual({ type: 'missingConfiguration' });
+ });
+
+ it('shows reconnect needed over missing configuration', () => {
+ expect(
+ getHighestPrioritySettingsApplicationStatus([
+ { type: 'missingConfiguration' },
+ { type: 'reconnectNeeded' },
+ ]),
+ ).toEqual({ type: 'reconnectNeeded' });
+ });
+
+ it('shows not connected over an available update', () => {
+ expect(
+ getHighestPrioritySettingsApplicationStatus([
+ { type: 'updateAvailable' },
+ { type: 'notConnected' },
+ ]),
+ ).toEqual({ type: 'notConnected' });
+ });
+
+ it('ranks every status from most to least urgent', () => {
+ let remainingStatuses: Pick<SettingsApplicationStatus, 'type'>[] = [
+ { type: 'notConnected' },
+ { type: 'updateAvailable' },
+ { type: 'accountSyncIssue' },
+ { type: 'missingConfiguration' },
+ { type: 'reconnectNeeded' },
+ ];
+ const pickedStatusTypes: SettingsApplicationStatus['type'][] = [];
+
+ while (isNonEmptyArray(remainingStatuses)) {
+ const pickedStatus =
+ getHighestPrioritySettingsApplicationStatus(remainingStatuses);
+
+ if (!isDefined(pickedStatus)) {
+ break;
+ }
+
+ pickedStatusTypes.push(pickedStatus.type);
+ remainingStatuses = remainingStatuses.filter(
+ (status) => status !== pickedStatus,
+ );
+ }
+
+ expect(pickedStatusTypes).toEqual([
+ 'reconnectNeeded',
+ 'accountSyncIssue',
+ 'missingConfiguration',
+ 'notConnected',
+ 'updateAvailable',
+ ]);
+ });
+
+ it('does not reorder the given statuses', () => {
+ const statuses = [
+ { type: 'updateAvailable' as const },
+ { type: 'missingConfiguration' as const },
+ ];
+
+ getHighestPrioritySettingsApplicationStatus(statuses);
+
+ expect(statuses).toEqual([
+ { type: 'updateAvailable' },
+ { type: 'missingConfiguration' },
+ ]);
+ });
+});
diff --git a/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getSettingsApplicationLink.test.ts b/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getSettingsApplicationLink.test.ts
new file mode 100644
index 00000000000..2f5b932baf2
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getSettingsApplicationLink.test.ts
@@ -0,0 +1,21 @@
+import { getSettingsApplicationLink } from '@/settings/applications/utils/getSettingsApplicationLink';
+
+describe('getSettingsApplicationLink', () => {
+ it('links to the application detail page', () => {
+ expect(
+ getSettingsApplicationLink({
+ linkTarget: 'applicationDetail',
+ applicationId: 'acme-application-id',
+ }),
+ ).toBe('/settings/applications/acme-application-id');
+ });
+
+ it('links to the member preferences of the application', () => {
+ expect(
+ getSettingsApplicationLink({
+ linkTarget: 'applicationPreferences',
+ applicationId: 'acme-application-id',
+ }),
+ ).toBe('/settings/accounts/applications/acme-application-id');
+ });
+});
diff --git a/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getSettingsBuiltInAccountAppLink.test.ts b/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getSettingsBuiltInAccountAppLink.test.ts
new file mode 100644
index 00000000000..a6021d3ca18
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getSettingsBuiltInAccountAppLink.test.ts
@@ -0,0 +1,21 @@
+import { getSettingsBuiltInAccountAppLink } from '@/settings/applications/utils/getSettingsBuiltInAccountAppLink';
+
+describe('getSettingsBuiltInAccountAppLink', () => {
+ it('links to the application detail page', () => {
+ expect(
+ getSettingsBuiltInAccountAppLink({
+ linkTarget: 'applicationDetail',
+ builtInAccountAppId: 'google',
+ }),
+ ).toBe('/settings/applications/google');
+ });
+
+ it('links to the member preferences of the built-in account app', () => {
+ expect(
+ getSettingsBuiltInAccountAppLink({
+ linkTarget: 'applicationPreferences',
+ builtInAccountAppId: 'google',
+ }),
+ ).toBe('/settings/accounts/apps/google');
+ });
+});
diff --git a/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getWorkspaceApplicationStatusesById.test.ts b/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getWorkspaceApplicationStatusesById.test.ts
new file mode 100644
index 00000000000..beefedfa33c
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/utils/__tests__/getWorkspaceApplicationStatusesById.test.ts
@@ -0,0 +1,137 @@
+import { getWorkspaceApplicationStatusesById } from '@/settings/applications/utils/getWorkspaceApplicationStatusesById';
+import {
+ ApplicationRegistrationSourceType,
+ type ApplicationRegistrationSummary,
+ type ApplicationVariable,
+ ApplicationVariableScope,
+} from '~/generated-metadata/graphql';
+
+const APPLICATION_ID = 'acme-application-id';
+
+type ApplicationRegistrationOverrides = Partial<
+ Pick<ApplicationRegistrationSummary, 'sourceType' | 'latestAvailableVersion'>
+>;
+
+const buildVariable = (
+ overrides: Partial<
+ Pick<
+ ApplicationVariable,
+ 'key' | 'value' | 'isRequired' | 'isDeprecated' | 'scope'
+ >
+ > = {},
+) => ({
+ key: 'API_KEY',
+ label: 'API key',
+ value: '',
+ isRequired: true,
+ isDeprecated: false,
+ scope: ApplicationVariableScope.WORKSPACE,
+ ...overrides,
+});
+
+const buildApplication = ({
+ sourceType = ApplicationRegistrationSourceType.NPM,
+ latestAvailableVersion = '1.0.0',
+}: ApplicationRegistrationOverrides = {}) => ({
+ id: APPLICATION_ID,
+ version: '1.0.0',
+ applicationRegistration: { sourceType, latestAvailableVersion },
+});
+
+const getStatusesById = ({
+ sourceType,
+ latestAvailableVersion,
+ applicationVariables = [],
+ applicationVariablesApplicationId = APPLICATION_ID,
+}: ApplicationRegistrationOverrides & {
+ applicationVariables?: ReturnType<typeof buildVariable>[];
+ applicationVariablesApplicationId?: string;
+} = {}) =>
+ getWorkspaceApplicationStatusesById({
+ applications: [buildApplication({ sourceType, latestAvailableVersion })],
+ applicationsWithVariables: [
+ { id: applicationVariablesApplicationId, applicationVariables },
+ ],
+ });
+
+describe('getWorkspaceApplicationStatusesById', () => {
+ it('flags an app with a required workspace variable left empty', () => {
+ expect(
+ getStatusesById({ applicationVariables: [buildVariable()] }),
+ ).toEqual({
+ [APPLICATION_ID]: [{ type: 'missingConfiguration' }],
+ });
+ });
+
+ it('counts a masked secret as filled', () => {
+ expect(
+ getStatusesById({
+ applicationVariables: [buildVariable({ value: '********' })],
+ }),
+ ).toEqual({});
+ });
+
+ it('ignores required variables each member fills in', () => {
+ expect(
+ getStatusesById({
+ applicationVariables: [
+ buildVariable({ scope: ApplicationVariableScope.USER }),
+ ],
+ }),
+ ).toEqual({});
+ });
+
+ it('ignores deprecated variables left empty', () => {
+ expect(
+ getStatusesById({
+ applicationVariables: [buildVariable({ isDeprecated: true })],
+ }),
+ ).toEqual({});
+ });
+
+ it('ignores variables that belong to another app', () => {
+ expect(
+ getStatusesById({
+ applicationVariables: [buildVariable()],
+ applicationVariablesApplicationId: 'other-application-id',
+ }),
+ ).toEqual({});
+ });
+
+ it('flags an app behind its latest version', () => {
+ expect(getStatusesById({ latestAvailableVersion: '1.1.0' })).toEqual({
+ [APPLICATION_ID]: [{ type: 'updateAvailable' }],
+ });
+ });
+
+ it('never flags an update for an app that cannot be upgraded', () => {
+ expect(
+ getStatusesById({
+ sourceType: ApplicationRegistrationSourceType.LOCAL,
+ latestAvailableVersion: '1.1.0',
+ }),
+ ).toEqual({});
+ });
+
+ it('still flags an update while variables are not loaded', () => {
+ expect(
+ getWorkspaceApplicationStatusesById({
+ applications: [buildApplication({ latestAvailableVersion: '1.1.0' })],
+ }),
+ ).toEqual({ [APPLICATION_ID]: [{ type: 'updateAvailable' }] });
+ });
+
+ it('reports both missing configuration and an available update', () => {
+ expect(
+ getStatusesById({
+ latestAvailableVersion: '1.1.0',
+ applicationVariables: [buildVariable()],
+ }),
+ ).toEqual({
+ [APPLICATION_ID]: [
+ { type: 'missingConfiguration' },
+ { type: 'updateAvailable' },
+ ],
+ });
+ });
+});
diff --git a/packages/twenty-front/src/modules/settings/applications/utils/__tests__/sortApplicationsWithOAuthOnlyLast.test.ts b/packages/twenty-front/src/modules/settings/applications/utils/__tests__/sortApplicationsWithOAuthOnlyLast.test.ts
new file mode 100644
index 00000000000..b5974525a4d
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/utils/__tests__/sortApplicationsWithOAuthOnlyLast.test.ts
@@ -0,0 +1,57 @@
+import { sortApplicationsWithOAuthOnlyLast } from '@/settings/applications/utils/sortApplicationsWithOAuthOnlyLast';
+import { isDefined } from 'twenty-shared/utils';
+import {
+ ApplicationRegistrationSourceType,
+ type ApplicationRegistrationSummary,
+} from '~/generated-metadata/graphql';
+
+const buildApplication = ({
+ id,
+ sourceType,
+}: { id: string } & Partial<
+ Pick<ApplicationRegistrationSummary, 'sourceType'>
+>) => ({
+ id,
+ applicationRegistration: isDefined(sourceType) ? { sourceType } : null,
+});
+
+describe('sortApplicationsWithOAuthOnlyLast', () => {
+ it('moves OAuth-only applications last and keeps the other order', () => {
+ const applications = [
+ buildApplication({
+ id: 'zapier',
+ sourceType: ApplicationRegistrationSourceType.OAUTH_ONLY,
+ }),
+ buildApplication({
+ id: 'acme',
+ sourceType: ApplicationRegistrationSourceType.NPM,
+ }),
+ buildApplication({ id: 'standard' }),
+ buildApplication({
+ id: 'make',
+ sourceType: ApplicationRegistrationSourceType.OAUTH_ONLY,
+ }),
+ ];
+
+ expect(
+ sortApplicationsWithOAuthOnlyLast(applications).map(({ id }) => id),
+ ).toEqual(['acme', 'standard', 'zapier', 'make']);
+ });
+
+ it('does not reorder the given applications', () => {
+ const applications = [
+ buildApplication({
+ id: 'zapier',
+ sourceType: ApplicationRegistrationSourceType.OAUTH_ONLY,
+ }),
+ buildApplication({
+ id: 'acme',
+ sourceType: ApplicationRegistrationSourceType.NPM,
+ }),
+ ];
+
+ sortApplicationsWithOAuthOnlyLast(applications);
+
+ expect(applications.map(({ id }) => id)).toEqual(['zapier', 'acme']);
+ });
+});
diff --git a/packages/twenty-front/src/modules/settings/applications/utils/getDisplayedWorkspaceApplicationVariables.ts b/packages/twenty-front/src/modules/settings/applications/utils/getDisplayedWorkspaceApplicationVariables.ts
new file mode 100644
index 00000000000..fa0eadaa25b
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/utils/getDisplayedWorkspaceApplicationVariables.ts
@@ -0,0 +1,20 @@
+import { getDisplayedApplicationVariables } from '@/settings/applications/utils/getDisplayedApplicationVariables';
+import {
+ type ApplicationVariable,
+ ApplicationVariableScope,
+} from '~/generated-metadata/graphql';
+
+export const getDisplayedWorkspaceApplicationVariables = <
+ WorkspaceApplicationVariable extends Pick<
+ ApplicationVariable,
+ 'key' | 'value' | 'isDeprecated' | 'scope'
+ >,
+>(
+ applicationVariables: WorkspaceApplicationVariable[],
+): WorkspaceApplicationVariable[] =>
+ getDisplayedApplicationVariables(
+ applicationVariables.filter(
+ (applicationVariable) =>
+ applicationVariable.scope === ApplicationVariableScope.WORKSPACE,
+ ),
+ );
diff --git a/packages/twenty-front/src/modules/settings/applications/utils/getHighestPrioritySettingsApplicationStatus.ts b/packages/twenty-front/src/modules/settings/applications/utils/getHighestPrioritySettingsApplicationStatus.ts
new file mode 100644
index 00000000000..f7309593f41
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/utils/getHighestPrioritySettingsApplicationStatus.ts
@@ -0,0 +1,13 @@
+import { SETTINGS_APPLICATION_STATUS_URGENCY_RANK } from '@/settings/applications/constants/SettingsApplicationStatusUrgencyRank';
+import { type SettingsApplicationStatus } from '@/settings/applications/types/SettingsApplicationStatus';
+
+export const getHighestPrioritySettingsApplicationStatus = <
+ TSettingsApplicationStatus extends Pick<SettingsApplicationStatus, 'type'>,
+>(
+ statuses: TSettingsApplicationStatus[],
+): TSettingsApplicationStatus | undefined =>
+ [...statuses].sort(
+ (firstStatus, secondStatus) =>
+ SETTINGS_APPLICATION_STATUS_URGENCY_RANK[firstStatus.type] -
+ SETTINGS_APPLICATION_STATUS_URGENCY_RANK[secondStatus.type],
+ )[0];
diff --git a/packages/twenty-front/src/modules/settings/applications/utils/getSettingsApplicationLink.ts b/packages/twenty-front/src/modules/settings/applications/utils/getSettingsApplicationLink.ts
new file mode 100644
index 00000000000..de21c5acb53
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/utils/getSettingsApplicationLink.ts
@@ -0,0 +1,14 @@
+import { type SettingsApplicationsTableLinkTarget } from '@/settings/applications/types/SettingsApplicationsTableLinkTarget';
+import { SettingsPath } from 'twenty-shared/types';
+import { getSettingsPath } from 'twenty-shared/utils';
+
+export const getSettingsApplicationLink = ({
+ linkTarget,
+ applicationId,
+}: {
+ linkTarget: SettingsApplicationsTableLinkTarget;
+ applicationId: string;
+}) =>
+ linkTarget === 'applicationPreferences'
+ ? getSettingsPath(SettingsPath.ApplicationPreferences, { applicationId })
+ : getSettingsPath(SettingsPath.ApplicationDetail, { applicationId });
diff --git a/packages/twenty-front/src/modules/settings/applications/utils/getSettingsBuiltInAccountAppLink.ts b/packages/twenty-front/src/modules/settings/applications/utils/getSettingsBuiltInAccountAppLink.ts
new file mode 100644
index 00000000000..d404c3f1f9e
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/utils/getSettingsBuiltInAccountAppLink.ts
@@ -0,0 +1,17 @@
+import { type BuiltInAccountApp } from '@/settings/app-preferences/types/BuiltInAccountApp';
+import { type SettingsApplicationsTableLinkTarget } from '@/settings/applications/types/SettingsApplicationsTableLinkTarget';
+import { SettingsPath } from 'twenty-shared/types';
+import { getSettingsPath } from 'twenty-shared/utils';
+
+export const getSettingsBuiltInAccountAppLink = ({
+ linkTarget,
+ builtInAccountAppId,
+}: {
+ linkTarget: SettingsApplicationsTableLinkTarget;
+ builtInAccountAppId: BuiltInAccountApp['id'];
+}) =>
+ linkTarget === 'applicationPreferences'
+ ? getSettingsPath(SettingsPath.BuiltInAccountApp, { builtInAccountAppId })
+ : getSettingsPath(SettingsPath.ApplicationDetail, {
+ applicationId: builtInAccountAppId,
+ });
diff --git a/packages/twenty-front/src/modules/settings/applications/utils/getWorkspaceApplicationStatusesById.ts b/packages/twenty-front/src/modules/settings/applications/utils/getWorkspaceApplicationStatusesById.ts
new file mode 100644
index 00000000000..322af9f97e4
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/utils/getWorkspaceApplicationStatusesById.ts
@@ -0,0 +1,79 @@
+import { type SettingsWorkspaceApplicationStatus } from '@/settings/applications/types/SettingsWorkspaceApplicationStatus';
+import { getDisplayedWorkspaceApplicationVariables } from '@/settings/applications/utils/getDisplayedWorkspaceApplicationVariables';
+import { getMissingRequiredApplicationVariables } from '@/settings/applications/utils/getMissingRequiredApplicationVariables';
+import { hasApplicationUpdate } from '@/settings/applications/utils/hasApplicationUpdate';
+import { isNonEmptyArray } from 'twenty-shared/utils';
+import {
+ type Application,
+ type ApplicationRegistrationSummary,
+ type ApplicationVariable,
+} from '~/generated-metadata/graphql';
+
+type WorkspaceApplicationStatusApplication = Pick<
+ Application,
+ 'id' | 'version'
+> & {
+ applicationRegistration?: Pick<
+ ApplicationRegistrationSummary,
+ 'sourceType' | 'latestAvailableVersion'
+ > | null;
+};
+
+type WorkspaceApplicationStatusApplicationWithVariables = Pick<
+ Application,
+ 'id'
+> & {
+ applicationVariables: Pick<
+ ApplicationVariable,
+ 'key' | 'label' | 'value' | 'isRequired' | 'isDeprecated' | 'scope'
+ >[];
+};
+
+export const getWorkspaceApplicationStatusesById = ({
+ applications,
+ applicationsWithVariables,
+}: {
+ applications: WorkspaceApplicationStatusApplication[];
+ applicationsWithVariables?: WorkspaceApplicationStatusApplicationWithVariables[];
+}): Record<string, SettingsWorkspaceApplicationStatus[]> => {
+ const applicationVariablesByApplicationId = new Map(
+ (applicationsWithVariables ?? []).map(({ id, applicationVariables }) => [
+ id,
+ applicationVariables,
+ ]),
+ );
+
+ const statusesById: Record<string, SettingsWorkspaceApplicationStatus[]> = {};
+
+ for (const application of applications) {
+ const statuses: SettingsWorkspaceApplicationStatus[] = [];
+
+ const missingRequiredApplicationVariables =
+ getMissingRequiredApplicationVariables(
+ getDisplayedWorkspaceApplicationVariables(
+ applicationVariablesByApplicationId.get(application.id) ?? [],
+ ),
+ );
+
+ if (isNonEmptyArray(missingRequiredApplicationVariables)) {
+ statuses.push({ type: 'missingConfiguration' });
+ }
+
+ if (
+ hasApplicationUpdate({
+ sourceType: application.applicationRegistration?.sourceType,
+ currentVersion: application.version,
+ latestAvailableVersion:
+ application.applicationRegistration?.latestAvailableVersion,
+ })
+ ) {
+ statuses.push({ type: 'updateAvailable' });
+ }
+
+ if (isNonEmptyArray(statuses)) {
+ statusesById[application.id] = statuses;
+ }
+ }
+
+ return statusesById;
+};
diff --git a/packages/twenty-front/src/modules/settings/applications/utils/sortApplicationsWithOAuthOnlyLast.ts b/packages/twenty-front/src/modules/settings/applications/utils/sortApplicationsWithOAuthOnlyLast.ts
new file mode 100644
index 00000000000..869703da808
--- /dev/null
+++ b/packages/twenty-front/src/modules/settings/applications/utils/sortApplicationsWithOAuthOnlyLast.ts
@@ -0,0 +1,29 @@
+import {
+ type ApplicationRegistrationSummary,
+ ApplicationRegistrationSourceType,
+} from '~/generated-metadata/graphql';
+
+export const sortApplicationsWithOAuthOnlyLast = <
+ TApplication extends {
+ applicationRegistration?: Pick<
+ ApplicationRegistrationSummary,
+ 'sourceType'
+ > | null;
+ },
+>(
+ applications: TApplication[],
+): TApplication[] =>
+ [...applications].sort((firstApplication, secondApplication) => {
+ const isFirstApplicationOAuthOnly =
+ firstApplication.applicationRegistration?.sourceType ===
+ ApplicationRegistrationSourceType.OAUTH_ONLY;
+ const isSecondApplicationOAuthOnly =
+ secondApplication.applicationRegistration?.sourceType ===
+ ApplicationRegistrationSourceType.OAUTH_ONLY;
+
+ if (isFirstApplicationOAuthOnly === isSecondApplicationOAuthOnly) {
+ return 0;
+ }
+
+ return isFirstApplicationOAuthOnly ? 1 : -1;
+ });
diff --git a/packages/twenty-front/src/pages/settings/applications/SettingsApplicationDetails.tsx b/packages/twenty-front/src/pages/settings/applications/SettingsApplicationDetails.tsx
index 5b2c5e78bd2..e073e8c0071 100644
--- a/packages/twenty-front/src/pages/settings/applications/SettingsApplicationDetails.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/SettingsApplicationDetails.tsx
@@ -3,7 +3,7 @@ import { useRefetchOnApplicationOperation } from '@/applications/hooks/useRefetc
import { useUpgradeApplication } from '@/marketplace/hooks/useUpgradeApplication';
import { useInstalledBuiltInAccountApp } from '@/settings/applications/hooks/useInstalledBuiltInAccountApp';
import { useUninstallApplication } from '@/settings/applications/hooks/useUninstallApplication';
-import { getDisplayedApplicationVariables } from '@/settings/applications/utils/getDisplayedApplicationVariables';
+import { getDisplayedWorkspaceApplicationVariables } from '@/settings/applications/utils/getDisplayedWorkspaceApplicationVariables';
import { getSettingsMenuItemsForScope } from '@/settings/applications/utils/getSettingsMenuItemsForScope';
import { APPLICATION_VARIABLES_TAB_ID } from '@/settings/applications/constants/ApplicationVariablesTabId';
import { getApplicationConfigurationTabId } from '@/settings/applications/utils/getApplicationConfigurationTabId';
@@ -140,12 +140,10 @@ export const SettingsApplicationDetails = () => {
onCompleted: handleUninstallCompleted,
});
- const displayedApplicationVariables = getDisplayedApplicationVariables(
- (application?.applicationVariables ?? []).filter(
- (applicationVariable) =>
- applicationVariable.scope === ApplicationVariableScope.WORKSPACE,
- ),
- );
+ const displayedApplicationVariables =
+ getDisplayedWorkspaceApplicationVariables(
+ application?.applicationVariables ?? [],
+ );
const [updateOneApplicationVariable] = useMutation(
UpdateOneApplicationVariableDocument,
diff --git a/packages/twenty-front/src/pages/settings/applications/SettingsApplications.tsx b/packages/twenty-front/src/pages/settings/applications/SettingsApplications.tsx
index 519676990c1..6fa5c3da685 100644
--- a/packages/twenty-front/src/pages/settings/applications/SettingsApplications.tsx
+++ b/packages/twenty-front/src/pages/settings/applications/SettingsApplications.tsx
@@ -13,7 +13,7 @@ import { IconApps, IconShoppingBag, IconSparkle2 } from 'twenty-ui/icon';
import coverDark from '~/pages/settings/applications/assets/cover-dark.png';
import coverLight from '~/pages/settings/applications/assets/cover-light.png';
import { SettingsApplicationsAvailableTab } from '~/pages/settings/applications/tabs/SettingsApplicationsAvailableTab';
-import { SettingsApplicationsInstalledTab } from '~/pages/settings/applications/tabs/SettingsApplicationsInstalledTab';
+import { SettingsApplicationsInstalledAppsSection } from '@/settings/applications/components/SettingsApplicationsInstalledAppsSection';
const APPLICATIONS_TAB_LIST_ID = 'applications-tab-list';
const APPLICATIONS_HERO_INSTANCE_ID_PREFIX = 'settings-applications-hero';
@@ -44,7 +44,7 @@ export const SettingsApplications = () => {
case 'marketplace':
return <SettingsApplicationsAvailableTab />;
case 'installed':
- return <SettingsApplicationsInstalledTab />;
+ return <SettingsApplicationsInstalledAppsSection />;
default:
return <SettingsApplicationsAvailableTab />;
}
diff --git a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsInstalledTab.tsx b/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsInstalledTab.tsx
deleted file mode 100644
index e9ae86b1189..00000000000
--- a/packages/twenty-front/src/pages/settings/applications/tabs/SettingsApplicationsInstalledTab.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import { useInstalledApplications } from '@/applications/hooks/useInstalledApplications';
-import { useInstalledBuiltInAccountApps } from '@/settings/applications/hooks/useInstalledBuiltInAccountApps';
-import { SettingsApplicationsTable } from '@/settings/applications/components/SettingsApplicationsTable';
-import { useLingui } from '@lingui/react/macro';
-
-export const SettingsApplicationsInstalledTab = () => {
- const { t } = useLingui();
- const installedApplications = useInstalledApplications();
- const installedBuiltInAccountApps = useInstalledBuiltInAccountApps();
-
- if (installedApplications.length === 0) {
- return null;
- }
-
- return (
- <SettingsApplicationsTable
- title={t`Installed apps`}
- description={t`All the applications currently installed on this workspace`}
- applications={installedApplications}
- builtInAccountApps={installedBuiltInAccountApps}
- variant="workspace"
- />
- );
-};