mirror of
https://github.com/lingble/twenty.git
synced 2025-11-01 21:27:58 +00:00
Fix: Remove 'Soon' integrations from Settings when disabled (#7259)
## Description This PR addresses issue #7110, where Airtable, Stripe and PostgreSQL integrations were showing as "Soon" under Settings > Integrations. ## Changes - Update `getSettingsIntegrationAll` so that when these integrations are disabled (via feature flags), they are removed from the list instead of showing as "Soon". <img width="569" alt="Screenshot 2024-09-25 at 11 21 07 a m" src="https://github.com/user-attachments/assets/dae34e1f-b231-4e0c-bbd0-7d43a6a2f94a"> - Tweaked `useSettingsIntegrationCategories` to only show the "All" category if there's at least one integration enabled. <img width="582" alt="Screenshot 2024-09-25 at 11 21 15 a m" src="https://github.com/user-attachments/assets/57b87b18-8018-49e5-a507-527f2e6e701b"> ## Notes This is my first contribution to the project, so I'm open to feedback! 😄 Let me know if there's anything I should tweak or improve.
This commit is contained in:
@@ -29,15 +29,17 @@ export const useSettingsIntegrationCategories =
|
|||||||
({ name }) => name === 'stripe',
|
({ name }) => name === 'stripe',
|
||||||
)?.isActive;
|
)?.isActive;
|
||||||
|
|
||||||
return [
|
const allIntegrations = getSettingsIntegrationAll({
|
||||||
getSettingsIntegrationAll({
|
|
||||||
isAirtableIntegrationEnabled,
|
isAirtableIntegrationEnabled,
|
||||||
isAirtableIntegrationActive,
|
isAirtableIntegrationActive,
|
||||||
isPostgresqlIntegrationEnabled,
|
isPostgresqlIntegrationEnabled,
|
||||||
isPostgresqlIntegrationActive,
|
isPostgresqlIntegrationActive,
|
||||||
isStripeIntegrationEnabled,
|
isStripeIntegrationEnabled,
|
||||||
isStripeIntegrationActive,
|
isStripeIntegrationActive,
|
||||||
}),
|
});
|
||||||
|
|
||||||
|
return [
|
||||||
|
...(allIntegrations.integrations.length > 0 ? [allIntegrations] : []),
|
||||||
SETTINGS_INTEGRATION_ZAPIER_CATEGORY,
|
SETTINGS_INTEGRATION_ZAPIER_CATEGORY,
|
||||||
SETTINGS_INTEGRATION_WINDMILL_CATEGORY,
|
SETTINGS_INTEGRATION_WINDMILL_CATEGORY,
|
||||||
SETTINGS_INTEGRATION_REQUEST_CATEGORY,
|
SETTINGS_INTEGRATION_REQUEST_CATEGORY,
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { SettingsIntegration } from '@/settings/integrations/types/SettingsIntegration';
|
||||||
import { SettingsIntegrationCategory } from '@/settings/integrations/types/SettingsIntegrationCategory';
|
import { SettingsIntegrationCategory } from '@/settings/integrations/types/SettingsIntegrationCategory';
|
||||||
|
|
||||||
export const getSettingsIntegrationAll = ({
|
export const getSettingsIntegrationAll = ({
|
||||||
@@ -18,44 +19,32 @@ export const getSettingsIntegrationAll = ({
|
|||||||
key: 'all',
|
key: 'all',
|
||||||
title: 'All',
|
title: 'All',
|
||||||
integrations: [
|
integrations: [
|
||||||
{
|
isAirtableIntegrationEnabled && {
|
||||||
from: {
|
from: {
|
||||||
key: 'airtable',
|
key: 'airtable',
|
||||||
image: '/images/integrations/airtable-logo.png',
|
image: '/images/integrations/airtable-logo.png',
|
||||||
},
|
},
|
||||||
type: !isAirtableIntegrationEnabled
|
type: isAirtableIntegrationActive ? 'Active' : 'Add',
|
||||||
? 'Soon'
|
|
||||||
: isAirtableIntegrationActive
|
|
||||||
? 'Active'
|
|
||||||
: 'Add',
|
|
||||||
text: 'Airtable',
|
text: 'Airtable',
|
||||||
link: '/settings/integrations/airtable',
|
link: '/settings/integrations/airtable',
|
||||||
},
|
},
|
||||||
{
|
isPostgresqlIntegrationEnabled && {
|
||||||
from: {
|
from: {
|
||||||
key: 'postgresql',
|
key: 'postgresql',
|
||||||
image: '/images/integrations/postgresql-logo.png',
|
image: '/images/integrations/postgresql-logo.png',
|
||||||
},
|
},
|
||||||
type: !isPostgresqlIntegrationEnabled
|
type: isPostgresqlIntegrationActive ? 'Active' : 'Add',
|
||||||
? 'Soon'
|
|
||||||
: isPostgresqlIntegrationActive
|
|
||||||
? 'Active'
|
|
||||||
: 'Add',
|
|
||||||
text: 'PostgreSQL',
|
text: 'PostgreSQL',
|
||||||
link: '/settings/integrations/postgresql',
|
link: '/settings/integrations/postgresql',
|
||||||
},
|
},
|
||||||
{
|
isStripeIntegrationEnabled && {
|
||||||
from: {
|
from: {
|
||||||
key: 'stripe',
|
key: 'stripe',
|
||||||
image: '/images/integrations/stripe-logo.png',
|
image: '/images/integrations/stripe-logo.png',
|
||||||
},
|
},
|
||||||
type: !isStripeIntegrationEnabled
|
type: isStripeIntegrationActive ? 'Active' : 'Add',
|
||||||
? 'Soon'
|
|
||||||
: isStripeIntegrationActive
|
|
||||||
? 'Active'
|
|
||||||
: 'Add',
|
|
||||||
text: 'Stripe',
|
text: 'Stripe',
|
||||||
link: '/settings/integrations/stripe',
|
link: '/settings/integrations/stripe',
|
||||||
},
|
},
|
||||||
],
|
].filter(Boolean) as SettingsIntegration[],
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user