Skip to content

Commit cbaeca7

Browse files
jpograndbanck
authored andcommitted
TFC organization icon (#1589)
* Display selected TFC organization - Add icon and 'TFC' prefix to statusBarItem text - Add organization name to Workspace view title - Add button to Workspace view to select organization * parens
1 parent bc9762d commit cbaeca7

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

package.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@
421421
"commands": [
422422
{
423423
"command": "terraform.cloud.login",
424-
"title": "Terraform Cloud: Login"
424+
"title": "HashiCorp Terraform Cloud: Login"
425425
},
426426
{
427427
"command": "terraform.generateBugReport",
@@ -502,6 +502,11 @@
502502
"title": "View raw apply log",
503503
"icon": "$(output)"
504504
},
505+
{
506+
"command": "terraform.cloud.organization.picker",
507+
"title": "HashiCorp Terraform Cloud: Pick Organization",
508+
"icon": "$(account)"
509+
},
505510
{
506511
"command": "terraform.cloud.workspaces.filterByProject",
507512
"title": "Filter by project",
@@ -565,6 +570,9 @@
565570
{
566571
"command": "terraform.cloud.run.apply.downloadLog",
567572
"when": "false"
573+
},
574+
{
575+
"command": "terraform.cloud.organization.picker"
568576
}
569577
],
570578
"view/title": [
@@ -588,6 +596,11 @@
588596
"when": "view == terraform.cloud.workspaces",
589597
"group": "navigation"
590598
},
599+
{
600+
"command": "terraform.cloud.organization.picker",
601+
"when": "view == terraform.cloud.workspaces",
602+
"group": "navigation"
603+
},
591604
{
592605
"command": "terraform.cloud.workspaces.refresh",
593606
"when": "view == terraform.cloud.workspaces",

src/features/terraformCloud.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export class TerraformCloudFeature implements vscode.Disposable {
7474
showCollapseAll: true,
7575
treeDataProvider: workspaceDataProvider,
7676
});
77+
const organization = this.context.workspaceState.get('terraform.cloud.organization', '');
78+
workspaceView.title = organization !== '' ? `Workspaces - (${organization})` : 'Workspaces';
7779

7880
this.context.subscriptions.push(runView, runDataProvider, workspaceDataProvider, workspaceView);
7981

@@ -153,6 +155,7 @@ export class TerraformCloudFeature implements vscode.Disposable {
153155
// user chose an organization so update the statusbar and make sure its visible
154156
organizationQuickPick.hide();
155157
this.statusBar.show(choice.label);
158+
workspaceView.title = `Workspace - (${choice.label})`;
156159

157160
// project filter should be cleared on org change
158161
await vscode.commands.executeCommand('terraform.cloud.workspaces.resetProjectFilter');
@@ -189,7 +192,7 @@ export class OrganizationStatusBar implements vscode.Disposable {
189192
}
190193

191194
if (organization) {
192-
this.organizationStatusBar.text = organization;
195+
this.organizationStatusBar.text = `$(account) TFC - ${organization}`;
193196
await vscode.commands.executeCommand('setContext', 'terraform.cloud.organizationsChosen', true);
194197
} else {
195198
await vscode.commands.executeCommand('setContext', 'terraform.cloud.organizationsChosen', false);

0 commit comments

Comments
 (0)