Skip to content

Commit

Permalink
fix: offer 'Open Helm Charts' on project node (was: cluster)(#676)
Browse files Browse the repository at this point in the history
Signed-off-by: Andre Dietisheim <[email protected]>
  • Loading branch information
adietish committed Jan 26, 2024
1 parent 3d2f8c6 commit d1dc9be
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import org.jboss.tools.intellij.openshift.actions.HelmAction;
import org.jboss.tools.intellij.openshift.telemetry.TelemetryService;
import org.jboss.tools.intellij.openshift.tree.application.ApplicationsRootNode;
import org.jboss.tools.intellij.openshift.tree.application.NamespaceNode;
import org.jboss.tools.intellij.openshift.tree.application.ParentableNode;
import org.jboss.tools.intellij.openshift.ui.helm.ChartsDialog;
import org.jboss.tools.intellij.openshift.utils.helm.Helm;
import org.jetbrains.annotations.NotNull;
Expand All @@ -24,7 +26,8 @@ public class OpenHelmChartsAction extends HelmAction {
@Override
public void actionPerformedOnSelectedObject(AnActionEvent anActionEvent, Object selected, @NotNull Helm helm) {
Project project = getEventProject(anActionEvent);
ChartsDialog dialog = new ChartsDialog((ApplicationsRootNode) selected, helm, project);
ApplicationsRootNode rootNode = ((ParentableNode<?>) selected).getRoot();
ChartsDialog dialog = new ChartsDialog(rootNode, helm, project);
sendTelemetryResults(TelemetryService.TelemetryResult.SUCCESS);
dialog.show();
}
Expand All @@ -36,7 +39,6 @@ protected String getTelemetryActionName() {

@Override
public boolean isVisible(Object selected) {
return (selected instanceof ApplicationsRootNode)
&& ((ApplicationsRootNode) selected).isLogged();
return selected instanceof NamespaceNode;
}
}
7 changes: 4 additions & 3 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -282,9 +282,6 @@
<separator/>
<action class="org.jboss.tools.intellij.openshift.actions.cluster.OpenConsoleAction" id="org.jboss.tools.intellij.openshift.actions.cluster.OpenConsoleAction" text="Open Console Dashboard"/>
<separator/>
<!-- helm -->
<action class="org.jboss.tools.intellij.openshift.actions.helm.OpenHelmChartsAction" id="org.jboss.tools.intellij.openshift.actions.helm.OpenHelmChartsAction" text="Open Helm Charts"/>
<separator/>
<action class="org.jboss.tools.intellij.openshift.actions.cluster.RefreshAction" id="org.jboss.tools.intellij.openshift.actions.cluster.RefreshAction" text="Refresh"/>
<separator/>
<action id="org.jboss.tools.intellij.openshift.actions.OpenGettingStartedAction"
Expand Down Expand Up @@ -324,6 +321,10 @@
<action class="org.jboss.tools.intellij.openshift.actions.binding.DeleteBindingAction" id="org.jboss.tools.intellij.openshift.actions.binding.DeleteBindingAction" text="Delete"/>
<!-- project level -->
<action class="org.jboss.tools.intellij.openshift.actions.project.DeleteProjectAction" id="org.jboss.tools.intellij.openshift.actions.project.DeleteProjectAction" text="Delete"/>
<separator/>
<!-- helm -->
<action class="org.jboss.tools.intellij.openshift.actions.helm.OpenHelmChartsAction" id="org.jboss.tools.intellij.openshift.actions.helm.OpenHelmChartsAction" text="Open Helm Charts"/>
<separator/>
<!-- registry management -->
<action class="org.jboss.tools.intellij.openshift.actions.registry.CreateRegistryAction" id="org.jboss.tools.intellij.openshift.actions.registry.CreateRegistryAction" text="New registry"/>
<action class="org.jboss.tools.intellij.openshift.actions.registry.DeleteRegistryAction" id="org.jboss.tools.intellij.openshift.actions.registry.DeleteRegistryAction" text="Delete"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ public AnAction getAction() {

@Override
protected void verifyProject(boolean visible) {
assertFalse(visible);
}

@Override
protected void verifyLoggedInCluster(boolean visible) {
assertTrue(visible);
}

}

0 comments on commit d1dc9be

Please sign in to comment.