## 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.
51 lines
1.6 KiB
TypeScript
51 lines
1.6 KiB
TypeScript
import { SettingsIntegration } from '@/settings/integrations/types/SettingsIntegration';
|
|
import { SettingsIntegrationCategory } from '@/settings/integrations/types/SettingsIntegrationCategory';
|
|
|
|
export const getSettingsIntegrationAll = ({
|
|
isAirtableIntegrationEnabled,
|
|
isAirtableIntegrationActive,
|
|
isPostgresqlIntegrationEnabled,
|
|
isPostgresqlIntegrationActive,
|
|
isStripeIntegrationEnabled,
|
|
isStripeIntegrationActive,
|
|
}: {
|
|
isAirtableIntegrationEnabled: boolean;
|
|
isAirtableIntegrationActive: boolean;
|
|
isPostgresqlIntegrationEnabled: boolean;
|
|
isPostgresqlIntegrationActive: boolean;
|
|
isStripeIntegrationEnabled: boolean;
|
|
isStripeIntegrationActive: boolean;
|
|
}): SettingsIntegrationCategory => ({
|
|
key: 'all',
|
|
title: 'All',
|
|
integrations: [
|
|
isAirtableIntegrationEnabled && {
|
|
from: {
|
|
key: 'airtable',
|
|
image: '/images/integrations/airtable-logo.png',
|
|
},
|
|
type: isAirtableIntegrationActive ? 'Active' : 'Add',
|
|
text: 'Airtable',
|
|
link: '/settings/integrations/airtable',
|
|
},
|
|
isPostgresqlIntegrationEnabled && {
|
|
from: {
|
|
key: 'postgresql',
|
|
image: '/images/integrations/postgresql-logo.png',
|
|
},
|
|
type: isPostgresqlIntegrationActive ? 'Active' : 'Add',
|
|
text: 'PostgreSQL',
|
|
link: '/settings/integrations/postgresql',
|
|
},
|
|
isStripeIntegrationEnabled && {
|
|
from: {
|
|
key: 'stripe',
|
|
image: '/images/integrations/stripe-logo.png',
|
|
},
|
|
type: isStripeIntegrationActive ? 'Active' : 'Add',
|
|
text: 'Stripe',
|
|
link: '/settings/integrations/stripe',
|
|
},
|
|
].filter(Boolean) as SettingsIntegration[],
|
|
});
|