feat: role CRUD page
This commit is contained in:
@@ -3,7 +3,7 @@ import { Outlet, useLocation, useNavigate } from "react-router";
|
||||
|
||||
import { PanelLeft, ChevronRight } from "lucide-react";
|
||||
import { navigation } from "./platform.navigation";
|
||||
import type { ActivePage, NavigationItem } from "./platform.navigation";
|
||||
import type { ActivePage, NavigationItem, SubPage } from "./platform.navigation";
|
||||
import { Collapsible } from "@base-ui/react/collapsible";
|
||||
|
||||
import type { Route } from "./+types/platform";
|
||||
@@ -70,7 +70,7 @@ function NavRow({
|
||||
can: (code: string) => boolean;
|
||||
activePage: ActivePage;
|
||||
pathname: string;
|
||||
onNavigate: (sub?: "users" | "projects") => void;
|
||||
onNavigate: (sub?: SubPage) => void;
|
||||
}) {
|
||||
const itemIcon = <item.icon />;
|
||||
const childActivePath = (child: NavigationItem) =>
|
||||
@@ -208,7 +208,7 @@ function AuthenticatedLayout() {
|
||||
|
||||
// 原 common/Sidebar 的编辑会话守卫上移到这里:切出 /scripts 时有活动编辑
|
||||
// 会话先 endEditing,回工作台时清空选中脚本;再按当前激活页导航。
|
||||
function guardedNavigate(page: ActivePage, sub?: "users" | "projects") {
|
||||
function guardedNavigate(page: ActivePage, sub?: SubPage) {
|
||||
if (page !== "scripts" && editSessionHandle.current) {
|
||||
void endEditing(true);
|
||||
} else if (page === "home") {
|
||||
|
||||
Reference in New Issue
Block a user