Skip to content

🪟 🧪 Make sure to filter out connectors correctly #19732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airbyte-webapp/src/core/domain/connector/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const DEV_IMAGE_TAG = "dev";
* @param {string} workspaceId The workspace Id
* @returns {array} List of connectorIds that should be filtered out
*/
export const getExcludedConnectorIds = (workspaceId: string) =>
export const getExcludedConnectorIds = (workspaceId?: string) =>
isCloudApp()
? [
"707456df-6f4f-4ced-b5c6-03f73bcad1c5", // hide Cassandra Destination https://github.com/airbytehq/airbyte-cloud/issues/2606
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ const fetchCatalog = async (): Promise<Catalog> => {
};

export const useGetSourceDefinitions = () => {
return useQuery<Catalog, Error, Catalog["sources"]>("cloud_catalog", fetchCatalog, {
return useQuery("cloud_catalog", fetchCatalog, {
select: (data) => {
const filteredConnectors = getExcludedConnectorIds();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rename this variable to excludedConnectorIds. When I read the word filtered, I'm never sure if it means the things that were "filtered out", or if it means what is remaining after other things have been filtered out.

return data.sources
.filter(() => getExcludedConnectorIds(""))
.filter((source) => !filteredConnectors.includes(source.sourceDefinitionId))
.map((source) => {
const icon = availableSourceDefinitions.sourceDefinitions.find(
(src) => src.sourceDefinitionId === source.sourceDefinitionId
Expand Down