This repository has been archived by the owner on Feb 16, 2023. It is now read-only.
forked from airbytehq/airbyte
-
Notifications
You must be signed in to change notification settings - Fork 0
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, enable…
… Snapchat in cloud (airbytehq#13174) * 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 * Remove Snapchat from filtered out list * Replace cloud check in index with util * Restore info about excluded connectors
- Loading branch information
Showing
6 changed files
with
53 additions
and
26 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,26 @@ | ||
import { isCloudApp } from "utils/app"; | ||
|
||
export const DEV_IMAGE_TAG = "dev"; | ||
|
||
/** | ||
* Returns the list of excluded connections for cloud users. | ||
* | ||
* During the Cloud private beta, we let users pick any connector in our catalog. | ||
* Later on, we realized we shouldn't have allowed using connectors whose platforms required oauth | ||
* But by that point, some users were already leveraging them, so removing them would crash the app for users | ||
* instead we'll filter out those connectors from this drop down menu, and retain them in the backend | ||
* This way, they will not be available for usage in new connections, but they will be available for users | ||
* already leveraging them. | ||
* @param {string} workspaceId The workspace Id | ||
* @returns {array} List of connectorIds that should be filtered out | ||
*/ | ||
export const getExcludedConnectorIds = (workspaceId: string) => | ||
isCloudApp() | ||
? [ | ||
"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
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