|
195 | 195 | <bootstrap-toggle v-model="isSuppressed" :options="{ on: 'Suppressed', off: 'Suppress', onstyle: 'warning', offstyle: 'outline-disabled'}" :disabled="false" /> |
196 | 196 | </b-input-group> |
197 | 197 | </b-form-group> |
| 198 | + <b-row> |
| 199 | + <b-col sm="6"> |
| 200 | + <b-form-group id="fieldset-10" :label="this.$t('message.justification')" label-for="input-10"> |
| 201 | + <b-input-group id="input-10"> |
| 202 | + <b-form-select v-model="analysisJustification" :options="justificationChoices" @change="makeAnalysis" :disabled="analysisState !== 'NOT_AFFECTED'"/> |
| 203 | + </b-input-group> |
| 204 | + </b-form-group> |
| 205 | + </b-col> |
| 206 | + <b-col sm="6"> |
| 207 | + <b-form-group id="fieldset-11" :label="this.$t('message.response')" label-for="input-11"> |
| 208 | + <b-input-group id="input-11"> |
| 209 | + <b-form-select v-model="analysisResponse" :options="responseChoices" @change="makeAnalysis"/> |
| 210 | + </b-input-group> |
| 211 | + </b-form-group> |
| 212 | + </b-col> |
| 213 | + </b-row> |
| 214 | + <b-form-group id="fieldset-12" :label="this.$t('message.details')" label-for="analysisDetailsField"> |
| 215 | + <b-form-textarea id="analysisDetailsField" v-model="analysisDetails" rows="7" class="form-control" |
| 216 | + v-debounce:750ms="makeAnalysis" :debounce-events="'keyup'"/> |
| 217 | + </b-form-group> |
198 | 218 | </b-col> |
199 | 219 | </b-row> |
200 | 220 | `, |
|
208 | 228 | { value: 'NOT_SET', text: this.$t('message.not_set') }, |
209 | 229 | { value: 'EXPLOITABLE', text: this.$t('message.exploitable') }, |
210 | 230 | { value: 'IN_TRIAGE', text: this.$t('message.in_triage') }, |
| 231 | + { value: 'RESOLVED', text: this.$t('message.resolved') }, |
211 | 232 | { value: 'FALSE_POSITIVE', text: this.$t('message.false_positive') }, |
212 | | - { value: 'NOT_AFFECTED', text: this.$t('message.not_affected') } |
| 233 | + { value: 'NOT_AFFECTED', text: this.$t('message.not_affected') }, |
| 234 | + ], |
| 235 | + justificationChoices: [ |
| 236 | + { value: 'NOT_SET', text: this.$t('message.not_set') }, |
| 237 | + { value: 'CODE_NOT_PRESENT', text: this.$t('message.code_not_present') }, |
| 238 | + { value: 'CODE_NOT_REACHABLE', text: this.$t('message.code_not_reachable') }, |
| 239 | + { value: 'REQUIRES_CONFIGURATION', text: this.$t('message.requires_configuration') }, |
| 240 | + { value: 'REQUIRES_DEPENDENCY', text: this.$t('message.requires_dependency') }, |
| 241 | + { value: 'REQUIRES_ENVIRONMENT', text: this.$t('message.requires_environment') }, |
| 242 | + { value: 'PROTECTED_BY_COMPILER', text: this.$t('message.protected_by_compiler') }, |
| 243 | + { value: 'PROTECTED_AT_RUNTIME', text: this.$t('message.protected_at_runtime') }, |
| 244 | + { value: 'PROTECTED_AT_PERIMETER', text: this.$t('message.protected_at_perimeter') }, |
| 245 | + { value: 'PROTECTED_BY_MITIGATING_CONTROL', text: this.$t('message.protected_by_mitigating_control') } |
| 246 | + ], |
| 247 | + responseChoices: [ |
| 248 | + { value: 'NOT_SET', text: this.$t('message.not_set') }, |
| 249 | + { value: 'CAN_NOT_FIX', text: this.$t('message.can_not_fix') }, |
| 250 | + { value: 'WILL_NOT_FIX', text: this.$t('message.will_not_fix') }, |
| 251 | + { value: 'UPDATE', text: this.$t('message.update') }, |
| 252 | + { value: 'ROLLBACK', text: this.$t('message.rollback') }, |
| 253 | + { value: 'WORKAROUND_AVAILABLE', text: this.$t('message.workaround_available') } |
213 | 254 | ], |
214 | 255 | analysisState: null, |
| 256 | + analysisJustification: null, |
| 257 | + analysisResponse: null, |
| 258 | + analysisDetails: null, |
215 | 259 | projectUuid: projectUuid |
216 | 260 | } |
217 | 261 | }, |
218 | 262 | watch: { |
219 | 263 | isSuppressed: function (currentValue, oldValue) { |
220 | 264 | if (oldValue != null) { |
221 | | - this.callRestEndpoint(this.analysisState, null, currentValue); |
| 265 | + this.callRestEndpoint(this.analysisState, null, null, null, null, currentValue); |
222 | 266 | } |
223 | 267 | } |
224 | 268 | }, |
|
247 | 291 | if (Object.prototype.hasOwnProperty.call(analysis, "analysisState")) { |
248 | 292 | this.analysisState = analysis.analysisState; |
249 | 293 | } |
| 294 | + if (Object.prototype.hasOwnProperty.call(analysis, "analysisJustification")) { |
| 295 | + this.analysisJustification = analysis.analysisJustification; |
| 296 | + } |
| 297 | + if (Object.prototype.hasOwnProperty.call(analysis, "analysisResponse")) { |
| 298 | + this.analysisResponse = analysis.analysisResponse; |
| 299 | + } |
| 300 | + if (Object.prototype.hasOwnProperty.call(analysis, "analysisDetails")) { |
| 301 | + this.analysisDetails = analysis.analysisDetails; |
| 302 | + } |
250 | 303 | if (Object.prototype.hasOwnProperty.call(analysis, "isSuppressed")) { |
251 | 304 | this.isSuppressed = analysis.isSuppressed; |
252 | 305 | } else { |
253 | 306 | this.isSuppressed = false; |
254 | 307 | } |
255 | 308 | }, |
256 | 309 | makeAnalysis: function() { |
257 | | - this.callRestEndpoint(this.analysisState, null, null); |
| 310 | + this.callRestEndpoint(this.analysisState, this.analysisJustification, this.analysisResponse, this.analysisDetails, null, null); |
258 | 311 | }, |
259 | 312 | addComment: function() { |
260 | 313 | if (this.comment != null) { |
261 | | - this.callRestEndpoint(this.analysisState, this.comment, null); |
| 314 | + this.callRestEndpoint(this.analysisState, this.analysisJustification, this.analysisResponse, this.analysisDetails, this.comment, null); |
262 | 315 | } |
263 | 316 | }, |
264 | | - callRestEndpoint: function(analysisState, comment, isSuppressed) { |
| 317 | + callRestEndpoint: function(analysisState, analysisJustification, analysisResponse, analysisDetails, comment, isSuppressed) { |
265 | 318 | let url = `${this.$api.BASE_URL}/${this.$api.URL_ANALYSIS}`; |
266 | 319 | this.axios.put(url, { |
267 | 320 | project: projectUuid, |
268 | 321 | component: this.finding.component.uuid, |
269 | 322 | vulnerability: this.finding.vulnerability.uuid, |
270 | 323 | analysisState: analysisState, |
| 324 | + analysisJustification: analysisJustification, |
| 325 | + analysisResponse: analysisResponse, |
| 326 | + analysisDetails: analysisDetails, |
271 | 327 | comment: comment, |
272 | 328 | isSuppressed: isSuppressed |
273 | 329 | }).then((response) => { |
|
0 commit comments