docs[patch]: Hide deprecated integration pages (#25389)

This commit is contained in:
Jacob Lee 2024-08-14 09:17:39 -07:00 committed by GitHub
parent 63c483ea01
commit 012929551c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -732,6 +732,23 @@ const FEATURE_TABLES = {
}
};
const DEPRECATED_DOC_IDS = [
"integrations/chat/anthropic_functions",
"integrations/chat/ernie",
"integrations/chat/ollama_functions",
"integrations/document_loaders/airbyte_cdk",
"integrations/document_loaders/airbyte_gong",
"integrations/document_loaders/airbyte_hubspot",
"integrations/document_loaders/airbyte_json",
"integrations/document_loaders/airbyte_salesforce",
"integrations/document_loaders/airbyte_shopify",
"integrations/document_loaders/airbyte_stripe",
"integrations/document_loaders/airbyte_typeform",
"integrations/document_loaders/airbyte_zendesk_support",
"integrations/llms/anthropic",
"integrations/text_embedding/ernie",
];
function toTable(columns, items) {
const headers = columns.map((col) => col.title);
return (
@ -775,14 +792,26 @@ function truncate(str, n) {
export function IndexTable() {
const { items } = useCurrentSidebarCategory();
const rows = items.filter(item => !item.docId?.endsWith?.('/index')).map(item => ({
const rows = items
.filter(
(item) =>
!item.docId?.endsWith?.("/index") &&
!DEPRECATED_DOC_IDS.includes(item.docId)
)
.map((item) => ({
...item,
description: useDocById(item.docId ?? undefined)?.description,
}));
const rtn = toTable(
[
{ title: "Label", formatter: (item) => <a href={item.href}>{item.label}</a> },
{ title: "Description", formatter: (item) => truncate(item.description ?? "", 70) },
{
title: "Name",
formatter: (item) => <a href={item.href}>{item.label}</a>,
},
{
title: "Description",
formatter: (item) => truncate(item.description ?? "", 70),
},
],
rows,
);