From 6c376167c33b3d5184a3f28f3855f80f44c0df53 Mon Sep 17 00:00:00 2001 From: DariusZdroba Date: Tue, 17 Dec 2024 14:03:17 +0200 Subject: [PATCH] fix: update root node branch name on changing base branch --- .../plugin/ui/toolwindow/SnykToolWindowPanel.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/kotlin/io/snyk/plugin/ui/toolwindow/SnykToolWindowPanel.kt b/src/main/kotlin/io/snyk/plugin/ui/toolwindow/SnykToolWindowPanel.kt index a861f1507..53742cae4 100644 --- a/src/main/kotlin/io/snyk/plugin/ui/toolwindow/SnykToolWindowPanel.kt +++ b/src/main/kotlin/io/snyk/plugin/ui/toolwindow/SnykToolWindowPanel.kt @@ -552,8 +552,21 @@ class SnykToolWindowPanel( val newContainerTreeNodeText = getNewContainerTreeNodeText(settings, containerResultsCount, addHMLPostfix) newContainerTreeNodeText?.let { rootContainerIssuesTreeNode.userObject = it } + + val newRootTreeNodeText = getNewRootTreeNodeText() + newRootTreeNodeText.let { rootTreeNode.info = it } } + private fun getNewRootTreeNodeText() : String { + val folderConfig = service().getFolderConfig(project.basePath.toString()) + if (folderConfig?.let { + getRootNodeText( + it.folderPath, + it.baseBranch + ) + } != null) return folderConfig.let { getRootNodeText(it.folderPath, it.baseBranch) } + return "Choose branch on ${project.basePath}" + } private fun getNewContainerTreeNodeText( settings: SnykApplicationSettingsStateService, containerResultsCount: Int?,