-
Notifications
You must be signed in to change notification settings - Fork 874
fix: make default support links respect --docs-url #14176
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
Merged
bcpeinhardt
merged 7 commits into
main
from
bcpeinhardt/respect_docs_url_within_default_appearance_config
Aug 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c1758fa
it works now yay
bcpeinhardt e95fb05
add test
bcpeinhardt af9af96
apparently I had an unstaged file?
bcpeinhardt f9dfb4e
fix lints
bcpeinhardt 466004d
add version through frontend
bcpeinhardt c92370b
Merge branch 'main' into bcpeinhardt/respect_docs_url_within_default_…
bcpeinhardt a756f3a
enrich support links from backend
bcpeinhardt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add version through frontend
- Loading branch information
commit 466004de30f9b190d0c04b5e31779d66cd9ed349
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,27 +10,9 @@ type Fetcher interface { | |
Fetch(ctx context.Context) (codersdk.AppearanceConfig, error) | ||
} | ||
|
||
var defaultSupportLinks = []codersdk.LinkConfig{ | ||
{ | ||
Name: "Report a bug", | ||
Target: "https://github.com/coder/coder/issues/new?labels=needs+grooming&body={CODER_BUILD_INFO}", | ||
Icon: "bug", | ||
}, | ||
{ | ||
Name: "Join the Coder Discord", | ||
Target: "https://coder.com/chat?utm_source=coder&utm_medium=coder&utm_campaign=server-footer", | ||
Icon: "chat", | ||
}, | ||
{ | ||
Name: "Star the Repo", | ||
Target: "https://github.com/coder/coder", | ||
Icon: "star", | ||
}, | ||
} | ||
|
||
func DefaultSupportLinks(docsURL string) []codersdk.LinkConfig { | ||
if docsURL == "" { | ||
docsURL = "https://coder.com/docs/coder-oss" | ||
docsURL = "https://coder.com/docs/{CODER_VERSION}" | ||
} | ||
|
||
docsLink := codersdk.LinkConfig{ | ||
|
@@ -39,6 +21,24 @@ func DefaultSupportLinks(docsURL string) []codersdk.LinkConfig { | |
Icon: "docs", | ||
} | ||
|
||
defaultSupportLinks := []codersdk.LinkConfig{ | ||
{ | ||
Name: "Report a bug", | ||
Target: "https://github.com/coder/coder/issues/new?labels=needs+grooming&body={CODER_BUILD_INFO}", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know you didn't introduce this, but I think we should be doing this replacement on the backend, not the frontend. We already should have this info anyways. |
||
Icon: "bug", | ||
}, | ||
{ | ||
Name: "Join the Coder Discord", | ||
Target: "https://coder.com/chat?utm_source=coder&utm_medium=coder&utm_campaign=server-footer", | ||
Icon: "chat", | ||
}, | ||
{ | ||
Name: "Star the Repo", | ||
Target: "https://github.com/coder/coder", | ||
Icon: "star", | ||
}, | ||
} | ||
|
||
return append([]codersdk.LinkConfig{docsLink}, defaultSupportLinks...) | ||
} | ||
|
||
|
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
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.
You could use
buildinfo.Version()
instead so the frontend doesn't have to replace this.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.
Yeah I was taking a "do as the Romans do" approach and doing it the way the build info was done, but I agree with your comment below that we have this info on the backend so we might as well do it here.
Let me ping someone for context on why it's set up this way before falling into the classic "refactor and then realize why they did it the original way" trap and get back to you haha.
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 like we can just have the backend do this :)
https://codercom.slack.com/archives/CJURPL8DN/p1723126779529959