261022_04_ENH: 프로젝트 제목 코드·명 병행 표기 및 URL 파라미터 프로젝트 선택 제거

This commit is contained in:
2026-10-22 11:54:39 +09:00
parent 86e7ce3e32
commit 642350bc6c
4 changed files with 14 additions and 43 deletions

View File

@@ -10,7 +10,7 @@ import { kartMenus } from "@/config/menu.data";
import type { KartMenuItem } from "@/config/menu.type";
import { ProjectSelector } from "@/components/project/ProjectSelector";
import { useProjectTitle } from "@/query/project";
import { useProjectParamsMigration, useSelectedProject } from "@/hooks/useSelectedProject";
import { useSelectedProject } from "@/hooks/useSelectedProject";
import { projectPagePath } from "@/lib/report-navigation";
import { useAuth } from "@/hooks/useAuth";
import { useMutation } from "@tanstack/react-query";
@@ -28,13 +28,18 @@ export function AppHeader({ user }: AppHeaderProps) {
const { auth } = useAuth();
const external = isExternalUser(user);
const { project } = useSelectedProject();
useProjectParamsMigration();
const title = useProjectTitle(project);
const [mobileOpen, setMobileOpen] = useState(false);
const menus = project && !(external && auth.external?.pageOnly)
? kartMenus.filter((menu) => !menu.visible || menu.visible(user))
: [];
const projectTitle = project ? title : "Project Overview TOP 6";
// "(code) name" like the project selector; the code alone until the project list provides the
// name (useProjectTitle falls back to pkey). External links keep their link title.
const projectTitle = !project
? "Project Overview TOP 6"
: external || title === project.pkey
? title
: "(" + project.pkey + ") " + title;
const canCopyUrl = !!project && user.userRole < REPORT_MEMBER_ROLE;
const copy = useMutation({
mutationFn: async (mode: "P" | "U") => {