Skip to content

Commit

Permalink
chore: last round of cleanup before approval (#5)
Browse files Browse the repository at this point in the history
Final round of cleanup before approval

- cleanup the results
  • Loading branch information
Owen authored Jun 30, 2024
1 parent 9f2ae46 commit 427f5eb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ClearResultsAction : AnAction() {
val toolWindow = ToolWindowManager.getInstance(project!!).getToolWindow(TOOL_WINDOW_ID)
val content = toolWindow!!.contentManager.getContent(0)
val infracostWindow = content!!.component as InfracostWindow
infracostWindow.clearModel()

infracostWindow.redraw()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ import java.io.File
import java.io.IOException

/**
* ResultProcessor takes the results finding and unmarshalls to object Then updates the findings
* window
* ResultProcessor takes the results and unmarshal to object then sets the model for the tree window
*/
object ResultProcessor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import java.io.InputStreamReader
import java.util.function.Consumer
import javax.swing.SwingUtilities

@Suppress("DialogTitleCapitalization")
internal class InfracostAuthRunTask(
private val project: Project,
private val callback: Consumer<Boolean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class InfracostSettingsComponent {

init {
infracostPath.addBrowseFolderListener(
"infracost binary path",
"Infracost binary path",
"Set the explicit path to infracost",
ProjectManager.getInstance().defaultProject,
FileChooserDescriptorFactory.createSingleFileDescriptor())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.infracost.plugins.infracost.ui

import com.intellij.ui.JBColor
import io.infracost.plugins.infracost.icons.InfracostIcons
import io.infracost.plugins.infracost.model.File
import io.infracost.plugins.infracost.model.InfracostProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@ import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.fileEditor.OpenFileDescriptor
import com.intellij.openapi.project.Project
import com.intellij.openapi.ui.SimpleToolWindowPanel
import com.intellij.openapi.ui.VerticalFlowLayout
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.ui.components.JBPanel
import com.intellij.ui.components.JBScrollPane
import com.intellij.ui.treeStructure.Tree
import io.infracost.plugins.infracost.actions.CheckAuthAction
import io.infracost.plugins.infracost.actions.ResultProcessor
import io.infracost.plugins.infracost.actions.RunAuthAction
import io.infracost.plugins.infracost.model.Resource
import java.awt.Panel
import java.awt.event.MouseAdapter
import java.awt.event.MouseEvent
import java.nio.file.Paths
Expand Down Expand Up @@ -113,6 +110,10 @@ class InfracostWindow(private val project: Project) : SimpleToolWindowPanel(fals
}
}

fun clearModel() {
this.root?.model = null
}

fun refreshModel() {
if (ResultProcessor.model == null) {
return
Expand Down

0 comments on commit 427f5eb

Please sign in to comment.