-
Notifications
You must be signed in to change notification settings - Fork 48
feat: security v2 UI #1774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: security v2 UI #1774
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
517f523
feat: added security vulnerabilities section UI
emlimlf c776e8c
feat: added vulnerability drawer
emlimlf 1c30fa5
chore: added auth wall component
emlimlf 22b5490
feat: added security vulnerabilities section UI
emlimlf c452e94
feat: added vulnerability drawer
emlimlf dd01db1
chore: added auth wall component
emlimlf 485f054
feat: wired the components to the backend
emlimlf d2cb655
fix: merge conflicts
emlimlf 8a4a358
feat: choose repo from vulnerabilities section
emlimlf 6bced74
Merge branch 'main' into feat/security-v2-ui
emlimlf 19bfd7f
feat: added fixable tooltip message
emlimlf 3599e8f
fix: pr comments and id display fallback
emlimlf 6d03f7c
chore: added loading states
emlimlf f2d0c19
fix: auth wall font styling
emlimlf c63adcc
fix: drawer styling
emlimlf 2e7ad27
chore: minor chart adjustments
emlimlf ce9239e
chore: added empty states
emlimlf a1efcc6
Merge branch 'main' into feat/security-v2-ui
emlimlf b995ec2
chore: minor text changes to the summary component
emlimlf 00fe8f5
feat: added source path dropdown
emlimlf f75ee41
chore: ui styling fixes and affected paths column
emlimlf 38a99c9
chore: handle gerrit, gitlab and other sources
emlimlf 8a7043b
feat: show security tab if project has vulnerability data
emlimlf 59b46df
chore: remove link for gerrit paths
emlimlf 4fbc662
fix: handling of the new gerrit file paths
emlimlf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
...d/app/components/modules/project/components/vulnerabilities/auth-wall-vulnerabilities.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| <!-- | ||
| Copyright (c) 2025 The Linux Foundation and each contributor. | ||
| SPDX-License-Identifier: MIT | ||
| --> | ||
| <template> | ||
| <lfx-card class="p-6 flex flex-col relative"> | ||
| <img | ||
| src="/images/misc/vulnerabilities-preview.png" | ||
| alt="Auth wall vulnerabilities" | ||
| /> | ||
|
|
||
| <div class="absolute h-full w-full flex items-center justify-center -mt-6 -ml-6"> | ||
| <div | ||
| class="shadow-xl bg-gradient-to-b from-violet-50/50 to-white p-8 border border-neutral-200 rounded-xl flex flex-col gap-8 items-center w-[50rem]" | ||
| > | ||
| <!-- Icon and text section --> | ||
| <div class="flex flex-col gap-5 items-center"> | ||
| <div class="bg-discovery-100 p-4 rounded-full flex items-center justify-center size-14"> | ||
| <lfx-icon | ||
| name="lock-keyhole" | ||
| class="text-discovery-600" | ||
| :size="32" | ||
| /> | ||
| </div> | ||
|
|
||
| <div class="flex flex-col gap-5 items-center"> | ||
| <div class="flex flex-col gap-1 items-center"> | ||
| <h4 class="text-xl font-secondary font-bold text-black">Unlock project vulnerabilities</h4> | ||
| <p class="text-sm text-neutral-600">Sign in to access detailed vulnerability insights including:</p> | ||
| </div> | ||
|
|
||
| <!-- Pills/Tags --> | ||
| <div class="flex flex-wrap gap-4 items-center justify-center max-w-[600px]"> | ||
| <lfx-chip | ||
| v-for="feature in features" | ||
| :key="feature" | ||
| type="bordered" | ||
| > | ||
| {{ feature }} | ||
| </lfx-chip> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- CTA section --> | ||
| <div class="flex flex-col gap-4 items-center"> | ||
| <lfx-button | ||
| type="primary" | ||
| class="!rounded-full" | ||
| @click="handleLogin" | ||
| > | ||
| Sign in to your LFX account | ||
| </lfx-button> | ||
|
emlimlf marked this conversation as resolved.
|
||
| <p class="text-xs text-neutral-600"> | ||
| New to LFX? | ||
| <a | ||
| href="#" | ||
| class="text-accent-500 hover:underline" | ||
| @click.prevent="handleLogin" | ||
| >Create an account</a | ||
| > | ||
| </p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </lfx-card> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import LfxCard from '~/components/uikit/card/card.vue'; | ||
| import LfxIcon from '~/components/uikit/icon/icon.vue'; | ||
| import LfxButton from '~/components/uikit/button/button.vue'; | ||
| import LfxChip from '~/components/uikit/chip/chip.vue'; | ||
| import { useAuth } from '~~/composables/useAuth'; | ||
|
|
||
| const { login } = useAuth(); | ||
|
|
||
| const features = [ | ||
| 'Open vulnerabilities', | ||
| 'Median CVS of all vulnerabilities', | ||
| 'Fix status', | ||
| 'Vulnerability by severity', | ||
|
emlimlf marked this conversation as resolved.
|
||
| 'Vulnerabilities by ecosystem', | ||
| ]; | ||
|
|
||
| const handleLogin = () => { | ||
| login(); | ||
| }; | ||
| </script> | ||
|
|
||
| <script lang="ts"> | ||
| export default { | ||
| name: 'LfxAuthWallVulnerabilities', | ||
| }; | ||
| </script> | ||
86 changes: 86 additions & 0 deletions
86
...tend/app/components/modules/project/components/vulnerabilities/recent-vulnerabilities.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| <!-- | ||
| Copyright (c) 2025 The Linux Foundation and each contributor. | ||
| SPDX-License-Identifier: MIT | ||
| --> | ||
| <template> | ||
| <div class="flex flex-col gap-6 items-center pt-6 w-full"> | ||
| <div class="flex flex-col gap-2 items-start w-full"> | ||
| <p class="text-base font-bold leading-6 text-neutral-900">Recent vulnerabilities</p> | ||
|
|
||
| <!-- Error state or empty state --> | ||
| <lfx-vulnerabilities-empty v-if="error || isEmpty" /> | ||
|
|
||
| <!-- Data display --> | ||
| <template v-else> | ||
| <lfx-project-vulnerability-table-header /> | ||
| <lfx-project-vulnerability-table | ||
| :vulnerabilities="data || []" | ||
| :is-loading="isLoading" | ||
| :is-fetching-next-page="false" | ||
| :load-count="5" | ||
| /> | ||
| </template> | ||
|
|
||
| <!-- Empty state --> | ||
| <div | ||
| v-if="!isLoading && !data" | ||
| class="flex items-center justify-center py-10 w-full" | ||
| > | ||
| <p class="text-neutral-500 text-sm">No recent vulnerabilities</p> | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- View More Button --> | ||
| <lfx-button | ||
| v-if="props.showViewMore && data && data.length > 0 && !isLoading" | ||
| type="transparent" | ||
| button-style="pill" | ||
| label="View more" | ||
| @click="emit('viewMore')" | ||
| /> | ||
|
emlimlf marked this conversation as resolved.
|
||
| </div> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { computed } from 'vue'; | ||
| import LfxProjectVulnerabilityTableHeader from './vulnerability-table-header.vue'; | ||
| import LfxProjectVulnerabilityTable from './vulnerability-table.vue'; | ||
| import LfxVulnerabilitiesEmpty from './vulnerabilities-empty.vue'; | ||
| import LfxButton from '~/components/uikit/button/button.vue'; | ||
| import { | ||
| VULNERABILITY_API_SERVICE, | ||
| type VulnerabilitiesQueryParams, | ||
| } from '~/components/modules/project/services/vulnerability.api.service'; | ||
|
|
||
| const props = withDefaults( | ||
| defineProps<{ | ||
| params: VulnerabilitiesQueryParams; | ||
| showViewMore?: boolean; | ||
| }>(), | ||
| { | ||
| showViewMore: true, | ||
| }, | ||
| ); | ||
|
|
||
| const queryParams = computed(() => props.params); | ||
|
|
||
| const { data, error, isLoading } = VULNERABILITY_API_SERVICE.fetchRecentVulnerabilities(queryParams); | ||
|
|
||
| const isEmpty = computed(() => { | ||
| if (isLoading.value) { | ||
| return false; | ||
| } | ||
|
|
||
| return data.value?.length === 0; | ||
| }); | ||
|
|
||
| const emit = defineEmits<{ | ||
| (e: 'viewMore'): void; | ||
| }>(); | ||
| </script> | ||
|
|
||
| <script lang="ts"> | ||
| export default { | ||
| name: 'LfxProjectRecentVulnerabilities', | ||
| }; | ||
| </script> | ||
33 changes: 33 additions & 0 deletions
33
frontend/app/components/modules/project/components/vulnerabilities/vulnerabilities-empty.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| <!-- | ||
| Copyright (c) 2025 The Linux Foundation and each contributor. | ||
| SPDX-License-Identifier: MIT | ||
| --> | ||
| <template> | ||
| <div class="flex flex-col gap-6 items-center justify-center py-10 w-full border border-neutral-200 rounded-lg"> | ||
| <div class="bg-accent-100 p-4 rounded-full flex items-center justify-center size-14"> | ||
| <lfx-icon | ||
| name="ban-bug" | ||
| class="text-accent-600" | ||
| :size="32" | ||
| /> | ||
| </div> | ||
| <div class="flex flex-col gap-3 items-center"> | ||
| <p class="text-xl font-secondary font-bold text-black">No vulnerabilities found</p> | ||
| <slot> | ||
| <p class="text-sm text-neutral-600"> | ||
| We didn’t detect any vulnerabilities across the selected repositories’ dependencies over the past 365 days | ||
| </p> | ||
| </slot> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import LfxIcon from '~/components/uikit/icon/icon.vue'; | ||
| </script> | ||
|
|
||
| <script lang="ts"> | ||
| export default { | ||
| name: 'LfxVulnerabilitiesEmpty', | ||
| }; | ||
| </script> |
107 changes: 107 additions & 0 deletions
107
...end/app/components/modules/project/components/vulnerabilities/vulnerabilities-section.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| <!-- | ||
| Copyright (c) 2025 The Linux Foundation and each contributor. | ||
| SPDX-License-Identifier: MIT | ||
| --> | ||
| <template> | ||
| <lfx-card class="p-6 flex flex-col gap-6"> | ||
| <!-- Header --> | ||
| <div class="flex flex-col gap-2"> | ||
| <h2 class="font-secondary text-xl font-bold leading-7 text-neutral-900">Vulnerabilities</h2> | ||
| <p class="text-xs leading-4 text-neutral-500"> | ||
| Overview of security vulnerabilities detected across project dependencies over the last 365 days. | ||
| </p> | ||
| </div> | ||
|
|
||
| <!-- Aggregated view disclaimer - hidden when repos are selected --> | ||
| <div | ||
| v-if="showAggregatedDisclaimer" | ||
| class="p-3 bg-neutral-50 border border-neutral-100 flex items-center gap-1.5 rounded-md" | ||
| > | ||
| <lfx-icon | ||
| name="info-circle" | ||
| :size="14" | ||
| class="text-neutral-500" | ||
| /> | ||
| <p class="text-xs leading-4 font-semibold text-neutral-500"> | ||
| You're viewing an aggregated snapshot of security vulnerabilities detected across all project dependencies over | ||
| the last 365 days. For a detailed analysis, | ||
| <span | ||
| class="underline cursor-pointer" | ||
| @click="emit('chooseRepository')" | ||
| >choose a specific repository</span | ||
| >. | ||
| </p> | ||
| </div> | ||
|
|
||
| <!-- Data display --> | ||
| <div class="flex flex-col gap-6"> | ||
| <!-- Summary stats row --> | ||
| <lfx-project-vulnerability-summary :params="params" /> | ||
|
|
||
| <!-- Charts row --> | ||
| <div class="flex gap-6"> | ||
| <lfx-project-vulnerability-severity :params="params" /> | ||
| <lfx-project-vulnerability-ecosystem :params="params" /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <!-- Recent vulnerabilities table --> | ||
| <lfx-project-recent-vulnerabilities | ||
| :params="params" | ||
| :show-view-more="true" | ||
| @view-more="handleViewMore" | ||
| /> | ||
|
|
||
| <!-- Vulnerability Drawer --> | ||
| <lfx-project-vulnerability-drawer | ||
| v-model="isDrawerOpen" | ||
| :project-name="projectName" | ||
| :project-logo="projectLogo" | ||
| /> | ||
| </lfx-card> | ||
| </template> | ||
|
|
||
| <script setup lang="ts"> | ||
| import { computed, ref } from 'vue'; | ||
| import { useRoute } from 'nuxt/app'; | ||
| import { storeToRefs } from 'pinia'; | ||
| import LfxProjectVulnerabilitySummary from './vulnerability-summary.vue'; | ||
| import LfxProjectVulnerabilitySeverity from './vulnerability-severity.vue'; | ||
| import LfxProjectVulnerabilityEcosystem from './vulnerability-ecosystem.vue'; | ||
| import LfxProjectRecentVulnerabilities from './recent-vulnerabilities.vue'; | ||
| import LfxProjectVulnerabilityDrawer from './vulnerability-drawer.vue'; | ||
| import LfxIcon from '~/components/uikit/icon/icon.vue'; | ||
| import LfxCard from '~/components/uikit/card/card.vue'; | ||
| import { useProjectStore } from '~/components/modules/project/store/project.store'; | ||
|
|
||
| const route = useRoute(); | ||
|
|
||
| const { selectedReposValues, project } = storeToRefs(useProjectStore()); | ||
|
|
||
| const isRepository = computed(() => !!route.params.name); | ||
| const hasSelectedRepos = computed(() => selectedReposValues.value && selectedReposValues.value.length > 0); | ||
| const showAggregatedDisclaimer = computed(() => !isRepository.value && !hasSelectedRepos.value); | ||
|
|
||
| const isDrawerOpen = ref(false); | ||
| const projectName = computed(() => project.value?.name || ''); | ||
| const projectLogo = computed(() => project.value?.logo || ''); | ||
|
|
||
| const params = computed(() => ({ | ||
| projectSlug: route.params.slug as string, | ||
| repos: selectedReposValues.value || undefined, | ||
| })); | ||
|
|
||
| const emit = defineEmits<{ | ||
| (e: 'chooseRepository'): void; | ||
| }>(); | ||
|
|
||
| const handleViewMore = () => { | ||
| isDrawerOpen.value = true; | ||
| }; | ||
| </script> | ||
|
|
||
| <script lang="ts"> | ||
| export default { | ||
| name: 'LfxProjectVulnerabilitiesSection', | ||
| }; | ||
| </script> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.