80
80
v-if =" !isFixAvailable"
81
81
@click =" generateFix"
82
82
class =" mr-8 button-theme-primary"
83
- :disabled =" isGenerateFixLoading"
83
+ :disabled =" isGenerateFixLoading || isGenerateFixDisabled "
84
84
>
85
85
Generate Fix
86
86
</button >
87
87
<button v-if =" isFixAvailable" @click =" applyFix" class =" mr-8 button-theme-primary" >Accept Fix</button >
88
- <button v-if =" isFixAvailable" @click =" regenerateFix" class =" mr-8 button-theme-secondary" >Regenerate Fix</button >
88
+ <button
89
+ v-if =" isFixAvailable"
90
+ @click =" regenerateFix"
91
+ class =" mr-8 button-theme-secondary"
92
+ :disabled =" isGenerateFixDisabled"
93
+ >
94
+ Regenerate Fix
95
+ </button >
89
96
<button @click =" explainWithQ" class =" mr-8 button-theme-secondary" >Explain</button >
90
97
<button @click =" ignoreIssue" class =" mr-8 button-theme-secondary" >Ignore</button >
91
98
<button @click =" ignoreAllIssues" class =" mr-8 button-theme-secondary" >Ignore All</button >
@@ -104,6 +111,7 @@ import criticalSeverity from '../../../../../resources/images/severity-critical.
104
111
import markdownIt from ' markdown-it'
105
112
import hljs from ' highlight.js'
106
113
import { CodeScanIssue } from ' ../../../models/model'
114
+ import { sasRuleId } from ' ../../../models/constants'
107
115
108
116
const client = WebviewClientFactory .create <SecurityIssueWebview >()
109
117
const severityImages: Record <string , string > = {
@@ -197,6 +205,7 @@ export default defineComponent({
197
205
fixedCode: ' ' ,
198
206
referenceText: ' ' ,
199
207
referenceSpan: [0 , 0 ],
208
+ isGenerateFixDisabled: false ,
200
209
}
201
210
},
202
211
created() {
@@ -277,6 +286,7 @@ export default defineComponent({
277
286
this .endLine = issue .endLine
278
287
this .isFixAvailable = false
279
288
this .isFixDescriptionAvailable = false
289
+ this .isGenerateFixDisabled = issue .ruleId === sasRuleId
280
290
if (suggestedFix ) {
281
291
this .isFixAvailable = !! suggestedFix .code && suggestedFix .code ?.trim () !== ' '
282
292
this .suggestedFix = suggestedFix .code ?? ' '
0 commit comments