-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add Active and Add integration card displays
Closes #4541
- Loading branch information
1 parent
6ab43c6
commit ac072b2
Showing
14 changed files
with
187 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
packages/twenty-front/src/modules/settings/integrations/constants/MockRemoteDatabases.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export const MOCK_REMOTE_DATABASES = [ | ||
{ | ||
name: 'airtable', | ||
isActive: false, | ||
}, | ||
{ | ||
name: 'postgresql', | ||
isActive: true, | ||
}, | ||
]; |
2 changes: 1 addition & 1 deletion
2
...s/constants/SettingsIntegrationRequest.ts → ...s/constants/SettingsIntegrationRequest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../constants/SettingsIntegrationWindmill.ts → .../constants/SettingsIntegrationWindmill.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ns/constants/SettingsIntegrationZapier.ts → ...ns/constants/SettingsIntegrationZapier.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
.../twenty-front/src/modules/settings/integrations/hooks/useSettingsIntegrationCategories.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { MOCK_REMOTE_DATABASES } from '@/settings/integrations/constants/MockRemoteDatabases'; | ||
import { SETTINGS_INTEGRATION_REQUEST_CATEGORY } from '@/settings/integrations/constants/SettingsIntegrationRequest'; | ||
import { SETTINGS_INTEGRATION_WINDMILL_CATEGORY } from '@/settings/integrations/constants/SettingsIntegrationWindmill'; | ||
import { SETTINGS_INTEGRATION_ZAPIER_CATEGORY } from '@/settings/integrations/constants/SettingsIntegrationZapier'; | ||
import { SettingsIntegrationCategory } from '@/settings/integrations/types/SettingsIntegrationCategory'; | ||
import { getSettingsIntegrationAll } from '@/settings/integrations/utils/getSettingsIntegrationAll'; | ||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled'; | ||
|
||
export const useSettingsIntegrationCategories = | ||
(): SettingsIntegrationCategory[] => { | ||
const isAirtableIntegrationEnabled = useIsFeatureEnabled( | ||
'IS_AIRTABLE_INTEGRATION_ENABLED', | ||
); | ||
const isAirtableIntegrationActive = !!MOCK_REMOTE_DATABASES.find( | ||
({ name }) => name === 'airtable', | ||
)?.isActive; | ||
const isPostgresqlIntegrationEnabled = useIsFeatureEnabled( | ||
'IS_POSTGRESQL_INTEGRATION_ENABLED', | ||
); | ||
const isPostgresqlIntegrationActive = !!MOCK_REMOTE_DATABASES.find( | ||
({ name }) => name === 'postgresql', | ||
)?.isActive; | ||
|
||
return [ | ||
getSettingsIntegrationAll({ | ||
isAirtableIntegrationEnabled, | ||
isAirtableIntegrationActive, | ||
isPostgresqlIntegrationEnabled, | ||
isPostgresqlIntegrationActive, | ||
}), | ||
SETTINGS_INTEGRATION_ZAPIER_CATEGORY, | ||
SETTINGS_INTEGRATION_WINDMILL_CATEGORY, | ||
SETTINGS_INTEGRATION_REQUEST_CATEGORY, | ||
]; | ||
}; |
7 changes: 6 additions & 1 deletion
7
...integrations/types/SettingsIntegration.ts → ...integrations/types/SettingsIntegration.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ions/types/SettingsIntegrationCategory.ts → ...ions/types/SettingsIntegrationCategory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
packages/twenty-front/src/modules/settings/integrations/utils/getSettingsIntegrationAll.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { SettingsIntegrationCategory } from '@/settings/integrations/types/SettingsIntegrationCategory'; | ||
|
||
export const getSettingsIntegrationAll = ({ | ||
isAirtableIntegrationEnabled, | ||
isAirtableIntegrationActive, | ||
isPostgresqlIntegrationEnabled, | ||
isPostgresqlIntegrationActive, | ||
}: { | ||
isAirtableIntegrationEnabled: boolean; | ||
isAirtableIntegrationActive: boolean; | ||
isPostgresqlIntegrationEnabled: boolean; | ||
isPostgresqlIntegrationActive: boolean; | ||
}): SettingsIntegrationCategory => ({ | ||
key: 'all', | ||
title: 'All', | ||
integrations: [ | ||
{ | ||
from: { | ||
key: 'airtable', | ||
image: '/images/integrations/airtable-logo.png', | ||
}, | ||
type: !isAirtableIntegrationEnabled | ||
? 'Soon' | ||
: isAirtableIntegrationActive | ||
? 'Active' | ||
: 'Add', | ||
text: 'Airtable', | ||
link: '/settings/integrations/airtable', | ||
}, | ||
{ | ||
from: { | ||
key: 'postgresql', | ||
image: '/images/integrations/postgresql-logo.png', | ||
}, | ||
type: !isPostgresqlIntegrationEnabled | ||
? 'Soon' | ||
: isPostgresqlIntegrationActive | ||
? 'Active' | ||
: 'Add', | ||
text: 'PostgreSQL', | ||
link: '/settings/integrations/postgresql', | ||
}, | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
packages/twenty-front/src/pages/settings/integrations/SettingsIntegrations.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.