Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
3 changes: 3 additions & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@
"add_license": "Add License",
"add_tag": "Add Tag",
"add_version": "Add Version",
"add_author": "Add Author",
"administration": "Administration",
"affected_components": "Affected Components",
"affected_projects": "Affected Projects",
Expand Down Expand Up @@ -770,6 +771,8 @@
"project_metadata_supplier_name_desc": "The organization that supplied the BOM",
"project_name": "Project Name",
"project_name_desc": "The name of the project or component as provided by the supplier",
"project_author":"Authors",
"project_author_desc": "The author of the project",
"project_properties": "Project Properties",
"project_reanalyze": "Reanalyze",
"project_reanalyze_requested": "A Project Vulnerability Analysis has been requested. Project vulnerability data will be updated when the reanalysis task has completed.",
Expand Down
4 changes: 2 additions & 2 deletions src/views/portfolio/projects/ComponentDetailsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
id="component-author-input"
input-group-size="mb-3"
type="text"
v-model="component.author"
v-model="component.authors"
required="false"
:label="$t('message.component_author')"
:tooltip="this.$t('message.component_author_desc')"
Expand Down Expand Up @@ -548,7 +548,7 @@ export default {
name: this.component.name,
version: this.component.version,
group: this.component.group,
author: this.component.author,
authors: this.component.authors,
description: this.component.description,
license: this.selectedLicense,
licenseExpression: this.component.licenseExpression,
Expand Down
11 changes: 10 additions & 1 deletion src/views/portfolio/projects/Project.vue
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,14 @@
</b-tab>
</b-tabs>
<project-details-modal
:project="cloneDeep(project)"
:project="project"
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing cloneDeep() means the modal now receives a direct reference to the project object. Modifications in the modal will mutate the parent's data directly, potentially causing unintended side effects if changes are cancelled. Consider restoring the deep clone or implementing proper change handling.

Copilot uses AI. Check for mistakes.
:uuid="this.uuid"
v-on:projectUpdated="syncProjectFields"
/>
<project-properties-modal :uuid="this.uuid" />
<project-create-property-modal :uuid="this.uuid" />
<project-add-version-modal :uuid="this.uuid" />
<project-add-author-modal :uuid="this.uuid" @author-added="addAuthor"/>
</div>
</template>

Expand All @@ -412,6 +413,7 @@ import ProjectDetailsModal from './ProjectDetailsModal';
import ProjectPropertiesModal from './ProjectPropertiesModal';
import ProjectCreatePropertyModal from './ProjectCreatePropertyModal';
import ProjectAddVersionModal from './ProjectAddVersionModal';
import ProjectAddAuthorModal from './ProjectAddAuthorModal.vue';
import ProjectFindings from './ProjectFindings';
import ProjectPolicyViolations from './ProjectPolicyViolations';
import ProjectEpss from './ProjectEpss';
Expand All @@ -424,6 +426,7 @@ export default {
ProjectPolicyViolations,
ProjectFindings,
ProjectAddVersionModal,
ProjectAddAuthorModal,
ProjectCreatePropertyModal,
ProjectPropertiesModal,
ProjectDetailsModal,
Expand Down Expand Up @@ -520,6 +523,12 @@ export default {
};
},
methods: {
addAuthor(newAuthor) {
if (!this.project.authors) {
this.project.authors = [];
}
this.project.authors.push(newAuthor);
},
cloneDeep: function (component) {
return cloneDeep(component);
},
Expand Down
59 changes: 59 additions & 0 deletions src/views/portfolio/projects/ProjectAddAuthorModal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!-- ProjectAddAuthorModal.vue -->
<template>
<b-modal id="projectAddAuthorModal" title="Add Author" hide-footer>
<b-form @submit.prevent="handleSubmit">
<b-form-group label="Name" label-for="nameInput">
<b-form-input id="nameInput" v-model="name" placeholder="Enter name" />
</b-form-group>

<b-form-group label="Email" label-for="emailInput">
<b-form-input id="emailInput" v-model="email" type="email" placeholder="Enter email" />
</b-form-group>

<b-form-group label="Phone" label-for="phoneInput">
<b-form-input id="phoneInput" v-model="phone" type="tel" placeholder="Enter phone number" />
</b-form-group>

<div class="d-flex justify-content-end">
<b-button variant="secondary" @click="$bvModal.hide('projectAddAuthorModal')">
Close
</b-button>
<b-button :disabled="!isFormValid" variant="primary" type="submit" class="ml-2">
Submit
</b-button>
</div>
</b-form>
</b-modal>
</template>

<script>
export default {
name: "ProjectAddAuthorModal",
data() {
return {
name: "",
email: "",
phone: "",
};
},
computed: {
isFormValid() {
return this.name && this.email && this.phone;
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Form validation requires phone to be filled, but phone is not marked as required in the form group (line 13-15) and should be optional based on typical contact information patterns. Remove this.phone from the validation condition or mark the phone field as required in the UI.

Suggested change
return this.name && this.email && this.phone;
return this.name && this.email;

Copilot uses AI. Check for mistakes.
},
},
methods: {
handleSubmit() {
const newAuthor = {
name: this.name,
email: this.email,
phone: this.phone,
};
this.$emit("author-added", newAuthor);
this.name = "";
this.email = "";
this.phone = "";
this.$bvModal.hide("projectAddAuthorModal");
}
}
};
</script>
Loading