Skip to content

[docs] Filter connectors by suport level tabs #45204

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 2 commits into from
Sep 6, 2024
Merged
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
95 changes: 59 additions & 36 deletions docusaurus/src/components/ConnectorRegistry.jsx
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -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 <div>{`Loading ${type}s...`}</div>;

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 (
<div>
<table>
<thead>
<tr>
<th>Connector Name</th>
<th>Links</th>
<th>Support Level</th>
<th>OSS</th>
<th>Cloud</th>
<th>Docker Image</th>
</tr>
</thead>
<tbody>
{connectors.sort(connectorSort).map((connector) => {
<table>
<thead>
<tr>
<th>Connector Name</th>
<th>Links</th>
<th>OSS</th>
<th>Cloud</th>
<th>Docker Image</th>
</tr>
</thead>
<tbody>
{connectors
.sort(connectorSort)
.filter((c) => c.supportLevel_oss === connectorSupportLevel)
.map((connector) => {
const docsLink = connector.documentationUrl_oss?.replace(
"https://docs.airbyte.com",
""
Expand Down Expand Up @@ -86,9 +74,6 @@ export default function ConnectorRegistry({ type }) {
<a href={connector.issue_url}>🐛</a>
) : null}
</td>
<td>
<small>{getSupportLevelDisplay(connector.supportLevel_oss)}</small>
</td>
<td>{connector.is_oss ? "✅" : "❌"}</td>
<td>{connector.is_cloud ? "✅" : "❌"}</td>
<td>
Expand All @@ -102,8 +87,46 @@ export default function ConnectorRegistry({ type }) {
</tr>
);
})}
</tbody>
</table>
</div>
</tbody>
</table>
);
}

export default function ConnectorRegistry({ type }) {
const [registry, setRegistry] = useState([]);

useEffect(() => {
fetchCatalog(REGISTRY_URL, setRegistry);
}, []);

if (registry.length === 0) return <div>{`Loading ${type}s...`}</div>;

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 (
<Tabs>
<TabItem value="certified" label="Airbyte Connector" default>
<ConnectorTable
connectors={connectors}
connectorSupportLevel={"certified"}
/>
</TabItem>
<TabItem value="community" label="Marketplace" default>
<ConnectorTable
connectors={connectors}
connectorSupportLevel={"community"}
/>
</TabItem>
{/* There are no archived connectors to show at the moment, so hiding for now */}
{/* <TabItem value="archived" label="Archived" default>
<ConnectorTable
connectors={connectors}
connectorSupportLevel={"archived"}
/>
</TabItem> */}
</Tabs>
);
}
Loading