Compare commits

..

10 Commits

Author SHA1 Message Date
fcf8c805f6 Merge pull request '260708_01_ENH: 전체 차트에 차트 최소 표기 값 3.99로 지정' (#4) from develop into master
Reviewed-on: #4
2026-07-08 11:01:25 +09:00
ea5d1744a7 260708_01_ENH: 전체 차트에 차트 최소 표기 값 3.99로 지정 2026-07-08 10:58:12 +09:00
7fe713e299 Merge pull request 'develop' (#3) from develop into master
Reviewed-on: #3
2026-07-01 14:21:49 +09:00
5502415825 260701_02_ENH: 사이트 접근 허용 IP추가 2026-07-01 14:17:23 +09:00
85f2b99345 260701_01_ENH: 사이트 접근 시 허용 IP만 접근하도록 수정 2026-07-01 14:15:05 +09:00
32758f32d3 Merge pull request 'develop' (#2) from develop into master
Reviewed-on: #2
2026-06-30 17:09:49 +09:00
632b4d3de4 260618_01_ENH: 사이트 타이틀 변경 2026-06-18 18:18:16 +09:00
e55ba7ac01 260617_01_ENH: Comment Table의 현재 높이를 최소 높이로 지정 최대 높이는 쓰여지는 글에 따라 유동적으로 증가하도록 수정 2026-06-17 10:40:01 +09:00
5e53663b24 260609_01_ENH: 메인 페이지 안내문 /기준으로 앞뒤 띄어쓰기 1개씩 추가 및 안내문 1줄 추가
Comment 테이블에서 plan26 제거 및 label 수정, 테이블 width 조정, 안내문 추가
전체 현황 외 차트 테이블의 차트 시작 위치 수정
2026-06-09 16:48:19 +09:00
24d917ac7b 260528_01_ENH: 28일 수정 사항 적용 2026-05-28 17:30:43 +09:00
24 changed files with 545 additions and 284 deletions

View File

@@ -3,3 +3,4 @@ NEXT_PUBLIC_API_BASE=https://test-kfpa-dash.kric.com/api
ENV=prod ENV=prod
API_BACK_SERVER=http://127.0.0.1:6103/api/v1 API_BACK_SERVER=http://127.0.0.1:6103/api/v1
IP_WHITELIST=127.0.0.1,::1,211.37.10.198,211.254.145.130,1.235.195.3

View File

@@ -3,3 +3,4 @@ NEXT_PUBLIC_API_BASE=http://localhost:6102/api
ENV=local ENV=local
API_BACK_SERVER=http://localhost:6103/api/v1 API_BACK_SERVER=http://localhost:6103/api/v1
IP_WHITELIST=127.0.0.1,::1

View File

@@ -3,3 +3,4 @@ NEXT_PUBLIC_API_BASE=https://kfpa-dash.kric.com/api
ENV=prod ENV=prod
API_BACK_SERVER=http://127.0.0.1:6103/api/v1 API_BACK_SERVER=http://127.0.0.1:6103/api/v1
IP_WHITELIST=127.0.0.1,::1,211.37.10.198,211.254.145.130,1.235.195.3

View File

@@ -14,6 +14,7 @@ const BridgePlatformPage = () => {
selectedDiv={selectedDiv} selectedDiv={selectedDiv}
viewSubTitle={false} viewSubTitle={false}
sectionTitleSuffix={COMMENT_TABLE_TITLE} sectionTitleSuffix={COMMENT_TABLE_TITLE}
widthClassName="w-[1200px]"
/>; />;
}; };

View File

@@ -7,7 +7,7 @@ import CustomerSatisfactionDetail from "@/components/kfpa/CustomerSatisfactionDe
const ConsultingPage = () => { const ConsultingPage = () => {
const { selectedDiv } = useLayoutFilter(); const { selectedDiv } = useLayoutFilter();
return selectedDiv === "-1" ? <CustomerSatisfactionTotal /> : <CustomerSatisfactionDetail selectedDiv={selectedDiv} />; return selectedDiv === "-1" ? <CustomerSatisfactionTotal /> : <CustomerSatisfactionDetail selectedDiv={selectedDiv} widthClassName="w-[1200px]"/>;
}; };
export default ConsultingPage; export default ConsultingPage;

View File

@@ -7,7 +7,7 @@ import CustomerSatisfactionDetail from "@/components/kfpa/CustomerSatisfactionDe
const FireInvestigationPage = () => { const FireInvestigationPage = () => {
const { selectedDiv } = useLayoutFilter(); const { selectedDiv } = useLayoutFilter();
return selectedDiv === "-1" ? <CustomerSatisfactionTotal /> : <CustomerSatisfactionDetail selectedDiv={selectedDiv} />; return selectedDiv === "-1" ? <CustomerSatisfactionTotal /> : <CustomerSatisfactionDetail selectedDiv={selectedDiv} widthClassName="w-[1200px]"/>;
}; };
export default FireInvestigationPage; export default FireInvestigationPage;

View File

@@ -7,7 +7,7 @@ import CustomerSatisfactionDetail from "@/components/kfpa/CustomerSatisfactionDe
const InsuranceOperationsPage = () => { const InsuranceOperationsPage = () => {
const { selectedDiv } = useLayoutFilter(); const { selectedDiv } = useLayoutFilter();
return selectedDiv === "-1" ? <CustomerSatisfactionTotal /> : <CustomerSatisfactionDetail selectedDiv={selectedDiv} />; return selectedDiv === "-1" ? <CustomerSatisfactionTotal /> : <CustomerSatisfactionDetail selectedDiv={selectedDiv} widthClassName="w-[1200px]"/>;
}; };
export default InsuranceOperationsPage; export default InsuranceOperationsPage;

View File

@@ -7,7 +7,12 @@ import CustomerSatisfactionDetail from "@/components/kfpa/CustomerSatisfactionDe
const SafetyInspectionPage = () => { const SafetyInspectionPage = () => {
const { selectedDiv } = useLayoutFilter(); const { selectedDiv } = useLayoutFilter();
return selectedDiv === "-1" ? <CustomerSatisfactionTotal /> : <CustomerSatisfactionDetail selectedDiv={selectedDiv} />; return selectedDiv === "-1"
? <CustomerSatisfactionTotal />
: <CustomerSatisfactionDetail
selectedDiv={selectedDiv}
//widthClassName="w-[1553px]"
/>;
}; };
export default SafetyInspectionPage; export default SafetyInspectionPage;

View File

@@ -14,6 +14,7 @@ const UcisPage = () => {
selectedDiv={selectedDiv} selectedDiv={selectedDiv}
viewSubTitle={false} viewSubTitle={false}
sectionTitleSuffix={COMMENT_TABLE_TITLE} sectionTitleSuffix={COMMENT_TABLE_TITLE}
widthClassName="w-[1200px]"
/>; />;
}; };

21
src/app/403/page.tsx Normal file
View File

@@ -0,0 +1,21 @@
import type { Metadata } from "next";
export const metadata: Metadata = {
title: "403 Forbidden",
};
const ForbiddenPage = () => {
return (
<main className="flex min-h-dvh items-center justify-center bg-background px-6">
<section className="w-full max-w-md border border-border bg-card p-8 text-center shadow-sm">
<p className="text-sm font-semibold text-primary">403</p>
<h1 className="mt-3 text-2xl font-bold text-foreground">외부에서 접속할 수 없습니다.</h1>
<p className="mt-4 text-sm leading-6 text-muted-foreground">
해당 사이트는 외부의 접근을 허용하지 않습니다.
</p>
</section>
</main>
);
};
export default ForbiddenPage;

View File

@@ -122,6 +122,8 @@
--kfpa-red-100: #f2a8b5; --kfpa-red-100: #f2a8b5;
--kfpa-red-50: #fae6ea; --kfpa-red-50: #fae6ea;
--kfpa-null: #9a9a9a;
/* ============================= /* =============================
Surface Surface
============================= */ ============================= */
@@ -357,6 +359,7 @@
.border-border { border-color: var(--border); } .border-border { border-color: var(--border); }
.text-zero { color: var(--kfpa-black-150) !important; } .text-zero { color: var(--kfpa-black-150) !important; }
.text-null { color: var(--kfpa-null) !important; }
/* KFPA neutral scale */ /* KFPA neutral scale */
.bg-black-600 { background-color: var(--kfpa-black-600) !important; } .bg-black-600 { background-color: var(--kfpa-black-600) !important; }
@@ -410,6 +413,7 @@
.bg-csi { background-color: var(--kfpa-csi) !important; } .bg-csi { background-color: var(--kfpa-csi) !important; }
.bg-direct { background-color: var(--kfpa-direct) !important; } .bg-direct { background-color: var(--kfpa-direct) !important; }
.bg-indirect { background-color: var(--kfpa-indirect) !important; } .bg-indirect { background-color: var(--kfpa-indirect) !important; }
.bg-null { background-color: var(--kfpa-null) !important; }
/* ============================= /* =============================
Content Text Size Utilities Content Text Size Utilities
@@ -599,10 +603,11 @@
.kfpa-detail-table { .kfpa-detail-table {
--kfpa-detail-table-head-height: 56px; --kfpa-detail-table-head-height: 56px;
--kfpa-detail-table-row-height: 56px;
--kfpa-detail-comment-table-row-height: 112px;
} }
.kfpa-detail-rank-table { .kfpa-detail-rank-table {
--kfpa-detail-table-row-height: 56px;
min-width: 285px !important; min-width: 285px !important;
} }
@@ -618,6 +623,7 @@
} }
.kfpa-detail-comment-table tbody td { .kfpa-detail-comment-table tbody td {
min-height: var(--kfpa-detail-comment-table-row-height);
vertical-align: top; vertical-align: top;
} }

View File

@@ -15,8 +15,8 @@ const geistMono = Geist_Mono({
}); });
export const metadata: Metadata = { export const metadata: Metadata = {
title: "화재보험협회 대시보드", title: "고객 관점 성과관리 대시보드",
description: "화재보험협회 CX 대시보드", description: "고객 관점 성과관리 대시보드",
}; };
export default function RootLayout({ export default function RootLayout({

View File

@@ -35,9 +35,52 @@ type Props = {
position?: "top" | "insideTop" | "right" | "insideRight"; position?: "top" | "insideTop" | "right" | "insideRight";
color?: string; color?: string;
distance?: number; distance?: number;
minPositionValue?: number;
}; };
}; };
type ChartCallbackParam = {
data?: unknown;
value?: unknown;
axisValueLabel?: string;
name?: string;
marker?: string;
seriesName?: string;
};
const isRecord = (value: unknown): value is Record<string, unknown> =>
typeof value === "object" && value !== null && !Array.isArray(value);
const toChartCallbackParam = (value: unknown): ChartCallbackParam =>
isRecord(value) ? value : {};
const getActualValue = (param: unknown) => {
const data = toChartCallbackParam(param).data;
if (isRecord(data) && "actualValue" in data) {
return data.actualValue;
}
return toChartCallbackParam(param).value;
};
const createLabelPositionTooltip = (fmt: ValueFormatter): EChartsOption["tooltip"] => ({
trigger: "axis",
axisPointer: { type: "shadow" },
formatter: (params: unknown) => {
const items = (Array.isArray(params) ? params : [params]).map(toChartCallbackParam);
const title = items[0]?.axisValueLabel ?? items[0]?.name ?? "";
const lines = items.map((item) => {
const value = getActualValue(item);
const text = typeof value === "number" ? fmt(value) : value == null ? "-" : String(value);
return `${item.marker ?? ""}${item.seriesName} ${text}`;
});
return [title, ...lines].join("<br/>");
},
});
const VerticalBar = ({ const VerticalBar = ({
data, data,
height, height,
@@ -58,21 +101,31 @@ const VerticalBar = ({
const option: EChartsOption = useMemo(() => { const option: EChartsOption = useMemo(() => {
const fmt = valueFormatter ?? ((v: number) => String(v)); const fmt = valueFormatter ?? ((v: number) => String(v));
const minPositionValue = labelOptions?.minPositionValue;
return { return {
color: palette, color: palette,
tooltip: tooltip ?? createDefaultTooltip(fmt), tooltip: tooltip ?? (typeof minPositionValue === "number" ? createLabelPositionTooltip(fmt) : createDefaultTooltip(fmt)),
legend: legend ?? createDefaultLegend(), legend: legend ?? createDefaultLegend(),
grid: grid ?? createDefaultGrid(), grid: grid ?? createDefaultGrid(),
xAxis: xAxis ?? createCategoryAxis(data.categories, false, { axisTick: { alignWithLabel: true } }), xAxis: xAxis ?? createCategoryAxis(data.categories, false, { axisTick: { alignWithLabel: true } }),
yAxis: yAxis ?? createValueAxis(), yAxis: yAxis ?? createValueAxis(),
series: data.series.map((s, index) => { series: data.series.map((s, index) => {
const showLabel = getIsShowLabel(showFocusLabel, index, data.series.length); const showLabel = getIsShowLabel(showFocusLabel, index, data.series.length);
const seriesData = s.data.map((value) =>
typeof minPositionValue === "number" &&
typeof value === "number" &&
Number.isFinite(value) &&
value > 0.00 &&
value < minPositionValue
? { value: minPositionValue, actualValue: value }
: value
);
return { return {
name: s.name, name: s.name,
type: "bar", type: "bar",
data: s.data, data: seriesData,
emphasis: { disabled: true }, emphasis: { disabled: true },
barMaxWidth: barMaxWidth ?? BAR_WIDTHS.DEFAULT, barMaxWidth: barMaxWidth ?? BAR_WIDTHS.DEFAULT,
label: showLabel label: showLabel
@@ -81,7 +134,10 @@ const VerticalBar = ({
position: labelOptions?.position ?? "right", position: labelOptions?.position ?? "right",
color: labelOptions?.color, color: labelOptions?.color,
distance: labelOptions?.distance, distance: labelOptions?.distance,
formatter: (p: any) => (typeof p?.value === "number" ? fmt(p.value) : (p?.value ?? "")) as any, formatter: (p: unknown) => {
const value = getActualValue(p);
return typeof value === "number" ? fmt(value) : value == null ? "" : String(value);
},
} }
: undefined, : undefined,
} }

View File

@@ -169,10 +169,14 @@ return (
<BaseTableHeader title={title}/> <BaseTableHeader title={title}/>
<div className="overflow-x-auto"> <div className="overflow-x-auto">
<table className={cn("kfpa-table kfpa-table", tableClassName)} style={{ minWidth: `${minWidth ?? minWidthPx}px` , maxWidth: maxWidth ? `${maxWidth}px` : undefined}}> <table className={cn("kfpa-table kfpa-table", tableClassName)} style={{
minWidth: `${minWidth ?? minWidthPx}px`,
maxWidth: maxWidth ? `${maxWidth}px` : undefined
}}>
<colgroup> <colgroup>
{leadingColumnWidths.map((width, index) => ( {leadingColumnWidths.map((width, index) => (
<col key={`leading-col-${index}`} style={width ? { width, minWidth: width } : undefined} /> <col key={`leading-col-${index}`}
style={width ? {width, minWidth: width} : undefined}/>
))} ))}
{columns.map((column, index) => { {columns.map((column, index) => {
const width = toCssSize(categoryColumnWidths?.[index] ?? column.width ?? categoryColumnWidth); const width = toCssSize(categoryColumnWidths?.[index] ?? column.width ?? categoryColumnWidth);
@@ -191,7 +195,8 @@ return (
className={cn(rowHeaderWidth ? undefined : "w-44", "border-none")} className={cn(rowHeaderWidth ? undefined : "w-44", "border-none")}
style={{whiteSpace: "nowrap", ...rowHeaderStyle}} style={{whiteSpace: "nowrap", ...rowHeaderStyle}}
/> />
<td colSpan={columns.length} style={{ padding: 0, height: chartNode ? chartHeight : 0 }}> <td colSpan={columns.length}
style={{padding: 0, height: chartNode ? chartHeight : 0}}>
{chartNode ? <div style={{width: "100%", height: "100%"}}>{chartNode}</div> : null} {chartNode ? <div style={{width: "100%", height: "100%"}}>{chartNode}</div> : null}
</td> </td>
</tr> </tr>
@@ -252,12 +257,16 @@ return (
const roundedValue = toRoundedNumber(rawValue, decimalPlaces); const roundedValue = toRoundedNumber(rawValue, decimalPlaces);
if (roundedValue === null) { if (roundedValue === null) {
return <td key={getColumnKey(column)} className={cn(column.cellClassName, row.cellClassName)} style={{ textAlign: column.align }}>-</td>; return <td key={getColumnKey(column)}
className={cn(column.cellClassName, row.cellClassName, column.nullCellClassName)}
style={{textAlign: column.align}}>-</td>;
} }
if (!signRow) { if (!signRow) {
return ( return (
<td key={getColumnKey(column)} className={cn(column.cellClassName, row.cellClassName)} style={{ textAlign: column.align }}> <td key={getColumnKey(column)}
className={cn(column.cellClassName, row.cellClassName)}
style={{textAlign: column.align}}>
{roundedValue.toFixed(decimalPlaces)} {roundedValue.toFixed(decimalPlaces)}
</td> </td>
); );

View File

@@ -0,0 +1,9 @@
const CommentNote = () => {
return (
<p className="mt-3 content-text-base">
▶ : 완료&nbsp;&nbsp;/&nbsp;&nbsp;▷ : 진행 중
</p>
);
};
export default CommentNote;

View File

@@ -1,9 +1,24 @@
const CsiFormulaNote = () => { const CsiFormulaNote = () => {
return ( return (
<>
<p className="mt-3 content-text-base"> <p className="mt-3 content-text-base">
※ 고객만족지수(CSI, Customer Satisfaction Index) = 고객 만족도조사 직접요소 항목 점수 X 가중치 + 고객 ※ 고객만족지수(CSI, Customer Satisfaction Index) = 고객 만족도조사 직접요소 항목 점수 X 가중치 + 고객
만족도조사 간접요소 항목 점수 X 가중치 만족도조사 간접요소 항목 점수 X 가중치
</p> </p>
<p className="mt-3 content-text-base">
※ 주요 고객 대상 : 안전점검(특수건물 관계자)
&nbsp;/&nbsp;&nbsp;UCIS(사원사 등)
&nbsp;/&nbsp;&nbsp;Bridge 플랫폼(사원사, 일반회원 등)
&nbsp;/&nbsp;&nbsp;방재컨설팅(발주처 관계자 약 20명)
&nbsp;/&nbsp;&nbsp;보험업무(보험 계약 담당자 약 300명)
&nbsp;/&nbsp;&nbsp;화재조사(사원사 손해사정부서 총 11명)
</p>
<p className="mt-3 content-text-base">
※ 응답 데이터 업데이트 주기 : 안전점검(매일 실시간)
&nbsp;/&nbsp;&nbsp;UCIS, Bridge플랫폼, 보험업무, 화재조사(매월 말)
&nbsp;/&nbsp;&nbsp;방재컨설팅(각 용역이 완료되는 하반기에 진행 예정)
</p>
</>
); );
}; };

View File

@@ -2,7 +2,9 @@
import DataTable from "@/components/table/DataTable"; import DataTable from "@/components/table/DataTable";
import type { DataColumn } from "@/components/table/types"; import type { DataColumn } from "@/components/table/types";
import { cn } from "@/lib/utils";
import type { CommentColumn, CommentField, CommentValue, DashboardCommentRowConfig } from "@/types/kfpa"; import type { CommentColumn, CommentField, CommentValue, DashboardCommentRowConfig } from "@/types/kfpa";
import CommentNote from "@/components/kfpa/CommentNote";
type CommentTableRow = DashboardCommentRowConfig & Record<string, unknown>; type CommentTableRow = DashboardCommentRowConfig & Record<string, unknown>;
@@ -63,12 +65,22 @@ const CustomerSatisfactionCommentTable = ({
const value = String(draft[column.key]?.[row.field] ?? ""); const value = String(draft[column.key]?.[row.field] ?? "");
if (!isEditing) { if (!isEditing) {
return <div className="min-h-24 whitespace-pre-wrap text-left">{value || "-"}</div>; return (
<div className={cn(
"min-h-24 whitespace-pre-wrap text-left",
"leading-[1.5] content-text-lg"
)}>
{value || "-"}
</div>
);
} }
return ( return (
<textarea <textarea
className="min-h-28 w-full resize-y border border-gray-300 bg-background p-2 text-sm outline-none focus:border-primary" className={cn(
"h-24 w-full resize-y border border-gray-300 bg-background p-2",
"leading-[1.5] content-text-lg outline-none focus:border-primary"
)}
value={value} value={value}
onChange={(event) => onChange(column.key, row.field, event.target.value)} onChange={(event) => onChange(column.key, row.field, event.target.value)}
/> />
@@ -78,6 +90,7 @@ const CustomerSatisfactionCommentTable = ({
]; ];
return ( return (
<>
<DataTable <DataTable
columns={tableColumns} columns={tableColumns}
rows={tableRows} rows={tableRows}
@@ -85,6 +98,8 @@ const CustomerSatisfactionCommentTable = ({
subheadRowClassName="bg-red-50" subheadRowClassName="bg-red-50"
wrapperClassName="w-full" wrapperClassName="w-full"
/> />
<CommentNote/>
</>
); );
}; };

View File

@@ -36,12 +36,14 @@ export type CustomerSatisfactionDetailProps = {
selectedDiv: string; selectedDiv: string;
sectionTitleSuffix?: string; sectionTitleSuffix?: string;
viewSubTitle?: boolean; viewSubTitle?: boolean;
widthClassName?: string;
}; };
const CustomerSatisfactionDetail = ({ const CustomerSatisfactionDetail = ({
selectedDiv, selectedDiv,
sectionTitleSuffix, sectionTitleSuffix,
viewSubTitle = true, viewSubTitle = true,
widthClassName = "w-full",
}: CustomerSatisfactionDetailProps) => { }: CustomerSatisfactionDetailProps) => {
const searchParams = useSearchParams(); const searchParams = useSearchParams();
const queryClient = useQueryClient(); const queryClient = useQueryClient();
@@ -122,7 +124,7 @@ const CustomerSatisfactionDetail = ({
} }
return ( return (
<div className="w-full"> <div className={widthClassName}>
<SectionTitle title={`${getSideMenuLabel(categoryKey, selectedDiv)} ${sectionTitleSuffix ?? '상세 내역'}`} /> <SectionTitle title={`${getSideMenuLabel(categoryKey, selectedDiv)} ${sectionTitleSuffix ?? '상세 내역'}`} />
<div className="mt-4 flex w-full items-start gap-16 overflow-x-auto pb-2"> <div className="mt-4 flex w-full items-start gap-16 overflow-x-auto pb-2">

View File

@@ -55,6 +55,13 @@ const CustomerSatisfactionSummary = () => {
: undefined, : undefined,
align: "center", align: "center",
})); }));
columns
.filter((column) => SUMMARY_CATEGORY_KEYS.includes(column.key ?? ""))
.forEach((column) => {
column.nullCellClassName = "bg-null text-null"
})
const categories = summaryColumns.map(getSummaryColumnLabel); const categories = summaryColumns.map(getSummaryColumnLabel);
const rows: TopChartTableRow[] = const rows: TopChartTableRow[] =
@@ -146,7 +153,7 @@ const CustomerSatisfactionSummary = () => {
signStyle={KFPA_GAP_SIGN_STYLE} signStyle={KFPA_GAP_SIGN_STYLE}
minWidth={tableLayout.tableWidth} minWidth={tableLayout.tableWidth}
maxWidth={tableLayout.tableWidth} maxWidth={tableLayout.tableWidth}
chartHeight={180} chartHeight={280}
chart={ chart={
<VerticalBar <VerticalBar
data={chartData} data={chartData}
@@ -155,8 +162,9 @@ const CustomerSatisfactionSummary = () => {
valueFormatter={(value) => value.toFixed(KFPA_DECIMAL_POINT)} valueFormatter={(value) => value.toFixed(KFPA_DECIMAL_POINT)}
barMaxWidth={30} barMaxWidth={30}
showFocusLabel="all" showFocusLabel="all"
labelOptions={{ position: "top", distance: 4 }} labelOptions={{ position: "top", distance: 4, minPositionValue: 3.99 }}
grid={{ left: 0, right: 0, top: 20, bottom: 5 }} legend={{top:50}}
grid={{ left: 0, right: 0, top: 120, bottom: 5 }}
xAxis={{ xAxis={{
type: "category", type: "category",
data: categories, data: categories,
@@ -166,7 +174,7 @@ const CustomerSatisfactionSummary = () => {
}} }}
yAxis={{ yAxis={{
type: "value", type: "value",
min: 4, min: 3.95,
max: 5, max: 5,
axisLabel: { show: false }, axisLabel: { show: false },
axisTick: { show: false }, axisTick: { show: false },

View File

@@ -225,8 +225,8 @@ const CustomerSatisfactionTotal = () => {
valueFormatter={(value) => value.toFixed(2)} valueFormatter={(value) => value.toFixed(2)}
barMaxWidth={30} barMaxWidth={30}
showFocusLabel="all" showFocusLabel="all"
labelOptions={{ position: "top", distance: 4 }} labelOptions={{ position: "top", distance: 4 , minPositionValue: 3.99}}
grid={{ left: 0, right: 0, top: 20, bottom: 5 }} grid={{ left: 0, right: 0, top: 30, bottom: 5 }}
xAxis={{ xAxis={{
type: "category", type: "category",
data: categories, data: categories,
@@ -236,7 +236,7 @@ const CustomerSatisfactionTotal = () => {
}} }}
yAxis={{ yAxis={{
type: "value", type: "value",
min: 4, min: 3.95,
max: 5, max: 5,
axisLabel: { show: false }, axisLabel: { show: false },
axisTick: { show: false }, axisTick: { show: false },

View File

@@ -9,6 +9,7 @@ type TableColumnShared<T> = {
align?: TableColumnAlign; align?: TableColumnAlign;
headerClassName?: string; headerClassName?: string;
cellClassName?: string; cellClassName?: string;
nullCellClassName?: string;
render?: (row: T) => React.ReactNode; render?: (row: T) => React.ReactNode;
}; };

View File

@@ -258,9 +258,9 @@ export const DASHBOARD_METRICS_BY_CATEGORY = {
} as const; } as const;
export const DASHBOARD_COMMENT_COLUMNS = [ export const DASHBOARD_COMMENT_COLUMNS = [
{ key: "performance25", label: "25년 성과" }, { key: "performance25", label: "25년 고객 관점 주요 성과" },
{ key: "plan26", label: "26년 업무계획" }, //{ key: "plan26", label: "26년 업무계획" },
{ key: "performance26", label: "26년 업무계획 진행률 및 성과" }, { key: "performance26", label: "26년 고객 관점 주요 성과" },
] as const; ] as const;
const DEFAULT_DASHBOARD_COMMENT_ROWS = [ const DEFAULT_DASHBOARD_COMMENT_ROWS = [

View File

@@ -79,7 +79,6 @@ export const getAverageGapValue = (
key: string, key: string,
wave: number, wave: number,
) => { ) => {
console.log(averageKey, key)
if(averageKey === key) return null; if(averageKey === key) return null;
const averageValue = roundNumber(getSummaryCsiValue(dataMap, averageKey, wave), KFPA_DECIMAL_POINT); const averageValue = roundNumber(getSummaryCsiValue(dataMap, averageKey, wave), KFPA_DECIMAL_POINT);
@@ -95,8 +94,7 @@ export const getSelectedDetail = (data: Record<string, DivDetailData> | undefine
}; };
export const getCommentColumns = (commentValues?: Record<string, CommentValue>): CommentColumn[] => { export const getCommentColumns = (commentValues?: Record<string, CommentValue>): CommentColumn[] => {
const keys = Object.keys(commentValues ?? {}); const selectedKeys = DASHBOARD_COMMENT_COLUMNS.map((column) => column.key);
const selectedKeys = keys.length > 0 ? keys : DASHBOARD_COMMENT_COLUMNS.map((column) => column.key);
return selectedKeys.map((key, index) => ({ return selectedKeys.map((key, index) => ({
key, key,

111
src/proxy.ts Normal file
View File

@@ -0,0 +1,111 @@
import { NextRequest, NextResponse } from "next/server";
const IP_WHITELIST_ENV = "IP_WHITELIST";
const LOCAL_IPS = new Set(["127.0.0.1", "::1"]);
const normalizeIp = (ip: string) => {
const trimmed = ip.trim();
if (!trimmed) return "";
if (trimmed.startsWith("::ffff:")) return trimmed.slice("::ffff:".length);
const withoutBrackets = trimmed.replace(/^\[|\]$/g, "");
const portSeparatorIndex = withoutBrackets.lastIndexOf(":");
if (
portSeparatorIndex > -1 &&
withoutBrackets.indexOf(":") === portSeparatorIndex &&
/^\d+$/.test(withoutBrackets.slice(portSeparatorIndex + 1))
) {
return withoutBrackets.slice(0, portSeparatorIndex);
}
return withoutBrackets;
};
const getClientIp = (request: NextRequest) => {
const forwardedFor = request.headers.get("x-forwarded-for");
if (forwardedFor) {
return normalizeIp(forwardedFor.split(",")[0]);
}
return normalizeIp(
request.headers.get("x-real-ip") ??
request.headers.get("cf-connecting-ip") ??
request.headers.get("true-client-ip") ??
""
);
};
const ipv4ToNumber = (ip: string) => {
const parts = ip.split(".");
if (parts.length !== 4) return null;
return parts.reduce<number | null>((acc, part) => {
if (acc === null || !/^\d+$/.test(part)) return null;
const value = Number(part);
if (value < 0 || value > 255) return null;
return ((acc << 8) + value) >>> 0;
}, 0);
};
const isIpv4InCidr = (ip: string, cidr: string) => {
const [rangeIp, prefixRaw] = cidr.split("/");
const prefix = Number(prefixRaw);
const target = ipv4ToNumber(ip);
const range = ipv4ToNumber(rangeIp);
if (target === null || range === null || !Number.isInteger(prefix) || prefix < 0 || prefix > 32) {
return false;
}
const mask = prefix === 0 ? 0 : (0xffffffff << (32 - prefix)) >>> 0;
return (target & mask) === (range & mask);
};
const parseWhitelist = () =>
(process.env[IP_WHITELIST_ENV] ?? "")
.split(",")
.map((ip) => normalizeIp(ip))
.filter(Boolean);
const isAllowedIp = (clientIp: string) => {
const whitelist = parseWhitelist();
if (whitelist.length === 0) {
return process.env.ENV === "local" && LOCAL_IPS.has(clientIp);
}
return whitelist.some((allowedIp) => {
if (allowedIp.includes("/")) {
return isIpv4InCidr(clientIp, allowedIp);
}
return clientIp === allowedIp;
});
};
export function proxy(request: NextRequest) {
const pathname = request.nextUrl.pathname;
if (pathname === "/403") {
return NextResponse.next();
}
const clientIp = getClientIp(request);
if (clientIp && isAllowedIp(clientIp)) {
return NextResponse.next();
}
const url = request.nextUrl.clone();
url.pathname = "/403";
url.search = "";
return NextResponse.redirect(url);
}
export const config = {
matcher: ["/((?!api|_next/static|_next/image|favicon.ico|.*\\..*).*)"],
};