Skip to content

Commit

Permalink
feat: started PR fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdlangton committed Nov 23, 2024
1 parent 4ed2012 commit a99b8e0
Show file tree
Hide file tree
Showing 3 changed files with 217 additions and 118 deletions.
90 changes: 86 additions & 4 deletions src/components/Finding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ import VCodeBlock from '@wdns/vue-code-block';
import { onMounted } from 'vue';
import { useTheme } from 'vuetify';
const { meta_x, meta_v } = useMagicKeys()
const { meta_o, meta_c, meta_f } = useMagicKeys()
onMounted(() => init())
const emit = defineEmits(["vector-updated"]);
const { global } = useTheme()
const fixDialog = ref(false)
const triageDialog = ref(false)
const branchChoice = ref('')
const response = ref('')
const justification = ref('')
const justificationText = ref('')
Expand All @@ -35,6 +37,10 @@ const props = defineProps({
type: Object,
required: true,
},
branches: {
type: Array,
required: true,
},
currentTriage: {
type: Object,
required: true,
Expand Down Expand Up @@ -618,8 +624,9 @@ function saveVector() {
cvssDialog.value = false
}
watch([meta_x], () => { triageDialog.value = true })
watch([meta_v], () => { cvssDialog.value = true })
watch([meta_f], () => { fixDialog.value = true })
watch([meta_o], () => { triageDialog.value = true })
watch([meta_c], () => { cvssDialog.value = true })
watch([
activeTab,
v31MetricsAV,
Expand Down Expand Up @@ -722,22 +729,97 @@ watch([
</VChip>
</div>
<div class="d-flex align-end">
<VDialog
v-if="props.branches.length"
v-model="fixDialog"
max-width="600"
>
<template v-slot:activator="{ props: activatorProps }">
<VBtn
class="me-2 text-none font-weight-regular"
variant="outlined"
v-bind="activatorProps"
>
Fix
<VChip
class="ms-1"
variant="outlined"
color="#e4e4e4"
>
&#8984;F
</VChip>
</VBtn>
</template>
<VCard>
<VCardText>
<!-- Analysis Form -->
<VRow dense>
<VCol
cols="12"
md="6"
>
<VSelect
v-model="branchChoice"
:items="branches"
item-title="text"
item-value="value"
label="Branch"
required
/>
</VCol>
<VCol
cols="12"
md="6"
>
PR details
</VCol>
<VCol cols="12">
Repo details
</VCol>
</VRow>
</VCardText>
<VDivider />
<VSpacer />
<VCardActions>
<VSpacer />
<VBtn
text="Close"
variant="plain"
@click="fixDialog = false"
></VBtn>
<VBtn
color="primary"
variant="plain"
text="Create PR"
@click="$emit('click:createPR', branchChoice); fixDialog = false"
>
</VBtn>
</VCardActions>
</VCard>
</VDialog>
<VDialog
v-model="triageDialog"
max-width="600"
>
<template v-slot:activator="{ props: activatorProps }">
<VBtn
class="text-none font-weight-regular"
color="info"
variant="outlined"
v-bind="activatorProps"
>
Triage
<VChip
class="ms-1"
variant="outlined"
color="#e4e4e4"
>
&#8984;X
&#8984;O
</VChip>
</VBtn>
</template>
Expand Down
100 changes: 51 additions & 49 deletions src/pages/IssuePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const initialState = {
info: "",
loading: false,
finding: null,
branches: [],
currentTriage: null,
}
Expand Down Expand Up @@ -47,6 +48,7 @@ class Controller {
})
}
state.finding = data.finding
state.branches = [...new Set([data.finding?.spdx?.repo?.defaultBranch, data.finding?.spdx?.repo?.defaultBranch].filter(i => !!i))]
state.currentTriage = data.finding.triage.sort((a, b) =>
a.lastObserved - b.lastObserved
).pop()
Expand Down Expand Up @@ -152,58 +154,57 @@ onBeforeRouteUpdate(async (to, from) => {
<template>
<VContainer class="d-flex justify-space-between align-center">
<VTabs
v-model="tab"
align-tabs="start"
stacked
grow
@update:model-value="onTabChange"
>
<VTab value="issue">
<VIcon
size="large"
icon="eos-icons:critical-bug-outlined"
></VIcon>
<span class="mt-2">
Issue Details
</span>
</VTab>
<VTab value="dependencies">
<VIcon
size="large"
icon="tabler:packages"
></VIcon>
<span class="mt-2">
Dependency Graph
</span>
</VTab>
<VRow dense>
<VCol cols="10">
<VTabs
v-model="tab"
align-tabs="start"
stacked
grow
@update:model-value="onTabChange"
>
<VTab value="issue">
<VIcon
size="large"
icon="eos-icons:critical-bug-outlined"
></VIcon>
<span class="mt-2">
Issue Details
</span>
</VTab>
<VTab value="artifacts">
<VIcon
size="large"
icon="eos-icons:file-system-outlined"
></VIcon>
<span class="mt-2">
Artifacts
</span>
</VTab>
<VTab value="dependencies">
<VIcon
size="large"
icon="tabler:packages"
></VIcon>
<span class="mt-2">
Dependency Graph
</span>
</VTab>
<VTab value="related">
<VIcon
size="large"
icon="fluent-mdl2:relationship"
></VIcon>
<span class="mt-2">
Related
</span>
</VTab>
</VTabs>
<VTab value="artifacts">
<VIcon
size="large"
icon="eos-icons:file-system-outlined"
></VIcon>
<span class="mt-2">
Artifacts
</span>
</VTab>
<div class="d-flex align-end">
<span class="mr-4 text-h5">
</span>
</div>
<VTab value="related">
<VIcon
size="large"
icon="fluent-mdl2:relationship"
></VIcon>
<span class="mt-2">
Related
</span>
</VTab>
</VTabs>
</VCol>
</VRow>
</VContainer>
<VTabsWindow v-model="tab">
Expand Down Expand Up @@ -257,6 +258,7 @@ onBeforeRouteUpdate(async (to, from) => {
<Finding
v-if="state.finding"
:finding="state.finding"
:branches="state.branches"
:current-triage="state.currentTriage"
@click:saveTriage="controller.handleTriage"
@vectorUpdated="controller.vectorUpdated"
Expand Down
Loading

0 comments on commit a99b8e0

Please sign in to comment.