-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Update docs to show archived information if connector is not in registries #35468
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -67,14 +67,17 @@ export const HeaderDecoration = ({ | |||
</a> | ||||
</dd> | ||||
</div> | ||||
<div> | ||||
<dt>Latest Version</dt> | ||||
<dd> | ||||
<a href={github_url} target="_blank"> | ||||
{dockerImageTag} | ||||
</a> | ||||
</dd> | ||||
</div> | ||||
{supportLevel !== "archived" && ( | ||||
<div> | ||||
<dt>Latest Version</dt> | ||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
<dd> | ||||
<a href={github_url} target="_blank"> | ||||
{dockerImageTag} | ||||
</a> | ||||
</dd> | ||||
</div> | ||||
)} | ||||
</dl> | ||||
|
||||
<div className={styles.header}> | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,19 +16,52 @@ const isDocsPage = (vfile) => { | |
}; | ||
|
||
const getRegistryEntry = async (vfile) => { | ||
const pathParts = vfile.path.split("/"); | ||
const connectorName = pathParts.pop().split(".")[0]; | ||
const connectorType = pathParts.pop(); | ||
const dockerRepository = `airbyte/${connectorType.replace( | ||
/s$/, | ||
"" | ||
)}-${connectorName}`; | ||
|
||
const registry = await catalog; | ||
|
||
return registry.find( | ||
(r) => r.dockerRepository_oss === dockerRepository | ||
const pathParts = vfile.path.split("/"); | ||
const connectorName = pathParts.pop().split(".")[0]; | ||
const connectorType = pathParts.pop(); | ||
const dockerRepository = `airbyte/${connectorType.replace( | ||
/s$/, | ||
"" | ||
)}-${connectorName}`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. curious why this expression is multiline There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤷 it's what my linter did |
||
|
||
const registry = await catalog; | ||
|
||
let registryEntry = registry.find( | ||
(r) => r.dockerRepository_oss === dockerRepository | ||
); | ||
|
||
if (!registryEntry) { | ||
registryEntry = buildArchivedRegistryEntry( | ||
connectorName, | ||
dockerRepository, | ||
connectorType | ||
); | ||
} | ||
} | ||
|
||
return registryEntry; | ||
}; | ||
|
||
const buildArchivedRegistryEntry = ( | ||
connectorName, | ||
dockerRepository, | ||
connectorType | ||
) => { | ||
const dockerName = dockerRepository.split("/")[1]; | ||
const registryEntry = { | ||
connectorName, | ||
name_oss: dockerName, | ||
dockerRepository_oss: dockerRepository, | ||
is_oss: false, | ||
is_cloud: false, | ||
iconUrl_oss: `https://connectors.airbyte.com/files/metadata/airbyte/${dockerName}/latest/icon.svg`, | ||
supportLevel_oss: "archived", | ||
documentationUrl_oss: `https://docs.airbyte.com/integrations/${connectorType}s/${connectorName}`, | ||
}; | ||
|
||
module.exports = { isDocsPage, getRegistryEntry }; | ||
return registryEntry; | ||
}; | ||
|
||
module.exports = { | ||
isDocsPage, | ||
getRegistryEntry, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.