Adding authors field #1391#1392
Adding authors field #1391#1392kavya-danivas wants to merge 5 commits intoDependencyTrack:masterfrom
Conversation
Signed-off-by: kavdan1 <kavya.danivas@itk-engineering.de>
Signed-off-by: kavdan1 <kavya.danivas@itk-engineering.de>
Signed-off-by: kavdan1 <kavya.danivas@itk-engineering.de>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for multiple authors in projects by replacing the single author field with an authors array. The implementation includes a new modal component for adding authors and updates the UI to display and manage multiple author entries.
Key Changes:
- Replaced single
authorfield withauthorsarray throughout the codebase - Added
ProjectAddAuthorModal.vuecomponent for adding new authors - Updated project creation and editing flows to support multiple authors
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| ProjectDetailsModal.vue | Updated to display authors table and integrate add author functionality |
| ProjectCreateProjectModal.vue | Added embedded author management modal with add/remove capabilities |
| ProjectAddAuthorModal.vue | New reusable modal component for adding individual authors |
| Project.vue | Integrated author modal and removed deep cloning of project object |
| ComponentDetailsModal.vue | Updated component author field from author to authors |
| en.json | Added translation keys for author-related UI elements |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <b-form-textarea id="project-description-description" v-model="project.copyright" rows="3" /> | ||
| <template #cell(actions)="row"> | ||
| <b-button size="sm" variant="danger" @click="removeAuthor(row.index)"> | ||
| removeAuthor |
There was a problem hiding this comment.
Button text 'removeAuthor' should be formatted as a proper label. Consider using 'Remove Author' or adding translation support with $t('message.remove_author').
| removeAuthor | |
| {{ $t('message.remove_author') }} |
| <div> | ||
| {{ this.newAuthor.name }} | ||
| </div> |
There was a problem hiding this comment.
This debug output appears to be leftover development code and should be removed from production code.
| <div> | |
| {{ this.newAuthor.name }} | |
| </div> | |
| import { BTable, BTableLite } from 'bootstrap-vue'; | ||
| import ProjectAddVersionModal from './ProjectAddVersionModal.vue'; | ||
| import ProjectAddAuthorModal from './ProjectAddAuthorModal.vue'; |
There was a problem hiding this comment.
Imported components BTable, BTableLite, ProjectAddVersionModal, and ProjectAddAuthorModal are not registered in the components section and appear unused. Remove unused imports.
| import { BTable, BTableLite } from 'bootstrap-vue'; | |
| import ProjectAddVersionModal from './ProjectAddVersionModal.vue'; | |
| import ProjectAddAuthorModal from './ProjectAddAuthorModal.vue'; |
| this.availableParents = []; | ||
| this.collectionTags = []; | ||
| this.showCollectionTags = false; | ||
| this.project.authors = []; |
There was a problem hiding this comment.
Redundant assignment - project.authors is already reset to an empty array on line 557 within the same resetValues() method.
| this.project.authors = []; |
| </b-tabs> | ||
| <project-details-modal | ||
| :project="cloneDeep(project)" | ||
| :project="project" |
There was a problem hiding this comment.
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.
| <label> Authors</label> | ||
| <b-table | ||
| :items="project.authors" | ||
| /> |
There was a problem hiding this comment.
The table is missing column definitions (:fields prop) and appears incomplete. Either define proper columns or remove this incomplete implementation if authors are displayed elsewhere.
| }, | ||
| computed: { | ||
| isFormValid() { | ||
| return this.name && this.email && this.phone; |
There was a problem hiding this comment.
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.
| return this.name && this.email && this.phone; | |
| return this.name && this.email; |
| <div> | ||
| <b-modal | ||
| id="projectCreateProjectModal" | ||
| @ok="resetValues()" |
There was a problem hiding this comment.
Changed from @hide to @ok means resetValues() only executes when OK is clicked, not when the modal is dismissed by other means (ESC, backdrop click, X button). This could leave stale data when reopening the modal. Consider reverting to @hide or adding @cancel='resetValues()' as well.
| @ok="resetValues()" | |
| @ok="resetValues()" | |
| @cancel="resetValues()" |
Signed-off-by: kavdan1 <kavya.danivas@itk-engineering.de>
Description
This PR implements feature to add multiple author details. Issue number #1391
Addressed Issue
Resolves #1391