Skip to content

Commit 7d7ddac

Browse files
committed
Add default command and menu for node 'Please login to the cluster'
Fix #1438. Signed-off-by: Denis Golovin <dgolovin@redhat.com>
1 parent 8191cf4 commit 7d7ddac

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
},
243243
{
244244
"command": "openshift.explorer.login",
245-
"title": "Log in to cluster",
245+
"title": "Login into Cluster",
246246
"category": "OpenShift",
247247
"icon": {
248248
"dark": "images/title/dark/icon-login.svg",
@@ -1073,6 +1073,14 @@
10731073
"command": "clusters.openshift.route.open",
10741074
"group": "2@0",
10751075
"when": "view == extension.vsKubernetesExplorer && viewItem =~ /vsKubernetes\\.resource\\.route/i"
1076+
},
1077+
{
1078+
"command": "openshift.explorer.login.tokenLogin",
1079+
"when": "view == openshiftProjectExplorer && viewItem == loginRequired"
1080+
},
1081+
{
1082+
"command": "openshift.explorer.login.credentialsLogin",
1083+
"when": "view == openshiftProjectExplorer && viewItem == loginRequired"
10761084
}
10771085
]
10781086
},

src/odo.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
/* TODO Review classes hierarchy */
1313

14-
import { ProviderResult, TreeItemCollapsibleState, window, Terminal, Uri, commands, QuickPickItem, workspace, WorkspaceFoldersChangeEvent, WorkspaceFolder, Disposable } from 'vscode';
14+
import { ProviderResult, TreeItemCollapsibleState, window, Terminal, Uri, commands, QuickPickItem, workspace, WorkspaceFoldersChangeEvent, WorkspaceFolder, Command as VSCommand, Disposable } from 'vscode';
1515
import * as path from 'path';
1616
import { statSync } from 'fs';
1717
import { Subject } from 'rxjs';
@@ -421,6 +421,15 @@ export class OpenShiftObjectImpl implements OpenShiftObject {
421421
return label;
422422
}
423423

424+
get command(): VSCommand {
425+
if (this.contextValue === ContextType.LOGIN_REQUIRED) {
426+
return {
427+
command: 'openshift.explorer.login',
428+
title: 'Login to the cluster',
429+
};
430+
}
431+
}
432+
424433
get description(): string {
425434
let suffix = '';
426435
if (this.contextValue === ContextType.COMPONENT) {

0 commit comments

Comments
 (0)