mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-31 04:12:10 +03:00
fix(dashboard): show Obsidian context source card (#7500)
* fix(dashboard): show Obsidian context source card * test(dashboard): guard Obsidian context source wiring --------- Co-authored-by: DKotsyuba <16292493+DKotsyuba@users.noreply.github.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import { useTranslations } from "next-intl";
|
||||
import A2ADashboardPage from "./components/A2ADashboard";
|
||||
import McpDashboardPage from "./components/MCPDashboard";
|
||||
import NotionSourceCard from "./components/NotionSourceCard";
|
||||
import ObsidianSourceCard from "./components/ObsidianSourceCard";
|
||||
import VscodeTokenAliasCard from "./VscodeTokenAliasCard";
|
||||
|
||||
const BUILD_TIME_CLOUD_URL = process.env.NEXT_PUBLIC_CLOUD_URL || null;
|
||||
@@ -1259,6 +1260,7 @@ export default function APIPageClient({ machineId }: Readonly<APIPageClientProps
|
||||
{activeEndpointTab === "context-sources" ? (
|
||||
<div className="flex flex-col gap-4">
|
||||
<NotionSourceCard />
|
||||
<ObsidianSourceCard />
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
|
||||
@@ -45,6 +45,27 @@ test("endpoint page keeps APIs, MCP, and A2A as in-page tabs", () => {
|
||||
assert.ok(source.includes('activeEndpointTab === "a2a" ? <A2ADashboardPage /> : null'));
|
||||
});
|
||||
|
||||
test("endpoint page exposes context-sources tab with Notion and Obsidian source cards", () => {
|
||||
const source = readSource("src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.tsx");
|
||||
|
||||
// Verify context-sources is part of the EndpointTab type contract
|
||||
assert.ok(source.includes('type EndpointTab = "apis" | "mcp" | "a2a" | "context-sources"'));
|
||||
|
||||
// Verify context-sources tab label is in ENDPOINT_TABS
|
||||
assert.ok(
|
||||
source.includes('{ value: "context-sources", label: "Context Sources", icon: "database" }')
|
||||
);
|
||||
|
||||
// Verify both source card components are imported
|
||||
assert.ok(source.includes('import NotionSourceCard from "./components/NotionSourceCard"'));
|
||||
assert.ok(source.includes('import ObsidianSourceCard from "./components/ObsidianSourceCard"'));
|
||||
|
||||
// Verify both components are rendered in the context-sources conditional block
|
||||
assert.ok(source.includes('activeEndpointTab === "context-sources" ? ('));
|
||||
assert.ok(source.includes("<NotionSourceCard />"));
|
||||
assert.ok(source.includes("<ObsidianSourceCard />"));
|
||||
});
|
||||
|
||||
test("settings root redirects to section pages instead of rendering a tab shell", () => {
|
||||
const pageSource = readSource("src/app/(dashboard)/dashboard/settings/page.tsx");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user