Skip to content

Commit d1b7182

Browse files
committed
[WIP] remove cluster -> clusterViewLoader cycle
Signed-off-by: David Thompson <davthomp@redhat.com>
1 parent 2dd1e81 commit d1b7182

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/openshift/cluster.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*-----------------------------------------------------------------------------------------------*/
55

66
import { KubernetesObject } from '@kubernetes/client-node';
7-
import { commands, env, ExtensionContext, Progress as VProgress, QuickInputButton, QuickPickItem, QuickPickItemButtonEvent, Terminal, ThemeIcon, Uri, WebviewPanel, window, workspace } from 'vscode';
7+
import { commands, env, ExtensionContext, Progress as VProgress, QuickInputButton, QuickPickItem, QuickPickItemButtonEvent, Terminal, ThemeIcon, Uri, window, workspace } from 'vscode';
88
import { CliChannel } from '../cli';
99
import { getInstance } from '../odo';
1010
import { Command } from '../odo/command';
@@ -16,7 +16,6 @@ import { Platform } from '../util/platform';
1616
import { Progress } from '../util/progress';
1717
import { WindowUtil } from '../util/windowUtils';
1818
import { vsCommand, VsCommandError } from '../vscommand';
19-
import ClusterViewLoader from '../webview/cluster/clusterViewLoader';
2019
import OpenShiftItem, { clusterRequired } from './openshiftItem';
2120
import fetch = require('make-fetch-happen');
2221

@@ -224,14 +223,6 @@ export class Cluster extends OpenShiftItem {
224223
});
225224
}
226225

227-
@vsCommand('openshift.explorer.addCluster')
228-
static async add(value: string): Promise<void> {
229-
const webViewPanel: WebviewPanel = await ClusterViewLoader.loadView('Add OpenShift Cluster');
230-
if(value?.length > 0){
231-
await webViewPanel.webview.postMessage({action: 'cluster', param: value});
232-
}
233-
}
234-
235226
@vsCommand('openshift.explorer.stopCluster')
236227
static async stop(): Promise<void> {
237228
let pathSelectionDialog;

src/webview/cluster/clusterViewLoader.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,14 @@ export default class ClusterViewLoader {
333333
});
334334
}
335335

336+
@vsCommand('openshift.explorer.addCluster')
337+
static async add(value: string): Promise<void> {
338+
const webViewPanel: vscode.WebviewPanel = await ClusterViewLoader.loadView('Add OpenShift Cluster');
339+
if(value?.length > 0){
340+
await webViewPanel.webview.postMessage({action: 'cluster', param: value});
341+
}
342+
}
343+
336344
static async crcSaveSettings(event) {
337345
const cfg = vscode.workspace.getConfiguration('openshiftToolkit');
338346
await cfg.update('crcBinaryLocation', event.crcLoc, vscode.ConfigurationTarget.Global);

0 commit comments

Comments
 (0)