Expand scoped demo analysis access
This commit is contained in:
@@ -59,7 +59,7 @@ export function useExportWorkflow({
|
||||
setExporting(true)
|
||||
setExportError(null)
|
||||
try {
|
||||
const response = await exportsApi.exportGeojson({
|
||||
const response = await exportsApi.exportGeojson(selectedDataset.project_id, {
|
||||
dataset_id: selectedDataset.id,
|
||||
export_kind: 'dataset',
|
||||
name: selectedDataset.name.replace(/\.(geo)?json$/i, ''),
|
||||
@@ -74,14 +74,14 @@ export function useExportWorkflow({
|
||||
}
|
||||
|
||||
const exportSelectedDetectionRunGeoJson = async () => {
|
||||
if (!selectedDetectionRunId) {
|
||||
if (!selectedDetectionRunId || !selectedProjectId) {
|
||||
setExportError('Select a detection run before exporting GeoJSON.')
|
||||
return
|
||||
}
|
||||
setExporting(true)
|
||||
setExportError(null)
|
||||
try {
|
||||
const response = await exportsApi.exportGeojson({
|
||||
const response = await exportsApi.exportGeojson(selectedProjectId, {
|
||||
analysis_run_id: selectedDetectionRunId,
|
||||
export_kind: 'detection_run',
|
||||
})
|
||||
@@ -95,14 +95,14 @@ export function useExportWorkflow({
|
||||
}
|
||||
|
||||
const exportSelectedSegmentationRunGeoJson = async () => {
|
||||
if (!selectedSegmentationRunId) {
|
||||
if (!selectedSegmentationRunId || !selectedProjectId) {
|
||||
setExportError('Select a segmentation run before exporting GeoJSON.')
|
||||
return
|
||||
}
|
||||
setExporting(true)
|
||||
setExportError(null)
|
||||
try {
|
||||
const response = await exportsApi.exportGeojson({
|
||||
const response = await exportsApi.exportGeojson(selectedProjectId, {
|
||||
analysis_run_id: selectedSegmentationRunId,
|
||||
export_kind: 'segmentation_run',
|
||||
})
|
||||
@@ -123,7 +123,7 @@ export function useExportWorkflow({
|
||||
setSelectionExporting(true)
|
||||
setSelectionExportError(null)
|
||||
try {
|
||||
const response = await exportsApi.exportGeojson({
|
||||
const response = await exportsApi.exportGeojson(selectedDataset.project_id, {
|
||||
dataset_id: selectedDataset.id,
|
||||
area_id: areaId,
|
||||
export_kind: 'vector_selection',
|
||||
@@ -199,7 +199,8 @@ export function useExportWorkflow({
|
||||
const previewExportContent = async (exportId: string) => {
|
||||
setExportError(null)
|
||||
try {
|
||||
const response = await exportsApi.getContent(exportId)
|
||||
if (!selectedProjectId) return
|
||||
const response = await exportsApi.getContent(selectedProjectId, exportId)
|
||||
setExportPreview(response.content)
|
||||
} catch (error) {
|
||||
setExportError(formatError(error, 'Failed to load export content'))
|
||||
@@ -207,7 +208,8 @@ export function useExportWorkflow({
|
||||
}
|
||||
|
||||
const downloadExportArtifact = (exportId: string) => {
|
||||
window.open(exportsApi.downloadUrl(exportId), '_blank', 'noopener,noreferrer')
|
||||
if (!selectedProjectId) return
|
||||
window.open(exportsApi.downloadUrl(selectedProjectId, exportId), '_blank', 'noopener,noreferrer')
|
||||
}
|
||||
|
||||
const resetExportsForProject = () => {
|
||||
|
||||
Reference in New Issue
Block a user