Skip to content

Commit a09c10e

Browse files
committed
fix(ui): location in code analysis incorrectly resolved as purl
1 parent 7a9b4f8 commit a09c10e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ui/src/components/CreateVulnAnalysisModal.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,12 @@ watch(() => props.findingRow, (newRow) => {
230230
formData.value.findingId = newRow.id || ''
231231
formData.value.findingAliases = newRow.aliases?.map((a: any) => a.aliasId) || []
232232
formData.value.findingType = newRow.type?.toUpperCase() || 'VULNERABILITY'
233-
formData.value.location = newRow.purl || newRow.location || ''
234-
formData.value.locationType = newRow.purl ? 'PURL' : 'CODE_POINT'
233+
234+
// Determine location and type
235+
const location = newRow.purl || newRow.location || ''
236+
formData.value.location = location
237+
// Check if location is actually a PURL (starts with 'pkg:')
238+
formData.value.locationType = location.startsWith('pkg:') ? 'PURL' : 'CODE_POINT'
235239
236240
setDefaultScope()
237241
}

0 commit comments

Comments
 (0)