From 840030ab1c59c1ae446b7728a6007f8e52fe5c38 Mon Sep 17 00:00:00 2001 From: tnagorra Date: Thu, 11 Jun 2026 20:36:47 +0545 Subject: [PATCH] fix(tutorial): correct expected count for tile based project - pass expected count of tasks per screen for tile based projects --- app/views/EditTutorial/utils.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/views/EditTutorial/utils.ts b/app/views/EditTutorial/utils.ts index 8a9ee23..9629bf4 100644 --- a/app/views/EditTutorial/utils.ts +++ b/app/views/EditTutorial/utils.ts @@ -263,11 +263,12 @@ function checkReferenceValues( // share a screen and the reference values come from the default tile options. function checkTileGroupedFeatures( features: { properties: { screen: number, reference: number } }[], + expectedCount: number, ): string[] { const screens = features.map((feature) => feature.properties.screen); return [ - ...checkScreenFeatureCount(screens, 6), + ...checkScreenFeatureCount(screens, expectedCount), ...checkScreensSerial(screens), ...checkReferenceValues( features.map((feature) => ({ @@ -406,7 +407,7 @@ export function transformFindGeoJson( return { ok: false, error: result.summary }; } - const problems = checkTileGroupedFeatures(result.features); + const problems = checkTileGroupedFeatures(result.features, 6); if (problems.length > 0) { return { ok: false, error: problems.join('\n') }; } @@ -434,7 +435,7 @@ export function transformCompareGeoJson( return { ok: false, error: result.summary }; } - const problems = checkTileGroupedFeatures(result.features); + const problems = checkTileGroupedFeatures(result.features, 1); if (problems.length > 0) { return { ok: false, error: problems.join('\n') }; } @@ -462,7 +463,7 @@ export function transformCompletenessGeoJson( return { ok: false, error: result.summary }; } - const problems = checkTileGroupedFeatures(result.features); + const problems = checkTileGroupedFeatures(result.features, 1); if (problems.length > 0) { return { ok: false, error: problems.join('\n') }; }