Skip to content

Commit

Permalink
add ability to navigate from vulns to components
Browse files Browse the repository at this point in the history
Signed-off-by: Kaden Emley <[email protected]>
  • Loading branch information
kemley76 committed Jul 29, 2024
1 parent dfbdf7b commit cec0115
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 574 deletions.
20 changes: 20 additions & 0 deletions apps/frontend/src/components/cards/controltable/ControlRowCol.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
class="pa-2 mono pre-formatted"
v-html="sanitize_html(result.code_desc.trim())"
/>
<v-btn

Check warning on line 31 in apps/frontend/src/components/cards/controltable/ControlRowCol.vue

View workflow job for this annotation

GitHub Actions / build

Replace `⏎········v-if="componentRef"⏎·······` with `·v-if="componentRef"`

Check warning on line 31 in apps/frontend/src/components/cards/controltable/ControlRowCol.vue

View workflow job for this annotation

GitHub Actions / build

Replace `⏎········v-if="componentRef"⏎·······` with `·v-if="componentRef"`
v-if="componentRef"
@click="goToComponent()"
>See component details <v-icon>mdi-view-list-outline</v-icon></v-btn
>
<!-- eslint-enable vue/no-v-html -->
</v-col>
<v-col v-if="resultMessage" cols="12" sm="6" lg="5" class="left">
Expand Down Expand Up @@ -78,6 +83,21 @@ export default class ControlRowCol extends mixins(HtmlSanitizeMixin) {
get resultMessage(): string | undefined {
return this.result.message || this.result.skip_message;
}
get componentRef(): string | undefined {
const matches = this.result.message?.match(/- bom-ref: (?<ref>.+)$/m);
if (matches) {
return matches.groups?.ref;
}
}
goToComponent() {
if (this.componentRef)
this.$router.push({
name: 'sbom',
params: {componentRef: this.componentRef}
});
}
}
</script>

Expand Down
Loading

0 comments on commit cec0115

Please sign in to comment.