Skip to content

Commit bb3278e

Browse files
Adding frontend support for component notes - DependencyTrack/dependency-track#682
1 parent b0924b6 commit bb3278e

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

src/i18n/locales/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@
243243
"package_url": "Package URL (PURL)",
244244
"conditions": "Conditions",
245245
"condition": "Condition",
246-
"condition_deleted": "Condition deleted"
246+
"condition_deleted": "Condition deleted",
247+
"notes": "Notes"
247248
},
248249
"admin": {
249250
"configuration": "Configuration",

src/views/portfolio/projects/ComponentDetailsModal.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,18 @@
9090
:readonly="this.isNotPermitted(PERMISSIONS.PORTFOLIO_MANAGEMENT)" />
9191
</b-card>
9292
</b-tab>
93+
<b-tab>
94+
<template v-slot:title><i class="fa fa-file-text-o"></i> {{ $t('message.notes') }}</template>
95+
<b-card>
96+
<b-form-group
97+
id="component-notes-form-group"
98+
:label="this.$t('message.notes')"
99+
label-for="component-notes-input">
100+
<b-form-textarea id="component-notes-description" v-model="component.notes" rows="3"
101+
:readonly="this.isNotPermitted(PERMISSIONS.PORTFOLIO_MANAGEMENT)" />
102+
</b-form-group>
103+
</b-card>
104+
</b-tab>
93105
</b-tabs>
94106
<template v-slot:modal-footer="{ cancel }">
95107
<b-button size="md" variant="outline-danger" @click="deleteComponent()" v-permission="PERMISSIONS.PORTFOLIO_MANAGEMENT">{{ $t('message.delete') }}</b-button>
@@ -158,7 +170,8 @@
158170
sha256: this.component.sha256,
159171
sha512: this.component.sha512,
160172
sha3_256: this.component.sha3_256,
161-
sha3_512: this.component.sha3_512
173+
sha3_512: this.component.sha3_512,
174+
notes: this.component.notes
162175
}).then((response) => {
163176
this.$emit('componentUpdated', response.data);
164177
this.$toastr.s(this.$t('message.component_updated'));

src/views/portfolio/projects/ProjectAddComponentModal.vue

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@
7373
required="false" :label="$t('message.sha3_512')" :tooltip="$t('message.component_hash_desc')" />
7474
</b-card>
7575
</b-tab>
76+
<b-tab>
77+
<template v-slot:title><i class="fa fa-file-text-o"></i> {{ $t('message.notes') }}</template>
78+
<b-card>
79+
<b-form-group
80+
id="component-notes-form-group"
81+
:label="this.$t('message.notes')"
82+
label-for="component-notes-input">
83+
<b-form-textarea id="component-notes-description" v-model="component.notes" rows="3" />
84+
</b-form-group>
85+
</b-card>
86+
</b-tab>
7687
</b-tabs>
7788
<template v-slot:modal-footer="{ cancel }">
7889
<b-button size="md" variant="secondary" @click="cancel()">{{ $t('message.close') }}</b-button>
@@ -138,7 +149,8 @@
138149
sha256: this.component.sha256,
139150
sha512: this.component.sha512,
140151
sha3_256: this.component.sha3_256,
141-
sha3_512: this.component.sha3_512
152+
sha3_512: this.component.sha3_512,
153+
notes: this.component.notes
142154
}).then((response) => {
143155
this.$emit('refreshTable');
144156
this.$toastr.s(this.$t('message.component_created'));
@@ -165,7 +177,8 @@
165177
sha256: null,
166178
sha512: null,
167179
sha3_256: null,
168-
sha3_512: null
180+
sha3_512: null,
181+
notes: null
169182
}
170183
},
171184
retrieveLicenses: function() {

0 commit comments

Comments
 (0)