From 65ad1f94eda5502c216ab45b95714afd048f4f42 Mon Sep 17 00:00:00 2001 From: Evan Tahler Date: Fri, 6 Sep 2024 15:18:47 -0700 Subject: [PATCH] [docs] Filter connectors by suport level tabs (#45204) --- .../src/components/ConnectorRegistry.jsx | 95 ++++++++++++------- 1 file changed, 59 insertions(+), 36 deletions(-) diff --git a/docusaurus/src/components/ConnectorRegistry.jsx b/docusaurus/src/components/ConnectorRegistry.jsx index b8d90b795a9f..691512956f2b 100644 --- a/docusaurus/src/components/ConnectorRegistry.jsx +++ b/docusaurus/src/components/ConnectorRegistry.jsx @@ -1,7 +1,7 @@ import React from "react"; import { useEffect, useState } from "react"; -import { getSupportLevelDisplay } from "../connector_registry"; - +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; import styles from "./ConnectorRegistry.module.css"; import { REGISTRY_URL } from "../connector_registry"; @@ -30,35 +30,23 @@ function connectorSort(a, b) { if (a.name_oss > b.name_oss) return 1; } -export default function ConnectorRegistry({ type }) { - const [registry, setRegistry] = useState([]); - - useEffect(() => { - fetchCatalog(REGISTRY_URL, setRegistry); - }, []); - - if (registry.length === 0) return
{`Loading ${type}s...`}
; - - const connectors = registry - .filter((c) => c.connector_type === type) - .filter((c) => c.name_oss) - .filter((c) => c.supportLevel_oss); // at lease one connector is missing a support level - +function ConnectorTable({ connectors, connectorSupportLevel }) { return ( -
- - - - - - - - - - - - - {connectors.sort(connectorSort).map((connector) => { +
Connector NameLinksSupport LevelOSSCloudDocker Image
+ + + + + + + + + + + {connectors + .sort(connectorSort) + .filter((c) => c.supportLevel_oss === connectorSupportLevel) + .map((connector) => { const docsLink = connector.documentationUrl_oss?.replace( "https://docs.airbyte.com", "" @@ -86,9 +74,6 @@ export default function ConnectorRegistry({ type }) { 🐛 ) : null} - ); })} - -
Connector NameLinksOSSCloudDocker Image
- {getSupportLevelDisplay(connector.supportLevel_oss)} - {connector.is_oss ? "✅" : "❌"} {connector.is_cloud ? "✅" : "❌"} @@ -102,8 +87,46 @@ export default function ConnectorRegistry({ type }) {
-
+ + + ); +} + +export default function ConnectorRegistry({ type }) { + const [registry, setRegistry] = useState([]); + + useEffect(() => { + fetchCatalog(REGISTRY_URL, setRegistry); + }, []); + + if (registry.length === 0) return
{`Loading ${type}s...`}
; + + const connectors = registry + .filter((c) => c.connector_type === type) + .filter((c) => c.name_oss) + .filter((c) => c.supportLevel_oss); // at least one connector is missing a support level + + return ( + + + + + + + + {/* There are no archived connectors to show at the moment, so hiding for now */} + {/* + + */} + ); }