📢
공지
diff --git a/frontend/app/(main)/COMPANY_9/pop/main/page.tsx b/frontend/app/(main)/COMPANY_9/pop/main/page.tsx
index ae6e9404..182e6659 100644
--- a/frontend/app/(main)/COMPANY_9/pop/main/page.tsx
+++ b/frontend/app/(main)/COMPANY_9/pop/main/page.tsx
@@ -2,7 +2,6 @@
import { useRouter } from "next/navigation";
import type React from "react";
-import { KpiCarousel, RecentActivity } from "@/components/pop/hardcoded";
import { usePopCompanyPath } from "@/hooks/usePopCompanyPath";
interface MenuIconItem {
@@ -142,9 +141,7 @@ function LocalMenuIcons() {
export default function PopMainPage() {
return (
<>
-
-
>
);
}
diff --git a/frontend/app/(main)/layout.tsx b/frontend/app/(main)/layout.tsx
index ddc15372..b34a3904 100644
--- a/frontend/app/(main)/layout.tsx
+++ b/frontend/app/(main)/layout.tsx
@@ -12,7 +12,7 @@ import { MessengerModal } from "@/components/messenger/MessengerModal";
export default function MainLayout({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
- const isPop = pathname.includes("/pop/") || pathname.endsWith("/pop");
+ const isPop = pathname.includes("/pop/");
if (isPop) {
return <>{children}>;
diff --git a/frontend/app/(pop)/layout.tsx b/frontend/app/(pop)/layout.tsx
index 1c41d1c0..64d322f5 100644
--- a/frontend/app/(pop)/layout.tsx
+++ b/frontend/app/(pop)/layout.tsx
@@ -1,3 +1,5 @@
+// DEPRECATED: 구 POP 라우트 그룹. 신 POP 는 frontend/app/(main)/COMPANY_X/pop/ 사용
+
import "@/app/globals.css";
export const metadata = {
diff --git a/frontend/components/layout/AppLayout.tsx b/frontend/components/layout/AppLayout.tsx
index ede0e1b8..58ae4db9 100644
--- a/frontend/components/layout/AppLayout.tsx
+++ b/frontend/components/layout/AppLayout.tsx
@@ -525,11 +525,27 @@ function AppLayoutInner({ children }: AppLayoutProps) {
// POP 모드 진입 핸들러
const handlePopModeClick = async () => {
- if (isSuperAdmin) {
+ const userCompanyCode = (user as ExtendedUserInfo)?.companyCode;
+
+ // SUPER_ADMIN: 회사 미선택(*) 상태 → 회사 선택 모달
+ if (isSuperAdmin && userCompanyCode === "*") {
setPopCompanySelectOpen(true);
return;
}
+ // SUPER_ADMIN: 특정 회사 선택 상태 → 해당 회사 POP 으로 직행
+ if (isSuperAdmin && userCompanyCode && userCompanyCode !== "*") {
+ try {
+ if (!document.fullscreenElement) {
+ await document.documentElement.requestFullscreen();
+ }
+ } catch {
+ // 전체화면 미지원 또는 거부 시 무시
+ }
+ router.push(`/${userCompanyCode}/pop/main`);
+ return;
+ }
+
try {
// PC → POP 전환 시 전체화면 적용
try {
@@ -551,7 +567,6 @@ function AppLayoutInner({ children }: AppLayoutProps) {
} else if (childMenus.length === 1) {
router.push(childMenus[0].menu_url);
} else {
- const userCompanyCode = (user as ExtendedUserInfo)?.companyCode;
if (userCompanyCode && userCompanyCode !== "*") {
router.push(`/${userCompanyCode}/pop/main`);
} else {
diff --git a/frontend/components/pop/hardcoded/index.ts b/frontend/components/pop/hardcoded/index.ts
index 4101be3d..45dbd3c7 100644
--- a/frontend/components/pop/hardcoded/index.ts
+++ b/frontend/components/pop/hardcoded/index.ts
@@ -1,3 +1,5 @@
+// DEPRECATED: 구 POP 컴포넌트 묶음. 신 POP 는 frontend/app/(main)/COMPANY_X/pop/_components/ 사용
+
export {
InboundCart,
InboundTypeSelect,
diff --git a/frontend/hooks/pop/usePopSettings.ts b/frontend/hooks/pop/usePopSettings.ts
index c2722496..79fcac2c 100644
--- a/frontend/hooks/pop/usePopSettings.ts
+++ b/frontend/hooks/pop/usePopSettings.ts
@@ -1,8 +1,6 @@
"use client";
-import { useState, useEffect, useCallback } from "react";
-import { usePathname } from "next/navigation";
-import { apiClient } from "@/lib/api/client";
+import { useState } from "react";
export interface PopSettings {
version: string;
@@ -34,7 +32,7 @@ export interface PopSettings {
photoUpload: boolean;
barcodeEnabled: boolean;
};
- home: {
+ main: {
kpiCarousel: boolean;
recentActivity: boolean;
bannerEnabled: boolean;
@@ -66,13 +64,13 @@ const DEFAULT_SETTINGS: PopSettings = {
version: "hardcoded-1.0",
screens: {
processExecution: {
- materialInput: true,
- photoUpload: true,
+ materialInput: false,
+ photoUpload: false,
plcEnabled: false,
- bomFlexible: true,
- packagingOptions: ["낱개", "박스", "파렛트"],
- defectTypes: ["스크래치", "치수불량", "변색", "크랙", "기포"],
- reworkTargetSelection: true,
+ bomFlexible: false,
+ packagingOptions: [],
+ defectTypes: [],
+ reworkTargetSelection: false,
groupPhotoEnabled: false,
dateFilter: false,
lastProcessInventory: "manual",
@@ -84,20 +82,20 @@ const DEFAULT_SETTINGS: PopSettings = {
inbound: {
inspectionRequired: false,
photoUpload: false,
- barcodeEnabled: true,
+ barcodeEnabled: false,
packagingRecord: false,
defectSeparation: false,
},
outbound: {
photoUpload: false,
- barcodeEnabled: true,
+ barcodeEnabled: false,
},
- home: {
- kpiCarousel: true,
- recentActivity: true,
+ main: {
+ kpiCarousel: false,
+ recentActivity: false,
bannerEnabled: false,
bannerText: "",
- iconThemeColor: "#2563eb",
+ iconThemeColor: "",
iconCustomImages: false,
dashboardLayout: "default",
},
@@ -110,142 +108,8 @@ const DEFAULT_SETTINGS: PopSettings = {
},
};
-// URL -> screen_id mapping
-const POP_SCREEN_MAP: Record
= {
- "/pop/home": 6526,
- "/pop/inbound": 6529,
- "/pop/inbound/purchase": 6528,
- "/pop/inbound/cart": 6527,
- "/pop/outbound": 6,
- "/pop/outbound/sales": 5,
- "/pop/production": 8,
- "/pop/production/process": 7,
- "/COMPANY_7/pop/production/process": 7,
-};
-
-// URL -> settingsKey mapping
-const PATH_TO_SETTINGS_KEY: Record = {
- "/pop/home": "home",
- "/pop/inbound": "inbound",
- "/pop/inbound/purchase": "inbound",
- "/pop/inbound/cart": "inbound",
- "/pop/outbound": "outbound",
- "/pop/outbound/sales": "outbound",
- "/pop/production": "processExecution",
- "/pop/production/process": "processExecution",
- "/COMPANY_7/pop/production/process": "processExecution",
-};
-
-// 신 URL `/COMPANY_X/pop/` 에서 화면 키 추출 (main → home 정규화)
-function extractScreenKey(pathname: string): string | null {
- const match = pathname.match(/^\/COMPANY_\d+\/pop\/(.+)$/);
- if (!match) return null;
- const tail = match[1];
- return tail === "main" ? "home" : tail;
-}
-
-function getScreenIdFromPath(pathname: string): number | null {
- // 신 URL 우선 처리 (회사 prefix 제거 후 화면 키 매핑)
- const screenKey = extractScreenKey(pathname);
- if (screenKey) {
- const lookupPath = `/pop/${screenKey}`;
- if (POP_SCREEN_MAP[lookupPath]) return POP_SCREEN_MAP[lookupPath];
- const sortedNew = Object.keys(POP_SCREEN_MAP).sort((a, b) => b.length - a.length);
- for (const path of sortedNew) {
- if (lookupPath.startsWith(path)) return POP_SCREEN_MAP[path];
- }
- return null;
- }
-
- // 구 (pop)/ 라우트 호환 fallback
- if (POP_SCREEN_MAP[pathname]) return POP_SCREEN_MAP[pathname];
- const sorted = Object.keys(POP_SCREEN_MAP).sort((a, b) => b.length - a.length);
- for (const path of sorted) {
- if (pathname.startsWith(path)) return POP_SCREEN_MAP[path];
- }
- return null;
-}
-
-function getSettingsKeyFromPath(pathname: string): keyof PopSettings["screens"] | null {
- // 신 URL 우선 처리 (회사 prefix 제거 후 화면 키 매핑)
- const screenKey = extractScreenKey(pathname);
- if (screenKey) {
- const lookupPath = `/pop/${screenKey}`;
- if (PATH_TO_SETTINGS_KEY[lookupPath]) return PATH_TO_SETTINGS_KEY[lookupPath];
- const sortedNew = Object.keys(PATH_TO_SETTINGS_KEY).sort((a, b) => b.length - a.length);
- for (const path of sortedNew) {
- if (lookupPath.startsWith(path)) return PATH_TO_SETTINGS_KEY[path];
- }
- return null;
- }
-
- // 구 (pop)/ 라우트 호환 fallback
- if (PATH_TO_SETTINGS_KEY[pathname]) return PATH_TO_SETTINGS_KEY[pathname];
- const sorted = Object.keys(PATH_TO_SETTINGS_KEY).sort((a, b) => b.length - a.length);
- for (const path of sorted) {
- if (pathname.startsWith(path)) return PATH_TO_SETTINGS_KEY[path];
- }
- return null;
-}
-
-// Per-screenId cache to avoid redundant fetches
-const screenCache: Record> = {};
-
-export function usePopSettings(screenPath?: string) {
- const autoPathname = usePathname();
- const pathname = screenPath || autoPathname || "";
-
- const [settings, setSettings] = useState(DEFAULT_SETTINGS);
- const [loading, setLoading] = useState(true);
-
- const fetchSettings = useCallback(async () => {
- const screenId = getScreenIdFromPath(pathname);
- const settingsKey = getSettingsKeyFromPath(pathname);
-
- if (!screenId || !settingsKey) {
- setLoading(false);
- return;
- }
-
- // Use cache if available
- if (screenCache[screenId]) {
- const popConfig = screenCache[screenId];
- const merged = { ...DEFAULT_SETTINGS };
- merged.screens = {
- ...merged.screens,
- [settingsKey]: { ...merged.screens[settingsKey], ...popConfig },
- };
- setSettings(merged);
- setLoading(false);
- return;
- }
-
- try {
- const res = await apiClient
- .get(`/screen-management/screens/${screenId}/layout-pop`)
- .catch(() => null);
-
- if (res?.data?.data?.settings?.popConfig) {
- const popConfig = res.data.data.settings.popConfig;
- screenCache[screenId] = popConfig;
-
- const merged = { ...DEFAULT_SETTINGS };
- merged.screens = {
- ...merged.screens,
- [settingsKey]: { ...merged.screens[settingsKey], ...popConfig },
- };
- setSettings(merged);
- }
- } catch {
- // Use default settings on failure
- }
-
- setLoading(false);
- }, [pathname]);
-
- useEffect(() => {
- fetchSettings();
- }, [fetchSettings]);
-
+export function usePopSettings(_screenPath?: string) {
+ const [settings] = useState(DEFAULT_SETTINGS);
+ const [loading] = useState(false);
return { settings, loading };
}