-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add iac ignore button [IDE-683] #634
Conversation
src/main/kotlin/io/snyk/plugin/ui/toolwindow/panels/JCEFDescriptionPanel.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/io/snyk/plugin/ui/toolwindow/panels/JCEFDescriptionPanel.kt
Outdated
Show resolved
Hide resolved
@@ -209,7 +233,6 @@ class SuggestionDescriptionPanelFromLS( | |||
|
|||
private fun getCustomScript(): String { | |||
return """ | |||
(function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When extracting the script to migrate it to Language Server, we need acces to some variables which are locked in the scope of this self invoked function and can't be accessed outside,
we can have all the logic encapsulated in a self invoked function in Language Server, that would require some minimal changes to all IDE's that inject scripts.
Description
This provides the logic to ignore an IaC finding for a specific file in the IntelliJ plugin, the ignore button is implicitly hidden and set to show in IntelliJ only.
The HTML panel that comes from the Language Server receives dynamic attributes with injected values such as the
path
andIssue.ID
, these are extracted in a custom JS script and called through a callback when clicking ignore button , this triggers theIgnoreHandler
.In the
IgnoreHandler
theIgnoreService
is called which calls calls the CLI through the LS Wrapper to execute thesnyk ignore
command on the specified params.This path and issue id comes injected in the HTML template which comes from Snyk LS.
Checklist
Screenshots / GIFs
Visuals that may help the reviewer. Please add screenshots for any UI change. GIFs are most welcome!