Skip to content
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: offer 'Open Helm Charts' on project node (was: cluster)(#676) #677

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}

}
Loading