fix(463 덧 지표면 설정 없는 노선): panelValuesOf · 서명 · [저장] 상단측 차례가 surface_params 없으면 기본값 — 종단도 안 그려지던 흠
- latest 에 surface_params 없음(옛 · 시험 · 막 만든 프로젝트) = 등고선 칸은 패널 값 그대로 · 종단도 기준은 저장 설정대로 - 시험 test_271_profile_settings 에 지표면 설정 없는 노선 한 건 · 346_2 · 442_2 · 저장 시험 통과 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -323,9 +323,9 @@ export async function flushRouteParts(projectId: string): Promise<void> {
|
||||
readRouteLatestCache(projectId) ?? (await fetchLatestRoute(projectId).catch(() => null));
|
||||
const surface = await fetchConfirmedSurface(projectId).catch(() => null);
|
||||
await saveRouteParts(projectId, {
|
||||
filter_key: latest?.surface_params.source_filter,
|
||||
method: latest?.surface_params.method,
|
||||
smooth: latest?.surface_params.smooth,
|
||||
filter_key: latest?.surface_params?.source_filter,
|
||||
method: latest?.surface_params?.method,
|
||||
smooth: latest?.surface_params?.smooth,
|
||||
surface_model_id: surface?.model_id ?? undefined,
|
||||
irregular_stations: [],
|
||||
uphill_overrides: uphillOverridesOf(projectId),
|
||||
|
||||
@@ -40,9 +40,9 @@ export function createLatestSource(projectId: string) {
|
||||
[
|
||||
value.route?.id ?? "",
|
||||
value.route?.surface_model_id ?? "",
|
||||
value.surface_params.source_filter,
|
||||
value.surface_params.method,
|
||||
String(value.surface_params.smooth),
|
||||
value.surface_params?.source_filter,
|
||||
value.surface_params?.method,
|
||||
String(value.surface_params?.smooth),
|
||||
].join("|");
|
||||
|
||||
/**
|
||||
@@ -72,7 +72,7 @@ export function panelValuesOf(next: RouteLatestResponse): Partial<RoutePanelValu
|
||||
const options = next.route_params?.options ?? {};
|
||||
const draft = readPageSettings(next.project_id);
|
||||
return {
|
||||
contourInterval: next.surface_params.contour_interval_m,
|
||||
contourInterval: next.surface_params?.contour_interval_m, // 없음(옛 · 시험 노선) = 패널 값 그대로
|
||||
gradeClass: options.grade_class as RoutePanelValues["gradeClass"] | undefined,
|
||||
stationInterval: next.route_params?.station_interval_m ?? undefined,
|
||||
crossSampleInterval: next.route_params?.cross_sample_interval_m ?? undefined,
|
||||
|
||||
@@ -115,4 +115,9 @@ settings.writePageSettings(P, {
|
||||
station_display: { station: 0, cumulative: 0 },
|
||||
});
|
||||
out.draftOnly = apply(undefined);
|
||||
state.clearState("pagesettings", P);
|
||||
// 463 덧 — surface_params 없는 노선(옛 · 시험 · 막 만든 프로젝트) = 안 죽고 저장 설정대로 · 등고선 칸은 패널 값 그대로
|
||||
const bare = { project_id: P, route_params: { enforce_pipe_clearance: true } };
|
||||
out.noSurface = apply(bare);
|
||||
out.noSurfacePanel = latestApi.panelValuesOf(bare).contourInterval ?? null;
|
||||
console.log(JSON.stringify(out));
|
||||
|
||||
@@ -89,3 +89,15 @@ def test_두_보기가_같은_함수로_얹음():
|
||||
def test_좌측_패널_상한도_같은_기준():
|
||||
part = src("B05_Profile", "B05_Profile_UI_Panel_Settings.ts")
|
||||
assert "return gradeLimitOf(currentSpeed(), terrain, parseOptional(maxGradePct));" in part
|
||||
|
||||
|
||||
def test_지표면_설정_없는_노선도_안_죽음(got):
|
||||
# 463 덧 — latest 에 surface_params 없음(옛 · 시험 · 막 만든 프로젝트) = 종단도 기준은 저장 설정대로 · 등고선 칸 그대로
|
||||
assert got["noSurface"] == {
|
||||
"grade": 14,
|
||||
"enforce": True,
|
||||
"display": {"station": 0, "cumulative": 0},
|
||||
}
|
||||
assert got["noSurfacePanel"] is None
|
||||
fetch = src("B05_Profile", "B05_Profile_Api_Fetch.ts")
|
||||
assert "latest?.surface_params.source_filter" not in fetch # [저장] 상단측 차례도 같은 꼴
|
||||
|
||||
Reference in New Issue
Block a user