-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter out unavailable connectors in cloud connector settings
* Move list of excluded connectors to connector constants * Add hook to filter out available connectors * Update settings connectorview component to filter out connectors * Add isCloudApp utility to check if the app is in cloud mode correctly
- Loading branch information
Showing
5 changed files
with
38 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
import { isCloudApp } from "utils/app"; | ||
|
||
export const DEV_IMAGE_TAG = "dev"; | ||
|
||
export const getExcludedConnectorIds = (workspaceId: string) => | ||
isCloudApp() | ||
? [ | ||
"200330b2-ea62-4d11-ac6d-cfe3e3f8ab2b", // Snapchat | ||
"2470e835-feaf-4db6-96f3-70fd645acc77", // Salesforce Singer | ||
...(workspaceId !== "54135667-ce73-4820-a93c-29fe1510d348" // Shopify workspace for review | ||
? ["9da77001-af33-4bcd-be46-6252bf9342b9"] // Shopify | ||
: []), | ||
] | ||
: []; |
16 changes: 16 additions & 0 deletions
16
airbyte-webapp/src/hooks/domain/connector/useAvailableConnectorDefinitions.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,16 @@ | ||
import { useMemo } from "react"; | ||
|
||
import { Connector, ConnectorDefinition } from "core/domain/connector"; | ||
import { getExcludedConnectorIds } from "core/domain/connector/constants"; | ||
import { WorkspaceRead } from "core/request/AirbyteClient"; | ||
|
||
export const useAvailableConnectorDefinitions = ( | ||
connectionDefinitions: ConnectorDefinition[], | ||
workspace: WorkspaceRead | ||
) => | ||
useMemo(() => { | ||
const excludedConnectorIds = getExcludedConnectorIds(workspace.workspaceId); | ||
return connectionDefinitions.filter( | ||
(connectorDefinition) => !excludedConnectorIds.includes(Connector.id(connectorDefinition)) | ||
); | ||
}, [connectionDefinitions, workspace.workspaceId]); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const isCloudApp = () => process.env.REACT_APP_CLOUD || window.CLOUD === "true"; |
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