feat(market-data): 优化同步并增加完整性检查
This commit is contained in:
@@ -24,6 +24,7 @@ import {
|
||||
function useActiveRoutePath() {
|
||||
const matchRoute = useMatchRoute()
|
||||
if (matchRoute({ to: "/selection", fuzzy: true })) return "/selection"
|
||||
if (matchRoute({ to: "/sync", fuzzy: true })) return "/sync"
|
||||
if (matchRoute({ to: "/components", fuzzy: true })) return "/components"
|
||||
if (matchRoute({ to: "/", fuzzy: false })) return "/"
|
||||
return "/"
|
||||
@@ -244,7 +245,7 @@ function MoreSheet({
|
||||
<DialogHeader>
|
||||
<DialogTitle>更多功能</DialogTitle>
|
||||
<DialogDescription>
|
||||
行情数据与同步任务尚未上线,暂无更多可用入口。
|
||||
行情数据尚未上线,暂无更多可用入口。
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
</DialogContent>
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import { describe, expect, it } from "vitest"
|
||||
|
||||
import {
|
||||
mobilePrimaryNavigation,
|
||||
primaryNavigation,
|
||||
routePresentation,
|
||||
} from "./navigation"
|
||||
|
||||
describe("sync navigation", () => {
|
||||
it("exposes the sync route in desktop and mobile navigation", () => {
|
||||
const sync = primaryNavigation.find((item) => item.id === "sync")
|
||||
|
||||
expect(sync).toMatchObject({
|
||||
availability: "available",
|
||||
label: "同步任务",
|
||||
to: "/sync",
|
||||
})
|
||||
expect(mobilePrimaryNavigation).toContain(sync)
|
||||
})
|
||||
|
||||
it("provides the active route presentation for sync", () => {
|
||||
expect(routePresentation["/sync"]).toEqual({
|
||||
breadcrumb: "研究工作台",
|
||||
id: "sync",
|
||||
title: "市场数据完整性检查",
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -35,9 +35,9 @@ export const primaryNavigation: readonly NavigationItem[] = [
|
||||
{
|
||||
id: "sync",
|
||||
label: "同步任务",
|
||||
to: null,
|
||||
to: "/sync",
|
||||
icon: ClipboardCheck,
|
||||
availability: "unavailable",
|
||||
availability: "available",
|
||||
},
|
||||
{
|
||||
id: "selection",
|
||||
@@ -79,6 +79,11 @@ export const routePresentation: Record<string, RoutePresentation> = {
|
||||
breadcrumb: "研究工作台",
|
||||
title: "知行 B1 执行结果",
|
||||
},
|
||||
"/sync": {
|
||||
id: "sync",
|
||||
breadcrumb: "研究工作台",
|
||||
title: "市场数据完整性检查",
|
||||
},
|
||||
"/components": {
|
||||
id: "components",
|
||||
breadcrumb: "研究工作台",
|
||||
|
||||
Reference in New Issue
Block a user