기타 수정사항

This commit is contained in:
dohyeons 2025-10-15 10:14:10 +09:00
parent 593983d6ee
commit 14d079b34f
2 changed files with 12 additions and 40 deletions

View File

@ -10,7 +10,7 @@ import { Badge } from "@/components/ui/badge";
import { Alert, AlertDescription } from "@/components/ui/alert";
import { Checkbox } from "@/components/ui/checkbox";
import { Separator } from "@/components/ui/separator";
import { Settings, TrendingUp, AlertCircle } from "lucide-react";
import { TrendingUp, AlertCircle } from "lucide-react";
interface ChartConfigPanelProps {
config?: ChartConfig;
@ -86,25 +86,6 @@ export function ChartConfigPanel({
<div className="mb-2 text-gray-600"> {queryResult.totalRows} :</div>
<pre className="overflow-x-auto text-gray-800">{JSON.stringify(sampleData, null, 2)}</pre>
</div>
{/* 컬럼 타입 정보 */}
{Object.keys(columnTypes).length > 0 && (
<div className="mt-3">
<div className="mb-2 text-xs font-medium text-gray-700"> :</div>
<div className="flex flex-wrap gap-2">
{availableColumns.map((col) => {
const type = columnTypes[col];
const isComplex = type === "object" || type === "array";
return (
<Badge key={col} variant={isComplex ? "destructive" : "secondary"} className="text-xs">
{col}: {type}
{isComplex && " ⚠️"}
</Badge>
);
})}
</div>
</div>
)}
</Card>
)}
@ -159,7 +140,6 @@ export function ChartConfigPanel({
</SelectTrigger>
<SelectContent>
{simpleColumns.map((col) => {
const type = columnTypes[col] || "unknown";
const preview = sampleData[col];
const previewText =
preview !== undefined && preview !== null
@ -170,13 +150,8 @@ export function ChartConfigPanel({
return (
<SelectItem key={col} value={col}>
<span className="flex items-center gap-2">
<span>{col}</span>
<Badge variant="outline" className="text-xs">
{type}
</Badge>
{previewText && <span className="text-xs text-gray-500">(: {previewText})</span>}
</span>
{col}
{previewText && <span className="ml-2 text-xs text-gray-500">(: {previewText})</span>}
</SelectItem>
);
})}
@ -237,9 +212,6 @@ export function ChartConfigPanel({
/>
<Label className="flex-1 cursor-pointer text-sm font-normal">
<span className="font-medium">{col}</span>
<Badge variant="outline" className="ml-2 bg-green-100 text-xs">
number
</Badge>
{sampleData[col] !== undefined && (
<span className="ml-2 text-xs text-gray-600">(: {sampleData[col]})</span>
)}
@ -261,7 +233,6 @@ export function ChartConfigPanel({
const isSelected = Array.isArray(currentConfig.yAxis)
? currentConfig.yAxis.includes(col)
: currentConfig.yAxis === col;
const type = columnTypes[col];
return (
<div key={col} className="flex items-center gap-2 rounded p-2 hover:bg-gray-50">
@ -290,9 +261,6 @@ export function ChartConfigPanel({
/>
<Label className="flex-1 cursor-pointer text-sm font-normal">
{col}
<Badge variant="outline" className="ml-2 text-xs">
{type}
</Badge>
{sampleData[col] !== undefined && (
<span className="ml-2 text-xs text-gray-500">
(: {String(sampleData[col]).substring(0, 30)})
@ -343,13 +311,16 @@ export function ChartConfigPanel({
</SelectContent>
</Select>
<p className="text-xs text-gray-500">
. SQL .
💡 . (: 부서별 , )
</p>
</div>
{/* 그룹핑 필드 (선택사항) */}
<div className="space-y-2">
<Label> ()</Label>
<Label>
()
<span className="ml-2 text-xs text-gray-500">( )</span>
</Label>
<Select
value={currentConfig.groupBy || undefined}
onValueChange={(value) => updateConfig({ groupBy: value })}

View File

@ -7,7 +7,6 @@ import { ChartConfigPanel } from "./ChartConfigPanel";
import { DataSourceSelector } from "./data-sources/DataSourceSelector";
import { DatabaseConfig } from "./data-sources/DatabaseConfig";
import { ApiConfig } from "./data-sources/ApiConfig";
import { validateDataSource } from "./data-sources/dataSourceUtils";
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
import { Progress } from "@/components/ui/progress";
@ -58,6 +57,10 @@ export function ElementConfigModal({ element, isOpen, onClose, onSave }: Element
refreshInterval: 0,
});
}
// 데이터 소스 변경 시 쿼리 결과와 차트 설정 초기화
setQueryResult(null);
setChartConfig({});
}, []);
// 데이터 소스 업데이트
@ -196,8 +199,6 @@ export function ElementConfigModal({ element, isOpen, onClose, onSave }: Element
) : (
<div className="flex h-full items-center justify-center rounded-lg border-2 border-dashed border-gray-300 bg-gray-50 p-8 text-center">
<div>
<div className="mb-2 text-4xl">📊</div>
<div className="text-sm font-medium text-gray-700"> </div>
<div className="mt-1 text-xs text-gray-500"> </div>
</div>
</div>