Skip to content
Merged
Show file tree
Hide file tree
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 Mar 24, 2026
c776e8c
feat: added vulnerability drawer
emlimlf Mar 25, 2026
1c30fa5
chore: added auth wall component
emlimlf Mar 25, 2026
22b5490
feat: added security vulnerabilities section UI
emlimlf Mar 24, 2026
c452e94
feat: added vulnerability drawer
emlimlf Mar 25, 2026
dd01db1
chore: added auth wall component
emlimlf Mar 25, 2026
485f054
feat: wired the components to the backend
emlimlf Mar 25, 2026
d2cb655
fix: merge conflicts
emlimlf Mar 25, 2026
8a4a358
feat: choose repo from vulnerabilities section
emlimlf Mar 25, 2026
6bced74
Merge branch 'main' into feat/security-v2-ui
emlimlf Mar 26, 2026
19bfd7f
feat: added fixable tooltip message
emlimlf Mar 26, 2026
3599e8f
fix: pr comments and id display fallback
emlimlf Mar 26, 2026
6d03f7c
chore: added loading states
emlimlf Mar 26, 2026
f2d0c19
fix: auth wall font styling
emlimlf Mar 26, 2026
c63adcc
fix: drawer styling
emlimlf Mar 26, 2026
2e7ad27
chore: minor chart adjustments
emlimlf Mar 26, 2026
ce9239e
chore: added empty states
emlimlf Mar 26, 2026
a1efcc6
Merge branch 'main' into feat/security-v2-ui
emlimlf Mar 26, 2026
b995ec2
chore: minor text changes to the summary component
emlimlf Mar 26, 2026
00fe8f5
feat: added source path dropdown
emlimlf Mar 27, 2026
f75ee41
chore: ui styling fixes and affected paths column
emlimlf Mar 27, 2026
38a99c9
chore: handle gerrit, gitlab and other sources
emlimlf Mar 27, 2026
8a7043b
feat: show security tab if project has vulnerability data
emlimlf Mar 27, 2026
59b46df
chore: remove link for gerrit paths
emlimlf Mar 27, 2026
4fbc662
fix: handling of the new gerrit file paths
emlimlf Mar 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ import { useProjectStore } from '~~/app/components/modules/project/store/project
import LfxSkeletonState from '~/components/modules/project/components/shared/skeleton-state.vue';
import { PROJECT_COMMUNITY_API_SERVICE } from '~/components/modules/project/services/community.api.service';
import { useAuthStore } from '~/components/modules/auth/store/auth.store';
import { VULNERABILITY_API_SERVICE } from '~/components/modules/project/services/vulnerability.api.service';

const props = defineProps<{
project?: Project;
Expand All @@ -93,9 +94,17 @@ const props = defineProps<{
const route = useRoute();
const repoName = computed(() => route.params.name as string);

const { selectedRepositoryGroup } = storeToRefs(useProjectStore());
const { selectedRepositoryGroup, selectedReposValues } = storeToRefs(useProjectStore());
const { user } = storeToRefs(useAuthStore());

const queryParams = computed(() => ({
projectSlug: props.project?.slug as string,
repos: selectedReposValues.value || undefined,
}));
const { data } = VULNERABILITY_API_SERVICE.fetchVulnerabilitySummary(queryParams);

const hasVulnerabilitiesData = computed(() => (data.value ? data.value.lastScanStatus === 'success' : false));

const activeLink = computed(() =>
lfProjectLinks.find((link) => {
if (selectedRepositoryGroup.value) {
Expand All @@ -116,7 +125,10 @@ const isAreaEnabled = (area: WidgetArea) => {
}

if (area === WidgetArea.SECURITY) {
return props.project?.connectedPlatforms?.some((platform) => platform.toLowerCase().includes('github'));
return (
props.project?.connectedPlatforms?.some((platform) => platform.toLowerCase().includes('github')) ||
hasVulnerabilitiesData.value
);
}

return widgets.length === 0 || widgets.some((widget) => props.project?.widgets?.includes(lfxWidgets[widget]?.key));
Expand Down
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
-->
Comment thread
emlimlf marked this conversation as resolved.
<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>
Comment thread
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',
Comment thread
emlimlf marked this conversation as resolved.
'Vulnerabilities by ecosystem',
];

const handleLogin = () => {
login();
};
</script>

<script lang="ts">
export default {
name: 'LfxAuthWallVulnerabilities',
};
</script>
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')"
/>
Comment thread
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>
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>
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>
Loading
Loading