Skip to content

Commit 943785e

Browse files
authored
Update docs to show archived information if connector is not in registries (#35468)
1 parent 2458c9b commit 943785e

File tree

3 files changed

+68
-25
lines changed

3 files changed

+68
-25
lines changed

docusaurus/src/components/ConnectorRegistry.jsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ export default function ConnectorRegistry({ type }) {
4242

4343
const connectors = registry
4444
.filter((c) => c.connector_type === type)
45-
.filter((c) => c.name_oss);
45+
.filter((c) => c.name_oss)
46+
.filter((c) => c.supportLevel_oss); // at lease one connector is missing a support level
4647

4748
return (
4849
<div>
@@ -77,8 +78,14 @@ export default function ConnectorRegistry({ type }) {
7778
{/* min width to prevent wrapping */}
7879
<td style={{ minWidth: 75 }}>
7980
<a href={docsLink}>📕</a>
80-
<a href={connector.github_url}>⚙️</a>
81-
<a href={connector.issue_url}>🐛</a>
81+
{connector.supportLevel_oss != "archived" ? (
82+
<a href={connector.github_url}>⚙️</a>
83+
) : (
84+
""
85+
)}
86+
{connector.supportLevel_oss != "archived" ? (
87+
<a href={connector.issue_url}>🐛</a>
88+
) : null}
8289
</td>
8390
<td>
8491
<small>{connector.supportLevel_oss}</small>

docusaurus/src/components/HeaderDecoration.jsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,17 @@ export const HeaderDecoration = ({
6767
</a>
6868
</dd>
6969
</div>
70-
<div>
71-
<dt>Latest Version</dt>
72-
<dd>
73-
<a href={github_url} target="_blank">
74-
{dockerImageTag}
75-
</a>
76-
</dd>
77-
</div>
70+
{supportLevel !== "archived" && (
71+
<div>
72+
<dt>Latest Version</dt>
73+
74+
<dd>
75+
<a href={github_url} target="_blank">
76+
{dockerImageTag}
77+
</a>
78+
</dd>
79+
</div>
80+
)}
7881
</dl>
7982

8083
<div className={styles.header}>

docusaurus/src/remark/utils.js

Lines changed: 47 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,52 @@ const isDocsPage = (vfile) => {
1616
};
1717

1818
const getRegistryEntry = async (vfile) => {
19-
const pathParts = vfile.path.split("/");
20-
const connectorName = pathParts.pop().split(".")[0];
21-
const connectorType = pathParts.pop();
22-
const dockerRepository = `airbyte/${connectorType.replace(
23-
/s$/,
24-
""
25-
)}-${connectorName}`;
26-
27-
const registry = await catalog;
28-
29-
return registry.find(
30-
(r) => r.dockerRepository_oss === dockerRepository
19+
const pathParts = vfile.path.split("/");
20+
const connectorName = pathParts.pop().split(".")[0];
21+
const connectorType = pathParts.pop();
22+
const dockerRepository = `airbyte/${connectorType.replace(
23+
/s$/,
24+
""
25+
)}-${connectorName}`;
26+
27+
const registry = await catalog;
28+
29+
let registryEntry = registry.find(
30+
(r) => r.dockerRepository_oss === dockerRepository
31+
);
32+
33+
if (!registryEntry) {
34+
registryEntry = buildArchivedRegistryEntry(
35+
connectorName,
36+
dockerRepository,
37+
connectorType
3138
);
32-
}
39+
}
40+
41+
return registryEntry;
42+
};
43+
44+
const buildArchivedRegistryEntry = (
45+
connectorName,
46+
dockerRepository,
47+
connectorType
48+
) => {
49+
const dockerName = dockerRepository.split("/")[1];
50+
const registryEntry = {
51+
connectorName,
52+
name_oss: dockerName,
53+
dockerRepository_oss: dockerRepository,
54+
is_oss: false,
55+
is_cloud: false,
56+
iconUrl_oss: `https://connectors.airbyte.com/files/metadata/airbyte/${dockerName}/latest/icon.svg`,
57+
supportLevel_oss: "archived",
58+
documentationUrl_oss: `https://docs.airbyte.com/integrations/${connectorType}s/${connectorName}`,
59+
};
3360

34-
module.exports = { isDocsPage, getRegistryEntry };
61+
return registryEntry;
62+
};
63+
64+
module.exports = {
65+
isDocsPage,
66+
getRegistryEntry,
67+
};

0 commit comments

Comments
 (0)