feat(WEB): 전체 페이지 ?mode= URL 네비게이션 패턴 적용
- 등록(?mode=new), 상세(?mode=view), 수정(?mode=edit) URL 패턴 일괄 적용
- 중복 패턴 제거: /edit?mode=edit → ?mode=edit (16개 파일)
- 제목 일관성: {기능} 등록/상세/수정 패턴 적용
- 검수 체크리스트 문서 추가 (79개 페이지)
- UniversalListPage, IntegratedDetailTemplate 공통 컴포넌트 개선
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -134,6 +134,10 @@ export function AccountDetail({ account, mode: initialMode }: AccountDetailProps
|
||||
|
||||
const handleEdit = () => {
|
||||
setMode('edit');
|
||||
// URL도 변경
|
||||
if (account?.id) {
|
||||
router.push(`/ko/settings/accounts/${account.id}?mode=edit`);
|
||||
}
|
||||
};
|
||||
|
||||
// 뷰 모드 렌더링
|
||||
|
||||
@@ -72,7 +72,7 @@ export function AccountManagement() {
|
||||
|
||||
// ===== 액션 핸들러 =====
|
||||
const handleRowClick = useCallback((item: Account) => {
|
||||
router.push(`/ko/settings/accounts/${item.id}`);
|
||||
router.push(`/ko/settings/accounts/${item.id}?mode=view`);
|
||||
}, [router]);
|
||||
|
||||
const handleEdit = useCallback((item: Account) => {
|
||||
@@ -138,7 +138,7 @@ export function AccountManagement() {
|
||||
}, [bulkDeleteIds]);
|
||||
|
||||
const handleCreate = useCallback(() => {
|
||||
router.push('/ko/settings/accounts/new');
|
||||
router.push('/ko/settings/accounts?mode=new');
|
||||
}, [router]);
|
||||
|
||||
// ===== UniversalListPage Config =====
|
||||
|
||||
@@ -108,6 +108,7 @@ function buildMenuTree(flatMenus: FlatMenuItem[]): MenuTreeItem[] {
|
||||
interface PermissionDetailClientProps {
|
||||
permissionId: string;
|
||||
isNew?: boolean;
|
||||
mode?: 'view' | 'edit';
|
||||
}
|
||||
|
||||
// 권한 타입
|
||||
@@ -122,7 +123,7 @@ const PERMISSION_LABELS_MAP: Record<PermissionType, string> = {
|
||||
manage: '관리',
|
||||
};
|
||||
|
||||
export function PermissionDetailClient({ permissionId, isNew = false }: PermissionDetailClientProps) {
|
||||
export function PermissionDetailClient({ permissionId, isNew = false, mode = 'view' }: PermissionDetailClientProps) {
|
||||
const router = useRouter();
|
||||
|
||||
// 역할 데이터
|
||||
@@ -477,8 +478,8 @@ export function PermissionDetailClient({ permissionId, isNew = false }: Permissi
|
||||
<PageLayout>
|
||||
{/* 페이지 헤더 */}
|
||||
<PageHeader
|
||||
title={isNew ? '역할 등록' : '역할 상세'}
|
||||
description={isNew ? '새 역할을 등록합니다' : '역할 정보와 권한을 관리합니다'}
|
||||
title={isNew ? '역할 등록' : mode === 'edit' ? '역할 수정' : '역할 상세'}
|
||||
description={isNew ? '새 역할을 등록합니다' : mode === 'edit' ? '역할 정보를 수정합니다' : '역할 정보와 권한을 관리합니다'}
|
||||
icon={Shield}
|
||||
actions={
|
||||
<Button variant="ghost" size="sm" onClick={handleBack}>
|
||||
|
||||
@@ -127,16 +127,16 @@ export function PermissionManagement() {
|
||||
|
||||
// ===== 핸들러 =====
|
||||
const handleAdd = () => {
|
||||
router.push('/settings/permissions/new');
|
||||
router.push('/settings/permissions?mode=new');
|
||||
};
|
||||
|
||||
const handleEdit = (role: Role, e?: React.MouseEvent) => {
|
||||
e?.stopPropagation();
|
||||
router.push(`/settings/permissions/${role.id}`);
|
||||
router.push(`/settings/permissions/${role.id}?mode=edit`);
|
||||
};
|
||||
|
||||
const handleViewDetail = (role: Role) => {
|
||||
router.push(`/settings/permissions/${role.id}`);
|
||||
router.push(`/settings/permissions/${role.id}?mode=view`);
|
||||
};
|
||||
|
||||
const handleDelete = (role: Role, e?: React.MouseEvent) => {
|
||||
|
||||
@@ -89,7 +89,7 @@ export function PopupDetailClientV2({ popupId, initialMode }: PopupDetailClientV
|
||||
if (newMode === 'edit' && popupId) {
|
||||
router.push(`${popupDetailConfig.basePath}/${popupId}?mode=edit`);
|
||||
} else if (newMode === 'view' && popupId) {
|
||||
router.push(`${popupDetailConfig.basePath}/${popupId}`);
|
||||
router.push(`${popupDetailConfig.basePath}/${popupId}?mode=view`);
|
||||
}
|
||||
},
|
||||
[router, popupId]
|
||||
@@ -120,7 +120,7 @@ export function PopupDetailClientV2({ popupId, initialMode }: PopupDetailClientV
|
||||
const result = await updatePopup(popupId!, popupFormData);
|
||||
if (result.success) {
|
||||
toast.success('팝업이 수정되었습니다.');
|
||||
router.push(`${popupDetailConfig.basePath}/${popupId}`);
|
||||
router.push(`${popupDetailConfig.basePath}/${popupId}?mode=view`);
|
||||
return { success: true };
|
||||
}
|
||||
return { success: false, error: result.error || '팝업 수정에 실패했습니다.' };
|
||||
@@ -158,7 +158,7 @@ export function PopupDetailClientV2({ popupId, initialMode }: PopupDetailClientV
|
||||
router.push(popupDetailConfig.basePath);
|
||||
} else {
|
||||
setMode('view');
|
||||
router.push(`${popupDetailConfig.basePath}/${popupId}`);
|
||||
router.push(`${popupDetailConfig.basePath}/${popupId}?mode=view`);
|
||||
}
|
||||
}, [router, popupId, isNewMode]);
|
||||
|
||||
@@ -175,14 +175,11 @@ export function PopupDetailClientV2({ popupId, initialMode }: PopupDetailClientV
|
||||
: popupData || undefined;
|
||||
|
||||
// 타이틀 동적 설정
|
||||
// IntegratedDetailTemplate: create → "{title} 등록", view → "{title}", edit → "{title} 수정"
|
||||
// view 모드에서 "팝업 상세"로 표시하려면 직접 설정 필요
|
||||
const dynamicConfig = {
|
||||
...popupDetailConfig,
|
||||
title:
|
||||
mode === 'create'
|
||||
? '팝업관리'
|
||||
: mode === 'edit'
|
||||
? popupData?.title || '팝업관리'
|
||||
: popupData?.title || '팝업관리 상세',
|
||||
title: mode === 'view' ? '팝업 상세' : '팝업',
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -36,20 +36,20 @@ export function PopupList({ initialData }: PopupListProps) {
|
||||
// ===== 핸들러 =====
|
||||
const handleRowClick = useCallback(
|
||||
(item: Popup) => {
|
||||
router.push(`/ko/settings/popup-management/${item.id}`);
|
||||
router.push(`/ko/settings/popup-management/${item.id}?mode=view`);
|
||||
},
|
||||
[router]
|
||||
);
|
||||
|
||||
const handleEdit = useCallback(
|
||||
(id: string) => {
|
||||
router.push(`/ko/settings/popup-management/${id}/edit`);
|
||||
router.push(`/ko/settings/popup-management/${id}?mode=edit`);
|
||||
},
|
||||
[router]
|
||||
);
|
||||
|
||||
const handleCreate = useCallback(() => {
|
||||
router.push('/ko/settings/popup-management/new');
|
||||
router.push('/ko/settings/popup-management?mode=new');
|
||||
}, [router]);
|
||||
|
||||
// ===== UniversalListPage Config =====
|
||||
|
||||
Reference in New Issue
Block a user