Complete operational map result workflow
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-17 12:35:50 +02:00
parent 8266929b2e
commit a29c787238
33 changed files with 1121 additions and 107 deletions
@@ -97,14 +97,27 @@ export function useMapThemeSelectionInsights<TThemeId extends string>(
})),
)
const successful = settled.flatMap((item) => (item.status === 'fulfilled' ? [item.value] : []))
const failureCount = settled.length - successful.length
const failures = settled.flatMap((item, index) => (
item.status === 'rejected'
? [{
dataset: queries[index]?.dataset.name ?? queries[index]?.themeId ?? 'Onbekende bron',
reason: formatError(item.reason, 'Bron kon niet worden bevraagd.'),
}]
: []
))
const failureCount = failures.length
if (requestSequence.current !== sequence) {
return []
}
setThemeInsights(successful)
if (failureCount > 0) {
const details = failures
.slice(0, 4)
.map((failure) => `${failure.dataset}: ${failure.reason}`)
.join(' · ')
const remainder = failureCount > 4 ? ` · en ${failureCount - 4} andere` : ''
setThemeInsightsError(
`${failureCount} beschikbare databron${failureCount === 1 ? '' : 'nen'} kon niet worden bevraagd.`,
`${failureCount} beschikbare databron${failureCount === 1 ? '' : 'nen'} kon niet worden bevraagd. ${details}${remainder}`,
)
}
return successful