Skip to content

Commit 7d1659f

Browse files
committed
feat: basic flow
Signed-off-by: Gašper Grom <[email protected]>
1 parent d1d41a6 commit 7d1659f

19 files changed

+717
-337
lines changed

frontend/app/components/modules/project/components/security/yaml/generate-yaml-modal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ SPDX-License-Identifier: MIT
3737
>
3838
{{ config.label }}
3939
</lfx-tag>
40-
<p class="text-sm text-neutral-600 leading-5">
40+
<p class="text-xs text-neutral-600 leading-5">
4141
<span v-if="type && step >= 0">Step {{step + 1}}/{{steps.length + 1}} - </span>
4242
<span v-if="!type || step < 0">Choose YAML file template</span>
4343
<span v-else-if="step < steps.length">{{ currentStep?.label }}</span>

frontend/app/components/modules/project/components/security/yaml/generate-yaml-type.vue

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,36 @@ SPDX-License-Identifier: MIT
44
-->
55
<template>
66
<div class="relative w-full">
7-
<h2 class="text-lg font-semibold text-slate-900 leading-7 mb-2">
7+
<h2 class="text-lg font-semibold text-slate-900 leading-7 mb-1">
88
Choose YAML file template
99
</h2>
10-
<p class="text-xs font-normal text-neutral-500 leading-4 mb-4">
10+
<p class="text-xs font-normal text-neutral-500 leading-4">
1111
Please select the YAML template file that better aligns with your project repository and security requirements.
1212
</p>
1313

1414
<div class="pt-6 flex flex-wrap -mx-1.5 gap-y-3">
1515
<div
1616
v-for="(option, key) in yamlGenerationConfig"
1717
:key="key"
18-
class="w-1/2 px-1.5"
18+
class="w-1/3 px-1.5"
1919
>
2020
<div
2121
class="p-4 rounded-lg border border-neutral-200 h-full transition hover:bg-neutral-50 cursor-pointer"
2222
:class="model === key ? 'border-neutral-900 bg-neutral-100' : ''"
2323
@click="model = key"
2424
>
25-
<div class="flex justify-between items-center pb-6">
25+
<div class="flex justify-between pb-6">
2626
<lfx-icon
2727
:size="24"
2828
:name="option.icon || 'file'"
2929
class="text-neutral-400"
3030
/>
31-
<lfx-tag
32-
v-if="option.recommended"
33-
type="solid"
34-
variation="neutral"
35-
size="small"
36-
>
37-
Recommended
38-
</lfx-tag>
31+
<lfx-icon
32+
v-if="model === key"
33+
name="check-circle"
34+
class="font-black"
35+
:size="16"
36+
/>
3937
</div>
4038

4139
<div class="flex flex-col gap-3">

frontend/app/components/modules/project/config/yaml-generation/basic/basic-yaml.config.ts

Lines changed: 81 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,33 @@
11
// Copyright (c) 2025 The Linux Foundation and each contributor.
22
// SPDX-License-Identifier: MIT
33
import {DateTime} from 'luxon';
4-
import YamlBasicProjectDetails
5-
from "./yaml-basic-project-details.vue";
4+
import YamlBasicProject
5+
from "./yaml-basic-project.vue";
6+
import YamlBasicProjectRepositories
7+
from "./yaml-basic-project-repositories.vue";
8+
import YamlBasicProjectVulnerability
9+
from "./yaml-basic-project-vulnerability.vue";
10+
import YamlBasicRepository
11+
from "./yaml-basic-repository.vue";
12+
import YamlBasicRepositoryMembers
13+
from "./yaml-basic-repository-members.vue";
14+
import YamlBasicRepositoryLicense
15+
from "./yaml-basic-repository-license.vue";
16+
import YamlBasicRepositorySecurity
17+
from "./yaml-basic-repository-security.vue";
618
import type {YamlGenerationConfig} from "~/components/modules/project/config/yaml-generation/yaml-generation.config";
719
import YamlHeaderInformation
820
from "~/components/modules/project/config/yaml-generation/shared/yaml-header-information.vue";
921

