fix: isolate regional project context
This commit is contained in:
@@ -30,6 +30,14 @@ function toRasterMetadata(metadata: Record<string, unknown> | null | undefined):
|
||||
return metadata as unknown as RasterMetadataResponse
|
||||
}
|
||||
|
||||
function isOperationalScopeBoundaryDataset(dataset: DatasetCreateResponse): boolean {
|
||||
return (
|
||||
dataset.status === 'ready' &&
|
||||
(dataset.dataset_type === 'vector' || dataset.dataset_type === 'geojson') &&
|
||||
dataset.source_metadata?.layer_type === 'regional_boundary'
|
||||
)
|
||||
}
|
||||
|
||||
function extractRasterTileManifestPath(job: JobRead | null | undefined): string {
|
||||
const manifest = toRasterTileHandoff(job)
|
||||
return manifest?.manifest_path ?? ''
|
||||
@@ -131,6 +139,7 @@ export function useDatasetWorkflow({
|
||||
}
|
||||
// Auto-open the first usable dataset so Data, Map and Exports start with real context.
|
||||
const defaultDataset =
|
||||
datasets.find(isOperationalScopeBoundaryDataset) ??
|
||||
datasets.find(isPrimaryFocusMunicipalityBoundaryDataset) ??
|
||||
datasets.find((dataset) => isVectorDatasetType(dataset.dataset_type) && dataset.status === 'ready') ??
|
||||
datasets.find((dataset) => dataset.status === 'ready') ??
|
||||
|
||||
Reference in New Issue
Block a user