Skip to content

Commit

Permalink
add commands and icons to refresh sources and deployments (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
usernamehw committed Sep 18, 2021
1 parent f59da94 commit 659b0e4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
"onCommand:gitops.kubectl.version",
"onCommand:gitops.flux.checkPrerequisites",
"onCommand:gitops.views.refreshTreeViews",
"onCommand:gitops.views.refreshSourceTreeView",
"onCommand:gitops.views.refreshDeploymentTreeView",
"onCommand:gitops.editor.openResource",
"onView:gitops.views.clusters",
"onView:gitops.views.sources",
Expand All @@ -60,6 +62,18 @@
"category": "GitOps",
"icon": "$(refresh)"
},
{
"command": "gitops.views.refreshSourceTreeView",
"title": "Refresh Sources tree view",
"category": "GitOps",
"icon": "$(refresh)"
},
{
"command": "gitops.views.refreshDeploymentTreeView",
"title": "Refresh Deployment tree view",
"category": "GitOps",
"icon": "$(refresh)"
},
{
"command": "gitops.editor.openResource",
"title": "View Config",
Expand Down Expand Up @@ -132,6 +146,16 @@
"command": "gitops.views.refreshTreeViews",
"group": "navigation",
"when": "view == gitops.views.clusters"
},
{
"command": "gitops.views.refreshSourceTreeView",
"group": "navigation",
"when": "view == gitops.views.sources"
},
{
"command": "gitops.views.refreshDeploymentTreeView",
"group": "navigation",
"when": "view == gitops.views.deployments"
}
],
"view/item/context": [],
Expand Down
10 changes: 9 additions & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ import {
Uri
} from 'vscode';
import { kubernetesTools } from './kubernetes/kubernetesTools';
import { refreshTreeViews } from './views/treeViews';
import {
refreshDeploymentTreeView,
refreshSourceTreeView,
refreshTreeViews
} from './views/treeViews';
import { runTerminalCommand } from './gitOps';

/**
Expand All @@ -24,6 +28,8 @@ export enum ViewCommands {
Open = 'vscode.open',
SetContext = 'setContext',
RefreshTreeViews = 'gitops.views.refreshTreeViews',
RefreshSourceTreeView = 'gitops.views.refreshSourceTreeView',
RefreshDeploymentTreeView = 'gitops.views.refreshDeploymentTreeView',
}

/**
Expand Down Expand Up @@ -52,6 +58,8 @@ export function registerCommands(context: ExtensionContext) {
registerCommand(KubectlCommands.Version, showKubectlVersion);
registerCommand(KubectlCommands.SetCurrentContext, setKubernetesClusterContext);
registerCommand(ViewCommands.RefreshTreeViews, refreshTreeViews);
registerCommand(ViewCommands.RefreshSourceTreeView, refreshSourceTreeView);
registerCommand(ViewCommands.RefreshDeploymentTreeView, refreshDeploymentTreeView);
registerCommand(FluxCommands.CheckPrerequisites, checkFluxPrerequisites);

// add open gitops resource in vscode editor command
Expand Down

1 comment on commit 659b0e4

@usernamehw
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate issue link: #75

Please sign in to comment.