refactor: 移除用户管理和系统设置占位页面
This commit is contained in:
@@ -2,7 +2,7 @@ import type { ReactElement } from "react";
|
|||||||
import type { MenuValue } from "tdesign-react";
|
import type { MenuValue } from "tdesign-react";
|
||||||
|
|
||||||
import { createElement } from "react";
|
import { createElement } from "react";
|
||||||
import { DashboardIcon, FolderIcon, SettingIcon, UserIcon } from "tdesign-icons-react";
|
import { DashboardIcon, FolderIcon } from "tdesign-icons-react";
|
||||||
|
|
||||||
export interface MenuItemConfig {
|
export interface MenuItemConfig {
|
||||||
icon: ReactElement;
|
icon: ReactElement;
|
||||||
@@ -14,6 +14,4 @@ export interface MenuItemConfig {
|
|||||||
export const MENU_ITEMS: readonly MenuItemConfig[] = [
|
export const MENU_ITEMS: readonly MenuItemConfig[] = [
|
||||||
{ icon: createElement(DashboardIcon), label: "仪表盘", path: "/", value: "dashboard" },
|
{ icon: createElement(DashboardIcon), label: "仪表盘", path: "/", value: "dashboard" },
|
||||||
{ icon: createElement(FolderIcon), label: "项目管理", path: "/projects", value: "projects" },
|
{ icon: createElement(FolderIcon), label: "项目管理", path: "/projects", value: "projects" },
|
||||||
{ icon: createElement(UserIcon), label: "用户管理", path: "/users", value: "users" },
|
|
||||||
{ icon: createElement(SettingIcon), label: "系统设置", path: "/settings", value: "settings" },
|
|
||||||
] as const;
|
] as const;
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
import { Card, Space } from "tdesign-react";
|
|
||||||
|
|
||||||
export function SettingsPage() {
|
|
||||||
return (
|
|
||||||
<Space className="full-width-space" direction="vertical" size="large">
|
|
||||||
<h2>系统设置</h2>
|
|
||||||
<Card>
|
|
||||||
<p>页面建设中...</p>
|
|
||||||
</Card>
|
|
||||||
</Space>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { Card, Space } from "tdesign-react";
|
|
||||||
|
|
||||||
export function UsersPage() {
|
|
||||||
return (
|
|
||||||
<Space className="full-width-space" direction="vertical" size="large">
|
|
||||||
<h2>用户管理</h2>
|
|
||||||
<Card>
|
|
||||||
<p>页面建设中...</p>
|
|
||||||
</Card>
|
|
||||||
</Space>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -5,16 +5,12 @@ import { Route, Routes } from "react-router";
|
|||||||
import { NotFoundPage } from "./pages/404";
|
import { NotFoundPage } from "./pages/404";
|
||||||
import { DashboardPage } from "./pages/dashboard";
|
import { DashboardPage } from "./pages/dashboard";
|
||||||
import { ProjectsPage } from "./pages/projects";
|
import { ProjectsPage } from "./pages/projects";
|
||||||
import { SettingsPage } from "./pages/settings";
|
|
||||||
import { UsersPage } from "./pages/users";
|
|
||||||
|
|
||||||
export function AppRoutes() {
|
export function AppRoutes() {
|
||||||
return (
|
return (
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route element={<DashboardPage />} path="/" />
|
<Route element={<DashboardPage />} path="/" />
|
||||||
<Route element={<ProjectsPage />} path="/projects" />
|
<Route element={<ProjectsPage />} path="/projects" />
|
||||||
<Route element={<UsersPage />} path="/users" />
|
|
||||||
<Route element={<SettingsPage />} path="/settings" />
|
|
||||||
<Route element={<NotFoundPage />} path="*" />
|
<Route element={<NotFoundPage />} path="*" />
|
||||||
</Routes>
|
</Routes>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
import { screen } from "@testing-library/react";
|
|
||||||
import { describe, expect, test } from "bun:test";
|
|
||||||
import { createElement } from "react";
|
|
||||||
|
|
||||||
import { SettingsPage } from "../../../src/web/pages/settings";
|
|
||||||
import { renderWithProviders } from "../test-utils";
|
|
||||||
|
|
||||||
describe("SettingsPage", () => {
|
|
||||||
test("渲染系统设置页面", () => {
|
|
||||||
renderWithProviders(createElement(SettingsPage));
|
|
||||||
|
|
||||||
expect(screen.getByText("系统设置")).not.toBeNull();
|
|
||||||
expect(screen.getByText("页面建设中...")).not.toBeNull();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import { screen } from "@testing-library/react";
|
|
||||||
import { describe, expect, test } from "bun:test";
|
|
||||||
import { createElement } from "react";
|
|
||||||
|
|
||||||
import { UsersPage } from "../../../src/web/pages/users";
|
|
||||||
import { renderWithProviders } from "../test-utils";
|
|
||||||
|
|
||||||
describe("UsersPage", () => {
|
|
||||||
test("渲染用户管理页面", () => {
|
|
||||||
renderWithProviders(createElement(UsersPage));
|
|
||||||
|
|
||||||
expect(screen.getByText("用户管理")).not.toBeNull();
|
|
||||||
expect(screen.getByText("页面建设中...")).not.toBeNull();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user