1022
const basicYamlGenerationConfig: YamlGenerationConfig = {
1123
label: 'Basic',
1224
icon: 'file-circle-check',
13-
description: 'Starting out with a single repository project.',
25+
description: 'Essential project security specifications.',
1426
features: [
15-
'Use when you want to get up and running quickly',
16-
'Best for projects just beginning to adopt the specification',
17-
'Provides basic security insights coverage',
27+
'Use as the master security insights file in your main repository.',
28+
'Use when you want to get up and running quickly.',
29+
'Best for projects just beginning to adopt the specification.',
30+
'Provides basic security insights coverage.',
1831
],
1932
steps: [
2033
{
@@ -23,33 +36,84 @@ const basicYamlGenerationConfig: YamlGenerationConfig = {
2336
},
2437
{
2538
label: 'Project details',
26-
component: YamlBasicProjectDetails,
27-
}
39+
component: YamlBasicProject,
40+
},
41+
{
42+
label: 'Project details | Repositories',
43+
component: YamlBasicProjectRepositories,
44+
},
45+
{
46+
label: 'Project details | Vulnerability reporting',
47+
component: YamlBasicProjectVulnerability,
48+
},
49+
{
50+
label: 'Repository details',
51+
component: YamlBasicRepository,
52+
},
53+
{
54+
label: 'Repository details | Core team members',
55+
component: YamlBasicRepositoryMembers,
56+
},
57+
{
58+
label: 'Repository details | License information',
59+
component: YamlBasicRepositoryLicense,
60+
},
61+
{
62+
label: 'Repository details | Security self-assessment',
63+
component: YamlBasicRepositorySecurity,
64+
},
2865
],
2966
template: {
3067
header: {
3168
'schema-version': '2.0.0',
3269
'last-updated': DateTime.now().toISODate(),
3370
'last-reviewed': DateTime.now().toISODate(),
3471
url: '',
35-
comment:
36-
'This file contains the minimum information for both project and repository.\n' +
72+
comment: 'This file contains the minimum information for both project and repository.\n' +
3773
'It not required to include both a project and repository section if the project\n' +
3874
'section is intended to be inherited by repositories via header.project-si-source'
3975
},
4076
project: {
4177
name: '',
42-
administrators: [],
43-
repositories: [],
44-
'vulnerability-reporting': {}
78+
administrators: [
79+
{
80+
name: '',
81+
affiliation: '',
82+
email: '',
83+
social: '',
84+
primary: false,
85+
}
86+
],
87+
repositories: [
88+
{
89+
name: '',
90+
url: '',
91+
comment: '',
92+
}
93+
],
94+
'vulnerability-reporting': {
95+
'reports-accepted': false,
96+
'bug-bounty-available': false,
97+
}
4598
},
4699
repository: {
47100
url: '',
48101
status: '',
49-
'accepts-change-request': true,
50-
'accepts-automated-change-request': true,
51-
'core-team': [],
52-
license: {},
102+
'accepts-change-request': false,
103+
'accepts-automated-change-request': false,
104+
'core-team': [
105+
{
106+
name: '',
107+
affiliation: '',
108+
email: '',
109+
social: '',
110+
primary: false,
111+
}
112+
],
113+
license: {
114+
url: '',
115+
expression: ''
116+
},
53117
security: {
54118
assessments: {
55119
self: {

frontend/app/components/modules/project/config/yaml-generation/basic/yaml-basic-project-details-repositories.vue

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<!--
2+
Copyright (c) 2025 The Linux Foundation and each contributor.
3+
SPDX-License-Identifier: MIT
4+
-->
5+
<template>
6+
<div class="flex flex-col gap-1 pb-6">
7+
<p class="text-sm font-semibold text-brand-600">
8+
Project details
9+
</p>
10+
<p class="text-lg font-semibold text-neutral-900">
11+
Repositories
12+
</p>
13+
<p class="text-xs font-normal text-neutral-500">
14+
Details about your project repository and contribution policies.
15+
</p>
16+
</div>
17+
18+
<div class="flex flex-col gap-4">
19+
<article
20+
v-for="(repository, index) of model.project.repositories"
21+
:key="index"
22+
class="bg-white border border-neutral-200 rounded-xl p-4 flex flex-col gap-4"
23+
>
24+
<div class="flex justify-between items-center min-h-7">
25+
<p class="text-sm font-semibold text-neutral-900">
26+
Repository #{{index + 1}}
27+
</p>
28+
29+
<lfx-icon-button
30+
v-if="model.project.repositories.length > 1"
31+
type="default"
32+
icon="trash-can"
33+
size="small"
34+
@click="model.project.repositories.splice(index, 1)"
35+
/>
36+
</div>
37+
<lfx-field label="Repository name">
38+
<lfx-input
39+
v-model="repository.name"
40+
placeholder=" "
41+
/>
42+
</lfx-field>
43+
44+
<lfx-field label="Repository URL">
45+
<lfx-input
46+
v-model="repository.url"
47+
placeholder="https://github.com/your-project/your-repository"
48+
/>
49+
</lfx-field>
50+
51+
<lfx-field label="Repository comment">
52+
<lfx-textarea
53+
v-model="repository.comment"
54+
placeholder="Brief description of the repository purpose and scope"
55+
class="min-h-18"
56+
/>
57+
</lfx-field>
58+
</article>
59+
</div>
60+
61+
<!-- Add repository button -->
62+
<div class="flex items-center justify-center pt-4">
63+
<lfx-button
64+
type="transparent"
65+
button-style="pill"
66+
@click="addRepository"
67+
>
68+
<lfx-icon name="plus" />
69+
Add repository
70+
</lfx-button>
71+
</div>
72+
</template>
73+
74+
<script setup lang="ts">
75+
import {computed} from "vue";
76+
import LfxInput from '~/components/uikit/input/input.vue';
77+
import LfxField from '~/components/uikit/field/field.vue';
78+
import LfxTextarea from '~/components/uikit/textarea/textarea.vue';
79+
import LfxButton from "~/components/uikit/button/button.vue";
80+
import LfxIcon from "~/components/uikit/icon/icon.vue";
81+
import LfxIconButton from "~/components/uikit/icon-button/icon-button.vue";
82+
83+
const props = defineProps<{
84+
modelValue: object;
85+
}>();
86+
87+
const emit = defineEmits<{(e: 'update:modelValue', value: object): void }>();
88+
89+
const model = computed<object>({
90+
get: () => props.modelValue,
91+
set: (value: object) => emit('update:modelValue', value)
92+
})
93+
94+
const addRepository = () => {
95+
model.value.project.repositories.push({
96+
name: '',
97+
url: '',
98+
comment: '',
99+
})
100+
}
101+
</script>

0 commit comments

Comments
 (0)