-
Notifications
You must be signed in to change notification settings - Fork 27
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
Remove edit button only for terraform enterprise #2564
Merged
rmainwork
merged 7 commits into
main
from
rm/remove-edit-button-only-for-terraform-enterprise
Sep 12, 2024
Merged
Remove edit button only for terraform enterprise #2564
rmainwork
merged 7 commits into
main
from
rm/remove-edit-button-only-for-terraform-enterprise
Sep 12, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Since `isHcp` and `isSentinel` aren't used elsewhere, this expression can be simplified down to a one-liner Co-authored-by: Heat Hamilton <[email protected]>
This will hide the "Edit on GitHub" link for terraform enterprise only
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
π¦ Next.js Bundle AnalysisThis analysis was generated by the next.js bundle analysis action π€ This PR introduced no changes to the javascript bundle π |
Since logic was implemented in the loader to hide the "Edit this page on GitHub" link for PTFE, it makes sense to move the other (similar) logic there too to keep everything together. Additionally, this also allows the expression to be cleaned up to use `this.opts.product` and `Array.includes()` to detect private repos.
rmainwork
force-pushed
the
rm/remove-edit-button-only-for-terraform-enterprise
branch
from
September 11, 2024 13:15
8831d65
to
b6253f4
Compare
RubenSandwich
approved these changes
Sep 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. ππ»
heatlikeheatwave
approved these changes
Sep 12, 2024
rmainwork
deleted the
rm/remove-edit-button-only-for-terraform-enterprise
branch
September 12, 2024 18:16
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π Relevant links
ποΈ What
Hide "Edit this page on GitHub" link for PTFE since (most) people looking at the page will be unable to do so and clicking the link takes them to a 404.
π€· Why
The initial implementation of this ticket was driven by this support request that came in because a customer had pointed out that the "Edit this page on GitHub" link took them to a 404. This PR was in turn a re-hash of #2540 (which turned out to be too broad and hid the link for ALL Terraform docs - which turned out not to be correct) after it was reverted by #2562.
π οΈ How
The initial implementation checked for
product.slug + currentPathUnderProduct !== 'terraform/enterprise'
which works but is a little messy. Shout-out to @heatlikeheatwave who instead proposed checking the JSON returned byfetchDocument
to determine if the product was PTFE(rather than string matching the URL). They also suggested moving this logic(and related logic forisPublicContentRepo
) out of server.ts and into the loader(which is much cleaner IMO π)π§ͺ Testing
In summary: