Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,18 @@
"@tanstack/react-table": "^8.21.3",
"axios": "^1.12.1",
"dayjs": "^1.11.18",
"lodash": "^4.17.21",
"react": "^18.3.1",
"react-big-calendar": "^1.19.4",
"react-dom": "^18.3.1",
"react-error-boundary": "^6.0.0",
"react-router-dom": "^7.8.2",
"sockjs-client": "^1.6.1",
"recharts": "^3.2.0",
"sockjs-client": "^1.6.1",
"tailwindcss": "^4.1.12",
"wx-gantt-data-provider": "^2.2.1",
"wx-react-gantt": "^1.3.1",
"zustand": "^5.0.8",
"lodash": "^4.17.21"
"zustand": "^5.0.8"
},
"devDependencies": {
"@eslint/js": "^9.33.0",
Expand Down
72 changes: 72 additions & 0 deletions src/components/common/ErrorBoundary.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import React from 'react';
import { AlertTriangle, RefreshCw } from '@mui/icons-material';

class ErrorBoundary extends React.Component {
constructor(props) {
super(props);
this.state = { hasError: false, error: null, errorInfo: null };
}

static getDerivedStateFromError() {
// 다음 렌더링에서 폴백 UI가 보이도록 상태를 업데이트 합니다.
return { hasError: true };
}

componentDidCatch(error, errorInfo) {
// 에러 리포팅 서비스에 에러를 기록할 수도 있습니다
console.error('ErrorBoundary caught an error:', error, errorInfo);
this.setState({
error: error,
errorInfo: errorInfo
});
}

handleRetry = () => {
this.setState({ hasError: false, error: null, errorInfo: null });
};

render() {
if (this.state.hasError) {
// 커스텀 에러 UI를 렌더링할 수 있습니다
return (
<div className="flex flex-col items-center justify-center p-8 bg-red-50 border border-red-200 rounded-lg">
<AlertTriangle className="w-12 h-12 text-red-500 mb-4" />
<h2 className="text-xl font-semibold text-red-800 mb-2">
{this.props.title || '오류가 발생했습니다'}
</h2>
<p className="text-red-600 text-center mb-4">
{this.props.message || '컴포넌트를 로드하는 중 문제가 발생했습니다.'}
</p>

{import.meta.env.DEV && this.state.error && (
<details className="w-full mb-4">
<summary className="cursor-pointer text-sm text-red-500 hover:text-red-700">
상세 오류 정보 (개발 모드)
</summary>
<div className="mt-2 p-3 bg-red-100 rounded text-sm text-red-800 overflow-auto max-h-32">
<div className="font-semibold">Error:</div>
<div className="mb-2">{this.state.error.toString()}</div>
<div className="font-semibold">Stack Trace:</div>
<pre className="whitespace-pre-wrap text-xs">
{this.state.errorInfo.componentStack}
</pre>
</div>
</details>
)}

<button
onClick={this.handleRetry}
className="flex items-center gap-2 px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors"
>
<RefreshCw className="w-4 h-4" />
다시 시도
</button>
</div>
);
}

return this.props.children;
}
}

export default ErrorBoundary;
94 changes: 94 additions & 0 deletions src/components/common/loading/LoadingComponents.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,100 @@
import { Replay, Warning} from "@mui/icons-material";
import { Skeleton } from "@mui/material";

// 대시보드 KPI 카드용 스켈레톤
export function KPICardSkeleton({ count = 2 }) {
return (
<div className="grid grid-cols-2 gap-6">
{Array.from({ length: count }).map((_, index) => (
<div key={index} className="bg-white p-6 rounded-lg border border-gray-200">
<div className="flex items-center justify-between">
<div className="flex-1">
<Skeleton variant="text" width="70%" height={20} className="mb-2" />
<Skeleton variant="text" width="40%" height={32} />
</div>
<Skeleton variant="circular" width={40} height={40} />
</div>
<div className="flex items-center gap-2 mt-4">
<Skeleton variant="text" width={30} height={16} />
<Skeleton variant="text" width={40} height={16} />
</div>
</div>
))}
</div>
);
}

// 차트용 스켈레톤
export function ChartSkeleton({ height = "h-64", title }) {
return (
<div className="bg-white p-6 rounded-lg border border-gray-200">
{title && (
<div className="mb-4">
<Skeleton variant="text" width="40%" height={24} />
</div>
)}
<div className={`${height} flex items-center justify-center`}>
<div className="w-full space-y-3">
<Skeleton variant="rounded" width="100%" height={40} />
<Skeleton variant="rounded" width="80%" height={40} />
<Skeleton variant="rounded" width="60%" height={40} />
<Skeleton variant="rounded" width="90%" height={40} />
</div>
</div>
</div>
);
}

// 테이블/리스트용 스켈레톤
export function TableSkeleton({ rows = 5, title }) {
return (
<div className="bg-white p-6 rounded-lg border border-gray-200">
{title && (
<div className="mb-4">
<Skeleton variant="text" width="40%" height={24} />
</div>
)}
<div className="space-y-3">
{Array.from({ length: rows }).map((_, index) => (
<div key={index} className="flex items-center space-x-4">
<Skeleton variant="circular" width={32} height={32} />
<div className="flex-1 space-y-2">
<Skeleton variant="text" width="60%" height={16} />
<Skeleton variant="text" width="40%" height={14} />
</div>
<Skeleton variant="text" width="20%" height={16} />
</div>
))}
</div>
</div>
);
}

// 위클리 스케줄용 스켈레톤
export function WeeklyScheduleSkeleton() {
return (
<div className="bg-white p-6 rounded-lg border border-gray-200">
<div className="mb-4">
<Skeleton variant="text" width="40%" height={24} />
</div>
<div className="space-y-4">
{Array.from({ length: 7 }).map((_, index) => (
<div key={index} className="flex items-center space-x-4">
<Skeleton variant="text" width={40} height={16} />
<div className="flex-1">
<div className="flex space-x-2">
<Skeleton variant="rounded" width={80} height={24} />
<Skeleton variant="rounded" width={100} height={24} />
<Skeleton variant="rounded" width={60} height={24} />
</div>
</div>
</div>
))}
</div>
</div>
);
}

// ProjectList용 Skeleton UI
export function ProjectListSkeleton({ count = 4 }) {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboard/TeamProductivityTrend.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function TeamProductivityTrend({ selectedProjectId, title = "인원별 이슈
<ResponsiveContainer width="100%" height="100%">
<BarChart
data={barData}
margin={{ top: 20, right: 30, left: 20, bottom: 60 }}
margin={{ top: 20, right: 30, left: 20, bottom: 30 }}
>
<CartesianGrid strokeDasharray="3 3" />
<XAxis
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useIssueQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function useProjectIssues(projectId, filters = {}) {
queryKey: ['issues', projectId, filters],
queryFn: () => getProjectIssues(projectId, filters),
staleTime: 0,
cacheTime: 5 * 60 * 1000,
// cacheTime: 5 * 60 * 1000,
refetchOnWindowFocus: false,
select: (response) => {
if (response && response.data && Array.isArray(response.data.issues)) {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useProjectQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export function useProjects(filters = {}) {
}
return { projects: [], total: 0, statusCounts: {}, delayed: 0 };
},
staleTime: 5 * 60 * 1000, // 5분
// staleTime: 5 * 60 * 1000,
});
}

Expand Down
1 change: 0 additions & 1 deletion src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { ToastProvider } from './contexts/ToastContext.jsx'
const queryClient = new QueryClient({
defaultOptions: {
queries: {
// staleTime: 3 * 60 * 1000,
retry: 1,
},
},
Expand Down