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

Configure command enablement #1643

Merged
merged 2 commits into from
Jan 8, 2024
Merged

Configure command enablement #1643

merged 2 commits into from
Jan 8, 2024

Conversation

jpogran
Copy link
Contributor

@jpogran jpogran commented Nov 28, 2023

  • Hide Terraform Cloud commands
  • Use proper titles for Terraform commands

Before:

image

After:

With TFC disabled:

image

With TFC enabled and not logged in:

image

With TFC enabled and logged in:

image

@jpogran jpogran self-assigned this Nov 28, 2023
@jpogran jpogran changed the title configue command enablement Configure command enablement Nov 28, 2023
@jpogran jpogran force-pushed the configue_command_enablement branch 2 times, most recently from 719ff3e to df0652a Compare November 29, 2023 16:44
@jpogran
Copy link
Contributor Author

jpogran commented Nov 29, 2023

Needs #1644 for tests to be fixed

@jpogran jpogran added the terraform-cloud Features or bugs related to TFC integration in the editor label Nov 29, 2023
@jpogran jpogran marked this pull request as ready for review November 29, 2023 17:10
@jpogran jpogran requested a review from a team as a code owner November 29, 2023 17:10
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

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

I have to say I don't love the HashiCorp prefix as it makes everything quite verbose in places but that's more a reflection on the whole Marketplace and VS Code situation in general - as in I don't love it in the extension name either. It is certainly not a reflection on your PR here! 😅

It dampens the impact of those newly introduced commands, so LGTM aside from the minor questions in-line.

src/features/terraformCloud.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
@jpogran jpogran marked this pull request as draft December 19, 2023 17:06
@jpogran jpogran force-pushed the configue_command_enablement branch from 19f66bb to 79f5476 Compare January 8, 2024 15:59
@jpogran jpogran marked this pull request as ready for review January 8, 2024 16:06
This commit hides all Terraform Cloud commands when the user is not logged in. This is done by adding an `enablement` property to each commadn that checks that context value for `terraform.cloud.signed-in` is true.

This commit also adds a new context value `terraform.cloud.views.visible` that is set to true when the TFC workspace view is visible. This is the closest thing we get to knowing if the user has enabled our views since the Activity Bar icon does not have a event for visiblity. This is used in conjunction with the `terraform.cloud.signed-in` context value to hide the TFC commands when the user is not logged in.
This adds HashiCorp to the command names to disambiguate commands contributed by this extension and align to the Terraform Cloud contributed commands.
@jpogran jpogran force-pushed the configue_command_enablement branch from 79f5476 to 4ee42f6 Compare January 8, 2024 18:17
@jpogran jpogran merged commit 8e897b0 into main Jan 8, 2024
18 checks passed
@jpogran jpogran deleted the configue_command_enablement branch January 8, 2024 18:19
@jpogran jpogran mentioned this pull request Jan 12, 2024
1 task
Copy link

github-actions bot commented Feb 8, 2024

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
terraform-cloud Features or bugs related to TFC integration in the editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants