Skip to content
Merged
Show file tree
Hide file tree
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
Prev Previous commit
Next Next commit
Update documentation page with improved formatting and routing
Co-Authored-By: Francisco Javier Arceo <arceofrancisco@gmail.com>
  • Loading branch information
commit bf9a0b91d11a6bf7dfc9a60b99c4b86bc8a92ea1
12 changes: 6 additions & 6 deletions ui/src/FeastUISansProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,13 @@ const FeastUISansProvidersInner = ({
/>
<Route path="permissions/" element={<PermissionsIndex />} />
<Route path="lineage/" element={<LineageIndex />} />
<Route
path="documentation/"
element={<DocumentationIndex />}
<Route
path="documentation/"
element={<DocumentationIndex />}
/>
<Route
path="documentation/:tab"
element={<DocumentationIndex />}
<Route
path="documentation/:tab"
element={<DocumentationIndex />}
/>
</Route>
</Route>
Expand Down
20 changes: 14 additions & 6 deletions ui/src/pages/documentation/Index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import React from "react";
import { EuiPageTemplate, EuiTabs, EuiTab, EuiSpacer, EuiTitle, EuiText, EuiSkeletonText } from "@elastic/eui";
import {
EuiPageTemplate,
EuiTabs,
EuiTab,
EuiSpacer,
EuiTitle,
EuiText,
EuiSkeletonText,
} from "@elastic/eui";
import { useParams, useNavigate } from "react-router-dom";
import { useDocumentTitle } from "../../hooks/useDocumentTitle";
import "./styles.css";
Expand All @@ -8,7 +16,7 @@ const DocumentationIndex = () => {
useDocumentTitle("Feast Documentation");
const { projectName, tab = "cli" } = useParams();
const navigate = useNavigate();

const tabs = [
{
id: "cli",
Expand All @@ -26,15 +34,15 @@ const DocumentationIndex = () => {
content: React.lazy(() => import("./APIDocumentation")),
},
];

const selectedTabId = tab;
const selectedTabConfig = tabs.find((t) => t.id === selectedTabId) || tabs[0];
const TabContent = selectedTabConfig.content;

const onSelectedTabChanged = (id: string) => {
navigate(`/p/${projectName}/documentation/${id}`);
};

const renderTabs = () => {
return tabs.map((tab, index) => (
<EuiTab
Expand All @@ -46,7 +54,7 @@ const DocumentationIndex = () => {
</EuiTab>
));
};

return (
<EuiPageTemplate panelled>
<EuiPageTemplate.Section>
Expand Down
4 changes: 2 additions & 2 deletions ui/src/services/DocumentationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ feast serve
return "# Error\nFailed to load CLI documentation.";
}
},

async fetchSDKDocumentation(): Promise<string> {
try {
return `# Feast SDK Reference
Expand Down Expand Up @@ -130,7 +130,7 @@ driver = Entity(
return "# Error\nFailed to load SDK documentation.";
}
},

async fetchAPIDocumentation(): Promise<string> {
try {
return `# Feast REST API Reference
Expand Down